From c6bfbac5aedeb84b902c7397eed8faa4fd9b1f69 Mon Sep 17 00:00:00 2001 From: maxgithubprofile <21055122+maxgithubprofile@users.noreply.github.com> Date: Sat, 5 Nov 2022 13:28:52 +0300 Subject: [PATCH] patch: packet 737 (#737) --- chat/matrix-element.5.js | 166 ++++++++++---------- chat/matrix-element.5.js.map | 2 +- chat/matrix-element.5.min.js | 2 +- chat/matrix-element.5.min.js.map | 2 +- chat/matrix-element.6.js | 14 -- chat/matrix-element.6.js.map | 2 +- chat/matrix-element.6.min.js | 2 +- chat/matrix-element.6.min.js.map | 2 +- chat/matrix-element.js | 108 ++++++------- chat/matrix-element.js.map | 2 +- chat/matrix-element.min.js | 16 +- chat/matrix-element.min.js.map | 2 +- components/author/index.js | 3 - components/camerapreview/index.js | 4 - components/donate/index.js | 2 - components/imagegallery/index.js | 1 - components/lenta/index.js | 5 - components/main/index.js | 5 +- components/menu/index.js | 4 - components/mobilesearch/index.js | 2 - components/navigation/index.js | 1 - components/navigation/templates/menu.html | 2 - components/post/index.js | 20 +-- components/recommendationinfo/index.js | 8 - components/share/index.js | 7 - components/slides/index.js | 4 - components/statistic/index.js | 1 - components/taginput/index.js | 4 - components/userpage/index.js | 1 - components/userpage/templates/fillUser.html | 2 - components/usersettings/index.js | 2 - components/ustate/index.js | 3 - components/videoCabinet/index.css | 1 - components/videoCabinet/index.js | 6 +- components/videoCabinet/index.less | 1 - js/app.js | 8 +- js/module.js | 1 + js/satolist.js | 54 ++++--- package.json | 8 +- proxy16/node/tor-control.js | 2 + 40 files changed, 197 insertions(+), 285 deletions(-) diff --git a/chat/matrix-element.5.js b/chat/matrix-element.5.js index cdac78bfe4..dbfd01549d 100644 --- a/chat/matrix-element.5.js +++ b/chat/matrix-element.5.js @@ -12,6 +12,18 @@ exports.push([module.i, ".nameWrapper[data-v-3b761913]{display:flex;align-items: module.exports = exports; +/***/ }), + +/***/ "0eb5": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_index_sass_vue_type_style_index_0_id_409a51d4_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d885"); +/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_index_sass_vue_type_style_index_0_id_409a51d4_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_index_sass_vue_type_style_index_0_id_409a51d4_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_index_sass_vue_type_style_index_0_id_409a51d4_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_index_sass_vue_type_style_index_0_id_409a51d4_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + + /***/ }), /***/ "0f20": @@ -26,24 +38,6 @@ exports.push([module.i, "#chatAttachement[data-v-41942aae]{height:90px;width:120 module.exports = exports; -/***/ }), - -/***/ "320a": -/***/ (function(module, exports, __webpack_require__) { - -// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chat.vue?vue&type=template&id=7f0235e5&scoped=true&\"\nimport script from \"./chat.vue?vue&type=script&lang=js&\"\nexport * from \"./chat.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chat.vue?vue&type=style&index=0&id=7f0235e5&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7f0235e5\",\n null\n ,true\n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chat.vue?vue&type=template&id=7f0235e5&scoped=true&\"\nimport script from \"./chat.vue?vue&type=script&lang=js&\"\nexport * from \"./chat.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chat.vue?vue&type=style&index=0&id=7f0235e5&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7f0235e5\",\n null\n ,true\n)\n\nexport default component.exports"],"sourceRoot":""} \ No newline at end of file diff --git a/chat/matrix-element.5.min.js b/chat/matrix-element.5.min.js index f8c159975f..8b7128ef7f 100644 --- a/chat/matrix-element.5.min.js +++ b/chat/matrix-element.5.min.js @@ -1,2 +1,2 @@ -(window["matrixElement_jsonp"]=window["matrixElement_jsonp"]||[]).push([[5],{"04b4":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".nameWrapper[data-v-3b761913]{display:flex;align-items:center;justify-content:center}.roomMuted[data-v-3b761913]{margin-left:3px}.roomMuted i[data-v-3b761913]{font-size:.7em}.editButton[data-v-3b761913]{display:flex;justify-content:center;align-items:center}.editButton i[data-v-3b761913]{font-size:1.5em}.nameline[data-v-3b761913]{max-width:250px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#topheader.minimized.fix[data-v-3b761913]{background:transparent;overflow:inherit}.donationModalBody[data-v-3b761913]{padding:1em;display:flex;flex-direction:column}.donationModalBody span[data-v-3b761913]{color:rgb(var(--color-txt-ac))}.donationModalBody input[data-v-3b761913],.donationModalBody select[data-v-3b761913]{margin-top:.5em;margin-bottom:1.5em;border:1px solid rgb(var(--color-txt-ac));border-radius:3px;padding:.5em}.donationModalBody input.disabled[data-v-3b761913],.donationModalBody select.disabled[data-v-3b761913]{color:rgb(var(--neutral-grad-2));border:1px solid rgba(var(--neutral-grad-2),.5)}.donationModalBody button[data-v-3b761913]{margin-top:1em}.donationModalBody button i[data-v-3b761913]{margin-right:.2em}.donationModalBody .totalAmount[data-v-3b761913]{font-weight:700;margin-left:.5em;margin-top:.5em;margin-bottom:1em}.donationModalBody .error[data-v-3b761913]{color:rgb(var(--color-bad));text-align:center}.donationModalBody .linepreloader[data-v-3b761913]{text-align:center;height:29px;margin-top:1em}",""]),t.exports=e},"0f20":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,"#chatAttachement[data-v-41942aae]{height:90px;width:120px;border-radius:5px;overflow:hidden;position:relative;background:rgb(var(--background-secondary-theme))}#chatAttachement>div[data-v-41942aae]{width:100%;height:100%}.cancel[data-v-41942aae],.loading[data-v-41942aae]{position:absolute;height:90px;width:120px;line-height:90px;text-align:center;font-size:3em;left:0;top:0;background:rgba(var(--background-main),.8);color:rgba(var(--text-color),.2)}.cancel[data-v-41942aae]{background:transparent;font-size:1.2em;color:rgb(var(--text-color))}.file[data-v-41942aae]{text-align:center;font-size:.8em;padding-top:1em}.file span[data-v-41942aae]{white-space:normal}.file .fileicon i[data-v-41942aae]{opacity:.4;font-size:1.5em}.image[data-v-41942aae],.image .bgimage[data-v-41942aae]{width:100%;height:100%}",""]),t.exports=e},"320a":function(t,e,a){var n=a("871e");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("10fadf76",n,t)}},3688:function(t,e,a){"use strict";a.r(e);var n=a("8669");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},"52ab":function(t,e,a){var n=a("9f70");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("5992f11e",n,t)}},"57f6":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".roomStatusView[data-v-85cc32fa]{height:50vh;display:flex;flex-direction:column;align-items:center;justify-content:center}.roomStatusView .statusViewIcon i[data-v-85cc32fa]{color:rgb(var(--color-txt-ac));font-size:5em}.roomStatusView .text[data-v-85cc32fa]{margin:40px 0;color:rgb(var(--color-txt-ac))}",""]),t.exports=e},"6af4":function(t,e,a){var n=a("0f20");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("42d072f6",n,t)}},"7e41":function(t,e,a){"use strict";a.r(e);var n=a("c27c");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},"817d":function(t,e,a){"use strict";a.r(e);var n=a("d75f");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},8669:function(t,e,a){var n=a("57f6");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("dfdc80cc",n,t)}},"871e":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".caption[data-v-f1738ea6]{padding:1em}.caption span[data-v-f1738ea6]{font-size:1.5em;font-weight:700}.tip[data-v-f1738ea6]{padding:1.5em;text-align:center}.tip span[data-v-f1738ea6]{font-size:.8em}.blocked[data-v-f1738ea6]{width:100%;text-align:center}.blocked span[data-v-f1738ea6]{font-size:.9em}.joinAction[data-v-f1738ea6]{position:fixed;bottom:0;left:0;right:0;background:rgb(var(--neutral-grad-0));padding:1em 0;text-align:center;z-index:3}.joinAction.bin[data-v-f1738ea6]{position:sticky}.joinAction .actions[data-v-f1738ea6]{display:flex}.joinAction .actions .action[data-v-f1738ea6]{padding:.5em;flex-grow:1}.joinAction .actions .action button[data-v-f1738ea6]{min-width:0;width:100%}.my-swipe[data-v-f1738ea6]{height:200px;font-size:30px;text-align:center}.my-swipe[data-v-f1738ea6],.slide1[data-v-f1738ea6]{color:rgb(var(--text-on-bg-ac-color))}.slide1[data-v-f1738ea6]{background-color:rgb(var(--color-bg-ac))}.slide2[data-v-f1738ea6]{background-color:rgb(var(--color-bg-orange));color:#000}.slide3[data-v-f1738ea6]{background-color:rgb(var(--color-bg-ac-2));color:rgb(var(--text-on-bg-ac-color))}.minimized:not(.active) .caption[data-v-f1738ea6]{width:52px;text-align:center}.minimized:not(.active) .caption span[data-v-f1738ea6]{color:rgb(var(--color-txt-ac));font-size:.6em}.minimized:not(.active) .chatPreview[data-v-f1738ea6],.minimized:not(.active) .joinAction[data-v-f1738ea6]{display:none}.minimized[data-v-f1738ea6]:not(.active) .userinfoWrapper{background:transparent!important;box-shadow:none}.minimized[data-v-f1738ea6]:not(.active) .haskeys{display:none}",""]),t.exports=e},"91ee":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".userinfoWrapper[data-v-79ef1fe4]{height:95%;width:100%;padding:2em .5em;background:rgba(var(--background-main),.4);border-radius:15px;position:relative;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.previewWrapper .work[data-v-79ef1fe4]{padding-bottom:.5em!important}.VueCarousel[data-v-79ef1fe4]{width:100%}.filter[data-v-79ef1fe4]{background-color:rgba(var(--color-shadow-base),.2)!important}",""]),t.exports=e},"9ad5":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".topheader[data-v-7f0235e5]{width:100%;top:0;z-index:999}.aboutContact[data-v-7f0235e5]{position:absolute;left:0;right:0;top:100px;bottom:0;z-index:999;background:#fff}.chat.mobile[data-v-7f0235e5] #maincontent .headerSpacerWrapper{bottom:0;overflow:visible}.chat.mobile[data-v-7f0235e5] #maincontent .headerSpacerWrapperOvf{overflow:visible}",""]),t.exports=e},"9f70":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".attachements[data-v-adf0f1c6]{position:absolute;left:0;top:0;right:0;padding:.5em .5em;overflow-x:scroll}.attachements .attachementsWrapper[data-v-adf0f1c6]{display:flex;align-items:center;flex-wrap:nowrap;flex-grow:1;flex-direction:row;margin-right:.5em;min-width:120px}.cantchatmessage[data-v-adf0f1c6]{padding:2em}.cantchatmessage .proceed[data-v-adf0f1c6]{padding-top:1em}.cantchatmessage .proceed button[data-v-adf0f1c6]{padding-left:0}.cantchatmessage .refresh[data-v-adf0f1c6]{padding-top:2em}.cantchatmessage .msg[data-v-adf0f1c6]{font-size:.8em}.encryptedInfo[data-v-adf0f1c6]{position:relative;z-index:9999;display:flex;justify-content:center;align-items:center;flex-direction:column}.encryptedInfo #slide[data-v-adf0f1c6]{padding:0 .5em;position:absolute;left:-180px;top:0;background:#fff;border-bottom-right-radius:8px;border-top-right-radius:8px;-webkit-animation:slide-data-v-adf0f1c6 .1s forwards;-webkit-animation-delay:.3s;animation:slide-data-v-adf0f1c6 .1s forwards;animation-delay:.3s;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}@-webkit-keyframes slide-data-v-adf0f1c6{left:0}@keyframes slide-data-v-adf0f1c6{to{left:0}}.encryptedInfo button[data-v-adf0f1c6]{cursor:pointer;display:flex;align-items:center;justify-content:flex-start;text-align:left}.encryptedInfo button i[data-v-adf0f1c6]{margin-right:5px}.encryptedInfo .encryptedTxtIcon[data-v-adf0f1c6]{flex-direction:column;align-items:center;justify-content:center;padding:.25em .25em;text-align:center}.encryptedInfo .encryptedTxtIcon span[data-v-adf0f1c6]{color:rgb(var(--color-good));font-size:.8em}.encryptedInfo .encryptedTxtIcon i[data-v-adf0f1c6]{color:rgb(var(--color-good));display:none}.blockedcaption[data-v-adf0f1c6]{text-align:center}.blockedcaption span[data-v-adf0f1c6]{font-size:.8em}.relationEvent[data-v-adf0f1c6]{display:flex;align-items:flex-end;width:100%}.relationEvent .relationEventWrapper[data-v-adf0f1c6]{padding-bottom:1em}.relationEvent .relationEventCaption[data-v-adf0f1c6]{padding:1em 0;padding-bottom:.5em}.relationEvent .relationEventCaption span[data-v-adf0f1c6]{font-size:.8em;font-weight:700;color:rgb(var(--color-txt-ac))}.relationEvent .relationEventPreview[data-v-adf0f1c6]{flex-grow:1;padding:0 1em;padding-top:0}.relationEvent[data-v-adf0f1c6] .previewMessage{font-size:.9em}.relationEvent .relationEventActions[data-v-adf0f1c6]{width:66px;min-width:66px}.relationEvent .relationEventActions .item[data-v-adf0f1c6]{width:100%;padding:.5em 0;cursor:pointer;text-align:center}.chatInputWrapper[data-v-adf0f1c6]{position:fixed;z-index:3;bottom:-1px;background:transparent;left:0;right:0;padding-bottom:35px;background:rgb(var(--background-total-theme));will-change:transform;transform:translate3d(0,calc(var(--keyboardheight, 0)*-1 - -1px),0);transition:.3s}.chatInputWrapper.bin[data-v-adf0f1c6]{position:absolute;left:1px;right:1px;bottom:0;border-radius:5px}#chat.minimized .chatInputWrapper[data-v-adf0f1c6]{opacity:0;padding-bottom:0}#chat.minimized:not(.active) .statusWrapper[data-v-adf0f1c6]{width:33px}#chat.minimized:not(.active) .statusWrapper i[data-v-adf0f1c6]{color:rgb(var(--color-txt-ac))}#chat.minimized:not(.active) .statusWrapper i span[data-v-adf0f1c6]{display:none}#chat.minimized:not(.active) .statusWrapper .messageRow[data-v-adf0f1c6]{padding:0!important;background:transparent!important}#chat.minimized:not(.active) .statusWrapper .event[data-v-adf0f1c6]{padding-bottom:.5em}#chat.minimized:not(.active) .statusWrapper #events[data-v-adf0f1c6]{transform:translate3d(.25em,30px,0)}#chat.minimized:not(.active) .statusWrapper .iconWrapper[data-v-adf0f1c6]{margin-left:0!important}#chat.minimized:not(.active) .statusWrapper [my=true][data-v-adf0f1c6]{justify-content:flex-start}#chat.minimized:not(.active) .statusWrapper [my=true] .iconWrapper[data-v-adf0f1c6]{margin-left:0!important;order:-1;align-self:flex-end}#chat.minimized:not(.active) .statusWrapper .actionsWrapper[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .filePreview[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .labelwrapper[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .linkPreview[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .maxcontent[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .messageImg[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .timeWrapper[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .userpic[data-v-adf0f1c6]:after{display:none}#chat.minimized.active[data-v-adf0f1c6]{padding-bottom:90px}#chat.minimized.active .chatInputWrapper[data-v-adf0f1c6]{opacity:1}.encrypted[data-v-adf0f1c6]{position:absolute;left:0;top:0;z-index:2;color:rgb(var(--color-good));padding:.25em .5em}.encrypted i[data-v-adf0f1c6]{font-size:.8em;cursor:pointer}.roomMuted[data-v-adf0f1c6]{position:absolute;left:5px;top:20px;z-index:2;color:rgb(var(--neutral-grad-3))}.roomMuted i[data-v-adf0f1c6]{font-size:.8em}.chatEmpty[data-v-adf0f1c6]{padding:4em;text-align:center;color:rgb(var(--neutral-grad-3))}.chatEmpty span[data-v-adf0f1c6]{font-size:.8em}.preview-wrapper[data-v-adf0f1c6]{max-height:350px;overflow-y:auto;border:1px solid rgb(var(rgb(var(--neutral-grad-2))));border-radius:10px;margin:0 auto;width:98%}.preview-wrapper[data-v-adf0f1c6]::-webkit-scrollbar{width:0!important}.shareEventsWrapper .cnt[data-v-adf0f1c6]{background:rgb(var(--background-secondary-theme));border-radius:30px;padding:.5em 1em;max-width:622px;width:100%;margin:0 auto;display:flex;align-items:center;justify-content:space-between;font-size:.9em}.shareEventsWrapper .cnt i[data-v-adf0f1c6]{margin-right:10px}.shareEventsWrapper .cnt i.fa-trash-alt[data-v-adf0f1c6]{color:#f41a4d}.shareEventsWrapper .cnt i.fa-share-alt[data-v-adf0f1c6]{color:#00a3f7}.shareEventsWrapper .cnt div[data-v-adf0f1c6]{transition:.3s;opacity:.6;cursor:pointer;margin-left:1em;display:flex;align-items:center}.shareEventsWrapper .cnt div[data-v-adf0f1c6]:hover{transition:.3s;opacity:1}.shareEventsWrapper .cnt div.cancel[data-v-adf0f1c6]{margin-right:auto;margin-left:0}",""]),t.exports=e},b91a:function(t,e,a){"use strict";a.r(e);var n=a("320a");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},c27c:function(t,e,a){var n=a("9ad5");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("981b0ec6",n,t)}},d75f:function(t,e,a){var n=a("04b4");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("a66dd582",n,t)}},e241:function(t,e,a){"use strict";a.r(e);var n=a("f082");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},ebaa8:function(t,e,a){"use strict";a.r(e);var n=a("52ab");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},ec21:function(t,e,a){"use strict";a.r(e);var n=a("6af4");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},ee79:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page chat",class:{mobile:t.mobile}},[a("topheader",{directives:[{name:"show",rawName:"v-show",value:!t.hideHeader||!t.ios,expression:"!hideHeader || !ios"}],key:t.k,staticClass:"topheader",attrs:{u:t.u,chat:t.chat},on:{addMember:t.addMemberModal}}),a("maincontent",{scopedSlots:t._u([{key:"content",fn:function(){return[a("chat",{key:t.k,attrs:{u:t.u,chat:t.chat},on:{sending:t.sending,newchat:t.newchat,removeBrokenRoom:t.creatorLeft,getEvents:t.eventsRoom,menuIsVisible:t.menuIsVisibleHandler}})]},proxy:!0}])}),t.openInviteModal?a("modal",{on:{close:t.closeModal},scopedSlots:t._u([{key:"header",fn:function(){return[a("span",[t._v(t._s(t.$t("caption.inviteUser")))])]},proxy:!0},{key:"body",fn:function(){return[a("contacts",{attrs:{mode:"inviteUsers",chatRoomId:t.chat.roomId},on:{closeModal:t.closeContactModal}})]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,1321158477)}):t._e()],1)},i=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:{bin:t.pocketnet,bout:!t.pocketnet,minimized:t.minimized,fix:t.pocketnet,active:t.active},attrs:{id:"chat"}},[t.cantchat&&!t.cantchatexc?a("div",{staticClass:"cantchatmessage"},[a("div",{staticClass:"msg"},[t._v(" "+t._s(t.$t("caption."+this.keyproblem))+" ")]),"usernotgen"==t.keyproblem?a("div",{staticClass:"refresh"},[a("button",{staticClass:"button small",on:{click:t.refreshkeys}},[t._v(" Refresh "),a("i",{staticClass:"fas fa-sync"})])]):t._e(),"younotgen"==t.keyproblem?a("div",{staticClass:"preloaderwrapper"},[a("linepreloader")],1):t._e()]):a("div",{staticClass:"chatcontent"},[t.m_chat&&"join"===t.membership&&t.ready?a("list",{key:t.key,ref:"list",attrs:{error:t.error,chat:t.m_chat,selectedMessages:t.selectedMessages,isRemoveSelectedMessages:t.isRemoveSelectedMessages},on:{editingEvent:t.editingEvent,replyEvent:t.replyEvent,eventImage:function(e){return t.galleryImage(e)},scroll:t.scroll,menuIsVisible:t.menuIsVisibleHandler,getEvents:t.events,messagesIsDeleted:t.messagesIsDeleted}}):t._e(),t.m_chat&&"invite"===t.membership?a("div",{staticClass:"joinwrapper"},[a("join",{attrs:{m_chat:t.m_chat,chat:t.chat,usersinfo:t.usersinfo},on:{creatorLeft:t.brokenInvitedRoom}})],1):t._e(),!t.m_chat&&t.usersinfo&&t.usersinfo.length?a("div",{staticClass:"chatEmpty"},[a("span",[t._v(t._s(t.$t("caption.startChatWith"))+" "+t._s(t.usersinfoNames()))])]):t._e(),t.m_chat&&"join"!==t.membership?t._e():a("div",{staticClass:"chatInputWrapper fixedOnPageBottom",class:{bin:t.pocketnet,bout:!t.pocketnet}},[a("div",[t.relationEvent?a("div",{staticClass:"relationEvent"},[a("div",{staticClass:"relationEventPreview"},[a("div",{staticClass:"relationEventCaption"},[a("span",[t._v(t._s(t.relationEvent.action))])]),"m.replace"!=t.relationEvent.type?a("div",{staticClass:"relationEventWrapper"},[a("eventsEvent",{attrs:{event:t.relationEvent.event,chat:t.chat,preview:!0}})],1):t._e()]),a("div",{staticClass:"relationEventActions"},[a("div",{staticClass:"item",on:{click:t.clearRelationEvent}},[a("i",{staticClass:"far fa-times-circle"})])])]):t._e(),t.blockedUser||t.selectedMessages.length?t._e():a("chatInput",{ref:"chatInput",attrs:{u:t.u,chat:t.m_chat,usersinfo:t.usersinfo,relationEvent:t.relationEvent},on:{sending:t.sending,sent:t.sent,sentError:t.sentError,sentMessageError:t.sentMessageError,sendingData:t.sendingData,sentData:t.sentData,force:t.force,newchat:t.newchat,closeMetaPreview:t.closing,clearRelationEvent:t.clearRelationEvent,focused:t.focused,cantchatcrypto:t.cantchatcrypto}}),t.selectedMessages.length?a("div",{staticClass:"center shareEventsWrapper"},[a("div",{staticClass:"work"},[a("div",{staticClass:"cnt"},[a("div",{staticClass:"cancel",on:{click:function(e){return t.cancelDataMessages()}}},[a("i",{staticClass:"fas fa-times"}),a("span",[t._v(t._s(t.$t("cancel")))])]),a("div",{on:{click:function(e){return t.removeDataMessages()}}},[a("i",{staticClass:"far fa-trash-alt"}),a("span",[t._v(t._s(t.localisationTitles.delete))])]),a("div",{on:{click:function(e){return t.shareDataMessages()}}},[a("i",{staticClass:"fas fa-share-alt"}),a("span",[t._v(t._s(t.localisationTitles.share))])])])])]):t._e(),t.blockedUser&&t.m_chat?a("div",{staticClass:"blockedcaption"},[a("span",[t._v("You have blocked this user")])]):t._e()],1)]),t.encrypted&&"invite"!=t.membership?a("div",{staticClass:"encrypted",on:{mouseover:function(e){return t.hoverEncrypt=!0}}},[a("i",{staticClass:"fas fa-lock"})]):t._e(),t.hoverEncrypt?a("div",{staticClass:"encryptedInfo",on:{mouseover:function(e){return t.hoverEncrypt=!0},mouseleave:function(e){return t.hoverEncrypt=!1},click:function(e){return t.hoverEncrypt=!t.hoverEncrypt}}},[a("div",{attrs:{id:"slide"}},[a("div",{staticClass:"encryptedTxtIcon"},[a("i",{staticClass:"fas fa-user-shield"}),a("span",[t._v(t._s(t.$t("caption.encrypted")))])])])]):t._e(),t.attachements.length?a("div",{staticClass:"attachements"},[a("div",{staticClass:"attachementsWrapper"},t._l(t.attachements,(function(e){return a("attachement",{key:e.id,attrs:{attachement:e},on:{cancel:function(a){return t.abortSending(e.id)}}})})),1)]):t._e()],1),t.roomUserBanned?a("userRoomStatus",{attrs:{chat:t.chat,text:"You've have been banned in this room"}}):t._e()],1)},s=[],r=a("2f62"),c=a("4e29"),d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"maskedtop",class:{minimized:t.minimized,active:t.active},attrs:{id:"chatJoin"}},[a("div",{staticClass:"work"},[a("div",{staticClass:"caption"},[t.creatorLeft?t._e():a("span",[t._v(" "+t._s(t.$t("caption.chatInvite"))+" ")]),t.creatorLeft?a("span",[t._v(t._s(t.$t("caption.cantJoin")))]):t._e()])]),a("chatPreview",{attrs:{usersinfo:t.usersinfo,chat:t.chat,m_chat:t.m_chat,undefinedRoom:t.creatorLeft}}),t.blockedCheck?t._e():a("div",{staticClass:"tip"},[t.creatorLeft?t._e():a("span",[t._v(t._s(t.$t("caption.chatInviteDecline")))]),t.creatorLeft?a("span",[t._v(t._s(t.$t("caption.creatorLeft")))]):t._e()]),t.hiddenInParent?t._e():a("div",{staticClass:"joinAction fixedOnPageBottom",class:{bin:t.pocketnet,bout:!t.pocketnet}},[a("div",{staticClass:"work"},[t.blockedCheck?a("div",{staticClass:"actions"},[t._m(0)]):a("div",{staticClass:"actions"},[t.creatorLeft||t.tetatet?t._e():a("div",{staticClass:"action"},[a("button",{staticClass:"small button black rounded",on:{click:t.decline}},[t._v(t._s(t.$t("button.decline")))])]),t.tetatet?a("div",{staticClass:"action"},[a("button",{staticClass:"small button black rounded",on:{click:t.ignore}},[t._v(t._s(t.$t("button.declineandignore")))])]):t._e(),t.creatorLeft?t._e():a("div",{staticClass:"action"},[a("button",{staticClass:"small button rounded",on:{click:t.join}},[t._v(t._s(t.$t("button.join")))])]),t.creatorLeft?a("div",{staticClass:"action"},[a("button",{staticClass:"small button rounded",on:{click:t.back}},[t._v(t._s(t.$t("button.ok")))])]):t._e()])])])],1)},l=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"blocked"},[a("span",[t._v("You have blocked this user")])])}],h=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"chatPreview"},[a("div",{staticClass:"work"},[a("div",{staticClass:"previewWrapper"},[t.users&&t.users.length?a("div",{staticClass:"users"},[a("swiper",{staticClass:"swiper",attrs:{options:t.swiperOption}},[t._l(t.users,(function(e){return t._.isEmpty(e)?t._e():a("swiper-slide",{key:e.id},[a("div",{staticClass:"work"},[a("div",{staticClass:"userinfoWrapper",class:{filter:t.undefinedRoom}},[e.name?a("userView",{attrs:{userinfo:e}}):t._e()],1)])])})),a("div",{staticClass:"swiper-pagination",attrs:{slot:"pagination"},slot:"pagination"})],2)],1):t._e()])])])},u=[],f=a("aa20"),m=a("3094"),p=a("42cd"),v=a("7212a"),g=a("0a63"),b={name:"chatPreview",props:{chat:Object,usersinfo:Array,room:{},undefinedRoom:!1},components:{userView:p["a"],chatName:f["a"],chatIcon:m["a"],Swiper:v["Swiper"],SwiperSlide:v["SwiperSlide"],Carousel:g["Carousel"],Slide:g["Slide"]},data:function(){return{loading:!1,swiperOption:{direction:"horizontal",pagination:{el:".swiper-pagination"}}}},computed:{users:function(){return this.chat?this.core.mtrx.chatUsersInfo(this.chat.roomId,"anotherChatUsers"):[]}}},x=b,y=a("2877");function k(t){var e=a("e241");e.__inject__&&e.__inject__(t)}var w=Object(y["a"])(x,h,u,!1,k,"79ef1fe4",null,!0),E=w.exports,I={name:"chatJoin",props:{chat:Object,m_chat:{},usersinfo:Array,room:Object},components:{chatPreview:E},data:function(){return{loading:!1,joinedMembers:[],creatorLeft:!1}},created:()=>{},watch:{},computed:Object(r["c"])({hiddenInParent:t=>t.hiddenInParent,auth:t=>t.auth,pocketnet:t=>t.pocketnet,minimized:t=>t.minimized,active:t=>t.active,tetatet:function(){return this.core.mtrx.kit.tetatetchat(this.m_chat)},blockedCheck:function(){var t=this.core.mtrx.anotherChatUsers(this.m_chat.roomId);if(1==t.length)return this.core.mtrx.blockeduser(t[0].userId)}}),mounted:function(){},methods:{join:function(){var t=this;this.$store.commit("SET_CHAT_TO_FORCE",this.m_chat.roomId),this.core.mtrx.client.joinRoom(this.m_chat.roomId).then(()=>{this.$emit("joined")}).catch((function(e){return t.brokenRoom(!0),t.creatorLeft=!0}))},back(){this.$router.go(-1)},ignore:function(){var t=this.core.mtrx.anotherChatUsers(this.chat.roomId);t.length>1||this.core.mtrx.blockUser(t[0].userId).then(t=>{this.$router.go(-1)}).catch(t=>{})},decline:function(){this.$store.commit("SET_CHAT_TO_FORCE",this.m_chat.roomId),this.core.mtrx.client.leave(this.chat.roomId).then(t=>{this.core.mtrx.client.forget(this.chat.roomId,!0).then(t=>t).then(t=>{this.$store.commit("DELETE_ROOM",this.chat.roomId),this.$router.go(-1)})})},brokenRoom(){this.$emit("creatorLeft",!0)}}},C=I;function M(t){var e=a("b91a");e.__inject__&&e.__inject__(t)}var $=Object(y["a"])(C,d,l,!1,M,"f1738ea6",null,!0),z=$.exports,R=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"chatAttachement"}},["image"==t.attachement.type?a("div",{staticClass:"image"},[t.attachement.base64?a("bgimage",{attrs:{src:t.attachement.base64}}):t._e()],1):t._e(),"file"==t.attachement.type?a("div",{staticClass:"file"},[a("div",{staticClass:"fileicon"},[a("i",{class:t.fileicon})]),a("div",{staticClass:"filename"},[a("span",[t._v(t._s(t.attachement.info.name||"File"))])]),t.humanReadableSize?a("div",{staticClass:"filesize"},[a("span",[t._v(t._s(t.humanReadableSize))])]):t._e()]):t._e(),t._m(0),a("div",{staticClass:"cancel",on:{click:t.cancel}},[a("i",{staticClass:"far fa-times-circle"})])])},j=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"loading"},[a("i",{staticClass:"fas fa-spinner fa-spin"})])}],O=a("3139"),T={name:"chatAttachement",props:{attachement:Object},data:function(){return{loading:!1,ext:{pdf:"far fa-file-pdf",custom:"far fa-file"}}},created:()=>{},watch:{},computed:Object(r["c"])({auth:t=>t.auth,extension:function(){if(!O["a"].deep(this,"attachement.info.name"))return"custom";var t=O["a"].deep(this,"attachement.info.name"),e=(t=t.split("."),t[t.length-1].toLowerCase());return e},humanReadableSize(){return O["a"].deep(this,"attachement.info.size")?O["a"].formatBytes(this.attachement.info.size):""},fileicon:function(){var t=this.extension;return this.ext[t]||this.ext["custom"]}}),methods:{cancel:function(){this.$emit("cancel")}}},S=T;function A(t){var e=a("ec21");e.__inject__&&e.__inject__(t)}var D=Object(y["a"])(S,R,j,!1,A,"41942aae",null,!0),W=D.exports,P=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"roomStatusView"},[t._m(0),a("div",{staticClass:"text"},[t._v(" "+t._s(t.text)+" ")]),a("button",{staticClass:"button small black rounded",on:{click:function(e){return t.leaveRoom()}}},[t._v("Delete room")])])},F=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"statusViewIcon"},[a("i",{staticClass:"fas fa-ban"})])}],B={props:{text:String,chat:Object},methods:{leaveRoom(){this.core.mtrx.client.forget(this.chat.roomId,!0).then(t=>{this.$store.commit("DELETE_ROOM",this.chat.roomId)}).then(t=>{this.$router.push({path:"/chats"}).catch(t=>{})})}}},U=B;function L(t){var e=a("3688");e.__inject__&&e.__inject__(t)}var N=Object(y["a"])(U,P,F,!1,L,"85cc32fa",null,!0),V=N.exports,H={name:"chat",props:{chat:Object,u:String},components:{list:c["a"],chatInput:()=>Promise.all([a.e(11),a.e(6)]).then(a.bind(null,"fe01")),join:z,attachement:W,userRoomStatus:V},data:function(){return{roomUserBanned:!1,roomUserKicked:!1,hoverEncrypt:!1,roomMuted:!1,loading:!1,ready:!1,encrypted:!1,usersinfo:[],chatEvents:{},relationEvent:null,key:"",sendingDataStore:{},esize:{},fsize:{},cantchat:!1,cantchatexc:!1,error:null,showInput:!0,showShareMessages:!1,selectedMessages:[],isRemoveSelectedMessages:!1}},created(){},mounted(){console.log(this.chat),this.getuserinfo(),this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"chat"})},destroyed(){this.$store.commit("blockactive",{value:!1,item:"chat"}),this.$store.commit("SET_CURRENT_ROOM",!1),this.clearintrv()},watch:{needcreatekey:function(){this.needcreatekey?this.intrv||(this.intrv=setInterval(()=>{this.refreshkeys(!0)},2e4)):this.clearintrv()},chatusers:function(){this.m_chat&&this.m_chat.pcrypto&&this.m_chat.pcrypto.userschanded().then(t=>{this.checkcrypto()})},m_chat:{immediate:!0,handler:function(){this.m_chat&&!_.isEmpty(this.m_chat)&&(console.log("this.m_chat",this.m_chat),console.log("getType",this.m_chat.getType()),this.core.mtrx.kit.allchatmembers([this.m_chat],!1,!0).then(t=>this.core.mtrx.kit.prepareChat(this.m_chat)).then(t=>{this.ready=!0,this.checkcrypto()}))}},chat:{immediate:!0,handler:function(){this.ready=!1,this.encrypted=!1,this.$store.commit("setmodal",null),this.chat?(this.$store.commit("SET_CURRENT_ROOM",this.chat.roomId),this.$store.commit("SET_LAST_ROOM",this.chat.roomId)):this.$store.commit("SET_CURRENT_ROOM",!1)}}},computed:Object(r["c"])({pocketnet:t=>t.pocketnet,minimized:t=>t.minimized,active:t=>t.active,auth:t=>t.auth,m_chat:function(){if(this.chat&&this.chat.roomId){let e=this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId);null!==e&&(this.roomMuted=!0);var t=this.core.mtrx.client.getRoom(this.chat.roomId);return t||{}}},keyproblem:function(){return this.core.user.userinfo.keys.length<12?"younotgen":"usernotgen"},needcreatekey:function(){return"younotgen"==this.keyproblem&&this.cantchat&&!this.cantchatexc},membership:function(){if(this.m_chat){if(this.m_chat.timeline.length>0){var t=this.core.mtrx.client.credentials.userId,e=this.m_chat.timeline[this.m_chat.timeline.length-1];e.event.state_key===t&&"admin ban"===e.event.content.reason&&(this.roomUserBanned=!0)}return this.m_chat.getMyMembership()}},blockedUser:function(){if(this.u)return this.core.mtrx.blockeduser(this.u[0]);if(this.chat){var t=this.core.mtrx.anotherChatUsers(this.chat.roomId);if(1==t.length)return this.core.mtrx.blockeduser(t[0].userId)}},openInviteModal:function(){return this.openInviteModal},attachements:function(){return _.toArray(this.sendingDataStore)},chatusers:function(){if(this.m_chat)return this.core.store.state.chatusers[this.m_chat.roomId]},localisationTitles:function(){return this.$i18n.t("button")}}),methods:{clearintrv:function(){this.intrv&&(clearInterval(this.intrv),this.intrv=null)},checkcrypto:function(){this.encrypted=this.m_chat.pcrypto.canBeEncrypt(),this.cantchat=this.m_chat.pcrypto.cantchat()},force:function(){this.key=O["a"].makeid()},clearRelationEvent:function(){this.relationEvent&&"m.replace"==this.relationEvent.type&&this.$refs["chatInput"]&&this.$refs["chatInput"].setText(""),this.relationEvent=null},newchat:function(t){this.$emit("newchat",t),this.m_chat.pcrypto.userschanded()},getuserinfo:function(){this.u&&this.core.user.usersInfo(this.u).then(t=>{this.usersinfo=t})},cantchatcrypto:function(){this.cantchat=!0},proceedwithoutkeys:function(){this.cantchatexc=!0},refreshkeys:function(){this.core.user.userInfo(!0).then(t=>{this.u?this.core.user.usersInfo(this.u,!1,!0).then(t=>{var e=t[0];e&&e.keys&&e.keys.length>=12&&this.core.user.userinfo.keys.length>=12&&(this.cantchat=!1),this.usersinfo=t}):this.core.store.dispatch("RELOAD_CHAT_USERS",[this.m_chat]).then(t=>{})})},closing:function(t){this.PNmetaPreview=t},usersinfoNames:function(){return _.map(this.usersinfo,(function(t){return t.name})).join(", ")},replyEvent:function(t){let{event:e}=t;this.relationEvent={type:"m.reference",event:e,action:this.$i18n.t("caption.replyOnMessage")},this.$refs["chatInput"]&&this.$refs["chatInput"].focus()},editingEvent:function(t){let{event:e,text:a}=t;this.relationEvent={type:"m.replace",event:e,action:this.$i18n.t("caption.editMessage")},this.$refs["chatInput"]&&this.$refs["chatInput"].setText(a)},focused:function(){this.fsize=_.clone(this.esize)},scroll(t){this.esize=t;var e=this.esize.scrollTop||0,a=this.fsize.scrollTop||0;e-450>a&&this.$refs["chatInput"]&&this.$refs["chatInput"].blurifempty()},events(t){this.$emit("getEvents",t),this.chatEvents=t},galleryImage(t){this.core.store.dispatch("SHOW_GALLERY_FROMEVENTS",{events:this.chatEvents,event:t})},sending:function(){this.$emit("sending"),this.$refs["list"].scrollToNew(0)},sent:function(){this.relationEvent&&"m.reference"==this.relationEvent.type&&(this.relationEvent=null),this.$emit("sent"),this.error=null},sendingData:function(t){this.$set(this.sendingDataStore,t.id,t)},sentData:function(t){this.clearMeta(t),this.error=null},sentError:function(t){t&&t.id&&this.clearMeta(t),t&&t.error&&(this.error=t.error)},sentMessageError:function(t){this.error=t.error,this.core.logerror("sentMessageError",O["a"].stringify(this.error))},abortSending:function(t){var e=this.sendingDataStore[t];e.abort&&e.abort(),e.aborted=!0,this.clearMeta(e)},brokenInvitedRoom(t){this.$emit("removeBrokenRoom",t)},clearMeta:function(t){this.$delete(this.sendingDataStore,t.id)},menuIsVisibleHandler:function(t){this.$emit("menuIsVisible",t)},shareDataMessages:function(){let t=[];for(let n=0;n{O["a"].Base64.fromFile(t.file)}).then(t=>{a.files=[t],Promise.resolve()})),e.then(()=>{this.core.share(a)})},removeDataMessages:function(){this.isRemoveSelectedMessages=!0},cancelDataMessages:function(){this.selectedMessages=[]},messagesIsDeleted:function(t){this.isRemoveSelectedMessages=!1,t&&(this.selectedMessages=[])}}},q=H;function Y(t){var e=a("ebaa8");e.__inject__&&e.__inject__(t)}var K=Object(y["a"])(q,o,s,!1,Y,"adf0f1c6",null,!0),J=K.exports,G=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"chatTopheader"}},[t.chat||t.u?a("topheader",{scopedSlots:t._u([{key:"left",fn:function(){return[a("backButton",{attrs:{action:"chats"}})]},proxy:!0},{key:"info",fn:function(){return[t.chat?a("router-link",{attrs:{to:"chatInfo?id="+t.chat.roomId}},[t.m_chat?a("div",[a("div",{staticClass:"nameWrapper"},[t.roomInfo?t._e():a("chatName",{attrs:{preview:!0,chat:t.chat,m_chat:t.m_chat}}),t.roomMuted?a("div",{staticClass:"roomMuted"},[a("i",{staticClass:"fas fa-bell-slash"})]):t._e()],1),a("transition",{attrs:{name:"fade"}},[t.m_chat_typing?a("chatTyping"):t._e()],1)],1):t._e(),!t.m_chat&&t.userinfo?a("div",[a("span",{staticClass:"nameline"},[t._v(t._s(t.userinfo.name))])]):t._e()]):t._e()]},proxy:!0},{key:"right",fn:function(){return[t.chat?a("router-link",{attrs:{to:"chatInfo?id="+t.chat.roomId}},[a("div",{staticClass:"iconbutton"},[a("i",{staticClass:"fas fa-ellipsis-h"})])]):t._e()]},proxy:!0}],null,!1,3419355125)}):t._e(),t.donateUserOpened?a("modal",{on:{close:t.closeDonateModal},scopedSlots:t._u([{key:"header",fn:function(){return[a("span",[t._v(t._s(t.$t("caption.donate")))])]},proxy:!0},{key:"body",fn:function(){return[a("div",{staticClass:"donationModalBody"},[a("span",[t._v(t._s(t.$t("caption.source")))]),a("input",{staticClass:"disabled",attrs:{type:"text",value:"Account Address",disabled:!0}}),a("span",[t._v(t._s(t.$t("caption.amount")))]),a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.donationAmount,expression:"donationAmount",modifiers:{number:!0}}],attrs:{type:"number",disabled:t.sending},domProps:{value:t.donationAmount},on:{keyup:function(e){return t.resetDonation()},input:function(e){e.target.composing||(t.donationAmount=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),a("span",[t._v(t._s(t.$t("caption.receiver")))]),a("input",{staticClass:"disabled",attrs:{type:"text",disabled:!0},domProps:{value:t.receiver?t.receiver.name:""}}),a("span",[t._v(t._s(t.$t("caption.message")))]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.donationMessage,expression:"donationMessage"}],attrs:{type:"text",placeholder:"Your message",disabled:t.sending},domProps:{value:t.donationMessage},on:{input:function(e){e.target.composing||(t.donationMessage=e.target.value)}}}),t.showFeesError&&"money"==t.showFeesError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.balanceTooLow")))]):t.showFeesError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.transactionError")))]):t._e(),1!=t.calculatingFees?a("button",{staticClass:"button small",attrs:{disabled:!t.donationAmount||null!=t.calculatedFees},on:{click:t.onCalculateFeesClick}},[a("i",{staticClass:"fas fa-chevron-circle-right"}),t._v(" "+t._s(t.$t("caption.calculateFees"))+" ")]):t._e(),1==t.calculatingFees?a("div",{staticClass:"linepreloader"},[a("linepreloader")],1):t._e()]),null!=t.calculatedFees?a("div",{staticClass:"donationModalBody"},[a("span",[t._v(t._s(t.$t("caption.includeFeesInAmount")))]),a("select",{directives:[{name:"model",rawName:"v-model",value:t.feesDirection,expression:"feesDirection"}],attrs:{disabled:t.sending},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.feesDirection=e.target.multiple?a:a[0]}}},t._l(t.feesDirectionPossibleValues,(function(e){return a("option",{domProps:{value:e.value}},[t._v(" "+t._s(e.label)+" ")])})),0),a("span",[t._v(t._s(t.$t("caption.transactionFees")))]),a("input",{staticClass:"disabled",attrs:{type:"number",disabled:!0},domProps:{value:t.calculatedFees}}),a("span",[t._v(t._s(t.$t("caption.totalAmount")))]),a("span",{staticClass:"totalAmount"},[t._v(t._s(+t.totalDonationAmount.toFixed(5))+" PKOIN")]),t.showTransactionError&&"balance too low"==t.showTransactionError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.balanceTooLow")))]):t.showTransactionError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.transactionError")))]):t._e(),1!=t.sending?a("button",{staticClass:"button small",attrs:{disabled:t.sending},on:{click:t.sendDonation}},[a("i",{staticClass:"fas fa-arrow-alt-circle-right"}),t._v(" Send ")]):t._e(),1==t.sending?a("div",{staticClass:"linepreloader"},[a("linepreloader")],1):t._e()]):t._e()]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,2899695861)}):t._e()],1)},Q=[],X=a("1da1"),Z=a("0826"),tt=a("71da"),et={name:"chatTopheader",props:{chat:Object,u:String,roomInfo:!1,aboutUser:!1},components:{chatName:f["a"],chatIcon:m["a"],chatTyping:Z["a"],contacts:tt["a"]},data:function(){return{menuItems:[{click:"callupVideoHandler",title:this.$i18n.t("caption.videocall"),icon:"fas fa-camera"},{click:"callupHandler",title:this.$i18n.t("caption.call"),icon:"fas fa-phone"}],menuItemsRoom:[{click:"AddMember",title:this.$i18n.t("caption.add"),icon:"fas fa-user-plus"},{click:"MuteRoom",title:this.$i18n.t("caption.mute"),icon:"fas fa-bell-slash"},{click:"LeaveFromRoom",title:this.$i18n.t("caption.leaveAndDelete"),icon:"fas fa-sign-out-alt"}],menuItemsRoomMuted:[{click:"AddMember",title:this.$i18n.t("caption.add"),icon:"fas fa-user-plus"},{click:"MuteRoom",title:this.$i18n.t("caption.unmute"),icon:"fas fa-bell"},{click:"LeaveFromRoom",title:this.$i18n.t("caption.leaveAndDelete"),icon:"fas fa-sign-out-alt"}],oneToOne:[{click:"MuteRoom",title:this.$i18n.t("caption.mute"),icon:"fas fa-bell-slash"},{click:"Donate",title:this.$i18n.t("caption.donate"),icon:"fas fa-money-bill-wave"}],oneToOneMuted:[{click:"MuteRoom",title:this.$i18n.t("caption.unmute"),icon:"fas fa-bell"},{click:"LeaveFromRoom",title:this.$i18n.t("caption.leaveAndDelete"),icon:"fas fa-sign-out-alt"},{click:"Donate",title:this.$i18n.t("caption.donate"),icon:"fas fa-money-bill-wave"}],donateMenu:[{click:"Donate",title:this.$i18n.t("caption.donate"),icon:"fas fa-money-bill-wave"}],loading:!1,typing:!1,userinfo:null,aboutUserShow:!1,roomBanned:!1,roomMuted:!1,donateUserOpened:!1,receiver:null,donationAmount:0,donationMessage:"",calculatedFees:null,showFeesError:"",showTransactionError:"",calculatingFees:!1,sending:!1,feesDirection:"include",feesDirectionPossibleValues:[{value:"include",label:this.$i18n.t("caption.toBePaidByReceiver")},{value:"exclude",label:this.$i18n.t("caption.toBePaidBySender")}]}},watch:{},mounted:function(){this.getuserinfo()},computed:Object(r["c"])({auth:t=>t.auth,m_chat:function(){if(this.chat&&this.chat.roomId){let e=this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId);null!==e&&(this.roomMuted=!0);var t=this.core.mtrx.client.getRoom(this.chat.roomId);return t||{}}},m_chat_typing:function(){if(!this.chat)return!1;var t=this.chat.roomId,e=this.$store.state.typing[t]||{},a=_.find(e,(t,e)=>{var a;if(t)return e!=(null===(a=this.core.user.userinfo)||void 0===a?void 0:a.id)});return a||!1},totalDonationAmount:function(){return"include"==this.feesDirection?this.donationAmount:this.donationAmount+this.calculatedFees}}),methods:{navigateToProfile(t){this.$router.push({path:"/contact?id="+O["a"].getmatrixid(t)}).catch(t=>{})},getuserinfo:function(){this.u&&this.core.user.usersInfo(this.u).then(t=>{this.userinfo=t[0]})},findOtherUser:function(){let t,e=this.m_chat.myUserId,a=this.m_chat.currentState.getMembers();return a.forEach((function(a){a&&a.userId!==e&&(t=a)})),t},addMember(){this.modalInviteUser()},menuItemClickHandler(t,e){if("AddMember"===t.click&&(this.$emit("addMember",!0),this.$refs.dropdownMenu.hidePopup()),"MuteRoom"===t.click){var a=this.chat.roomId;this.core.mtrx.client.deviceId;let t=this,e=this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId);null!==e?(t.core.mtrx.client.deletePushRule("global","room",a),this.roomMuted=!1):(t.core.mtrx.client.setRoomMutePushRule("global",a,"true"),this.roomMuted=!0),this.$refs.dropdownMenu.hidePopup()}if("LeaveFromRoom"===t.click){this.core.mtrx.client.leave(this.chat.roomId).then(t=>{this.core.mtrx.client.forget(this.chat.roomId,!0).then(t=>{this.$store.commit("DELETE_ROOM",this.chat.roomId)}).then(t=>{this.$router.push({path:"/chats"}).catch(t=>{})})}),this.$refs.dropdownMenu.hidePopup()}if("BanRoom"===t.click){let t="",e=this.findOtherUser();e&&e.userId&&(t=e.userId);let a=this.chat.roomId;this.core.mtrx.client.ban(a,t,"ban").then(t=>{}),this.roomBanned=!0,this.$refs.dropdownMenu.hidePopup()}if("Unban"===t.click){let t="",e=this.findOtherUser();e&&e.userId&&(t=e.userId),this.core.mtrx.client.unban(this.chat.roomId,t).then(e=>{this.core.mtrx.client.invite(this.chat.roomId,t)}),this.roomBanned=!1,this.$refs.dropdownMenu.hidePopup()}if("Donate"===t.click){this.donateUserOpened=!0,this.$refs.dropdownMenu.hidePopup();let t=this.findOtherUser();this.receiver=t?this.$f.deep(this,"$store.state.users."+this.$f.getmatrixid(t.name)):null}},closeDonateModal(){this.donateUserOpened=!1},onCalculateFeesClick(){this.calculatingFees=!0,this.calculateFees().finally(()=>this.calculatingFees=!1)},calculateFees(){var t=this;return this.showFeesError="",new Promise((e,a)=>{if(this.donationAmount<=0||!this.receiver||!this.receiver.source||!this.receiver.source.address)return this.showFeesError="invalid",a("Missing amount or receiver");try{var n=window.POCKETNETINSTANCE.platform.sdk;n.node.fee.estimate((function(i){var o=[{address:t.receiver.source.address,amount:t.donationAmount}];n.wallet.txbase([n.address.pnet().address],o,0,t.feesDirection,(function(o,s,r){if(o)return console.error(o),t.showFeesError=o,a(o);var c=n.node.transactions.create.wallet(s,r),d=Math.min(c.virtualSize()*i.feerate,.0999);return t.calculatedFees=d,e()}))}))}catch(i){return console.error(i),t.showFeesError=i,a(i)}})},sendDonation(){var t=this;return Object(X["a"])((function*(){var e=t;t.sending=!0,t.showTransactionError="";try{yield t.calculateFees()}catch(n){return t.showTransactionError="error",void(t.sending=!1)}var a=window.POCKETNETINSTANCE.platform.sdk;a.node.transactions.get.canSpend(a.address.pnet().address,t=>{if(!t||isNaN(t)||t{t.cantspend=!0}),a.node.transactions.send(o,(function(t,o){if(o)return a.node.transactions.releaseCS(n),e.showTransactionError="error",void(e.sending=!1);var s=n.map(t=>t.txid);a.node.transactions.clearUnspents(s),a.wallet.saveTempInfoWallet(t,n,i),e.core.mtrx.client.sendEvent(e.chat.roomId,"m.room.message",{from:e.$f.getmatrixid(e.m_chat.myUserId),to:e.receiver.id,amount:e.donationAmount,txId:t,msgtype:"m.notice"},""),e.closeDonateModal()}))}))}catch(n){console.error(n),e.showTransactionError="error",e.sending=!1}})}))()},resetDonation(){this.calculatedFees=null,this.showFeesError="",this.showTransactionError=""}}},at=et;function nt(t){var e=a("817d");e.__inject__&&e.__inject__(t)}var it=Object(y["a"])(at,G,Q,!1,nt,"3b761913",null,!0),ot=it.exports,st={name:"pagechat",components:{chat:J,topheader:ot,contacts:tt["a"]},data:()=>({events:[],openInviteModal:!1,brokenRoom:!1,hideHeader:!1}),computed:{u(){return this.$route.query.u},chat(){var t=this.$route.query.id;return this.$store.state.chatsMap[t]},k(){return this.u+this.$route.query.id},ios(){return O["a"].isios()},...Object(r["c"])({pocketnet:t=>t.pocketnet,minimized:t=>t.minimized,mobile:t=>t.mobile})},mounted(){setTimeout(()=>{this.leaveIfBroken()},2e3)},methods:{creatorLeft(t){this.brokenRoom=t},closeModal(){this.openInviteModal=!1},closeContactModal(t){this.openInviteModal=t},addMemberModal(t){this.openInviteModal=t},newchat(t){},sending(){},eventsRoom(t){this.events=t},menuIsVisibleHandler(t){this.hideHeader=t},leaveIfBroken(){return!!this.brokenRoom&&(this.core.mtrx.client.leave(from.query.id).then(t=>{this.core.mtrx.client.forget(from.query.id,!0).then(t=>t).then(t=>{this.$store.commit("DELETE_ROOM",from.query.id)})}),!0)}}},rt=st;function ct(t){var e=a("7e41");e.__inject__&&e.__inject__(t)}var dt=Object(y["a"])(rt,n,i,!1,ct,"7f0235e5",null,!0);e["default"]=dt.exports},f082:function(t,e,a){var n=a("91ee");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("1a21ba68",n,t)}}}]); +(window["matrixElement_jsonp"]=window["matrixElement_jsonp"]||[]).push([[5],{"04b4":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".nameWrapper[data-v-3b761913]{display:flex;align-items:center;justify-content:center}.roomMuted[data-v-3b761913]{margin-left:3px}.roomMuted i[data-v-3b761913]{font-size:.7em}.editButton[data-v-3b761913]{display:flex;justify-content:center;align-items:center}.editButton i[data-v-3b761913]{font-size:1.5em}.nameline[data-v-3b761913]{max-width:250px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#topheader.minimized.fix[data-v-3b761913]{background:transparent;overflow:inherit}.donationModalBody[data-v-3b761913]{padding:1em;display:flex;flex-direction:column}.donationModalBody span[data-v-3b761913]{color:rgb(var(--color-txt-ac))}.donationModalBody input[data-v-3b761913],.donationModalBody select[data-v-3b761913]{margin-top:.5em;margin-bottom:1.5em;border:1px solid rgb(var(--color-txt-ac));border-radius:3px;padding:.5em}.donationModalBody input.disabled[data-v-3b761913],.donationModalBody select.disabled[data-v-3b761913]{color:rgb(var(--neutral-grad-2));border:1px solid rgba(var(--neutral-grad-2),.5)}.donationModalBody button[data-v-3b761913]{margin-top:1em}.donationModalBody button i[data-v-3b761913]{margin-right:.2em}.donationModalBody .totalAmount[data-v-3b761913]{font-weight:700;margin-left:.5em;margin-top:.5em;margin-bottom:1em}.donationModalBody .error[data-v-3b761913]{color:rgb(var(--color-bad));text-align:center}.donationModalBody .linepreloader[data-v-3b761913]{text-align:center;height:29px;margin-top:1em}",""]),t.exports=e},"0eb5":function(t,e,a){"use strict";a.r(e);var n=a("d885");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},"0f20":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,"#chatAttachement[data-v-41942aae]{height:90px;width:120px;border-radius:5px;overflow:hidden;position:relative;background:rgb(var(--background-secondary-theme))}#chatAttachement>div[data-v-41942aae]{width:100%;height:100%}.cancel[data-v-41942aae],.loading[data-v-41942aae]{position:absolute;height:90px;width:120px;line-height:90px;text-align:center;font-size:3em;left:0;top:0;background:rgba(var(--background-main),.8);color:rgba(var(--text-color),.2)}.cancel[data-v-41942aae]{background:transparent;font-size:1.2em;color:rgb(var(--text-color))}.file[data-v-41942aae]{text-align:center;font-size:.8em;padding-top:1em}.file span[data-v-41942aae]{white-space:normal}.file .fileicon i[data-v-41942aae]{opacity:.4;font-size:1.5em}.image[data-v-41942aae],.image .bgimage[data-v-41942aae]{width:100%;height:100%}",""]),t.exports=e},3688:function(t,e,a){"use strict";a.r(e);var n=a("8669");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},"52ab":function(t,e,a){var n=a("9f70");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("5992f11e",n,t)}},"57f6":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".roomStatusView[data-v-85cc32fa]{height:50vh;display:flex;flex-direction:column;align-items:center;justify-content:center}.roomStatusView .statusViewIcon i[data-v-85cc32fa]{color:rgb(var(--color-txt-ac));font-size:5em}.roomStatusView .text[data-v-85cc32fa]{margin:40px 0;color:rgb(var(--color-txt-ac))}",""]),t.exports=e},"5ab8":function(t,e,a){var n=a("b2b2");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("02da690d",n,t)}},"6af4":function(t,e,a){var n=a("0f20");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("42d072f6",n,t)}},"7e41":function(t,e,a){"use strict";a.r(e);var n=a("c27c");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},"817d":function(t,e,a){"use strict";a.r(e);var n=a("d75f");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},8669:function(t,e,a){var n=a("57f6");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("dfdc80cc",n,t)}},"9ad5":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".topheader[data-v-7f0235e5]{width:100%;top:0;z-index:999}.aboutContact[data-v-7f0235e5]{position:absolute;left:0;right:0;top:100px;bottom:0;z-index:999;background:#fff}.chat.mobile[data-v-7f0235e5] #maincontent .headerSpacerWrapper{bottom:0;overflow:visible}.chat.mobile[data-v-7f0235e5] #maincontent .headerSpacerWrapperOvf{overflow:visible}",""]),t.exports=e},"9f70":function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".attachements[data-v-adf0f1c6]{position:absolute;left:0;top:0;right:0;padding:.5em .5em;overflow-y:scroll}.attachements .attachementsWrapper[data-v-adf0f1c6]{display:flex;align-items:center;flex-wrap:nowrap;flex-grow:1;flex-direction:row;margin-right:.5em;min-width:120px}.joinwrapper[data-v-adf0f1c6]{position:absolute;left:0;top:0;bottom:0;right:0;padding-bottom:100px;overflow-x:scroll}.cantchatmessage[data-v-adf0f1c6]{padding:2em}.cantchatmessage .proceed[data-v-adf0f1c6]{padding-top:1em}.cantchatmessage .proceed button[data-v-adf0f1c6]{padding-left:0}.cantchatmessage .refresh[data-v-adf0f1c6]{padding-top:2em}.cantchatmessage .msg[data-v-adf0f1c6]{font-size:.8em}.encryptedInfo[data-v-adf0f1c6]{position:relative;z-index:9999;display:flex;justify-content:center;align-items:center;flex-direction:column}.encryptedInfo #slide[data-v-adf0f1c6]{padding:0 .5em;position:absolute;left:-180px;top:0;background:#fff;border-bottom-right-radius:8px;border-top-right-radius:8px;-webkit-animation:slide-data-v-adf0f1c6 .1s forwards;-webkit-animation-delay:.3s;animation:slide-data-v-adf0f1c6 .1s forwards;animation-delay:.3s;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}@-webkit-keyframes slide-data-v-adf0f1c6{left:0}@keyframes slide-data-v-adf0f1c6{to{left:0}}.encryptedInfo button[data-v-adf0f1c6]{cursor:pointer;display:flex;align-items:center;justify-content:flex-start;text-align:left}.encryptedInfo button i[data-v-adf0f1c6]{margin-right:5px}.encryptedInfo .encryptedTxtIcon[data-v-adf0f1c6]{flex-direction:column;align-items:center;justify-content:center;padding:.25em .25em;text-align:center}.encryptedInfo .encryptedTxtIcon span[data-v-adf0f1c6]{color:rgb(var(--color-good));font-size:.8em}.encryptedInfo .encryptedTxtIcon i[data-v-adf0f1c6]{color:rgb(var(--color-good));display:none}.blockedcaption[data-v-adf0f1c6]{text-align:center}.blockedcaption span[data-v-adf0f1c6]{font-size:.8em}.relationEvent[data-v-adf0f1c6]{display:flex;align-items:flex-end;width:100%}.relationEvent .relationEventWrapper[data-v-adf0f1c6]{padding-bottom:1em}.relationEvent .relationEventCaption[data-v-adf0f1c6]{padding:1em 0;padding-bottom:.5em}.relationEvent .relationEventCaption span[data-v-adf0f1c6]{font-size:.8em;font-weight:700;color:rgb(var(--color-txt-ac))}.relationEvent .relationEventPreview[data-v-adf0f1c6]{flex-grow:1;padding:0 1em;padding-top:0}.relationEvent[data-v-adf0f1c6] .previewMessage{font-size:.9em}.relationEvent .relationEventActions[data-v-adf0f1c6]{width:66px;min-width:66px}.relationEvent .relationEventActions .item[data-v-adf0f1c6]{width:100%;padding:.5em 0;cursor:pointer;text-align:center}.chatInputWrapper[data-v-adf0f1c6]{position:fixed;z-index:3;bottom:-1px;background:transparent;left:0;right:0;padding-bottom:35px;background:rgb(var(--background-total-theme));will-change:transform;transform:translate3d(0,calc(var(--keyboardheight, 0)*-1 - -1px),0);transition:.3s}.chatInputWrapper.bin[data-v-adf0f1c6]{position:absolute;left:1px;right:1px;bottom:0;border-radius:5px}#chat.minimized .chatInputWrapper[data-v-adf0f1c6]{opacity:0;padding-bottom:0}#chat.minimized:not(.active) .statusWrapper[data-v-adf0f1c6]{width:33px}#chat.minimized:not(.active) .statusWrapper i[data-v-adf0f1c6]{color:rgb(var(--color-txt-ac))}#chat.minimized:not(.active) .statusWrapper i span[data-v-adf0f1c6]{display:none}#chat.minimized:not(.active) .statusWrapper .messageRow[data-v-adf0f1c6]{padding:0!important;background:transparent!important}#chat.minimized:not(.active) .statusWrapper .event[data-v-adf0f1c6]{padding-bottom:.5em}#chat.minimized:not(.active) .statusWrapper #events[data-v-adf0f1c6]{transform:translate3d(.25em,30px,0)}#chat.minimized:not(.active) .statusWrapper .iconWrapper[data-v-adf0f1c6]{margin-left:0!important}#chat.minimized:not(.active) .statusWrapper [my=true][data-v-adf0f1c6]{justify-content:flex-start}#chat.minimized:not(.active) .statusWrapper [my=true] .iconWrapper[data-v-adf0f1c6]{margin-left:0!important;order:-1;align-self:flex-end}#chat.minimized:not(.active) .statusWrapper .actionsWrapper[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .filePreview[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .labelwrapper[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .linkPreview[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .maxcontent[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .messageImg[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .timeWrapper[data-v-adf0f1c6],#chat.minimized:not(.active) .statusWrapper .userpic[data-v-adf0f1c6]:after{display:none}#chat.minimized.active[data-v-adf0f1c6]{padding-bottom:90px}#chat.minimized.active .chatInputWrapper[data-v-adf0f1c6]{opacity:1}.encrypted[data-v-adf0f1c6]{position:absolute;left:0;top:0;z-index:2;color:rgb(var(--color-good));padding:.25em .5em}.encrypted i[data-v-adf0f1c6]{font-size:.8em;cursor:pointer}.roomMuted[data-v-adf0f1c6]{position:absolute;left:5px;top:20px;z-index:2;color:rgb(var(--neutral-grad-3))}.roomMuted i[data-v-adf0f1c6]{font-size:.8em}.chatEmpty[data-v-adf0f1c6]{padding:4em;text-align:center;color:rgb(var(--neutral-grad-3))}.chatEmpty span[data-v-adf0f1c6]{font-size:.8em}.preview-wrapper[data-v-adf0f1c6]{max-height:350px;overflow-y:auto;border:1px solid rgb(var(rgb(var(--neutral-grad-2))));border-radius:10px;margin:0 auto;width:98%}.preview-wrapper[data-v-adf0f1c6]::-webkit-scrollbar{width:0!important}.shareEventsWrapper .cnt[data-v-adf0f1c6]{background:rgb(var(--background-secondary-theme));border-radius:30px;padding:.5em 1em;max-width:622px;width:100%;margin:0 auto;display:flex;align-items:center;justify-content:space-between;font-size:.9em}.shareEventsWrapper .cnt i[data-v-adf0f1c6]{margin-right:10px}.shareEventsWrapper .cnt i.fa-trash-alt[data-v-adf0f1c6]{color:#f41a4d}.shareEventsWrapper .cnt i.fa-share-alt[data-v-adf0f1c6]{color:#00a3f7}.shareEventsWrapper .cnt div[data-v-adf0f1c6]{transition:.3s;opacity:.6;cursor:pointer;margin-left:1em;display:flex;align-items:center}.shareEventsWrapper .cnt div[data-v-adf0f1c6]:hover{transition:.3s;opacity:1}.shareEventsWrapper .cnt div.cancel[data-v-adf0f1c6]{margin-right:auto;margin-left:0}",""]),t.exports=e},ad42:function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".userinfoWrapper[data-v-409a51d4]{height:95%;width:100%;padding:2em .5em;background:rgba(var(--background-main),.4);border-radius:15px;position:relative;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.previewWrapper .work[data-v-409a51d4]{padding-bottom:.5em!important}.VueCarousel[data-v-409a51d4]{width:100%}.filter[data-v-409a51d4]{background-color:rgba(var(--color-shadow-base),.2)!important}",""]),t.exports=e},b2b2:function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.i,".caption[data-v-a8ae0c26]{padding:1em}.caption span[data-v-a8ae0c26]{font-size:1.5em;font-weight:700}.tip[data-v-a8ae0c26]{padding:1.5em;text-align:center}.tip span[data-v-a8ae0c26]{font-size:.8em}.blocked[data-v-a8ae0c26]{width:100%;text-align:center}.blocked span[data-v-a8ae0c26]{font-size:.9em}.joinAction[data-v-a8ae0c26]{position:fixed;bottom:0;left:0;right:0;background:rgb(var(--neutral-grad-0));padding:1em 0;text-align:center;z-index:3}.joinAction.bin[data-v-a8ae0c26]{position:sticky}.joinAction .actions[data-v-a8ae0c26]{display:flex}.joinAction .actions .action[data-v-a8ae0c26]{padding:.5em;flex-grow:1}.joinAction .actions .action button[data-v-a8ae0c26]{min-width:0;width:100%}.my-swipe[data-v-a8ae0c26]{height:200px;font-size:30px;text-align:center}.my-swipe[data-v-a8ae0c26],.slide1[data-v-a8ae0c26]{color:rgb(var(--text-on-bg-ac-color))}.slide1[data-v-a8ae0c26]{background-color:rgb(var(--color-bg-ac))}.slide2[data-v-a8ae0c26]{background-color:rgb(var(--color-bg-orange));color:#000}.slide3[data-v-a8ae0c26]{background-color:rgb(var(--color-bg-ac-2));color:rgb(var(--text-on-bg-ac-color))}.minimized:not(.active) .caption[data-v-a8ae0c26]{width:52px;text-align:center}.minimized:not(.active) .caption span[data-v-a8ae0c26]{color:rgb(var(--color-txt-ac));font-size:.6em}.minimized:not(.active) .chatPreview[data-v-a8ae0c26],.minimized:not(.active) .joinAction[data-v-a8ae0c26]{display:none}.minimized[data-v-a8ae0c26]:not(.active) .userinfoWrapper{background:transparent!important;box-shadow:none}.minimized[data-v-a8ae0c26]:not(.active) .haskeys{display:none}",""]),t.exports=e},c27c:function(t,e,a){var n=a("9ad5");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("981b0ec6",n,t)}},c709:function(t,e,a){"use strict";a.r(e);var n=a("5ab8");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},d75f:function(t,e,a){var n=a("04b4");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("a66dd582",n,t)}},d885:function(t,e,a){var n=a("ad42");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("35d6").default;t.exports.__inject__=function(t){i("475698de",n,t)}},ebaa8:function(t,e,a){"use strict";a.r(e);var n=a("52ab");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},ec21:function(t,e,a){"use strict";a.r(e);var n=a("6af4");for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i)},ee79:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page chat",class:{mobile:t.mobile}},[a("topheader",{directives:[{name:"show",rawName:"v-show",value:!t.hideHeader||!t.ios,expression:"!hideHeader || !ios"}],key:t.k,staticClass:"topheader",attrs:{u:t.u,chat:t.chat},on:{addMember:t.addMemberModal}}),a("maincontent",{scopedSlots:t._u([{key:"content",fn:function(){return[a("chat",{key:t.k,attrs:{u:t.u,chat:t.chat},on:{sending:t.sending,newchat:t.newchat,removeBrokenRoom:t.creatorLeft,getEvents:t.eventsRoom,menuIsVisible:t.menuIsVisibleHandler}})]},proxy:!0}])}),t.openInviteModal?a("modal",{on:{close:t.closeModal},scopedSlots:t._u([{key:"header",fn:function(){return[a("span",[t._v(t._s(t.$t("caption.inviteUser")))])]},proxy:!0},{key:"body",fn:function(){return[a("contacts",{attrs:{mode:"inviteUsers",chatRoomId:t.chat.roomId},on:{closeModal:t.closeContactModal}})]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,1321158477)}):t._e()],1)},i=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:{bin:t.pocketnet,bout:!t.pocketnet,minimized:t.minimized,fix:t.pocketnet,active:t.active},attrs:{id:"chat"}},[t.cantchat&&!t.cantchatexc?a("div",{staticClass:"cantchatmessage"},[a("div",{staticClass:"msg"},[t._v(" "+t._s(t.$t("caption."+this.keyproblem))+" ")]),"usernotgen"==t.keyproblem?a("div",{staticClass:"refresh"},[a("button",{staticClass:"button small",on:{click:t.refreshkeys}},[t._v(" Refresh "),a("i",{staticClass:"fas fa-sync"})])]):t._e(),"younotgen"==t.keyproblem?a("div",{staticClass:"preloaderwrapper"},[a("linepreloader")],1):t._e()]):a("div",{staticClass:"chatcontent"},[t.m_chat&&"join"===t.membership&&t.ready?a("list",{key:t.key,ref:"list",attrs:{error:t.error,chat:t.m_chat,selectedMessages:t.selectedMessages,isRemoveSelectedMessages:t.isRemoveSelectedMessages},on:{editingEvent:t.editingEvent,replyEvent:t.replyEvent,eventImage:function(e){return t.galleryImage(e)},scroll:t.scroll,menuIsVisible:t.menuIsVisibleHandler,getEvents:t.events,messagesIsDeleted:t.messagesIsDeleted}}):t._e(),t.m_chat&&"invite"===t.membership?a("div",{staticClass:"joinwrapper"},[a("join",{attrs:{m_chat:t.m_chat,chat:t.chat,usersinfo:t.usersinfo},on:{creatorLeft:t.brokenInvitedRoom}})],1):t._e(),!t.m_chat&&t.usersinfo&&t.usersinfo.length?a("div",{staticClass:"chatEmpty"},[a("span",[t._v(t._s(t.$t("caption.startChatWith"))+" "+t._s(t.usersinfoNames()))])]):t._e(),t.m_chat&&"join"!==t.membership?t._e():a("div",{staticClass:"chatInputWrapper fixedOnPageBottom",class:{bin:t.pocketnet,bout:!t.pocketnet}},[a("div",[t.relationEvent?a("div",{staticClass:"relationEvent"},[a("div",{staticClass:"relationEventPreview"},[a("div",{staticClass:"relationEventCaption"},[a("span",[t._v(t._s(t.relationEvent.action))])]),"m.replace"!=t.relationEvent.type?a("div",{staticClass:"relationEventWrapper"},[a("eventsEvent",{attrs:{event:t.relationEvent.event,chat:t.chat,preview:!0}})],1):t._e()]),a("div",{staticClass:"relationEventActions"},[a("div",{staticClass:"item",on:{click:t.clearRelationEvent}},[a("i",{staticClass:"far fa-times-circle"})])])]):t._e(),t.blockedUser||t.selectedMessages.length?t._e():a("chatInput",{ref:"chatInput",attrs:{u:t.u,chat:t.m_chat,usersinfo:t.usersinfo,relationEvent:t.relationEvent},on:{sending:t.sending,sent:t.sent,sentError:t.sentError,sentMessageError:t.sentMessageError,sendingData:t.sendingData,sentData:t.sentData,force:t.force,newchat:t.newchat,closeMetaPreview:t.closing,clearRelationEvent:t.clearRelationEvent,focused:t.focused,cantchatcrypto:t.cantchatcrypto}}),t.selectedMessages.length?a("div",{staticClass:"center shareEventsWrapper"},[a("div",{staticClass:"work"},[a("div",{staticClass:"cnt"},[a("div",{staticClass:"cancel",on:{click:function(e){return t.cancelDataMessages()}}},[a("i",{staticClass:"fas fa-times"}),a("span",[t._v(t._s(t.$t("cancel")))])]),a("div",{on:{click:function(e){return t.removeDataMessages()}}},[a("i",{staticClass:"far fa-trash-alt"}),a("span",[t._v(t._s(t.localisationTitles.delete))])]),a("div",{on:{click:function(e){return t.shareDataMessages()}}},[a("i",{staticClass:"fas fa-share-alt"}),a("span",[t._v(t._s(t.localisationTitles.share))])])])])]):t._e(),t.blockedUser&&t.m_chat?a("div",{staticClass:"blockedcaption"},[a("span",[t._v("You have blocked this user")])]):t._e()],1)]),t.encrypted&&"invite"!=t.membership?a("div",{staticClass:"encrypted",on:{mouseover:function(e){return t.hoverEncrypt=!0}}},[a("i",{staticClass:"fas fa-lock"})]):t._e(),t.hoverEncrypt?a("div",{staticClass:"encryptedInfo",on:{mouseover:function(e){return t.hoverEncrypt=!0},mouseleave:function(e){return t.hoverEncrypt=!1},click:function(e){return t.hoverEncrypt=!t.hoverEncrypt}}},[a("div",{attrs:{id:"slide"}},[a("div",{staticClass:"encryptedTxtIcon"},[a("i",{staticClass:"fas fa-user-shield"}),a("span",[t._v(t._s(t.$t("caption.encrypted")))])])])]):t._e(),t.attachements.length?a("div",{staticClass:"attachements"},[a("div",{staticClass:"attachementsWrapper"},t._l(t.attachements,(function(e){return a("attachement",{key:e.id,attrs:{attachement:e},on:{cancel:function(a){return t.abortSending(e.id)}}})})),1)]):t._e()],1),t.roomUserBanned?a("userRoomStatus",{attrs:{chat:t.chat,text:"You've have been banned in this room"}}):t._e()],1)},s=[],r=a("2f62"),c=a("4e29"),d=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"maskedtop",class:{minimized:t.minimized,active:t.active},attrs:{id:"chatJoin"}},[a("div",{staticClass:"work"},[a("div",{staticClass:"caption"},[t.creatorLeft?t._e():a("span",[t._v(" "+t._s(t.$t("caption.chatInvite"))+" ")]),t.creatorLeft?a("span",[t._v(t._s(t.$t("caption.cantJoin")))]):t._e()])]),t.blockedCheck?t._e():a("div",{staticClass:"tip"},[t.creatorLeft?t._e():a("span",[t._v(t._s(t.$t("caption.chatInviteDecline")))]),t.creatorLeft?a("span",[t._v(t._s(t.$t("caption.creatorLeft")))]):t._e()]),a("chatPreview",{attrs:{usersinfo:t.usersinfo,chat:t.chat,m_chat:t.m_chat,undefinedRoom:t.creatorLeft}}),t.hiddenInParent?t._e():a("div",{staticClass:"joinAction fixedOnPageBottom",class:{bin:t.pocketnet,bout:!t.pocketnet}},[a("div",{staticClass:"work"},[t.blockedCheck?a("div",{staticClass:"actions"},[t._m(0)]):a("div",{staticClass:"actions"},[t.creatorLeft||t.tetatet?t._e():a("div",{staticClass:"action"},[a("button",{staticClass:"small button black rounded",on:{click:t.decline}},[t._v(t._s(t.$t("button.decline")))])]),t.tetatet?a("div",{staticClass:"action"},[a("button",{staticClass:"small button black rounded",on:{click:t.ignore}},[t._v(t._s(t.$t("button.declineandignore")))])]):t._e(),t.creatorLeft?t._e():a("div",{staticClass:"action"},[a("button",{staticClass:"small button rounded",on:{click:t.join}},[t._v(t._s(t.$t("button.join")))])]),t.creatorLeft?a("div",{staticClass:"action"},[a("button",{staticClass:"small button rounded",on:{click:t.back}},[t._v(t._s(t.$t("button.ok")))])]):t._e()])])])],1)},l=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"blocked"},[a("span",[t._v("You have blocked this user")])])}],h=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"chatPreview"},[a("div",{staticClass:"work"},[a("div",{staticClass:"previewWrapper"},[t.users&&t.users.length?a("div",{staticClass:"users"},t._l(t.users,(function(e){return t.empty(e)?t._e():a("div",{key:e.id,staticClass:"work"},[a("div",{staticClass:"userinfoWrapper",class:{filter:t.undefinedRoom}},[e.name?a("userView",{attrs:{userinfo:e}}):t._e()],1)])})),0):t._e()])])])},u=[],m=a("aa20"),f=a("3094"),p=a("42cd"),v=a("7212a"),g=a("0a63"),b={name:"chatPreview",props:{chat:Object,usersinfo:Array,room:{},undefinedRoom:!1},components:{userView:p["a"],chatName:m["a"],chatIcon:f["a"],Swiper:v["Swiper"],SwiperSlide:v["SwiperSlide"],Carousel:g["Carousel"],Slide:g["Slide"]},data:function(){return{loading:!1,swiperOption:{direction:"horizontal",pagination:{el:".swiper-pagination"}}}},computed:{users:function(){return this.chat?this.core.mtrx.chatUsersInfo(this.chat.roomId,"anotherChatUsers"):[]}},methods:{empty:function(t){return _.isEmpty(t)}}},x=b,y=a("2877");function k(t){var e=a("0eb5");e.__inject__&&e.__inject__(t)}var w=Object(y["a"])(x,h,u,!1,k,"409a51d4",null,!0),E=w.exports,I={name:"chatJoin",props:{chat:Object,m_chat:{},usersinfo:Array,room:Object},components:{chatPreview:E},data:function(){return{loading:!1,joinedMembers:[],creatorLeft:!1}},created:()=>{},watch:{},computed:Object(r["c"])({hiddenInParent:t=>t.hiddenInParent,auth:t=>t.auth,pocketnet:t=>t.pocketnet,minimized:t=>t.minimized,active:t=>t.active,tetatet:function(){return this.core.mtrx.kit.tetatetchat(this.m_chat)},blockedCheck:function(){var t=this.core.mtrx.anotherChatUsers(this.m_chat.roomId);if(1==t.length)return this.core.mtrx.blockeduser(t[0].userId)}}),mounted:function(){},methods:{join:function(){var t=this;this.$store.commit("SET_CHAT_TO_FORCE",this.m_chat.roomId),this.core.mtrx.client.joinRoom(this.m_chat.roomId).then(()=>{this.$emit("joined")}).catch((function(e){return t.brokenRoom(!0),t.creatorLeft=!0}))},back(){this.$router.go(-1)},ignore:function(){var t=this.core.mtrx.anotherChatUsers(this.chat.roomId);t.length>1||this.core.mtrx.blockUser(t[0].userId).then(t=>{this.$router.go(-1)}).catch(t=>{})},decline:function(){this.$store.commit("SET_CHAT_TO_FORCE",this.m_chat.roomId),this.core.mtrx.client.leave(this.chat.roomId).then(t=>{this.core.mtrx.client.forget(this.chat.roomId,!0).then(t=>t).then(t=>{this.$store.commit("DELETE_ROOM",this.chat.roomId),this.$router.go(-1)})})},brokenRoom(){this.$emit("creatorLeft",!0)}}},C=I;function M(t){var e=a("c709");e.__inject__&&e.__inject__(t)}var $=Object(y["a"])(C,d,l,!1,M,"a8ae0c26",null,!0),z=$.exports,R=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"chatAttachement"}},["image"==t.attachement.type?a("div",{staticClass:"image"},[t.attachement.base64?a("bgimage",{attrs:{src:t.attachement.base64}}):t._e()],1):t._e(),"file"==t.attachement.type?a("div",{staticClass:"file"},[a("div",{staticClass:"fileicon"},[a("i",{class:t.fileicon})]),a("div",{staticClass:"filename"},[a("span",[t._v(t._s(t.attachement.info.name||"File"))])]),t.humanReadableSize?a("div",{staticClass:"filesize"},[a("span",[t._v(t._s(t.humanReadableSize))])]):t._e()]):t._e(),t._m(0),a("div",{staticClass:"cancel",on:{click:t.cancel}},[a("i",{staticClass:"far fa-times-circle"})])])},j=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"loading"},[a("i",{staticClass:"fas fa-spinner fa-spin"})])}],O=a("3139"),T={name:"chatAttachement",props:{attachement:Object},data:function(){return{loading:!1,ext:{pdf:"far fa-file-pdf",custom:"far fa-file"}}},created:()=>{},watch:{},computed:Object(r["c"])({auth:t=>t.auth,extension:function(){if(!O["a"].deep(this,"attachement.info.name"))return"custom";var t=O["a"].deep(this,"attachement.info.name"),e=(t=t.split("."),t[t.length-1].toLowerCase());return e},humanReadableSize(){return O["a"].deep(this,"attachement.info.size")?O["a"].formatBytes(this.attachement.info.size):""},fileicon:function(){var t=this.extension;return this.ext[t]||this.ext["custom"]}}),methods:{cancel:function(){this.$emit("cancel")}}},S=T;function A(t){var e=a("ec21");e.__inject__&&e.__inject__(t)}var D=Object(y["a"])(S,R,j,!1,A,"41942aae",null,!0),W=D.exports,P=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"roomStatusView"},[t._m(0),a("div",{staticClass:"text"},[t._v(" "+t._s(t.text)+" ")]),a("button",{staticClass:"button small black rounded",on:{click:function(e){return t.leaveRoom()}}},[t._v("Delete room")])])},F=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"statusViewIcon"},[a("i",{staticClass:"fas fa-ban"})])}],B={props:{text:String,chat:Object},methods:{leaveRoom(){this.core.mtrx.client.forget(this.chat.roomId,!0).then(t=>{this.$store.commit("DELETE_ROOM",this.chat.roomId)}).then(t=>{this.$router.push({path:"/chats"}).catch(t=>{})})}}},U=B;function L(t){var e=a("3688");e.__inject__&&e.__inject__(t)}var N=Object(y["a"])(U,P,F,!1,L,"85cc32fa",null,!0),V=N.exports,H={name:"chat",props:{chat:Object,u:String},components:{list:c["a"],chatInput:()=>Promise.all([a.e(11),a.e(6)]).then(a.bind(null,"fe01")),join:z,attachement:W,userRoomStatus:V},data:function(){return{roomUserBanned:!1,roomUserKicked:!1,hoverEncrypt:!1,roomMuted:!1,loading:!1,ready:!1,encrypted:!1,usersinfo:[],chatEvents:{},relationEvent:null,key:"",sendingDataStore:{},esize:{},fsize:{},cantchat:!1,cantchatexc:!1,error:null,showInput:!0,showShareMessages:!1,selectedMessages:[],isRemoveSelectedMessages:!1}},created(){},mounted(){this.getuserinfo(),this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"chat"})},destroyed(){this.$store.commit("blockactive",{value:!1,item:"chat"}),this.$store.commit("SET_CURRENT_ROOM",!1),this.clearintrv()},watch:{needcreatekey:function(){this.needcreatekey?this.intrv||(this.intrv=setInterval(()=>{this.refreshkeys(!0)},2e4)):this.clearintrv()},chatusers:function(){this.m_chat&&this.m_chat.pcrypto&&this.m_chat.pcrypto.userschanded().then(t=>{this.checkcrypto()})},m_chat:{immediate:!0,handler:function(){this.m_chat&&!_.isEmpty(this.m_chat)&&this.core.mtrx.kit.allchatmembers([this.m_chat],!1,!0).then(t=>this.core.mtrx.kit.prepareChat(this.m_chat)).then(t=>{this.ready=!0,this.checkcrypto()})}},chat:{immediate:!0,handler:function(){this.ready=!1,this.encrypted=!1,this.$store.commit("setmodal",null),this.chat?(this.$store.commit("SET_CURRENT_ROOM",this.chat.roomId),this.$store.commit("SET_LAST_ROOM",this.chat.roomId)):this.$store.commit("SET_CURRENT_ROOM",!1)}}},computed:Object(r["c"])({pocketnet:t=>t.pocketnet,minimized:t=>t.minimized,active:t=>t.active,auth:t=>t.auth,m_chat:function(){if(this.chat&&this.chat.roomId){let e=this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId);null!==e&&(this.roomMuted=!0);var t=this.core.mtrx.client.getRoom(this.chat.roomId);return t||{}}},keyproblem:function(){return this.core.user.userinfo.keys.length<12?"younotgen":"usernotgen"},needcreatekey:function(){return"younotgen"==this.keyproblem&&this.cantchat&&!this.cantchatexc},membership:function(){if(this.m_chat){if(this.m_chat.timeline.length>0){var t=this.core.mtrx.client.credentials.userId,e=this.m_chat.timeline[this.m_chat.timeline.length-1];e.event.state_key===t&&"admin ban"===e.event.content.reason&&(this.roomUserBanned=!0)}return this.m_chat.getMyMembership()}},blockedUser:function(){if(this.u)return this.core.mtrx.blockeduser(this.u[0]);if(this.chat){var t=this.core.mtrx.anotherChatUsers(this.chat.roomId);if(1==t.length)return this.core.mtrx.blockeduser(t[0].userId)}},openInviteModal:function(){return this.openInviteModal},attachements:function(){return _.toArray(this.sendingDataStore)},chatusers:function(){if(this.m_chat)return this.core.store.state.chatusers[this.m_chat.roomId]},localisationTitles:function(){return this.$i18n.t("button")}}),methods:{clearintrv:function(){this.intrv&&(clearInterval(this.intrv),this.intrv=null)},checkcrypto:function(){this.encrypted=this.m_chat.pcrypto.canBeEncrypt(),this.cantchat=this.m_chat.pcrypto.cantchat()},force:function(){this.key=O["a"].makeid()},clearRelationEvent:function(){this.relationEvent&&"m.replace"==this.relationEvent.type&&this.$refs["chatInput"]&&this.$refs["chatInput"].setText(""),this.relationEvent=null},newchat:function(t){this.$emit("newchat",t),this.m_chat.pcrypto.userschanded()},getuserinfo:function(){this.u&&this.core.user.usersInfo(this.u).then(t=>{this.usersinfo=t})},cantchatcrypto:function(){this.cantchat=!0},proceedwithoutkeys:function(){this.cantchatexc=!0},refreshkeys:function(){this.core.user.userInfo(!0).then(t=>{this.u?this.core.user.usersInfo(this.u,!1,!0).then(t=>{var e=t[0];e&&e.keys&&e.keys.length>=12&&this.core.user.userinfo.keys.length>=12&&(this.cantchat=!1),this.usersinfo=t}):this.core.store.dispatch("RELOAD_CHAT_USERS",[this.m_chat]).then(t=>{})})},closing:function(t){this.PNmetaPreview=t},usersinfoNames:function(){return _.map(this.usersinfo,(function(t){return t.name})).join(", ")},replyEvent:function(t){let{event:e}=t;this.relationEvent={type:"m.reference",event:e,action:this.$i18n.t("caption.replyOnMessage")},this.$refs["chatInput"]&&this.$refs["chatInput"].focus()},editingEvent:function(t){let{event:e,text:a}=t;this.relationEvent={type:"m.replace",event:e,action:this.$i18n.t("caption.editMessage")},this.$refs["chatInput"]&&this.$refs["chatInput"].setText(a)},focused:function(){this.fsize=_.clone(this.esize)},scroll(t){this.esize=t;var e=this.esize.scrollTop||0,a=this.fsize.scrollTop||0;e-450>a&&this.$refs["chatInput"]&&this.$refs["chatInput"].blurifempty()},events(t){this.$emit("getEvents",t),this.chatEvents=t},galleryImage(t){this.core.store.dispatch("SHOW_GALLERY_FROMEVENTS",{events:this.chatEvents,event:t})},sending:function(){this.$emit("sending"),this.$refs["list"].scrollToNew(0)},sent:function(){this.relationEvent&&"m.reference"==this.relationEvent.type&&(this.relationEvent=null),this.$emit("sent"),this.error=null},sendingData:function(t){this.$set(this.sendingDataStore,t.id,t)},sentData:function(t){this.clearMeta(t),this.error=null},sentError:function(t){t&&t.id&&this.clearMeta(t),t&&t.error&&(this.error=t.error)},sentMessageError:function(t){this.error=t.error,this.core.logerror("sentMessageError",O["a"].stringify(this.error))},abortSending:function(t){var e=this.sendingDataStore[t];e.abort&&e.abort(),e.aborted=!0,this.clearMeta(e)},brokenInvitedRoom(t){this.$emit("removeBrokenRoom",t)},clearMeta:function(t){this.$delete(this.sendingDataStore,t.id)},menuIsVisibleHandler:function(t){this.$emit("menuIsVisible",t)},shareDataMessages:function(){let t=[];for(let n=0;n{O["a"].Base64.fromFile(t.file)}).then(t=>{a.files=[t],Promise.resolve()})),e.then(()=>{this.core.share(a)})},removeDataMessages:function(){this.isRemoveSelectedMessages=!0},cancelDataMessages:function(){this.selectedMessages=[]},messagesIsDeleted:function(t){this.isRemoveSelectedMessages=!1,t&&(this.selectedMessages=[])}}},q=H;function Y(t){var e=a("ebaa8");e.__inject__&&e.__inject__(t)}var K=Object(y["a"])(q,o,s,!1,Y,"adf0f1c6",null,!0),J=K.exports,G=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"chatTopheader"}},[t.chat||t.u?a("topheader",{scopedSlots:t._u([{key:"left",fn:function(){return[a("backButton",{attrs:{action:"chats"}})]},proxy:!0},{key:"info",fn:function(){return[t.chat?a("router-link",{attrs:{to:"chatInfo?id="+t.chat.roomId}},[t.m_chat?a("div",[a("div",{staticClass:"nameWrapper"},[t.roomInfo?t._e():a("chatName",{attrs:{preview:!0,chat:t.chat,m_chat:t.m_chat}}),t.roomMuted?a("div",{staticClass:"roomMuted"},[a("i",{staticClass:"fas fa-bell-slash"})]):t._e()],1),a("transition",{attrs:{name:"fade"}},[t.m_chat_typing?a("chatTyping"):t._e()],1)],1):t._e(),!t.m_chat&&t.userinfo?a("div",[a("span",{staticClass:"nameline"},[t._v(t._s(t.userinfo.name))])]):t._e()]):t._e()]},proxy:!0},{key:"right",fn:function(){return[t.chat?a("router-link",{attrs:{to:"chatInfo?id="+t.chat.roomId}},[a("div",{staticClass:"iconbutton"},[a("i",{staticClass:"fas fa-ellipsis-h"})])]):t._e()]},proxy:!0}],null,!1,3419355125)}):t._e(),t.donateUserOpened?a("modal",{on:{close:t.closeDonateModal},scopedSlots:t._u([{key:"header",fn:function(){return[a("span",[t._v(t._s(t.$t("caption.donate")))])]},proxy:!0},{key:"body",fn:function(){return[a("div",{staticClass:"donationModalBody"},[a("span",[t._v(t._s(t.$t("caption.source")))]),a("input",{staticClass:"disabled",attrs:{type:"text",value:"Account Address",disabled:!0}}),a("span",[t._v(t._s(t.$t("caption.amount")))]),a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.donationAmount,expression:"donationAmount",modifiers:{number:!0}}],attrs:{type:"number",disabled:t.sending},domProps:{value:t.donationAmount},on:{keyup:function(e){return t.resetDonation()},input:function(e){e.target.composing||(t.donationAmount=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),a("span",[t._v(t._s(t.$t("caption.receiver")))]),a("input",{staticClass:"disabled",attrs:{type:"text",disabled:!0},domProps:{value:t.receiver?t.receiver.name:""}}),a("span",[t._v(t._s(t.$t("caption.message")))]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.donationMessage,expression:"donationMessage"}],attrs:{type:"text",placeholder:"Your message",disabled:t.sending},domProps:{value:t.donationMessage},on:{input:function(e){e.target.composing||(t.donationMessage=e.target.value)}}}),t.showFeesError&&"money"==t.showFeesError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.balanceTooLow")))]):t.showFeesError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.transactionError")))]):t._e(),1!=t.calculatingFees?a("button",{staticClass:"button small",attrs:{disabled:!t.donationAmount||null!=t.calculatedFees},on:{click:t.onCalculateFeesClick}},[a("i",{staticClass:"fas fa-chevron-circle-right"}),t._v(" "+t._s(t.$t("caption.calculateFees"))+" ")]):t._e(),1==t.calculatingFees?a("div",{staticClass:"linepreloader"},[a("linepreloader")],1):t._e()]),null!=t.calculatedFees?a("div",{staticClass:"donationModalBody"},[a("span",[t._v(t._s(t.$t("caption.includeFeesInAmount")))]),a("select",{directives:[{name:"model",rawName:"v-model",value:t.feesDirection,expression:"feesDirection"}],attrs:{disabled:t.sending},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.feesDirection=e.target.multiple?a:a[0]}}},t._l(t.feesDirectionPossibleValues,(function(e){return a("option",{domProps:{value:e.value}},[t._v(" "+t._s(e.label)+" ")])})),0),a("span",[t._v(t._s(t.$t("caption.transactionFees")))]),a("input",{staticClass:"disabled",attrs:{type:"number",disabled:!0},domProps:{value:t.calculatedFees}}),a("span",[t._v(t._s(t.$t("caption.totalAmount")))]),a("span",{staticClass:"totalAmount"},[t._v(t._s(+t.totalDonationAmount.toFixed(5))+" PKOIN")]),t.showTransactionError&&"balance too low"==t.showTransactionError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.balanceTooLow")))]):t.showTransactionError?a("span",{staticClass:"error"},[t._v(t._s(t.$t("caption.transactionError")))]):t._e(),1!=t.sending?a("button",{staticClass:"button small",attrs:{disabled:t.sending},on:{click:t.sendDonation}},[a("i",{staticClass:"fas fa-arrow-alt-circle-right"}),t._v(" Send ")]):t._e(),1==t.sending?a("div",{staticClass:"linepreloader"},[a("linepreloader")],1):t._e()]):t._e()]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,2899695861)}):t._e()],1)},Q=[],X=a("1da1"),Z=a("0826"),tt=a("71da"),et={name:"chatTopheader",props:{chat:Object,u:String,roomInfo:!1,aboutUser:!1},components:{chatName:m["a"],chatIcon:f["a"],chatTyping:Z["a"],contacts:tt["a"]},data:function(){return{menuItems:[{click:"callupVideoHandler",title:this.$i18n.t("caption.videocall"),icon:"fas fa-camera"},{click:"callupHandler",title:this.$i18n.t("caption.call"),icon:"fas fa-phone"}],menuItemsRoom:[{click:"AddMember",title:this.$i18n.t("caption.add"),icon:"fas fa-user-plus"},{click:"MuteRoom",title:this.$i18n.t("caption.mute"),icon:"fas fa-bell-slash"},{click:"LeaveFromRoom",title:this.$i18n.t("caption.leaveAndDelete"),icon:"fas fa-sign-out-alt"}],menuItemsRoomMuted:[{click:"AddMember",title:this.$i18n.t("caption.add"),icon:"fas fa-user-plus"},{click:"MuteRoom",title:this.$i18n.t("caption.unmute"),icon:"fas fa-bell"},{click:"LeaveFromRoom",title:this.$i18n.t("caption.leaveAndDelete"),icon:"fas fa-sign-out-alt"}],oneToOne:[{click:"MuteRoom",title:this.$i18n.t("caption.mute"),icon:"fas fa-bell-slash"},{click:"Donate",title:this.$i18n.t("caption.donate"),icon:"fas fa-money-bill-wave"}],oneToOneMuted:[{click:"MuteRoom",title:this.$i18n.t("caption.unmute"),icon:"fas fa-bell"},{click:"LeaveFromRoom",title:this.$i18n.t("caption.leaveAndDelete"),icon:"fas fa-sign-out-alt"},{click:"Donate",title:this.$i18n.t("caption.donate"),icon:"fas fa-money-bill-wave"}],donateMenu:[{click:"Donate",title:this.$i18n.t("caption.donate"),icon:"fas fa-money-bill-wave"}],loading:!1,typing:!1,userinfo:null,aboutUserShow:!1,roomBanned:!1,roomMuted:!1,donateUserOpened:!1,receiver:null,donationAmount:0,donationMessage:"",calculatedFees:null,showFeesError:"",showTransactionError:"",calculatingFees:!1,sending:!1,feesDirection:"include",feesDirectionPossibleValues:[{value:"include",label:this.$i18n.t("caption.toBePaidByReceiver")},{value:"exclude",label:this.$i18n.t("caption.toBePaidBySender")}]}},watch:{},mounted:function(){this.getuserinfo()},computed:Object(r["c"])({auth:t=>t.auth,m_chat:function(){if(this.chat&&this.chat.roomId){let e=this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId);null!==e&&(this.roomMuted=!0);var t=this.core.mtrx.client.getRoom(this.chat.roomId);return t||{}}},m_chat_typing:function(){if(!this.chat)return!1;var t=this.chat.roomId,e=this.$store.state.typing[t]||{},a=_.find(e,(t,e)=>{var a;if(t)return e!=(null===(a=this.core.user.userinfo)||void 0===a?void 0:a.id)});return a||!1},totalDonationAmount:function(){return"include"==this.feesDirection?this.donationAmount:this.donationAmount+this.calculatedFees}}),methods:{navigateToProfile(t){this.$router.push({path:"/contact?id="+O["a"].getmatrixid(t)}).catch(t=>{})},getuserinfo:function(){this.u&&this.core.user.usersInfo(this.u).then(t=>{this.userinfo=t[0]})},findOtherUser:function(){let t,e=this.m_chat.myUserId,a=this.m_chat.currentState.getMembers();return a.forEach((function(a){a&&a.userId!==e&&(t=a)})),t},addMember(){this.modalInviteUser()},menuItemClickHandler(t,e){if("AddMember"===t.click&&(this.$emit("addMember",!0),this.$refs.dropdownMenu.hidePopup()),"MuteRoom"===t.click){var a=this.chat.roomId;this.core.mtrx.client.deviceId;let t=this,e=this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId);null!==e?(t.core.mtrx.client.deletePushRule("global","room",a),this.roomMuted=!1):(t.core.mtrx.client.setRoomMutePushRule("global",a,"true"),this.roomMuted=!0),this.$refs.dropdownMenu.hidePopup()}if("LeaveFromRoom"===t.click){this.core.mtrx.client.leave(this.chat.roomId).then(t=>{this.core.mtrx.client.forget(this.chat.roomId,!0).then(t=>{this.$store.commit("DELETE_ROOM",this.chat.roomId)}).then(t=>{this.$router.push({path:"/chats"}).catch(t=>{})})}),this.$refs.dropdownMenu.hidePopup()}if("BanRoom"===t.click){let t="",e=this.findOtherUser();e&&e.userId&&(t=e.userId);let a=this.chat.roomId;this.core.mtrx.client.ban(a,t,"ban").then(t=>{}),this.roomBanned=!0,this.$refs.dropdownMenu.hidePopup()}if("Unban"===t.click){let t="",e=this.findOtherUser();e&&e.userId&&(t=e.userId),this.core.mtrx.client.unban(this.chat.roomId,t).then(e=>{this.core.mtrx.client.invite(this.chat.roomId,t)}),this.roomBanned=!1,this.$refs.dropdownMenu.hidePopup()}if("Donate"===t.click){this.donateUserOpened=!0,this.$refs.dropdownMenu.hidePopup();let t=this.findOtherUser();this.receiver=t?this.$f.deep(this,"$store.state.users."+this.$f.getmatrixid(t.name)):null}},closeDonateModal(){this.donateUserOpened=!1},onCalculateFeesClick(){this.calculatingFees=!0,this.calculateFees().finally(()=>this.calculatingFees=!1)},calculateFees(){var t=this;return this.showFeesError="",new Promise((e,a)=>{if(this.donationAmount<=0||!this.receiver||!this.receiver.source||!this.receiver.source.address)return this.showFeesError="invalid",a("Missing amount or receiver");try{var n=window.POCKETNETINSTANCE.platform.sdk;n.node.fee.estimate((function(i){var o=[{address:t.receiver.source.address,amount:t.donationAmount}];n.wallet.txbase([n.address.pnet().address],o,0,t.feesDirection,(function(o,s,r){if(o)return console.error(o),t.showFeesError=o,a(o);var c=n.node.transactions.create.wallet(s,r),d=Math.min(c.virtualSize()*i.feerate,.0999);return t.calculatedFees=d,e()}))}))}catch(i){return console.error(i),t.showFeesError=i,a(i)}})},sendDonation(){var t=this;return Object(X["a"])((function*(){var e=t;t.sending=!0,t.showTransactionError="";try{yield t.calculateFees()}catch(n){return t.showTransactionError="error",void(t.sending=!1)}var a=window.POCKETNETINSTANCE.platform.sdk;a.node.transactions.get.canSpend(a.address.pnet().address,t=>{if(!t||isNaN(t)||t{t.cantspend=!0}),a.node.transactions.send(o,(function(t,o){if(o)return a.node.transactions.releaseCS(n),e.showTransactionError="error",void(e.sending=!1);var s=n.map(t=>t.txid);a.node.transactions.clearUnspents(s),a.wallet.saveTempInfoWallet(t,n,i),e.core.mtrx.client.sendEvent(e.chat.roomId,"m.room.message",{from:e.$f.getmatrixid(e.m_chat.myUserId),to:e.receiver.id,amount:e.donationAmount,txId:t,msgtype:"m.notice"},""),e.closeDonateModal()}))}))}catch(n){console.error(n),e.showTransactionError="error",e.sending=!1}})}))()},resetDonation(){this.calculatedFees=null,this.showFeesError="",this.showTransactionError=""}}},at=et;function nt(t){var e=a("817d");e.__inject__&&e.__inject__(t)}var it=Object(y["a"])(at,G,Q,!1,nt,"3b761913",null,!0),ot=it.exports,st={name:"pagechat",components:{chat:J,topheader:ot,contacts:tt["a"]},data:()=>({events:[],openInviteModal:!1,brokenRoom:!1,hideHeader:!1}),computed:{u(){return this.$route.query.u},chat(){var t=this.$route.query.id;return this.$store.state.chatsMap[t]},k(){return this.u+this.$route.query.id},ios(){return O["a"].isios()},...Object(r["c"])({pocketnet:t=>t.pocketnet,minimized:t=>t.minimized,mobile:t=>t.mobile})},mounted(){setTimeout(()=>{this.leaveIfBroken()},2e3)},methods:{creatorLeft(t){this.brokenRoom=t},closeModal(){this.openInviteModal=!1},closeContactModal(t){this.openInviteModal=t},addMemberModal(t){this.openInviteModal=t},newchat(t){},sending(){},eventsRoom(t){this.events=t},menuIsVisibleHandler(t){this.hideHeader=t},leaveIfBroken(){return!!this.brokenRoom&&(this.core.mtrx.client.leave(from.query.id).then(t=>{this.core.mtrx.client.forget(from.query.id,!0).then(t=>t).then(t=>{this.$store.commit("DELETE_ROOM",from.query.id)})}),!0)}}},rt=st;function ct(t){var e=a("7e41");e.__inject__&&e.__inject__(t)}var dt=Object(y["a"])(rt,n,i,!1,ct,"7f0235e5",null,!0);e["default"]=dt.exports}}]); //# sourceMappingURL=matrix-element.5.min.js.map \ No newline at end of file diff --git a/chat/matrix-element.5.min.js.map b/chat/matrix-element.5.min.js.map index 426e5efe59..1c54ed64ec 100644 --- a/chat/matrix-element.5.min.js.map +++ b/chat/matrix-element.5.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/chat/topheader/index.sass","webpack:///./src/components/chat/attachement/index.sass","webpack:///./src/components/chat/join/index.sass?8299","webpack:///./src/components/chat/userRoomStatus/index.sass?9a43","webpack:///./src/components/chat/index.sass?51f1","webpack:///./src/components/chat/userRoomStatus/index.sass","webpack:///./src/components/chat/attachement/index.sass?e67b","webpack:///./src/views/chat.vue?b42b","webpack:///./src/components/chat/topheader/index.sass?4415","webpack:///./src/components/chat/userRoomStatus/index.sass?e7b4","webpack:///./src/components/chat/join/index.sass","webpack:///./src/components/chat/preview/index.sass","webpack:///./src/views/chat.vue?bb3f","webpack:///./src/components/chat/index.sass","webpack:///./src/components/chat/join/index.sass?9ed3","webpack:///./src/views/chat.vue?a330","webpack:///./src/components/chat/topheader/index.sass?58a1","webpack:///./src/components/chat/preview/index.sass?3383","webpack:///./src/components/chat/index.sass?81db","webpack:///./src/components/chat/attachement/index.sass?6f95","webpack:///./src/views/chat.vue?2a48","webpack:///./src/components/chat/index.vue?b2ae","webpack:///./src/components/chat/join/index.vue?14e1","webpack:///./src/components/chat/preview/index.vue?c566","webpack:///./src/components/chat/preview/index.js","webpack:///./src/components/chat/preview","webpack:///./src/components/chat/preview/index.vue","webpack:///./src/components/chat/join/index.js","webpack:///./src/components/chat/join","webpack:///./src/components/chat/join/index.vue","webpack:///./src/components/chat/attachement/index.vue?6930","webpack:///./src/components/chat/attachement/index.js","webpack:///./src/components/chat/attachement","webpack:///./src/components/chat/attachement/index.vue","webpack:///./src/components/chat/userRoomStatus/index.vue?8ca9","webpack:///./src/components/chat/userRoomStatus/index.js","webpack:///./src/components/chat/userRoomStatus","webpack:///./src/components/chat/userRoomStatus/index.vue","webpack:///./src/components/chat/index.js","webpack:///./src/components/chat","webpack:///./src/components/chat/index.vue","webpack:///./src/components/chat/topheader/index.vue?44fa","webpack:///./src/components/chat/topheader/index.js","webpack:///./src/components/chat/topheader","webpack:///./src/components/chat/topheader/index.vue","webpack:///src/views/chat.vue","webpack:///./src/views/chat.vue?27e3","webpack:///./src/views/chat.vue","webpack:///./src/components/chat/preview/index.sass?b73a"],"names":["___CSS_LOADER_API_IMPORT___","exports","push","module","i","content","__esModule","default","locals","add","__inject__","shadowRoot","render","_vm","this","_h","$createElement","_c","_self","staticClass","class","mobile","directives","name","rawName","value","hideHeader","ios","expression","key","k","attrs","u","chat","on","addMemberModal","scopedSlots","_u","fn","sending","newchat","creatorLeft","eventsRoom","menuIsVisibleHandler","proxy","closeModal","_v","_s","$t","roomId","closeContactModal","_e","staticRenderFns","pocketnet","minimized","fix","active","cantchat","cantchatexc","keyproblem","refreshkeys","m_chat","membership","ready","ref","error","selectedMessages","isRemoveSelectedMessages","editingEvent","replyEvent","e","galleryImage","scroll","events","messagesIsDeleted","usersinfo","brokenInvitedRoom","length","usersinfoNames","relationEvent","action","type","event","clearRelationEvent","blockedUser","sent","sentError","sentMessageError","sendingData","sentData","force","closing","focused","cantchatcrypto","$event","cancelDataMessages","removeDataMessages","localisationTitles","delete","shareDataMessages","share","encrypted","hoverEncrypt","attachements","_l","attachement","id","abortSending","blockedCheck","hiddenInParent","_m","tetatet","decline","ignore","join","back","users","swiperOption","user","_","isEmpty","undefinedRoom","slot","props","Object","Array","room","components","userView","chatName","chatIcon","Swiper","SwiperSlide","Carousel","Slide","data","loading","direction","pagination","el","computed","core","mtrx","chatUsersInfo","injectStyles","context","style0","component","chatPreview","joinedMembers","created","watch","mapState","state","auth","kit","tetatetchat","anotherChatUsers","blockeduser","userId","mounted","methods","self","$store","commit","client","joinRoom","then","$emit","catch","brokenRoom","$router","go","blockUser","r","leave","forget","base64","fileicon","info","humanReadableSize","cancel","ext","extension","f","deep","split","toLowerCase","formatBytes","size","text","leaveRoom","String","path","list","chatInput","userRoomStatus","roomUserBanned","roomUserKicked","roomMuted","chatEvents","sendingDataStore","esize","fsize","showInput","showShareMessages","console","log","getuserinfo","item","destroyed","clearintrv","needcreatekey","intrv","setInterval","chatusers","pcrypto","userschanded","checkcrypto","immediate","handler","getType","allchatmembers","prepareChat","pushRules","_pushProcessor","getPushRuleById","getRoom","userinfo","keys","timeline","credentials","lastEvent","state_key","reason","getMyMembership","openInviteModal","toArray","store","$i18n","t","clearInterval","canBeEncrypt","makeid","$refs","setText","usersInfo","proceedwithoutkeys","userInfo","_info","dispatch","PNmetaPreview","map","focus","clone","ns","scrollTop","fs","blurifempty","scrollToNew","meta","$set","clearMeta","logerror","stringify","abort","aborted","val","$delete","isVisible","allMessages","messages","pr","Promise","resolve","_sharing","download","getFile","Base64","fromFile","file","files","roomInfo","closeDonateModal","modifiers","domProps","resetDonation","target","composing","donationAmount","_n","$forceUpdate","receiver","donationMessage","showFeesError","calculatingFees","calculatedFees","onCalculateFeesClick","$$selectedVal","prototype","filter","call","options","o","selected","_value","feesDirection","multiple","feeDirection","label","totalDonationAmount","toFixed","showTransactionError","sendDonation","aboutUser","chatTyping","contacts","menuItems","click","title","icon","menuItemsRoom","menuItemsRoomMuted","oneToOne","oneToOneMuted","donateMenu","typing","aboutUserShow","roomBanned","donateUserOpened","feesDirectionPossibleValues","m_chat_typing","userTyping","find","navigateToProfile","getmatrixid","findOtherUser","my","myUserId","members","currentState","getMembers","forEach","member","addMember","modalInviteUser","menuItemClickHandler","rowObject","dropdownMenu","hidePopup","deviceId","deletePushRule","setRoomMutePushRule","banUserId","banUser","roomID","ban","unban","invite","receiverObj","$f","calculateFees","finally","reject","source","address","sdk","window","POCKETNETINSTANCE","platform","node","fee","estimate","fees","outputs","amount","wallet","txbase","pnet","err","inputs","_outputs","tx","transactions","create","totalFees","Math","min","virtualSize","feerate","get","canSpend","currentBalance","isNaN","embed","cantspend","send","d","releaseCS","ids","txid","clearUnspents","saveTempInfoWallet","sendEvent","from","to","txId","msgtype","topheader","setTimeout","leaveIfBroken"],"mappings":"oGACA,IAAIA,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,s6CAAu6C,KAEh8CD,EAAOF,QAAUA,G,uBCLjB,IAAID,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,yyBAA0yB,KAEn0BD,EAAOF,QAAUA,G,uBCHjB,IAAII,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAAqEF,QACvFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM,K,kCCV3B,oH,uBCGA,IAAIN,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAAkEF,QACpFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM,K,uBCT3B,IAAIX,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,iTAAkT,KAE3UD,EAAOF,QAAUA,G,uBCHjB,IAAII,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAAqEF,QACvFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM,K,oCCV3B,oH,oCCAA,oH,qBCGA,IAAIN,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAAqEF,QACvFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM,K,uBCT3B,IAAIX,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,8iDAA+iD,KAExkDD,EAAOF,QAAUA,G,uBCLjB,IAAID,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,4ZAA6Z,KAEtbD,EAAOF,QAAUA,G,uBCLjB,IAAID,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,yVAA0V,KAEnXD,EAAOF,QAAUA,G,uBCLjB,IAAID,EAA8B,EAAQ,QAC1CC,EAAUD,GAA4B,GAEtCC,EAAQC,KAAK,CAACC,EAAOC,EAAI,46LAA66L,KAEt8LD,EAAOF,QAAUA,G,kCCNjB,oH,qBCGA,IAAII,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAA+DF,QACjFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM,K,qBCP3B,IAAIN,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAAqEF,QACvFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM,K,kCCV3B,oH,mCCAA,oH,kCCAA,oH,yCCAA,IAAIC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,YAAYC,MAAM,CAACC,OAAQR,EAAIQ,SAAS,CAACJ,EAAG,YAAY,CAACK,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,OAAQZ,EAAIa,aAAeb,EAAIc,IAAKC,WAAW,wBAAwBC,IAAIhB,EAAIiB,EAAEX,YAAY,YAAYY,MAAM,CAAC,EAAIlB,EAAImB,EAAE,KAAOnB,EAAIoB,MAAMC,GAAG,CAAC,UAAYrB,EAAIsB,kBAAkBlB,EAAG,cAAc,CAACmB,YAAYvB,EAAIwB,GAAG,CAAC,CAACR,IAAI,UAAUS,GAAG,WAAW,MAAO,CAACrB,EAAG,OAAO,CAACY,IAAIhB,EAAIiB,EAAEC,MAAM,CAAC,EAAIlB,EAAImB,EAAE,KAAOnB,EAAIoB,MAAMC,GAAG,CAAC,QAAUrB,EAAI0B,QAAQ,QAAU1B,EAAI2B,QAAQ,iBAAmB3B,EAAI4B,YAAY,UAAY5B,EAAI6B,WAAW,cAAgB7B,EAAI8B,0BAA0BC,OAAM,OAAW/B,EAAmB,gBAAEI,EAAG,QAAQ,CAACiB,GAAG,CAAC,MAAQrB,EAAIgC,YAAYT,YAAYvB,EAAIwB,GAAG,CAAC,CAACR,IAAI,SAASS,GAAG,WAAW,MAAO,CAACrB,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,4BAA4BJ,OAAM,GAAM,CAACf,IAAI,OAAOS,GAAG,WAAW,MAAO,CAACrB,EAAG,WAAW,CAACc,MAAM,CAAC,KAAO,cAAc,WAAalB,EAAIoB,KAAKgB,QAAQf,GAAG,CAAC,WAAarB,EAAIqC,uBAAuBN,OAAM,GAAM,CAACf,IAAI,SAASS,GAAG,aAA6BM,OAAM,IAAO,MAAK,EAAM,cAAc/B,EAAIsC,MAAM,IACnnCC,EAAkB,GCDlB,EAAS,WAAa,IAAIvC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACG,MAAM,CAAC,IAAQP,EAAIwC,UAAW,MAAUxC,EAAIwC,UAAWC,UAAWzC,EAAIyC,UAAWC,IAAM1C,EAAIwC,UAAWG,OAAQ3C,EAAI2C,QAAQzB,MAAM,CAAC,GAAK,SAAS,CAAElB,EAAI4C,WAAa5C,EAAI6C,YAAazC,EAAG,MAAM,CAACE,YAAY,mBAAmB,CAACF,EAAG,MAAM,CAACE,YAAY,OAAO,CAACN,EAAIiC,GAAG,IAAIjC,EAAIkC,GAAGlC,EAAImC,GAAG,WAAalC,KAAK6C,aAAa,OAAwB,cAAhB9C,EAAI8C,WAA0B1C,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,SAAS,CAACE,YAAY,eAAee,GAAG,CAAC,MAAQrB,EAAI+C,cAAc,CAAC/C,EAAIiC,GAAG,aAAa7B,EAAG,IAAI,CAACE,YAAY,oBAAoBN,EAAIsC,KAAsB,aAAhBtC,EAAI8C,WAAyB1C,EAAG,MAAM,CAACE,YAAY,oBAAoB,CAACF,EAAG,kBAAkB,GAAGJ,EAAIsC,OAAOlC,EAAG,MAAM,CAACE,YAAY,eAAe,CAAEN,EAAIgD,QAA6B,SAAnBhD,EAAIiD,YAAyBjD,EAAIkD,MAAO9C,EAAG,OAAO,CAACY,IAAIhB,EAAIgB,IAAImC,IAAI,OAAOjC,MAAM,CAAC,MAAQlB,EAAIoD,MAAM,KAAOpD,EAAIgD,OAAO,iBAAmBhD,EAAIqD,iBAAiB,yBAA2BrD,EAAIsD,0BAA0BjC,GAAG,CAAC,aAAerB,EAAIuD,aAAa,WAAavD,EAAIwD,WAAW,WAAa,SAAUC,GAAK,OAAOzD,EAAI0D,aAAaD,IAAM,OAASzD,EAAI2D,OAAO,cAAgB3D,EAAI8B,qBAAqB,UAAY9B,EAAI4D,OAAO,kBAAoB5D,EAAI6D,qBAAqB7D,EAAIsC,KAAMtC,EAAIgD,QAA6B,WAAnBhD,EAAIiD,WAAyB7C,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAG,OAAO,CAACc,MAAM,CAAC,OAASlB,EAAIgD,OAAO,KAAOhD,EAAIoB,KAAK,UAAYpB,EAAI8D,WAAWzC,GAAG,CAAC,YAAcrB,EAAI+D,sBAAsB,GAAG/D,EAAIsC,MAAOtC,EAAIgD,QAAUhD,EAAI8D,WAAa9D,EAAI8D,UAAUE,OAAQ5D,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,0BAA0B,IAAInC,EAAIkC,GAAGlC,EAAIiE,uBAAuBjE,EAAIsC,KAAOtC,EAAIgD,QAA6B,SAAnBhD,EAAIiD,WAAkiEjD,EAAIsC,KAA/gElC,EAAG,MAAM,CAACE,YAAY,qCAAqCC,MAAM,CAAC,IAAQP,EAAIwC,UAAW,MAAUxC,EAAIwC,YAAY,CAACpC,EAAG,MAAM,CAAEJ,EAAiB,cAAEI,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,wBAAwB,CAACF,EAAG,MAAM,CAACE,YAAY,wBAAwB,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAIkE,cAAcC,aAAsC,aAAxBnE,EAAIkE,cAAcE,KAAmBhE,EAAG,MAAM,CAACE,YAAY,wBAAwB,CAACF,EAAG,cAAc,CAACc,MAAM,CAAC,MAAQlB,EAAIkE,cAAcG,MAAM,KAAOrE,EAAIoB,KAAK,SAAU,MAAS,GAAGpB,EAAIsC,OAAOlC,EAAG,MAAM,CAACE,YAAY,wBAAwB,CAACF,EAAG,MAAM,CAACE,YAAY,OAAOe,GAAG,CAAC,MAAQrB,EAAIsE,qBAAqB,CAAClE,EAAG,IAAI,CAACE,YAAY,8BAA8BN,EAAIsC,KAAOtC,EAAIuE,aAAgBvE,EAAIqD,iBAAiBW,OAA0dhE,EAAIsC,KAAtdlC,EAAG,YAAY,CAAC+C,IAAI,YAAYjC,MAAM,CAAC,EAAIlB,EAAImB,EAAE,KAAOnB,EAAIgD,OAAO,UAAYhD,EAAI8D,UAAU,cAAgB9D,EAAIkE,eAAe7C,GAAG,CAAC,QAAUrB,EAAI0B,QAAQ,KAAO1B,EAAIwE,KAAK,UAAYxE,EAAIyE,UAAU,iBAAmBzE,EAAI0E,iBAAiB,YAAc1E,EAAI2E,YAAY,SAAW3E,EAAI4E,SAAS,MAAQ5E,EAAI6E,MAAM,QAAU7E,EAAI2B,QAAQ,iBAAmB3B,EAAI8E,QAAQ,mBAAqB9E,EAAIsE,mBAAmB,QAAUtE,EAAI+E,QAAQ,eAAiB/E,EAAIgF,kBAA8BhF,EAAIqD,iBAAiBW,OAAQ5D,EAAG,MAAM,CAACE,YAAY,6BAA6B,CAACF,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,OAAO,CAACF,EAAG,MAAM,CAACE,YAAY,SAASe,GAAG,CAAC,MAAQ,SAAS4D,GAAQ,OAAOjF,EAAIkF,wBAAwB,CAAC9E,EAAG,IAAI,CAACE,YAAY,iBAAiBF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,gBAAgB/B,EAAG,MAAM,CAACiB,GAAG,CAAC,MAAQ,SAAS4D,GAAQ,OAAOjF,EAAImF,wBAAwB,CAAC/E,EAAG,IAAI,CAACE,YAAY,qBAAqBF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAIoF,mBAAmBC,aAAajF,EAAG,MAAM,CAACiB,GAAG,CAAC,MAAQ,SAAS4D,GAAQ,OAAOjF,EAAIsF,uBAAuB,CAAClF,EAAG,IAAI,CAACE,YAAY,qBAAqBF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAIoF,mBAAmBG,kBAAkBvF,EAAIsC,KAAMtC,EAAIuE,aAAevE,EAAIgD,OAAQ5C,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAG,kCAAkCjC,EAAIsC,MAAM,KAAetC,EAAIwF,WAA+B,UAAlBxF,EAAIiD,WAAwB7C,EAAG,MAAM,CAACE,YAAY,YAAYe,GAAG,CAAC,UAAY,SAAUoC,GAAK,OAAOzD,EAAIyF,cAAe,KAAU,CAACrF,EAAG,IAAI,CAACE,YAAY,kBAAkBN,EAAIsC,KAAMtC,EAAgB,aAAEI,EAAG,MAAM,CAACE,YAAY,gBAAgBe,GAAG,CAAC,UAAY,SAAUoC,GAAK,OAAOzD,EAAIyF,cAAe,GAAQ,WAAa,SAAUhC,GAAK,OAAOzD,EAAIyF,cAAe,GAAS,MAAQ,SAAUhC,GAAK,OAAOzD,EAAIyF,cAAgBzF,EAAIyF,gBAAkB,CAACrF,EAAG,MAAM,CAACc,MAAM,CAAC,GAAK,UAAU,CAACd,EAAG,MAAM,CAACE,YAAY,oBAAoB,CAACF,EAAG,IAAI,CAACE,YAAY,uBAAuBF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,+BAA+BnC,EAAIsC,KAAMtC,EAAI0F,aAAmB,OAAEtF,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,MAAM,CAACE,YAAY,uBAAuBN,EAAI2F,GAAI3F,EAAgB,cAAE,SAAS4F,GAAa,OAAOxF,EAAG,cAAc,CAACY,IAAI4E,EAAYC,GAAG3E,MAAM,CAAC,YAAc0E,GAAavE,GAAG,CAAC,OAAS,SAAUoC,GAAK,OAAOzD,EAAI8F,aAAaF,EAAYC,WAAY,KAAK7F,EAAIsC,MAAM,GAAItC,EAAkB,eAAEI,EAAG,iBAAiB,CAACc,MAAM,CAAC,KAAOlB,EAAIoB,KAAK,KAAO,0CAA0CpB,EAAIsC,MAAM,IAChxJ,EAAkB,G,wBCDlB,EAAS,WAAa,IAAItC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,YAAYC,MAAM,CAACkC,UAAWzC,EAAIyC,UAAWE,OAAQ3C,EAAI2C,QAAQzB,MAAM,CAAC,GAAK,aAAa,CAACd,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,WAAW,CAAGN,EAAI4B,YAA+E5B,EAAIsC,KAAtElC,EAAG,OAAO,CAACJ,EAAIiC,GAAG,IAAIjC,EAAIkC,GAAGlC,EAAImC,GAAG,uBAAuB,OAAiBnC,EAAe,YAAEI,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,wBAAwBnC,EAAIsC,SAASlC,EAAG,cAAc,CAACc,MAAM,CAAC,UAAYlB,EAAI8D,UAAU,KAAO9D,EAAIoB,KAAK,OAASpB,EAAIgD,OAAO,cAAgBhD,EAAI4B,eAAiB5B,EAAI+F,aAAiO/F,EAAIsC,KAAvNlC,EAAG,MAAM,CAACE,YAAY,OAAO,CAAGN,EAAI4B,YAA8E5B,EAAIsC,KAArElC,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,iCAA2CnC,EAAe,YAAEI,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,2BAA2BnC,EAAIsC,OAAkBtC,EAAIgG,eAA2+BhG,EAAIsC,KAA/9BlC,EAAG,MAAM,CAACE,YAAY,+BAA+BC,MAAM,CAAC,IAAQP,EAAIwC,UAAW,MAAUxC,EAAIwC,YAAY,CAACpC,EAAG,MAAM,CAACE,YAAY,QAAQ,CAAGN,EAAI+F,aAAsxB3F,EAAG,MAAM,CAACE,YAAY,WAAW,CAACN,EAAIiG,GAAG,KAAjzB7F,EAAG,MAAM,CAACE,YAAY,WAAW,CAAGN,EAAI4B,aAAgB5B,EAAIkG,QAAwKlG,EAAIsC,KAAnKlC,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,SAAS,CAACE,YAAY,6BAA6Be,GAAG,CAAC,MAAQrB,EAAImG,UAAU,CAACnG,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,wBAAkCnC,EAAW,QAAEI,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,SAAS,CAACE,YAAY,6BAA6Be,GAAG,CAAC,MAAQrB,EAAIoG,SAAS,CAACpG,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,iCAAiCnC,EAAIsC,KAAOtC,EAAI4B,YAAgK5B,EAAIsC,KAAvJlC,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,SAAS,CAACE,YAAY,uBAAuBe,GAAG,CAAC,MAAQrB,EAAIqG,OAAO,CAACrG,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,qBAA+BnC,EAAe,YAAEI,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,SAAS,CAACE,YAAY,uBAAuBe,GAAG,CAAC,MAAQrB,EAAIsG,OAAO,CAACtG,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,mBAAmBnC,EAAIsC,YAAmE,IACxyD,EAAkB,CAAC,WAAa,IAAItC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAG,oCCD1J,EAAS,WAAa,IAAIjC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAAEN,EAAIuG,OAASvG,EAAIuG,MAAMvC,OAAQ5D,EAAG,MAAM,CAACE,YAAY,SAAS,CAACF,EAAG,SAAS,CAACE,YAAY,SAASY,MAAM,CAAC,QAAUlB,EAAIwG,eAAe,CAACxG,EAAI2F,GAAI3F,EAAS,OAAE,SAASyG,GAAM,OAASzG,EAAI0G,EAAEC,QAAQF,GAA2NzG,EAAIsC,KAAxNlC,EAAG,eAAe,CAACY,IAAIyF,EAAKZ,IAAI,CAACzF,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,kBAAkBC,MAAM,CAAC,OAAUP,EAAI4G,gBAAgB,CAAEH,EAAS,KAAErG,EAAG,WAAW,CAACc,MAAM,CAAC,SAAWuF,KAAQzG,EAAIsC,MAAM,UAAkBlC,EAAG,MAAM,CAACE,YAAY,oBAAoBY,MAAM,CAAC,KAAO,cAAc2F,KAAK,gBAAgB,IAAI,GAAG7G,EAAIsC,YACttB,EAAkB,G,6DCUP,GACb5B,KAAM,cACNoG,MAAO,CACL1F,KAAM2F,OACNjD,UAAWkD,MACXC,KAAM,GACNL,eAAe,GAGjBM,WAAY,CACVC,gBACAC,gBACAC,gBACAC,mBACAC,6BACAC,uBACAC,kBAGFC,KAAM,WAEJ,MAAO,CACLC,SAAS,EACTnB,aAAc,CACZoB,UAAW,aACXC,WAAY,CACVC,GAAI,yBAOZC,SAAU,CAERxB,MAAQ,WACN,OAAItG,KAAKmB,KAEFnB,KAAK+H,KAAKC,KAAKC,cAAcjI,KAAKmB,KAAKgB,OAAQ,oBAFhC,MC/C+M,I,YCG3O,SAAS+F,EAAcC,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAIE,EAAY,eACd,EACA,EACA,GACA,EACAH,EACA,WACA,MACC,GAGY,EAAAG,E,QCpBA,GACb5H,KAAM,WACNoG,MAAO,CACL1F,KAAM2F,OACN/D,OAAQ,GACRc,UAAWkD,MACXC,KAAMF,QAGRG,WAAY,CACVqB,eAGFb,KAAM,WAEJ,MAAO,CACLC,SAAS,EACTa,cAAe,GACf5G,aAAa,IAKjB6G,QAAS,OAITC,MAAO,GAEPX,SAAUY,eAAS,CACjB3C,eAAiB4C,GAASA,EAAM5C,eAChC6C,KAAMD,GAASA,EAAMC,KACrBrG,UAAWoG,GAASA,EAAMpG,UAC1BC,UAAWmG,GAASA,EAAMnG,UAC1BE,OAAQiG,GAASA,EAAMjG,OACvBuD,QAAU,WACR,OAAOjG,KAAK+H,KAAKC,KAAKa,IAAIC,YAAY9I,KAAK+C,SAG7C+C,aAAc,WAEZ,IAAIQ,EAAQtG,KAAK+H,KAAKC,KAAKe,iBAAiB/I,KAAK+C,OAAOZ,QAExD,GAAoB,GAAhBmE,EAAMvC,OACR,OAAO/D,KAAK+H,KAAKC,KAAKgB,YAAY1C,EAAM,GAAG2C,WAKjDC,QAAS,aAGTC,QAAS,CAEP/C,KAAM,WACJ,IAAIgD,EAAOpJ,KAEXA,KAAKqJ,OAAOC,OAAO,oBAAqBtJ,KAAK+C,OAAOZ,QAEpDnC,KAAK+H,KAAKC,KAAKuB,OAAOC,SAASxJ,KAAK+C,OAAOZ,QAAQsH,KAAK,KAEtDzJ,KAAK0J,MAAM,YAEVC,OAAM,SAAUxG,GAGjB,OADAiG,EAAKQ,YAAW,GACTR,EAAKzH,aAAc,MAG9B0E,OACErG,KAAK6J,QAAQC,IAAI,IAGnB3D,OAAS,WACP,IAAIG,EAAQtG,KAAK+H,KAAKC,KAAKe,iBAAiB/I,KAAKmB,KAAKgB,QAElDmE,EAAMvC,OAAS,GAInB/D,KAAK+H,KAAKC,KAAK+B,UAAUzD,EAAM,GAAG2C,QAAQQ,KAAKO,IAE7ChK,KAAK6J,QAAQC,IAAI,KAEhBH,MAAMnG,QAGX0C,QAAS,WAEPlG,KAAKqJ,OAAOC,OAAO,oBAAqBtJ,KAAK+C,OAAOZ,QAEpDnC,KAAK+H,KAAKC,KAAKuB,OAAOU,MAAMjK,KAAKmB,KAAKgB,QAAQsH,KAAKO,IAEjDhK,KAAK+H,KAAKC,KAAKuB,OAAOW,OAAOlK,KAAKmB,KAAKgB,QAAQ,GAAMsH,KAAKO,GACjDA,GACNP,KAAKO,IAENhK,KAAKqJ,OAAOC,OAAO,cAAetJ,KAAKmB,KAAKgB,QAG5CnC,KAAK6J,QAAQC,IAAI,QAKvBF,aACE5J,KAAK0J,MAAM,eAAe,MC7G2M,ICG3O,SAAS,EAAcvB,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIpI,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACc,MAAM,CAAC,GAAK,oBAAoB,CAA0B,SAAxBlB,EAAI4F,YAAYxB,KAAiBhE,EAAG,MAAM,CAACE,YAAY,SAAS,CAAEN,EAAI4F,YAAkB,OAAExF,EAAG,UAAU,CAACc,MAAM,CAAC,IAAMlB,EAAI4F,YAAYwE,UAAUpK,EAAIsC,MAAM,GAAGtC,EAAIsC,KAA8B,QAAxBtC,EAAI4F,YAAYxB,KAAgBhE,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,IAAI,CAACG,MAAMP,EAAIqK,aAAajK,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAI4F,YAAY0E,KAAK5J,MAAQ,aAAcV,EAAqB,kBAAEI,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAIuK,wBAAwBvK,EAAIsC,OAAOtC,EAAIsC,KAAKtC,EAAIiG,GAAG,GAAG7F,EAAG,MAAM,CAACE,YAAY,SAASe,GAAG,CAAC,MAAQrB,EAAIwK,SAAS,CAACpK,EAAG,IAAI,CAACE,YAAY,6BAChvB,EAAkB,CAAC,WAAa,IAAIN,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,IAAI,CAACE,YAAY,+B,YCCjJ,GACXI,KAAM,kBACNoG,MAAO,CACHlB,YAAcmB,QAGlBW,KAAO,WAEH,MAAO,CACHC,SAAU,EAEV8C,IAAM,CACF,IAAQ,kBACR,OAAW,iBAMvBhC,QAAU,OAIVC,MAAO,GAGPX,SAAUY,eAAS,CACfE,KAAOD,GAASA,EAAMC,KACtB6B,UAAW,WAEP,IAAIC,OAAEC,KAAK3K,KAAM,yBAA0B,MAAO,SAElD,IAAIS,EAAOiK,OAAEC,KAAK3K,KAAM,yBAEpBwK,GADA/J,EAAOA,EAAKmK,MAAM,KACZnK,EAAKA,EAAKsD,OAAS,GAAG8G,eAEhC,OAAOL,GAEXF,oBAEI,OAAII,OAAEC,KAAK3K,KAAM,yBAEV0K,OAAEI,YAAY9K,KAAK2F,YAAY0E,KAAKU,MAFO,IAKtDX,SAAW,WACP,IAAII,EAAMxK,KAAKyK,UAEf,OAAOzK,KAAKwK,IAAIA,IAAQxK,KAAKwK,IAAI,aAIzCrB,QAAU,CACNoB,OAAS,WACLvK,KAAK0J,MAAM,aCxDoN,ICG3O,SAAS,EAAcvB,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIpI,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAACN,EAAIiG,GAAG,GAAG7F,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACN,EAAIiC,GAAG,IAAIjC,EAAIkC,GAAGlC,EAAIiL,MAAM,OAAO7K,EAAG,SAAS,CAACE,YAAY,6BAA6Be,GAAG,CAAC,MAAQ,SAAS4D,GAAQ,OAAOjF,EAAIkL,eAAe,CAAClL,EAAIiC,GAAG,oBACtU,EAAkB,CAAC,WAAa,IAAIjC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAACF,EAAG,IAAI,CAACE,YAAY,mBCDxJ,GACbwG,MAAO,CACLmE,KAAME,OACN/J,KAAM2F,QAERqC,QAAS,CACP8B,YAEEjL,KAAK+H,KAAKC,KAAKuB,OAAOW,OAAOlK,KAAKmB,KAAKgB,QAAQ,GAAMsH,KAAKO,IAExDhK,KAAKqJ,OAAOC,OAAO,cAAetJ,KAAKmB,KAAKgB,UAC3CsH,KAAKO,IACNhK,KAAK6J,QAAQzK,KAAK,CAAC+L,KAAM,WAAWxB,MAAMnG,YCZyL,ICG3O,SAAS,EAAc2E,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCfA,GACb1H,KAAM,OACNoG,MAAO,CACL1F,KAAM2F,OACN5F,EAAGgK,QAGLjE,WAAY,CACVmE,YACAC,UAAY,IAAM,wDAClBjF,OACAT,cACA2F,kBAGF7D,KAAM,WAEJ,MAAO,CACL8D,gBAAgB,EAChBC,gBAAgB,EAChBhG,cAAc,EACdiG,WAAW,EACX/D,SAAS,EACTzE,OAAO,EACPsC,WAAW,EACX1B,UAAW,GACX6H,WAAY,GACZzH,cAAe,KACflD,IAAK,GACL4K,iBAAkB,GAClBC,MAAO,GACPC,MAAO,GACPlJ,UAAU,EACVC,aAAa,EACbO,MAAQ,KAER2I,WAAW,EACXC,mBAAmB,EAEnB3I,iBAAkB,GAClBC,0BAA0B,IAK9BmF,YAIAU,UAEE8C,QAAQC,IAAIjM,KAAKmB,MAEjBnB,KAAKkM,cACLlM,KAAKqJ,OAAOC,OAAO,UAAU,GAC7BtJ,KAAKqJ,OAAOC,OAAO,cAAe,CAAC3I,OAAO,EAAMwL,KAAM,UAIxDC,YACEpM,KAAKqJ,OAAOC,OAAO,cAAe,CAAC3I,OAAO,EAAOwL,KAAM,SACvDnM,KAAKqJ,OAAOC,OAAO,oBAAoB,GAEvCtJ,KAAKqM,cAGP5D,MAAO,CAEL6D,cAAe,WACTtM,KAAKsM,cAEFtM,KAAKuM,QACRvM,KAAKuM,MAAQC,YAAY,KACvBxM,KAAK8C,aAAY,IAChB,MAKL9C,KAAKqM,cAITI,UAAW,WAGLzM,KAAK+C,QAAU/C,KAAK+C,OAAO2J,SAC7B1M,KAAK+C,OAAO2J,QAAQC,eAAelD,KAAKO,IACtChK,KAAK4M,iBAMX7J,OAAQ,CACN8J,WAAW,EACXC,QAAS,WAGH9M,KAAK+C,SAAW0D,EAAEC,QAAQ1G,KAAK+C,UAEjCiJ,QAAQC,IAAI,cAAejM,KAAK+C,QAChCiJ,QAAQC,IAAI,UAAWjM,KAAK+C,OAAOgK,WACnC/M,KAAK+H,KAAKC,KAAKa,IAAImE,eAAe,CAAChN,KAAK+C,SAAS,GAAO,GAAM0G,KAAKO,GAC1DhK,KAAK+H,KAAKC,KAAKa,IAAIoE,YAAYjN,KAAK+C,SAC1C0G,KAAKO,IAENhK,KAAKiD,OAAQ,EAEbjD,KAAK4M,mBAQbzL,KAAM,CACJ0L,WAAW,EACXC,QAAS,WAEP9M,KAAKiD,OAAQ,EACbjD,KAAKuF,WAAY,EACjBvF,KAAKqJ,OAAOC,OAAO,WAAY,MAC3BtJ,KAAKmB,MACPnB,KAAKqJ,OAAOC,OAAO,mBAAoBtJ,KAAKmB,KAAKgB,QACjDnC,KAAKqJ,OAAOC,OAAO,gBAAiBtJ,KAAKmB,KAAKgB,SAE9CnC,KAAKqJ,OAAOC,OAAO,oBAAoB,MAK/CxB,SAAUY,eAAS,CAEjBnG,UAAWoG,GAASA,EAAMpG,UAC1BC,UAAWmG,GAASA,EAAMnG,UAC1BE,OAAQiG,GAASA,EAAMjG,OACvBkG,KAAMD,GAASA,EAAMC,KACrB7F,OAAQ,WAEN,GAAI/C,KAAKmB,MAAQnB,KAAKmB,KAAKgB,OAAQ,CAEjC,IAAI+K,EAAYlN,KAAK+H,KAAKC,KAAKuB,OAAO4D,eAAeC,gBAAgBpN,KAAKmB,KAAKgB,QAC7D,OAAd+K,IACFlN,KAAKyL,WAAY,GAGnB,IAAI1I,EAAS/C,KAAK+H,KAAKC,KAAKuB,OAAO8D,QAAQrN,KAAKmB,KAAKgB,QAErD,OAAOY,GAAU,KAKrBF,WAAY,WACV,OAAI7C,KAAK+H,KAAKvB,KAAK8G,SAASC,KAAKxJ,OAAS,GACjC,YACK,cAGhBuI,cAAe,WACb,MAA0B,aAAnBtM,KAAK6C,YAA6B7C,KAAK2C,WAAa3C,KAAK4C,aAGlEI,WAAY,WAEV,GAAIhD,KAAK+C,OAAQ,CACf,GAAI/C,KAAK+C,OAAOyK,SAASzJ,OAAS,EAAG,CACnC,IAAI6B,EAAK5F,KAAK+H,KAAKC,KAAKuB,OAAOkE,YAAYxE,OACvCyE,EAAY1N,KAAK+C,OAAOyK,SAASxN,KAAK+C,OAAOyK,SAASzJ,OAAS,GAC/D2J,EAAUtJ,MAAMuJ,YAAc/H,GAAyC,cAAnC8H,EAAUtJ,MAAM7E,QAAQqO,SAC9D5N,KAAKuL,gBAAiB,GAK1B,OAAOvL,KAAK+C,OAAO8K,oBAKvBvJ,YAAa,WAEX,GAAItE,KAAKkB,EACP,OAAOlB,KAAK+H,KAAKC,KAAKgB,YAAYhJ,KAAKkB,EAAE,IAG3C,GAAIlB,KAAKmB,KAAM,CACb,IAAImF,EAAQtG,KAAK+H,KAAKC,KAAKe,iBAAiB/I,KAAKmB,KAAKgB,QAEtD,GAAoB,GAAhBmE,EAAMvC,OACR,OAAO/D,KAAK+H,KAAKC,KAAKgB,YAAY1C,EAAM,GAAG2C,UAajD6E,gBAAiB,WACf,OAAO9N,KAAK8N,iBAGdrI,aAAc,WACZ,OAAOgB,EAAEsH,QAAQ/N,KAAK2L,mBAGxBc,UAAW,WACT,GAAIzM,KAAK+C,OACP,OAAO/C,KAAK+H,KAAKiG,MAAMrF,MAAM8D,UAAUzM,KAAK+C,OAAOZ,SAGvDgD,mBAAoB,WAClB,OAAOnF,KAAKiO,MAAMC,EAAE,aAGxB/E,QAAS,CAEPkD,WAAY,WACNrM,KAAKuM,QACP4B,cAAcnO,KAAKuM,OACnBvM,KAAKuM,MAAQ,OAIjBK,YAAa,WACX5M,KAAKuF,UAAYvF,KAAK+C,OAAO2J,QAAQ0B,eACrCpO,KAAK2C,SAAW3C,KAAK+C,OAAO2J,QAAQ/J,YAGtCiC,MAAO,WACL5E,KAAKe,IAAM2J,OAAE2D,UAGfhK,mBAAoB,WAEdrE,KAAKiE,eAA4C,aAA3BjE,KAAKiE,cAAcE,MAAuBnE,KAAKsO,MAAM,cAC7EtO,KAAKsO,MAAM,aAAaC,QAAQ,IAGlCvO,KAAKiE,cAAgB,MAGvBvC,QAAS,SAAUP,GACjBnB,KAAK0J,MAAM,UAAWvI,GAGtBnB,KAAK+C,OAAO2J,QAAQC,gBAGtBT,YAAa,WACPlM,KAAKkB,GACPlB,KAAK+H,KAAKvB,KAAKgI,UAAUxO,KAAKkB,GAAGuI,KAAKY,IACpCrK,KAAK6D,UAAYwG,KAKvBtF,eAAgB,WACd/E,KAAK2C,UAAW,GAGlB8L,mBAAoB,WAClBzO,KAAK4C,aAAc,GAGrBE,YAAa,WAEX9C,KAAK+H,KAAKvB,KAAKkI,UAAS,GAAMjF,KAAKO,IAG7BhK,KAAKkB,EACPlB,KAAK+H,KAAKvB,KAAKgI,UAAUxO,KAAKkB,GAAG,GAAO,GAAMuI,KAAKY,IAEjD,IAAIsE,EAAQtE,EAAK,GAEbsE,GAASA,EAAMpB,MAAQoB,EAAMpB,KAAKxJ,QAAU,IAAM/D,KAAK+H,KAAKvB,KAAK8G,SAASC,KAAKxJ,QAAU,KAC3F/D,KAAK2C,UAAW,GAGlB3C,KAAK6D,UAAYwG,IAMnBrK,KAAK+H,KAAKiG,MAAMY,SAAS,oBAAqB,CAAC5O,KAAK+C,SAAS0G,KAAKO,UAaxEnF,QAAS,SAAUrB,GACjBxD,KAAK6O,cAAgBrL,GAGvBQ,eAAgB,WACd,OAAOyC,EAAEqI,IAAI9O,KAAK6D,WAAW,SAAU3C,GACrC,OAAOA,EAAET,QACR2F,KAAK,OAGV7C,WAAY,SAAU,GAAS,IAAT,MAACa,GAAQ,EAE7BpE,KAAKiE,cAAgB,CACnBE,KAAM,cACNC,MAAOA,EACPF,OAAQlE,KAAKiO,MAAMC,EAAE,2BAEnBlO,KAAKsO,MAAM,cACbtO,KAAKsO,MAAM,aAAaS,SAK5BzL,aAAc,SAAU,GAAe,IAAf,MAACc,EAAD,KAAQ4G,GAAO,EAErChL,KAAKiE,cAAgB,CACnBE,KAAM,YACNC,MAAOA,EACPF,OAAQlE,KAAKiO,MAAMC,EAAE,wBAGnBlO,KAAKsO,MAAM,cACbtO,KAAKsO,MAAM,aAAaC,QAAQvD,IAKpClG,QAAS,WACP9E,KAAK6L,MAAQpF,EAAEuI,MAAMhP,KAAK4L,QAG5BlI,OAAOqH,GACL/K,KAAK4L,MAAQb,EAEb,IAAIkE,EAAKjP,KAAK4L,MAAMsD,WAAa,EAC7BC,EAAKnP,KAAK6L,MAAMqD,WAAa,EAE7BD,EAAK,IAAME,GAAMnP,KAAKsO,MAAM,cAC9BtO,KAAKsO,MAAM,aAAac,eAK5BzL,OAAO8D,GACLzH,KAAK0J,MAAM,YAAajC,GACxBzH,KAAK0L,WAAajE,GAGpBhE,aAAaD,GAEXxD,KAAK+H,KAAKiG,MAAMY,SAAS,0BAA2B,CAClDjL,OAAQ3D,KAAK0L,WACbtH,MAAOZ,KAKX/B,QAAS,WAEPzB,KAAK0J,MAAM,WAEX1J,KAAKsO,MAAM,QAAQe,YAAY,IAKjC9K,KAAM,WAEAvE,KAAKiE,eAA4C,eAA3BjE,KAAKiE,cAAcE,OAC3CnE,KAAKiE,cAAgB,MAGvBjE,KAAK0J,MAAM,QAEX1J,KAAKmD,MAAQ,MAGfuB,YAAa,SAAU4K,GAErBtP,KAAKuP,KAAKvP,KAAK2L,iBAAkB2D,EAAK1J,GAAI0J,IAG5C3K,SAAU,SAAU2K,GAClBtP,KAAKwP,UAAUF,GAEftP,KAAKmD,MAAQ,MAGfqB,UAAW,SAAU8K,GAEfA,GAAQA,EAAK1J,IACf5F,KAAKwP,UAAUF,GAGbA,GAAQA,EAAKnM,QACfnD,KAAKmD,MAAQmM,EAAKnM,QAKtBsB,iBAAmB,SAASjB,GAE1BxD,KAAKmD,MAAQK,EAAEL,MACfnD,KAAK+H,KAAK0H,SAAS,mBAAoB/E,OAAEgF,UAAU1P,KAAKmD,SAI1D0C,aAAc,SAAUD,GACtB,IAAI0J,EAAOtP,KAAK2L,iBAAiB/F,GAE7B0J,EAAKK,OAAOL,EAAKK,QAErBL,EAAKM,SAAU,EAIf5P,KAAKwP,UAAUF,IAGjBxL,kBAAkB+L,GAChB7P,KAAK0J,MAAM,mBAAoBmG,IAGjCL,UAAW,SAAUF,GACnBtP,KAAK8P,QAAQ9P,KAAK2L,iBAAkB2D,EAAK1J,KAG3C/D,qBAAsB,SAASkO,GAC7B/P,KAAK0J,MAAM,gBAAiBqG,IAG9B1K,kBAAmB,WACjB,IAAI2K,EAAc,GAElB,IAAK,IAAI1Q,EAAI,EAAGA,EAAIU,KAAKoD,iBAAiBW,OAAQzE,IAC5CU,KAAKoD,iBAAiB9D,GAAG2Q,UAC3BD,EAAY5Q,KAAKY,KAAKoD,iBAAiB9D,GAAG2Q,SAAS,IAIvD,IAAIC,EAAKC,QAAQC,UACbC,EAAWrQ,KAAKoD,iBAAiB,GACrCiN,EAASJ,SAAWD,EAChBK,EAASC,WACXJ,EAAKlQ,KAAK+H,KAAKC,KACZuI,QAAQvQ,KAAKmB,KAAMnB,KAAKoE,OACxBqF,KAAMO,IACLU,OAAE8F,OAAOC,SAASzG,EAAE0G,QAErBjH,KAAMO,IACLqG,EAASM,MAAQ,CAAC3G,GAClBmG,QAAQC,aAGdF,EAAGzG,KAAK,KACNzJ,KAAK+H,KAAKzC,MAAM+K,MAIpBnL,mBAAoB,WAClBlF,KAAKqD,0BAA2B,GAGlC4B,mBAAqB,WACnBjF,KAAKoD,iBAAmB,IAG1BQ,kBAAmB,SAAU+E,GAC3B3I,KAAKqD,0BAA2B,EAC5BsF,IACF3I,KAAKoD,iBAAmB,OC7ekM,ICGlO,SAAS,EAAc+E,GAErB,IAAIC,EAAS,EAAQ,SACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIpI,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACc,MAAM,CAAC,GAAK,kBAAkB,CAAElB,EAAIoB,MAAQpB,EAAImB,EAAGf,EAAG,YAAY,CAACmB,YAAYvB,EAAIwB,GAAG,CAAC,CAACR,IAAI,OAAOS,GAAG,WAAW,MAAO,CAACrB,EAAG,aAAa,CAACc,MAAM,CAAC,OAAS,aAAaa,OAAM,GAAM,CAACf,IAAI,OAAOS,GAAG,WAAW,MAAO,CAAEzB,EAAQ,KAAEI,EAAG,cAAc,CAACc,MAAM,CAAC,GAAK,eAAiBlB,EAAIoB,KAAKgB,SAAS,CAAEpC,EAAU,OAAEI,EAAG,MAAM,CAACA,EAAG,MAAM,CAACE,YAAY,eAAe,CAAGN,EAAI6Q,SAAsF7Q,EAAIsC,KAAhFlC,EAAG,WAAW,CAACc,MAAM,CAAC,SAAU,EAAK,KAAOlB,EAAIoB,KAAK,OAASpB,EAAIgD,UAAoBhD,EAAa,UAAEI,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,IAAI,CAACE,YAAY,wBAAwBN,EAAIsC,MAAM,GAAGlC,EAAG,aAAa,CAACc,MAAM,CAAC,KAAO,SAAS,CAAElB,EAAiB,cAAEI,EAAG,cAAcJ,EAAIsC,MAAM,IAAI,GAAGtC,EAAIsC,MAAOtC,EAAIgD,QAAUhD,EAAIuN,SAAUnN,EAAG,MAAM,CAACA,EAAG,OAAO,CAACE,YAAY,YAAY,CAACN,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAIuN,SAAS7M,WAAWV,EAAIsC,OAAOtC,EAAIsC,OAAOP,OAAM,GAAM,CAACf,IAAI,QAAQS,GAAG,WAAW,MAAO,CAAEzB,EAAQ,KAAEI,EAAG,cAAc,CAACc,MAAM,CAAC,GAAK,eAAiBlB,EAAIoB,KAAKgB,SAAS,CAAChC,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,IAAI,CAACE,YAAY,0BAA0BN,EAAIsC,OAAOP,OAAM,IAAO,MAAK,EAAM,cAAc/B,EAAIsC,KAAMtC,EAAoB,iBAAEI,EAAG,QAAQ,CAACiB,GAAG,CAAC,MAAQrB,EAAI8Q,kBAAkBvP,YAAYvB,EAAIwB,GAAG,CAAC,CAACR,IAAI,SAASS,GAAG,WAAW,MAAO,CAACrB,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,wBAAwBJ,OAAM,GAAM,CAACf,IAAI,OAAOS,GAAG,WAAW,MAAO,CAACrB,EAAG,MAAM,CAACE,YAAY,qBAAqB,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,sBAAsB/B,EAAG,QAAQ,CAACE,YAAY,WAAWY,MAAM,CAAC,KAAO,OAAO,MAAQ,kBAAkB,UAAW,KAAQd,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,sBAAsB/B,EAAG,QAAQ,CAACK,WAAW,CAAC,CAACC,KAAK,QAAQC,QAAQ,iBAAiBC,MAAOZ,EAAkB,eAAEe,WAAW,iBAAiBgQ,UAAU,CAAC,QAAS,KAAQ7P,MAAM,CAAC,KAAO,SAAS,SAAWlB,EAAI0B,SAASsP,SAAS,CAAC,MAAShR,EAAkB,gBAAGqB,GAAG,CAAC,MAAQ,SAAS4D,GAAQ,OAAOjF,EAAIiR,iBAAiB,MAAQ,SAAShM,GAAWA,EAAOiM,OAAOC,YAAqBnR,EAAIoR,eAAepR,EAAIqR,GAAGpM,EAAOiM,OAAOtQ,SAAQ,KAAO,SAASqE,GAAQ,OAAOjF,EAAIsR,mBAAmBlR,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,wBAAwB/B,EAAG,QAAQ,CAACE,YAAY,WAAWY,MAAM,CAAC,KAAO,OAAO,UAAW,GAAM8P,SAAS,CAAC,MAAShR,EAAY,SAAIA,EAAIuR,SAAS7Q,KAAO,MAAMN,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,uBAAuB/B,EAAG,QAAQ,CAACK,WAAW,CAAC,CAACC,KAAK,QAAQC,QAAQ,UAAUC,MAAOZ,EAAmB,gBAAEe,WAAW,oBAAoBG,MAAM,CAAC,KAAO,OAAO,YAAc,eAAe,SAAWlB,EAAI0B,SAASsP,SAAS,CAAC,MAAShR,EAAmB,iBAAGqB,GAAG,CAAC,MAAQ,SAAS4D,GAAWA,EAAOiM,OAAOC,YAAqBnR,EAAIwR,gBAAgBvM,EAAOiM,OAAOtQ,WAAWZ,EAAIyR,eAAsC,SAArBzR,EAAIyR,cAA0BrR,EAAG,OAAO,CAACE,YAAY,SAAS,CAACN,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,6BAA8BnC,EAAiB,cAAEI,EAAG,OAAO,CAACE,YAAY,SAAS,CAACN,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,gCAAgCnC,EAAIsC,KAA6B,GAAvBtC,EAAI0R,gBAAyBtR,EAAG,SAAS,CAACE,YAAY,eAAeY,MAAM,CAAC,UAAYlB,EAAIoR,gBAAwC,MAAtBpR,EAAI2R,gBAAwBtQ,GAAG,CAAC,MAAQrB,EAAI4R,uBAAuB,CAACxR,EAAG,IAAI,CAACE,YAAY,gCAAgCN,EAAIiC,GAAG,IAAIjC,EAAIkC,GAAGlC,EAAImC,GAAG,0BAA0B,OAAOnC,EAAIsC,KAA6B,GAAvBtC,EAAI0R,gBAAyBtR,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,kBAAkB,GAAGJ,EAAIsC,OAA8B,MAAtBtC,EAAI2R,eAAwBvR,EAAG,MAAM,CAACE,YAAY,qBAAqB,CAACF,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,mCAAmC/B,EAAG,SAAS,CAACK,WAAW,CAAC,CAACC,KAAK,QAAQC,QAAQ,UAAUC,MAAOZ,EAAiB,cAAEe,WAAW,kBAAkBG,MAAM,CAAC,SAAWlB,EAAI0B,SAASL,GAAG,CAAC,OAAS,SAAS4D,GAAQ,IAAI4M,EAAgB7K,MAAM8K,UAAUC,OAAOC,KAAK/M,EAAOiM,OAAOe,SAAQ,SAASC,GAAG,OAAOA,EAAEC,YAAWpD,KAAI,SAASmD,GAAG,IAAIpC,EAAM,WAAYoC,EAAIA,EAAEE,OAASF,EAAEtR,MAAM,OAAOkP,KAAO9P,EAAIqS,cAAcpN,EAAOiM,OAAOoB,SAAWT,EAAgBA,EAAc,MAAM7R,EAAI2F,GAAI3F,EAA+B,6BAAE,SAASuS,GAAc,OAAOnS,EAAG,SAAS,CAAC4Q,SAAS,CAAC,MAAQuB,EAAa3R,QAAQ,CAACZ,EAAIiC,GAAG,IAAIjC,EAAIkC,GAAGqQ,EAAaC,OAAO,UAAS,GAAGpS,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,+BAA+B/B,EAAG,QAAQ,CAACE,YAAY,WAAWY,MAAM,CAAC,KAAO,SAAS,UAAW,GAAM8P,SAAS,CAAC,MAAQhR,EAAI2R,kBAAkBvR,EAAG,OAAO,CAACJ,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,2BAA2B/B,EAAG,OAAO,CAACE,YAAY,eAAe,CAACN,EAAIiC,GAAGjC,EAAIkC,IAAIlC,EAAIyS,oBAAoBC,QAAQ,IAAI,YAAa1S,EAAI2S,sBAAoD,mBAA5B3S,EAAI2S,qBAA2CvS,EAAG,OAAO,CAACE,YAAY,SAAS,CAACN,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,6BAA8BnC,EAAwB,qBAAEI,EAAG,OAAO,CAACE,YAAY,SAAS,CAACN,EAAIiC,GAAGjC,EAAIkC,GAAGlC,EAAImC,GAAG,gCAAgCnC,EAAIsC,KAAqB,GAAftC,EAAI0B,QAAiBtB,EAAG,SAAS,CAACE,YAAY,eAAeY,MAAM,CAAC,SAAWlB,EAAI0B,SAASL,GAAG,CAAC,MAAQrB,EAAI4S,eAAe,CAACxS,EAAG,IAAI,CAACE,YAAY,kCAAkCN,EAAIiC,GAAG,YAAYjC,EAAIsC,KAAqB,GAAftC,EAAI0B,QAAiBtB,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,kBAAkB,GAAGJ,EAAIsC,OAAOtC,EAAIsC,OAAOP,OAAM,GAAM,CAACf,IAAI,SAASS,GAAG,aAA6BM,OAAM,IAAO,MAAK,EAAM,cAAc/B,EAAIsC,MAAM,IACtgK,EAAkB,G,qCCOP,IACb5B,KAAM,gBACNoG,MAAO,CACL1F,KAAM2F,OACN5F,EAAGgK,OACH0F,UAAU,EACVgC,WAAW,GAGb3L,WAAY,CACVE,gBACAC,gBACAyL,kBACAC,kBAGFrL,KAAM,WAEJ,MAAO,CAELsL,UAAW,CACT,CACEC,MAAO,qBACPC,MAAOjT,KAAKiO,MAAMC,EAAE,qBACpBgF,KAAM,iBAGR,CACEF,MAAO,gBACPC,MAAOjT,KAAKiO,MAAMC,EAAE,gBACpBgF,KAAM,iBAIVC,cAAe,CACb,CACEH,MAAO,YACPC,MAAOjT,KAAKiO,MAAMC,EAAE,eACpBgF,KAAM,oBAGR,CACEF,MAAO,WACPC,MAAOjT,KAAKiO,MAAMC,EAAE,gBACpBgF,KAAM,qBAER,CACEF,MAAO,gBACPC,MAAOjT,KAAKiO,MAAMC,EAAE,0BACpBgF,KAAM,wBAGVE,mBAAoB,CAClB,CACEJ,MAAO,YACPC,MAAOjT,KAAKiO,MAAMC,EAAE,eACpBgF,KAAM,oBAGR,CACEF,MAAO,WACPC,MAAOjT,KAAKiO,MAAMC,EAAE,kBACpBgF,KAAM,eAER,CACEF,MAAO,gBACPC,MAAOjT,KAAKiO,MAAMC,EAAE,0BACpBgF,KAAM,wBAIVG,SAAU,CACR,CACEL,MAAO,WACPC,MAAOjT,KAAKiO,MAAMC,EAAE,gBACpBgF,KAAM,qBAOR,CACEF,MAAO,SACPC,MAAOjT,KAAKiO,MAAMC,EAAE,kBACpBgF,KAAM,2BAGVI,cAAe,CACb,CACEN,MAAO,WACPC,MAAOjT,KAAKiO,MAAMC,EAAE,kBACpBgF,KAAM,eAER,CACEF,MAAO,gBACPC,MAAOjT,KAAKiO,MAAMC,EAAE,0BACpBgF,KAAM,uBAER,CACEF,MAAO,SACPC,MAAOjT,KAAKiO,MAAMC,EAAE,kBACpBgF,KAAM,2BAGVK,WAAY,CACV,CACEP,MAAO,SACPC,MAAOjT,KAAKiO,MAAMC,EAAE,kBACpBgF,KAAM,2BAIVxL,SAAS,EACT8L,QAAQ,EACRlG,SAAU,KACVmG,eAAe,EACfC,YAAY,EACZjI,WAAW,EAIXkI,kBAAkB,EAElBrC,SAAU,KAEVH,eAAgB,EAEhBI,gBAAiB,GAEjBG,eAAgB,KAEhBF,cAAe,GACfkB,qBAAsB,GAEtBjB,iBAAiB,EACjBhQ,SAAS,EAET2Q,cAAe,UACfwB,4BAA6B,CAAC,CAC5BjT,MAAO,UACP4R,MAAOvS,KAAKiO,MAAMC,EAAE,+BACnB,CACDvN,MAAO,UACP4R,MAAOvS,KAAKiO,MAAMC,EAAE,gCAQ1BzF,MAAO,GAIPS,QAAS,WACPlJ,KAAKkM,eAIPpE,SAAUY,eAAS,CACjBE,KAAMD,GAASA,EAAMC,KAErB7F,OAAQ,WAEN,GAAI/C,KAAKmB,MAAQnB,KAAKmB,KAAKgB,OAAQ,CACjC,IAAI+K,EAAYlN,KAAK+H,KAAKC,KAAKuB,OAAO4D,eAAeC,gBAAgBpN,KAAKmB,KAAKgB,QAC7D,OAAd+K,IACFlN,KAAKyL,WAAY,GAEnB,IAAI1I,EAAS/C,KAAK+H,KAAKC,KAAKuB,OAAO8D,QAAQrN,KAAKmB,KAAKgB,QACrD,OAAOY,GAAU,KAIrB8Q,cAAe,WAEb,IAAK7T,KAAKmB,KAAM,OAAO,EAEvB,IAAIA,EAAOnB,KAAKmB,KAAKgB,OACjBqR,EAASxT,KAAKqJ,OAAOV,MAAM6K,OAAOrS,IAAS,GAE3C2S,EAAarN,EAAEsN,KAAKP,EAAQ,CAACtF,EAAG5O,KAE3B,MAAP,GAAI4O,EAEF,OAAI5O,IAAC,UAAIU,KAAK+H,KAAKvB,KAAK8G,gBAAnB,aAAI,EAAyB1H,MAQtC,OAAOkO,IAAc,GAGvBtB,oBAAqB,WACnB,MAA8B,WAAtBxS,KAAKoS,cAA8BpS,KAAKmR,eAAiBnR,KAAKmR,eAAiBnR,KAAK0R,kBAIhGvI,QAAS,CACP6K,kBAAkBpO,GAChB5F,KAAK6J,QAAQzK,KAAK,CAAC+L,KAAO,eAAcT,OAAEuJ,YAAYrO,KAAQ+D,MAAMnG,QAEtE0I,YAAa,WACPlM,KAAKkB,GACPlB,KAAK+H,KAAKvB,KAAKgI,UAAUxO,KAAKkB,GAAGuI,KAAKY,IACpCrK,KAAKsN,SAAWjD,EAAK,MAO3B6J,cAAe,WACb,IACI5C,EADA6C,EAAKnU,KAAK+C,OAAOqR,SAEjBC,EAAUrU,KAAK+C,OAAOuR,aAAaC,aAKvC,OAJAF,EAAQG,SAAQ,SAAUC,GACpBA,GAAUA,EAAOxL,SAAWkL,IAC9B7C,EAAWmD,MAERnD,GAEToD,YACE1U,KAAK2U,mBAEPC,qBAAqBzI,EAAM0I,GASzB,GANmB,cAAf1I,EAAK6G,QACPhT,KAAK0J,MAAM,aAAa,GACxB1J,KAAKsO,MAAMwG,aAAaC,aAIP,aAAf5I,EAAK6G,MAAsB,CAC7B,IAAI7Q,EAASnC,KAAKmB,KAAKgB,OACRnC,KAAK+H,KAAKC,KAAKuB,OAAOyL,SACrC,IAAI5L,EAAOpJ,KACPkN,EAAYlN,KAAK+H,KAAKC,KAAKuB,OAAO4D,eAAeC,gBAAgBpN,KAAKmB,KAAKgB,QAC7D,OAAd+K,GACF9D,EAAKrB,KAAKC,KAAKuB,OAAO0L,eAAe,SAAU,OAAQ9S,GACvDnC,KAAKyL,WAAY,IAGjBrC,EAAKrB,KAAKC,KAAKuB,OAAO2L,oBAAoB,SAAU/S,EAAQ,QAC5DnC,KAAKyL,WAAY,GAEnBzL,KAAKsO,MAAMwG,aAAaC,YAI1B,GAAmB,kBAAf5I,EAAK6G,MAA2B,CAIlChT,KAAK+H,KAAKC,KAAKuB,OAAOU,MAAMjK,KAAKmB,KAAKgB,QAAQsH,KAAKO,IAEjDhK,KAAK+H,KAAKC,KAAKuB,OAAOW,OAAOlK,KAAKmB,KAAKgB,QAAQ,GAAMsH,KAAKO,IAExDhK,KAAKqJ,OAAOC,OAAO,cAAetJ,KAAKmB,KAAKgB,UAC3CsH,KAAKO,IACNhK,KAAK6J,QAAQzK,KAAK,CAAC+L,KAAM,WAAWxB,MAAMnG,WAI9CxD,KAAKsO,MAAMwG,aAAaC,YAK1B,GAAmB,YAAf5I,EAAK6G,MAAqB,CAE5B,IAAImC,EAAY,GACZC,EAAUpV,KAAKkU,gBACfkB,GAAWA,EAAQnM,SACrBkM,EAAYC,EAAQnM,QACtB,IAAIoM,EAASrV,KAAKmB,KAAKgB,OACvBnC,KAAK+H,KAAKC,KAAKuB,OAAO+L,IAAID,EAAQF,EAAW,OAAO1L,KAAKO,OAEzDhK,KAAK0T,YAAa,EAClB1T,KAAKsO,MAAMwG,aAAaC,YAK1B,GAAmB,UAAf5I,EAAK6G,MAAmB,CAC1B,IAAImC,EAAY,GACZC,EAAUpV,KAAKkU,gBACfkB,GAAWA,EAAQnM,SACrBkM,EAAYC,EAAQnM,QACtBjJ,KAAK+H,KAAKC,KAAKuB,OAAOgM,MAAMvV,KAAKmB,KAAKgB,OAAQgT,GAAW1L,KAAKO,IAC5DhK,KAAK+H,KAAKC,KAAKuB,OAAOiM,OAAOxV,KAAKmB,KAAKgB,OAAQgT,KAEjDnV,KAAK0T,YAAa,EAClB1T,KAAKsO,MAAMwG,aAAaC,YAI1B,GAAmB,WAAf5I,EAAK6G,MAAoB,CAE3BhT,KAAK2T,kBAAmB,EAExB3T,KAAKsO,MAAMwG,aAAaC,YAExB,IAAIU,EAAczV,KAAKkU,gBACvBlU,KAAKsR,SAAYmE,EAAezV,KAAK0V,GAAG/K,KAAK3K,KAAM,sBAAwBA,KAAK0V,GAAGzB,YAAYwB,EAAYhV,OAAS,OAKxHoQ,mBACE7Q,KAAK2T,kBAAmB,GAG1BhC,uBACE3R,KAAKyR,iBAAkB,EACvBzR,KAAK2V,gBAAgBC,QAAQ,IAAM5V,KAAKyR,iBAAkB,IAG5DkE,gBACE,IAAIvM,EAAOpJ,KAEX,OADAA,KAAKwR,cAAgB,GACd,IAAIrB,QAAQ,CAACC,EAASyF,KAE3B,GAAI7V,KAAKmR,gBAAkB,IAAMnR,KAAKsR,WAAatR,KAAKsR,SAASwE,SAAW9V,KAAKsR,SAASwE,OAAOC,QAE/F,OADA/V,KAAKwR,cAAgB,UACdqE,EAAO,8BAGhB,IACE,IAAIG,EAAMC,OAAOC,kBAAkBC,SAASH,IAC5CA,EAAII,KAAKC,IAAIC,UAAS,SAAUC,GAC9B,IAAIC,EAAU,CAAC,CAACT,QAAS3M,EAAKkI,SAASwE,OAAOC,QAASU,OAAQrN,EAAK+H,iBACpE6E,EAAIU,OAAOC,OAAO,CAACX,EAAID,QAAQa,OAAOb,SAAUS,EAAS,EAAGpN,EAAKgJ,eAAe,SAAUyE,EAAKC,EAAQC,GACrG,GAAIF,EAGF,OAFA7K,QAAQ7I,MAAM0T,GACdzN,EAAKoI,cAAgBqF,EACdhB,EAAOgB,GAEhB,IAAIG,EAAKhB,EAAII,KAAKa,aAAaC,OAAOR,OAAOI,EAAQC,GACjDI,EAAYC,KAAKC,IAAIL,EAAGM,cAAgBf,EAAKgB,QAAS,OAG1D,OADAnO,EAAKsI,eAAiByF,EACf/G,UAGX,MAAOyG,GAGP,OAFA7K,QAAQ7I,MAAM0T,GACdzN,EAAKoI,cAAgBqF,EACdhB,EAAOgB,OAKdlE,eAAe,8CACnB,IAAIvJ,EAAO,EACX,EAAK3H,SAAU,EACf,EAAKiR,qBAAuB,GAE5B,UACQ,EAAKiD,gBACX,MAAOkB,GAGP,OAFA,EAAKnE,qBAAuB,aAC5B,EAAKjR,SAAU,GAIjB,IAAIuU,EAAMC,OAAOC,kBAAkBC,SAASH,IAC5CA,EAAII,KAAKa,aAAaO,IAAIC,SAASzB,EAAID,QAAQa,OAAOb,QAAU2B,IAE9D,IAAKA,GAAkBC,MAAMD,IAAmBA,EAAiBtO,EAAKoJ,oBAGpE,OAFApJ,EAAKsJ,qBAAuB,uBAC5BtJ,EAAK3H,SAAU,GAIjB,IACE,IAAI+U,EAAU,CAAC,CAACT,QAAS3M,EAAKkI,SAASwE,OAAOC,QAASU,OAAQrN,EAAK+H,iBACpE6E,EAAIU,OAAOkB,MAAMpB,EAASpN,EAAKmI,iBAE/ByE,EAAIU,OAAOC,OAAO,CAACX,EAAID,QAAQa,OAAOb,SAAUS,EAASpN,EAAKsI,eAAgBtI,EAAKgJ,eAAe,SAAUyE,EAAKC,EAAQC,GACvH,GAAIF,EAIF,OAHA7K,QAAQ7I,MAAM0T,GACdzN,EAAKsJ,qBAAuB,QAC5BtJ,EAAK3H,SAAU,EACRoU,OAAOgB,GAEhB,IAAIG,EAAKhB,EAAII,KAAKa,aAAaC,OAAOR,OAAOI,EAAQC,GACrDD,EAAOtC,QAAStG,IACdA,EAAE2J,WAAY,IAGhB7B,EAAII,KAAKa,aAAaa,KAAKd,GAAI,SAAUe,EAAGlB,GAC1C,GAAIA,EAIF,OAHAb,EAAII,KAAKa,aAAae,UAAUlB,GAChC1N,EAAKsJ,qBAAuB,aAC5BtJ,EAAK3H,SAAU,GAIjB,IAAIwW,EAAMnB,EAAOhI,IAAKxP,GAAMA,EAAE4Y,MAC9BlC,EAAII,KAAKa,aAAakB,cAAcF,GACpCjC,EAAIU,OAAO0B,mBAAmBL,EAAGjB,EAAQC,GAEzC3N,EAAKrB,KAAKC,KAAKuB,OAAO8O,UAAUjP,EAAKjI,KAAKgB,OAAQ,iBAAkB,CAClEmW,KAAMlP,EAAKsM,GAAGzB,YAAY7K,EAAKrG,OAAOqR,UACtCmE,GAAInP,EAAKkI,SAAS1L,GAClB6Q,OAAQrN,EAAK+H,eACbqH,KAAMT,EACNU,QAAS,YACR,IAEHrP,EAAKyH,yBAGT,MAAOgG,GACP7K,QAAQ7I,MAAM0T,GACdzN,EAAKsJ,qBAAuB,QAC5BtJ,EAAK3H,SAAU,OAhEA,IAqErBuP,gBACEhR,KAAK0R,eAAiB,KACtB1R,KAAKwR,cAAgB,GACrBxR,KAAK0S,qBAAuB,MCvbyM,MCG3O,SAAS,GAAcvK,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAI,GAAY,eACd,GACA,EACA,GACA,EACA,GACA,WACA,MACC,GAGY,M,QC+CA,IACf1H,gBACAwG,YACA9F,OACAuX,aACA5F,kBAEArL,UACA,CAEA9D,UACAmK,mBACAlE,cACAhJ,gBAKAkH,UACA5G,IACA,4BAEAC,OACA,2BAEA,sCAGAH,IACA,oCAEAH,MACA,0BAGA,gBACA0B,yBACAC,yBACAjC,sBAKA2I,UACAyP,gBAEA,sBAMA,MAEAxP,SACAxH,eACA,mBAEAI,aACA,yBAGAK,qBACA,wBAEAf,kBACA,wBAEAK,aAGAD,YAEAG,cACA,eAEAC,wBACA,mBAGA+W,gBACA,0BAEA,oDACA,uDACA,GACAnP,KAAAO,IACA,qDAKA,MClK8U,MCG9U,SAAS,GAAc7B,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAOxI,YAAYwI,EAAOxI,WAAWuI,GAMzC,IAAI,GAAY,eACd,GACArI,EACAwC,GACA,EACA,GACA,WACA,MACC,GAGY,gB,8BCpBf,IAAI/C,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACF,EAAOC,EAAIC,EAAS,MAC7DA,EAAQG,SAAQL,EAAOF,QAAUI,EAAQG,QAE5C,IAAIC,EAAM,EAAQ,QAAqEF,QACvFJ,EAAOF,QAAQS,WAAa,SAAUC,GACpCF,EAAI,WAAYJ,EAASM","file":"matrix-element.5.min.js","sourcesContent":["// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".nameWrapper[data-v-3b761913]{display:flex;align-items:center;justify-content:center}.roomMuted[data-v-3b761913]{margin-left:3px}.roomMuted i[data-v-3b761913]{font-size:.7em}.editButton[data-v-3b761913]{display:flex;justify-content:center;align-items:center}.editButton i[data-v-3b761913]{font-size:1.5em}.nameline[data-v-3b761913]{max-width:250px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#topheader.minimized.fix[data-v-3b761913]{background:transparent;overflow:inherit}.donationModalBody[data-v-3b761913]{padding:1em;display:flex;flex-direction:column}.donationModalBody span[data-v-3b761913]{color:rgb(var(--color-txt-ac))}.donationModalBody input[data-v-3b761913],.donationModalBody select[data-v-3b761913]{margin-top:.5em;margin-bottom:1.5em;border:1px solid rgb(var(--color-txt-ac));border-radius:3px;padding:.5em}.donationModalBody input.disabled[data-v-3b761913],.donationModalBody select.disabled[data-v-3b761913]{color:rgb(var(--neutral-grad-2));border:1px solid rgba(var(--neutral-grad-2),.5)}.donationModalBody button[data-v-3b761913]{margin-top:1em}.donationModalBody button i[data-v-3b761913]{margin-right:.2em}.donationModalBody .totalAmount[data-v-3b761913]{font-weight:700;margin-left:.5em;margin-top:.5em;margin-bottom:1em}.donationModalBody .error[data-v-3b761913]{color:rgb(var(--color-bad));text-align:center}.donationModalBody .linepreloader[data-v-3b761913]{text-align:center;height:29px;margin-top:1em}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#chatAttachement[data-v-41942aae]{height:90px;width:120px;border-radius:5px;overflow:hidden;position:relative;background:rgb(var(--background-secondary-theme))}#chatAttachement>div[data-v-41942aae]{width:100%;height:100%}.cancel[data-v-41942aae],.loading[data-v-41942aae]{position:absolute;height:90px;width:120px;line-height:90px;text-align:center;font-size:3em;left:0;top:0;background:rgba(var(--background-main),.8);color:rgba(var(--text-color),.2)}.cancel[data-v-41942aae]{background:transparent;font-size:1.2em;color:rgb(var(--text-color))}.file[data-v-41942aae]{text-align:center;font-size:.8em;padding-top:1em}.file span[data-v-41942aae]{white-space:normal}.file .fileicon i[data-v-41942aae]{opacity:.4;font-size:1.5em}.image[data-v-41942aae],.image .bgimage[data-v-41942aae]{width:100%;height:100%}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chat.vue?vue&type=template&id=7f0235e5&scoped=true&\"\nimport script from \"./chat.vue?vue&type=script&lang=js&\"\nexport * from \"./chat.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chat.vue?vue&type=style&index=0&id=7f0235e5&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7f0235e5\",\n null\n ,true\n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chat.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chat.vue?vue&type=template&id=7f0235e5&scoped=true&\"\nimport script from \"./chat.vue?vue&type=script&lang=js&\"\nexport * from \"./chat.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chat.vue?vue&type=style&index=0&id=7f0235e5&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7f0235e5\",\n null\n ,true\n)\n\nexport default component.exports"],"sourceRoot":""} \ No newline at end of file diff --git a/chat/matrix-element.6.js b/chat/matrix-element.6.js index fd0784ca16..f5f9afa774 100644 --- a/chat/matrix-element.6.js +++ b/chat/matrix-element.6.js @@ -859,8 +859,6 @@ var vuex_esm = __webpack_require__("2f62"); }, handleTouchStart(e) { - console.log("E", e, this.isHold, this.isRecording); - if (!this.isRecording) { this.$emit('onRecordingStart'); } else { @@ -875,7 +873,6 @@ var vuex_esm = __webpack_require__("2f62"); }, handleTouchEnd(e) { - console.log("E", e, this.isHold); if (this.isHold) return; if (this.isRecording || this.prepareRecording) { @@ -903,7 +900,6 @@ var vuex_esm = __webpack_require__("2f62"); handleMove(e) { var _e$changedTouches; - console.log("E", e, this.isRecording); if (!this.isRecording) return; let deltaY = this.start.Y - e.pageY; let deltaX = this.start.X - e.pageX; @@ -2137,7 +2133,6 @@ var CancelablePromise = __webpack_require__("0bb9"); }, getFileIosCordova(path) { - console.log('load', path); return new Promise((resolve, reject) => { window.resolveLocalFileSystemURL(path, entry => { if (!entry) { @@ -2146,13 +2141,11 @@ var CancelablePromise = __webpack_require__("0bb9"); entry.file(file => { var reader = new FileReader(); - console.log('file', file); reader.onloadend = function () { var blob = new Blob([new Uint8Array(this.result)], { type: file.type }); - console.log('blob', blob); entry.remove(); resolve(blob); }; @@ -2182,7 +2175,6 @@ var CancelablePromise = __webpack_require__("0bb9"); return Promise.reject(err); })); this.prepareRecording.then(() => { - console.log("START RECORDING"); this.microphoneDisabled = false; var path = 'recording.mp3'; if (functions["a" /* default */].isios()) path = 'cdvfile://localhost/temporary/recording.m4a'; @@ -2190,7 +2182,6 @@ var CancelablePromise = __webpack_require__("0bb9"); this.audioContext = this.core.getAudioContext(); //var startedTime = (new Date()).getTime() / 1000 var media = this.cordovaMediaRecorder = new Media(path, () => { - console.log("MEDIA PREPARED", this.cancelledCordovaMediaRecorder); this.recordTime = 0; media.release(); @@ -2221,8 +2212,6 @@ var CancelablePromise = __webpack_require__("0bb9"); /*var e = { data : r.data }*/ - console.log('media.duration', media.duration); - if (media.duration && media.duration > 0) { r.duration = media.duration; } @@ -2280,7 +2269,6 @@ var CancelablePromise = __webpack_require__("0bb9"); initRecording() { if (this.prepareRecording || this.isRecording || this.cordovaMediaRecorder) return; - console.log("INIT RECORDING"); if (window.cordova) { return this.initRecordingCordova(); @@ -2370,8 +2358,6 @@ var CancelablePromise = __webpack_require__("0bb9"); }, createVoiceMessage(event, sendnow) { - console.log('event', event); - var c = () => { //this.record = this.checkaudioForSend({ diff --git a/chat/matrix-element.6.js.map b/chat/matrix-element.6.js.map index 86bc766e2d..c89ef91414 100644 --- a/chat/matrix-element.6.js.map +++ b/chat/matrix-element.6.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?6dbd","webpack:///./src/components/assets/recordProgress/index.scss?7174","webpack:///./src/components/chat/input/InputField/InputField.vue?f020","webpack:///./src/components/assets/upload/index.vue?4a8e","webpack:///./src/components/assets/recordProgress/index.scss?cee1","webpack:///./src/components/chat/input/index.sass?2730","webpack:///./src/components/chat/input/InputField/InputField.vue?fce9","webpack:///./src/components/assets/upload/index.vue?6d1f","webpack:///./src/components/assets/recordVoice/index.scss?ad6e","webpack:///./src/components/chat/input/index.sass?ea34","webpack:///./src/components/assets/recordVoice/index.scss?76f8","webpack:///./src/components/assets/upload/index.vue?fdd5","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?9ee5","webpack:///./src/components/chat/input/index.sass","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?90c5","webpack:///./src/components/assets/recordVoice/index.scss","webpack:///./src/components/assets/recordProgress/index.scss","webpack:///./src/components/chat/input/InputField/InputField.vue?1d64","webpack:///./src/components/chat/input/index.vue?56ea","webpack:///./src/components/chat/input/InputField/InputField.vue?d728","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?0090","webpack:///src/components/chat/input/picturePreview/picturePreview.vue","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?3bda","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue","webpack:///src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/chat/input/InputField/InputField.vue?3335","webpack:///./src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/assets/recordVoice/index.vue?97db","webpack:///./src/components/assets/recordVoice/index.js","webpack:///./src/components/assets/recordVoice","webpack:///./src/components/assets/recordVoice/index.vue","webpack:///./src/components/assets/recordProgress/index.vue?083f","webpack:///./src/components/assets/recordProgress/index.js","webpack:///./src/components/assets/recordProgress","webpack:///./src/components/assets/recordProgress/index.vue","webpack:///./src/components/assets/upload/index.vue?1a6d","webpack:///src/components/assets/upload/index.vue","webpack:///./src/components/assets/upload/index.vue?f5f6","webpack:///./src/components/assets/upload/index.vue","webpack:///./src/components/chat/input/index.js","webpack:///./src/components/chat/input","webpack:///./src/components/chat/input/index.vue"],"names":["name","props","data","is_opened","methods","hide","components","Picker","picturePreview","directives","clickOutside","watch","text","immediately","handler","send","ready","exclude","display_emoji","content_height","pasted_data","block","upload","multiple","extensions","images","resize","type","hidden_previews","emojiIndex","computed","mobile","prepareemoji","window","setText","setTimeout","focused","textchange","savetextinstorage","localStorage","send_empty_array","focus","blur","blurifempty","close_emoji_picker","textarea_resize","textarea_resize_reset","toggle_emoji_picker","send_text","insert_emoji","paste_image","get_base64","reader","okText","cancelText","then","dialog","resize_image","catch","error","getsearchposition","start","middle","end","sposition","br","dg","i","getsearch","keydown","event","keyup","blured","inserttip","f","storagekey","tipusers","creared","mounted","isRecording","Boolean","required","prepareRecording","disabled","isHold","direction","mapState","state","beforeDestroy","document","removeEventListener","handleMove","$emit","cancel","mouseup","e","handleTouchEnd","mousedown","handleTouchStart","console","log","Y","changedTouches","pageY","X","pageX","addEventListener","sendnow","clearStyle","$refs","toggle","style","transform","classList","remove","holder","deltaY","deltaX","length","contains","add","recordEnd","recordTime","Number","rmsData","Array","opacity","width","timer","minute","Math","floor","sec","rmsDataLast","_","last","throttle","draw","graph","offsetWidth","re","canvas","ctx","getContext","x","count","l","c","max","clearRect","fillStyle","fillRect","clear","dropzone","onlyimage","maxsize","default","loading","maxSize","created","read","resolve","base64","file","each","ha","next","result","err","errorText","check","checkSize","getExtension","checkExtension","handle","sendAnyFile","resizeIfNeed","handleImages","chat","Object","u","String","relationEvent","InputField","contacts","preview","recordProgress","recordVoice","test","fileInfo","creating","userId","showuserselect","anyUrlMeta","joinedMembers","tipvalue","tipuserindex","record","recordRmsData","mediaRecorder","audioContext","audioAnalyser","interval","cancelOpacity","microphoneDisabled","cancelledCordovaMediaRecorder","usersForKeysHash","close","voiceEnable","$store","voiceMessagesEnabled","connect","contact","pkoindisabled","menuItems","POCKETNETINSTANCE","supportimagegallery","push","click","title","$i18n","t","icon","transaction","unshift","userlist","core","mtrx","chatUsersInfo","roomId","deep","uusers","map","split","ausers","user","matrixId","stateChat","id","$route","query","chatsMap","invited","filter","currentState","getMembers","m","v","membership","joined","self","arr","members","forEach","value","toLowerCase","indexOf","maintipuser","client","newchat","Promise","wait","$f","pretry","access","browsetip","increase","selectcurrenttip","insertuser","tipBySearch","showuserselected","action","resizeImage","ftype","Images","reject","cameraHandlerCustom","dropdownMenu","hidePopup","platform","ui","uploadImage","Base64","toFile","uploadUploaded","onSuccess","imgs","uploadUploadedAll","sendtransactionWrapper","menuIsVisible","users","j","getmatrixid","r","source","userinfo","store","commit","caption","userselected","sendtransaction","api","roomid","address","emitInputData","HideUploadPic","emitUrl","url","globalpreloader","myMatrixId","usersInfo","info","_info","keys","kit","tetatetid","initialstate","encrypted","createRoom","room_alias_name","visibility","invite","initial_state","_chat","m_chat","getRoom","room_id","getStateEvents","setPowerLevel","greetings","errcode","joinRoom","baseUrl","replace","maySendMessage","sendinput","textCutLimit","limit","trim","slice","replaceMentions","RegExp","textEvent","clearEventId","makeid","editEvent","content","body","msgtype","decryptKey","decrypted","sendEvent","dispatch","sendtext","relation","pasteImage","sendImage","meta","aborted","canencryptfilesize","s","pcrypto","canBeEncrypt","size","$dialog","confirm","sendFile","notenc","change","evt","target","getUrl","undefined","sendTyping","menuItemClick","item","rowObject","menuItemLoadedHandler","uploadStart","files","uploadError","message","getImg","uploadSizeError","validImageTypes","includes","imageWH","img","Image","imgInfo","onload","w","h","height","onerror","src","catchPermissonsError","toString","cordova","getFileIosCordova","path","resolveLocalFileSystemURL","entry","FileReader","onloadend","blob","Blob","Uint8Array","readAsArrayBuffer","initRecordingCordova","cancelable","media","permissions","audio","isios","getAudioContext","cordovaMediaRecorder","Media","release","fu","externalDataDirectory","duration","createVoiceMessage","finally","rmsdata","currentPlaying","currentPlayingVoiceMessage","pause","setInterval","clone","getCurrentAmplitude","amp","startRecord","initRecording","initMediaRecorder","recorder","stream","getTracks","track","stop","createAnalyser","createMediaStreamSource","startRecording","dataArray","frequencyBinCount","getByteFrequencyData","generateRms","checkaudioForSend","sendVoiceMessage","getduration","readFile","arraybuffer","decodeAudioData","buffer","frequencies","sqrt","reduce","a","b","toPrecision","stopRecording","clearInterval","stopRecord","convertAudioToBase64","sendAudio","setOpacity"],"mappings":";;;;;AAAA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAkkB;AACxlB;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAsE;AACxF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAga;AACtb;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAA8jB;AACplB;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAsE;AACxF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAoiB;AAC1jB;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;;ACXA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;ACAA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAoa;AAC1b;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAga;AACtb;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;ACXA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,4BAA4B,WAAW,gCAAgC,kBAAkB,kGAAkG,kBAAkB,OAAO,QAAQ,MAAM,SAAS,UAAU;AAC5Q;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAA4D;AACtG;AACA;AACA,cAAc,QAAS,6BAA6B,kBAAkB,sBAAsB,kBAAkB,WAAW,SAAS,kCAAkC,WAAW,YAAY,mBAAmB;AAC9M;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,+BAA+B,oBAAoB,kDAAkD,OAAO,kCAAkC,4BAA4B,6BAA6B,+BAA+B,aAAa,qCAAqC,WAAW,aAAa,yBAAyB,mBAAmB,kBAAkB,iDAAiD,aAAa,mBAAmB,uBAAuB,YAAY,WAAW,wCAAwC,yCAAyC,WAAW,gBAAgB,0CAA0C,WAAW,mCAAmC,eAAe,uCAAuC,iBAAiB,eAAe,aAAa,8BAA8B,mBAAmB,YAAY,6BAA6B,mBAAmB,kDAAkD,qCAAqC,4CAA4C,2CAA2C,mBAAmB,WAAW,iBAAiB,wDAAwD,eAAe,kBAAkB,kCAAkC,eAAe,4BAA4B,eAAe,2DAA2D,kBAAkB,4BAA4B,aAAa,8CAA8C,iBAAiB,kBAAkB,aAAa,mCAAmC,YAAY,mBAAmB,kBAAkB,yCAAyC,WAAW,2BAA2B,kBAAkB,iBAAiB,mBAAmB,gDAAgD,mBAAmB,yDAAyD,0BAA0B,kCAAkC,gBAAgB,YAAY,mBAAmB,WAAW,YAAY,8CAA8C,oBAAoB,kBAAkB,mBAAmB,kBAAkB,qBAAqB,8DAA8D,6BAA6B,8BAA8B,uDAAuD,uCAAuC,2BAA2B,aAAa,uBAAuB,mBAAmB,WAAW,YAAY,iCAAiC,6BAA6B,gBAAgB;AACj/E;AACA;;;;;;;;;ACNA;AAAA;AAAA;AAAA;;;;;;;;ACAA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,0CAA0C,kBAAkB,sCAAsC,kBAAkB,kBAAkB,aAAa,uBAAuB,mBAAmB,YAAY,WAAW,gBAAgB,kBAAkB,YAAY,eAAe,UAAU,4CAA4C,WAAW,cAAc,6CAA6C,mBAAmB,2CAA2C,gBAAgB,mBAAmB,YAAY,iDAAiD,WAAW,oCAAoC,gBAAgB,kBAAkB,aAAa,mBAAmB,uBAAuB,WAAW,YAAY,2BAA2B,uBAAuB,kBAAkB,aAAa,kBAAkB,2CAA2C,mCAAmC,sDAAsD,8CAA8C,iDAAiD,0CAA0C,kDAAkD,kBAAkB,WAAW,aAAa,YAAY,UAAU,aAAa,kBAAkB,8CAA8C,sDAAsD,8CAA8C,mDAAmD,iCAAiC,gFAAgF,iCAAiC,oCAAoC,0CAA0C,eAAe,yCAAyC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW,iCAAiC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW;AACpzD;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,oCAAoC,aAAa,YAAY,2BAA2B,cAAc,mBAAmB,cAAc,YAAY,mDAAmD,eAAe,WAAW,iBAAiB,aAAa,uBAAuB,mBAAmB,4CAA4C,WAAW,UAAU,mBAAmB,kBAAkB,sDAAsD,2DAA2D,mDAAmD,sCAAsC,eAAe,eAAe,aAAa,uBAAuB,mBAAmB,WAAW,YAAY,iBAAiB,wCAAwC,UAAU,eAAe,wCAAwC,iBAAiB,wCAAwC,cAAc,YAAY,gBAAgB,mBAAmB,iEAAiE,aAAa,uBAAuB,yBAAyB,kBAAkB,OAAO,QAAQ,MAAM,SAAS,kDAAkD,UAAU,kBAAkB,mBAAmB,8BAA8B,mBAAmB,eAAe,yCAAyC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW,iCAAiC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW;AACx7C;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAA4D;AACtG;AACA;AACA,cAAc,QAAS,qCAAqC,WAAW,aAAa,uBAAuB,mBAAmB,cAAc,gBAAgB,gEAAgE,UAAU,YAAY,eAAe,qEAAqE,eAAe,sEAAsE,gBAAgB,gBAAgB,6EAA6E,aAAa,iDAAiD,aAAa,sBAAsB,uBAAuB,uBAAuB,kBAAkB,WAAW,yCAAyC,cAAc,yDAAyD,WAAW,0DAA0D,WAAW,sDAAsD,WAAW,YAAY,iBAAiB,wDAAwD,2BAA2B,4CAA4C,WAAW,gBAAgB,YAAY,aAAa,uBAAuB,cAAc,gBAAgB,wDAAwD,cAAc,4CAA4C,WAAW,aAAa,2BAA2B,mBAAmB,6BAA6B,WAAW,iBAAiB,gBAAgB,YAAY,gDAAgD,kBAAkB,wEAAwE,2BAA2B,6DAA6D,UAAU;AACnrD;AACA;;;;;;;;;;;;;ACNA,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,gCAAgC,kBAAkB,wBAAwB,mBAAmB,uBAAuB,2BAA2B,kCAAkC,uBAAuB,wCAAwC,iBAAiB,mDAAmD,iCAAiC,KAAK,yBAAyB,8BAA8B,gBAAgB,OAAO,0BAA0B,MAAM,wBAAwB,qBAAqB,6EAA6E,OAAO,kHAAkH,KAAK,qBAAqB,mBAAmB,sBAAsB,mEAAmE,KAAK,+OAA+O,qCAAqC,0BAA0B,2BAA2B,8CAA8C,yBAAyB,qBAAqB,0BAA0B,wCAAwC,sBAAsB,sBAAsB,qCAAqC,2CAA2C,4BAA4B,yBAAyB,2CAA2C,YAAY,0BAA0B,gCAAgC,0BAA0B,uBAAuB,oBAAoB,gEAAgE,OAAO,0KAA0K,KAAK,0BAA0B,+CAA+C,EAAE,6BAA6B,iDAAiD,EAAE,kCAAkC,sDAAsD,EAAE,2BAA2B,+CAA+C,GAAG,sBAAsB,4BAA4B,kBAAkB,wBAAwB,YAAY,0BAA0B,gCAAgC,0BAA0B,uBAAuB,oBAAoB,oDAAoD,YAAY,EAAE,6BAA6B,iBAAiB,YAAY,aAAa,IAAI,yBAAyB,4CAA4C,aAAa,4GAA4G,2BAA2B,oBAAoB,OAAO,uHAAuH,KAAK,yHAAyH,2DAA2D,6BAA6B,sBAAsB,yBAAyB,+DAA+D,uBAAuB;AACh3G,oCAAoC,aAAa,0BAA0B,wBAAwB,yBAAyB,sCAAsC,IAAI;;;;;;;;;;;;;;;ACDtK,IAAI,0DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,8BAA8B,YAAY,4BAA4B,YAAY,uBAAuB,iBAAiB,+CAA+C,4HAA4H,WAAW,iBAAiB,KAAK,gJAAgJ,mDAAmD,OAAO,+BAA+B,eAAe,aAAa,kFAAkF,EAAE,8GAA8G,UAAU,kHAAkH,SAAS,kHAAkH,KAAK,2BAA2B,6CAA6C,yCAAyC,yBAAyB,mCAAmC,YAAY,wBAAwB,YAAY,qBAAqB,8BAA8B,2BAA2B,UAAU,2BAA2B,sCAAsC,6BAA6B,yBAAyB,+BAA+B;AAC9jD,IAAI,mEAAe,iBAAiB,aAAa,0BAA0B,wBAAwB,iBAAiB,yBAAyB,YAAY,qBAAqB,UAAU,iCAAiC,MAAM;;;;;;;;;;;;;;;;;;;ACD/N,IAAI,8DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iCAAiC,sBAAsB,YAAY,qCAAqC,0CAA0C,UAAU,qCAAqC,kBAAkB;AAC5S,IAAI,uEAAe;;;;;;;;;;;;;ACQJ;EACfA,sBADA;EAEAC,iBAFA;;EAIAC;IACA;MACAC;IADA;EAGA,CARA;;EAUAC;IACAC;MACA;IACA;;EAHA;AAVA,G;;ACTqX,CAAgB,gIAAG,EAAC,C;;;;;ACAhS;AACvC;AACL;AAC7D;;AAEA,eAAe,mBAAO,CAAC,OAAgF;AACvG;;AAEA;;AAEA;AACmG;AACnG,gBAAgB,8CAAU;AAC1B,EAAE,qDAAM;AACR,EAAE,8DAAM;AACR,EAAE,uEAAe;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEe,oE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqCf;AACgD;AACR;AACxC;AAEA;AAEA;AAEA,IAAI,wCAAM,OAAO,+BAAM;AAER;EACfL,kBADA;EAEAM;IACAC,iCADA;IAEAC;EAFA,CAFA;EAOAC;IACAC;EADA,CAPA;EAWAC;IACAC;MACAC,iBADA;MAEAC;QAEA;UAEA;UACA;QAEA,CALA,MAKA;UAEA;UACA;QACA;;QAEA;MACA;IAhBA;EADA,CAXA;;EAgCAZ;IACA;MACAa,WADA;MAGAC,YAHA;MAIAJ,QAJA;MAKAK,kBALA;MAMAC,oBANA;MAOAC,kBAPA;MAQAC,eARA;MASAC,YATA;MAWAC;QACAC,cADA;QAEAC,oDAFA;QAGAC;UACAC;YACAC;UADA;QADA;MAHA,CAXA;MAoBAC,qBApBA;MAqBAC;IArBA;EAuBA,CAxDA;;EA0DAC;IACAC;MACA;IACA;IAEA;;;;;EALA,CA1DA;EAyEA3B;IAEA4B;MAEA;QACA,gEAEA;UAEA;;UACAC;UACA;QAIA;MACA;IACA,CAjBA;IAmBAC;MACA;MAEA;MAEAC;QACA;QACA;MACA,CAHA;IAKA,CA7BA;IA+BAC;MACA;IACA,CAjCA;IAmCAC;MACA;IAEA,CAtCA;IAyCAC;MACA;QACAC;MACA;IACA,CA7CA;;IA8CAC;MACA;IACA,CAhDA;;IAkDAC;MACA;IACA,CApDA;;IAsDAC;MACA;IACA,CAxDA;;IA0DAC;MACA,gBACA;IACA,CA7DA;;IA+DAC;MACA;QACA;UACA;QACA;MACA;IACA,CArEA;;IAuEAC;MAEA;QACA;MACA,CAFA,MAEA;QACA;QACA;QACA;MACA;IAGA,CAlFA;;IAoFAC;MACA;IACA,CAtFA;;IAuFAC;MACA;IACA,CAzFA;;IA2FAC;MAEA;QAEA;QACA;QACA;QACA;QACA;MAEA;;MAEA;IAEA,CAzGA;;IA2GAC;MACA;MAEA;IACA,CA/GA;;IAgHAC;MAEA;IAEA,CApHA;;IAqHAC;MACA;;MAEA;QAEA;UACA;UAEA;;UAEA;YAGA;YACA;;YAEAC;cAEA,qBACA,wCADA,EACA;gBACAC,aADA;gBAEAC;cAFA,CADA,EAMAC,IANA,CAMAC;gBACA;gBACA;cAEA,CAVA;YAWA,CAbA;;YAcAJ;UAGA;QACA;MAEA;IACA,CA1JA;;IA2JAK;MACA;QACA;;QAEA;UAEA;QAEA,CAJA,EAIAC,KAJA,CAIAC,uDAJA;MAKA,CARA,EAQAD,KARA,CAQAC,uDARA;IASA,CArKA;;IAuKAC;MAEA;MAEA;QAAAC;QAAAC;QAAAC;MAAA;MAEA;MACA;MACA;MAEA;MAEAC;;MAEA;QAEA;;QAEA;UAEA;YACAC;UACA,CAFA,MAEA;YACAC;UACA;QACA,CAPA,MAOA;UAEA;YACAF;UACA,CAFA,MAEAC;QACA;;QAEAE;MAEA,CApBA,QAoBAA,2CApBA;;MAsBA;QACAH;MACA,CAFA,MAEA;QAEAC;QACAE;;QAEA;UACA;YACAH;UACA,CAFA,MAEA;YACAC;UACA;;UAEAE;QAEA,CATA,QASAA,4BATA;MAUA;;MAEA;IAEA,CAhOA;;IAmOAC;MAEA;MAEA;MAEA;IAEA,CA3OA;;IA8OAC;MAEA;QAEA;UAEA;UAEAC;UAEA;QACA;MAEA;;MAGA;QAEA;UAEA;UAEAA;UAEA;QAEA;MAEA;;MAEA;QACA;UACA;QACA,CAFA,MAEA;UACA;QACA;;QAEAA;QAEA;MACA;IACA,CAvRA;;IAyRAC;MAEA;QACAD;QAEA;MACA;;MAEA;MAEA;MAEA;MAEA;IACA,CAxSA;;IA0SAE;MAEArC;QACA;MACA,CAFA,EAEA,GAFA;IAIA,CAhTA;;IAkTAsC;MAEA;MAEA;MACA;MAEA;MAEA;;MAGA;QACA;MACA;;MAEA;MAEAC;MAEAvC;QACA;MACA,CAFA,EAEA,GAFA;IAIA;;EA1UA,CAzEA;EAsZAlC;IACA0E,kBADA;IAEAC;EAFA,CAtZA;;EA6ZAC,WAEA,CA/ZA;;EAiaAC;IAEA;MACA;IACA;;IAEA;IAGA;;IAEA;MACA;IACA;EACA;;AA/aA,G;;ACvEiX,CAAgB,oHAAG,EAAC,C;;ACAhS;AACvC;AACL;AACzD,SAAS,uBAAY;;AAErB,eAAe,mBAAO,CAAC,MAA4E;AACnG;;AAEA;;AAEA;AACmG;AACnG,IAAI,oBAAS,GAAG,8CAAU;AAC1B,EAAE,6CAAM;AACR,EAAE,0DAAM;AACR,EAAE,mEAAe;AACjB;AACA,EAAE,uBAAY;AACd;AACA;AACA;AACA;;AAEe,mEAAS,Q;;ACvBxB,IAAI,2DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,mCAAmC,YAAY,sDAAsD,kBAAkB,UAAU,oEAAoE,4BAA4B,uEAAuE,gDAAgD,KAAK,kJAAkJ,UAAU,qCAAqC,oCAAoC,iEAAiE,uBAAuB,UAAU,+BAA+B;AAC7yB,IAAI,oEAAe;;;;;;;;;ACDnB;AAEe;EACd9E,IAAI,EAAE,aADQ;EAEdC,KAAK,EAAE;IACN8E,WAAW,EAAE;MACZpD,IAAI,EAAEqD,OADM;MAEZC,QAAQ,EAAE;IAFE,CADP;IAKNC,gBAAgB,EAAE;MACjBvD,IAAI,EAAEqD;IADW,CALZ;IAQNG,QAAQ,EAAEH;EARJ,CAFO;;EAYd9E,IAAI,GAAG;IACN,OAAO;MACN2D,KAAK,EAAE,CADD;MAENuB,MAAM,EAAE,KAFF;MAGNC,SAAS,EAAE;IAHL,CAAP;EAKA,CAlBa;;EAmBdvD,QAAQ,EAAE,EACT,GAAGwD,oCAAQ,CAAC;MACXvD,MAAM,EAAEwD,KAAK,IAAIA,KAAK,CAACxD;IADZ,CAAD;EADF,CAnBI;;EAwBd+C,OAAO,GAAG,CAET,CA1Ba;;EA2BdU,aAAa,GAAG;IAEfC,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;IACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;;IAEA,IAAI,KAAKZ,WAAT,EAAsB;MACrB,KAAKa,KAAL,CAAW,iBAAX,EAA8B;QAACC,MAAM,EAAG;MAAV,CAA9B;IACA;EACD,CAnCa;;EAoCdzF,OAAO,EAAE;IAER0F,OAAO,EAAG,UAASC,CAAT,EAAW;MACpB,IAAG,CAAC,KAAKhE,MAAT,EACC,KAAKiE,cAAL,CAAoBD,CAApB;IACD,CALO;IAORE,SAAS,EAAG,UAASF,CAAT,EAAW;MACtB,IAAG,CAAC,KAAKhE,MAAT,EACC,KAAKmE,gBAAL,CAAsBH,CAAtB;IACD,CAVO;;IAYRG,gBAAgB,CAACH,CAAD,EAAI;MAEnBI,OAAO,CAACC,GAAR,CAAY,GAAZ,EAAiBL,CAAjB,EAAoB,KAAKX,MAAzB,EAAiC,KAAKL,WAAtC;;MAGA,IAAG,CAAC,KAAKA,WAAT,EAAsB;QACrB,KAAKa,KAAL,CAAW,kBAAX;MACA,CAFD,MAII;QACH,IAAG,KAAKR,MAAR,EAAgB;MAChB;;MAED,KAAKvB,KAAL,GAAa;QACZwC,CAAC,EAAEN,CAAC,CAACO,cAAF,GAAmBP,CAAC,CAACO,cAAF,CAAiB,CAAjB,EAAoBC,KAAvC,GAA+CR,CAAC,CAACQ,KADxC;QAEZC,CAAC,EAAET,CAAC,CAACO,cAAF,GAAmBP,CAAC,CAACO,cAAF,CAAiB,CAAjB,EAAoBG,KAAvC,GAA+CV,CAAC,CAACU;MAFxC,CAAb;MAKA,IAAG,CAAC,KAAK1E,MAAT,EACC0D,QAAQ,CAACiB,gBAAT,CAA0B,WAA1B,EAAuC,KAAKf,UAA5C,EADD,KAGCF,QAAQ,CAACiB,gBAAT,CAA0B,WAA1B,EAAuC,KAAKf,UAA5C;IAED,CAnCO;;IAoCRK,cAAc,CAACD,CAAD,EAAI;MACjBI,OAAO,CAACC,GAAR,CAAY,GAAZ,EAAiBL,CAAjB,EAAoB,KAAKX,MAAzB;MAEA,IAAI,KAAKA,MAAT,EAAiB;;MAEjB,IAAI,KAAKL,WAAL,IAAoB,KAAKG,gBAA7B,EAA+C;QAC9C,KAAKU,KAAL,CAAW,iBAAX,EAA8B;UAC7Be,OAAO,EAAG;QADmB,CAA9B;MAGA;;MAEDlB,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;MACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;MAEA,KAAKiB,UAAL;IAEA,CApDO;;IAsDRA,UAAU,GAAE;MAEX,IAAI,KAAKC,KAAL,CAAWC,MAAf,EAAsB;QACrB,KAAKD,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAArC;QACA,KAAKH,KAAL,CAAWC,MAAX,CAAkBG,SAAlB,CAA4BC,MAA5B,CAAmC,SAAnC;MACA;;MAED,IAAI,KAAKL,KAAL,CAAWM,MAAf,EAAsB;QACrB,KAAKN,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BC,MAA5B,CAAmC,QAAnC;MACA;IACD,CAhEO;;IAkERvB,UAAU,CAACI,CAAD,EAAI;MAAA;;MAEbI,OAAO,CAACC,GAAR,CAAY,GAAZ,EAAiBL,CAAjB,EAAoB,KAAKhB,WAAzB;MAEA,IAAG,CAAC,KAAKA,WAAT,EAAsB;MAEtB,IAAIqC,MAAM,GAAG,KAAKvD,KAAL,CAAWwC,CAAX,GAAeN,CAAC,CAACQ,KAA9B;MACA,IAAIc,MAAM,GAAG,KAAKxD,KAAL,CAAW2C,CAAX,GAAeT,CAAC,CAACU,KAA9B;;MAEA,IAAIV,CAAJ,aAAIA,CAAJ,oCAAIA,CAAC,CAAEO,cAAP,8CAAI,kBAAmBgB,MAAvB,EAA+B;QAC9BF,MAAM,GAAG,KAAKvD,KAAL,CAAWwC,CAAX,GAAeN,CAAC,CAACO,cAAF,CAAiB,CAAjB,EAAoBC,KAA5C;QACAc,MAAM,GAAG,KAAKxD,KAAL,CAAW2C,CAAX,GAAeT,CAAC,CAACO,cAAF,CAAiB,CAAjB,EAAoBG,KAA5C;MACA;;MAED,IAAIW,MAAM,GAAG,CAAT,IAAcC,MAAM,GAAG,CAA3B,EAA8B;QAC7B,KAAKhC,SAAL,GAAiB,GAAjB;MACA,CAFD,MAEO;QACN,KAAKA,SAAL,GAAiB,GAAjB;MACA;;MAGD,IAAI+B,MAAM,GAAG,CAAT,IAAc,KAAK/B,SAAL,KAAmB,GAArC,EAA0C;QAEzC,IAAG,CAAC,KAAKwB,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BM,QAA5B,CAAqC,QAArC,CAAJ,EACC,KAAKV,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BO,GAA5B,CAAgC,QAAhC;QAED,KAAKX,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAAeI,MAAO,KAA3D;;QAEA,IAAIA,MAAM,GAAG,EAAb,EAAiB;UAChB,KAAKP,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAArC;UAEAvB,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;UACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C,EAJgB,CAKhB;;UAEA,KAAKP,MAAL,GAAc,IAAd;QACA;MAGD,CAlBD,MAkBO,IAAIiC,MAAM,GAAG,CAAT,IAAc,KAAKhC,SAAL,KAAmB,GAArC,EAA0C;QAEhD,KAAKwB,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,cAAaK,MAAO,QAAzD;QAEA,IAAG,CAAC,KAAKR,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BM,QAA5B,CAAqC,SAArC,CAAJ,EACC,KAAKV,KAAL,CAAWC,MAAX,CAAkBG,SAAlB,CAA4BO,GAA5B,CAAgC,SAAhC;QAED,KAAK5B,KAAL,CAAW,WAAX,EAAwB,CAACyB,MAAM,GAAG,CAAV,IAAe,GAAvC;;QAEA,IAAIA,MAAM,GAAG,GAAb,EAAkB;UACjB,KAAKR,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAArC;UACAvB,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;UACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C,EAHiB,CAIjB;;UACA,KAAKC,KAAL,CAAW,iBAAX,EAA8B;YAAEC,MAAM,EAAE;UAAV,CAA9B;UACA,KAAKD,KAAL,CAAW,SAAX;QACA;MAED,CAlBM,MAmBF;QACJ,KAAKgB,UAAL;MACA;IACD,CA/HO;;IAiIRa,SAAS,CAAC1B,CAAD,EAAI;MAEZ,KAAKa,UAAL;;MAEA,IAAI,KAAK7B,WAAL,IAAoB,KAAKK,MAA7B,EAAqC;QAEpC,KAAKQ,KAAL,CAAW,iBAAX,EAA8B,EAA9B;QACA,KAAKR,MAAL,GAAc,KAAd;QAEA;MAEA;IAED;;EA9IO;AApCK,CAAf,E;;ACF2N,CAAgB,oHAAG,EAAC,C;;ACA/I;AACxC;AACL;AACnD,SAAS,wBAAY;;AAErB,eAAe,mBAAO,CAAC,MAAwE;AAC/F;;AAEA;;AAEA;AACgG;AAChG,IAAI,qBAAS,GAAG,8CAAU;AAC1B,EAAE,2CAAM;AACR,EAAE,2DAAM;AACR,EAAE,oEAAe;AACjB;AACA,EAAE,wBAAY;AACd;AACA;AACA;AACA;;AAEe,qEAAS,Q;;;;;;;;ACvBxB,IAAI,8DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,6BAA6B,8BAA8B,+BAA+B,YAAY,+BAA+B,8BAA8B,cAAc,sBAAsB,mBAAmB,UAAU,2BAA2B,cAAc,oBAAoB,wCAAwC,gCAAgC,eAAe,oBAAoB,+CAA+C,cAAc,aAAa,wGAAwG,oCAAoC;AAC5sB,IAAI,uEAAe;;;;;;ACDJ;EACbpF,IAAI,EAAE,gBADO;EAEbC,KAAK,EAAE;IACLyH,UAAU,EAAE;MACV/F,IAAI,EAAEgG,MADI;MAEV1C,QAAQ,EAAE;IAFA,CADP;IAKL2C,OAAO,EAAE;MACPjG,IAAI,EAAEkG,KADC;MAEP5C,QAAQ,EAAE;IAFH,CALJ;IASLF,WAAW,EAAE;MACXpD,IAAI,EAAEqD;IADK,CATR;IAYL8C,OAAO,EAAE;EAZJ,CAFM;;EAgBb5H,IAAI,GAAG;IACL,OAAO;MACL6H,KAAK,EAAE;IADF,CAAP;EAGD,CApBY;;EAqBbjG,QAAQ,EAAE;IACRkG,KAAK,GAAG;MACN,IAAIC,MAAM,GAAGC,IAAI,CAACC,KAAL,CAAW,KAAKT,UAAL,GAAkB,KAA7B,CAAb;MACA,IAAIU,GAAG,GAAGF,IAAI,CAACC,KAAL,CAAW,KAAKT,UAAL,GAAkB,IAA7B,IAAqC,EAA/C;MACA,OAAQ,GAAEO,MAAM,GAAGA,MAAM,GAAG,GAAZ,GAAkB,IAAK,GAAGG,GAAG,GAAG,EAAP,GAAa,MAAMA,GAAnB,GAAyBA,GAAI,EAAtE;IACD,CALO;;IAORC,WAAW,GAAE;MACX,OAAOC,CAAC,CAACC,IAAF,CAAO,KAAKX,OAAZ,EAAqB,EAArB,CAAP;IACD;;EATO,CArBG;EAiCbjH,KAAK,EAAG;IACNiH,OAAO,EAAGU,CAAC,CAACE,QAAF,CAAW,YAAU;MAC7B,KAAKC,IAAL;IACD,CAFS,EAEP,EAFO,CADJ;IAKNX,OAAO,EAAG,YAAU;MAClB,KAAKjB,KAAL,CAAWhB,MAAX,CAAkBkB,KAAlB,CAAwBe,OAAxB,GAAkC,KAAKA,OAAvC;IACD;EAPK,CAjCK;;EA2CbhD,OAAO,GAAG;IACR,KAAK+B,KAAL,CAAWhB,MAAX,CAAkBkB,KAAlB,CAAwBe,OAAxB,GAAkC,CAAlC;IACA,IAAIC,KAAK,GAAG,KAAKlB,KAAL,CAAW6B,KAAX,CAAiBC,WAA7B;IACA,KAAKZ,KAAL,GAAaA,KAAK,GAAGA,KAAK,GAAG,GAA7B;IAEA9F,MAAM,CAACyE,gBAAP,CAAwB,QAAxB,EAAkC,KAAKhF,MAAvC;EACD,CAjDY;;EAkDb8D,aAAa,GAAG;IACdvD,MAAM,CAACyD,mBAAP,CAA2B,QAA3B,EAAqC,KAAKhE,MAA1C;EACD,CApDY;;EAsDbtB,OAAO,EAAE;IACPsB,MAAM,GAAG;MACP,IAAIsG,KAAK,GAAG,IAAZ;;MAEA,IAAIY,EAAE,GAAG,MAAM;QACb,IAAI,CAACZ,KAAL,EAAY;UACVA,KAAK,GAAG7F,UAAU,CAAC,MAAM;YACvB6F,KAAK,GAAG,IAAR;YACA,IAAID,KAAK,GAAG,KAAKlB,KAAL,CAAW6B,KAAX,CAAiBC,WAA7B;YACA,KAAKZ,KAAL,GAAaA,KAAK,GAAGA,KAAK,GAAG,GAA7B;UACD,CAJiB,EAIf,EAJe,CAAlB;QAKD;MACF,CARD;;MAUAa,EAAE;IACH,CAfM;;IAgBPH,IAAI,GAAG;MAEL,IAAG,CAAC,KAAK5B,KAAL,CAAWgC,MAAf,EAAuB;MAEvB,MAAMC,GAAG,GAAG,KAAKjC,KAAL,CAAWgC,MAAX,CAAkBE,UAAlB,CAA8B,IAA9B,CAAZ;MACA,IAAIC,CAAC,GAAG,CAAR;MACA,IAAIC,KAAK,GAAG,EAAZ;MACA,IAAIlB,KAAK,GAAG,CAAZ,CAPK,CAOS;;MACd,IAAImB,CAAC,GAAG,KAAKb,WAAL,CAAiBf,MAAzB;MACA,IAAI6B,CAAC,GAAGjB,IAAI,CAACkB,GAAL,CAASlB,IAAI,CAACC,KAAL,CAAWe,CAAC,GAAGD,KAAf,CAAT,EAAgC,CAAhC,CAAR;MAEAH,GAAG,CAACO,SAAJ,CAAc,CAAd,EAAiB,CAAjB,EAAoB,KAAKtB,KAAzB,EAAgC,EAAhC;;MAEA,KAAK,IAAI5D,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG+E,CAApB,EAAuB/E,CAAC,GAAGA,CAAC,GAAGgF,CAA/B,EAAkC;QAChCL,GAAG,CAACQ,SAAJ,GAAgB,SAAhB;QACAR,GAAG,CAACS,QAAJ,CAAapF,CAAC,GAAG,CAAJ,GAAQ4D,KAArB,EAA4B,KAAK,KAAKM,WAAL,CAAiBlE,CAAjB,IAAsB,CAAvD,EAA0D4D,KAA1D,EAAiE,KAAKM,WAAL,CAAiBlE,CAAjB,IAAsB,CAAtB,GAA0B,CAA3F;MACD;IAEF,CAlCM;;IAmCPqF,KAAK,GAAG;MACN,KAAK5D,KAAL,CAAW,SAAX;IACD;;EArCM;AAtDI,CAAf,E;;ACA2N,CAAgB,0HAAG,EAAC,C;;ACA/I;AACxC;AACL;AACnD,SAAS,2BAAY;;AAErB,eAAe,mBAAO,CAAC,MAAwE;AAC/F;;AAEA;;AAEA;AACgG;AAChG,IAAI,wBAAS,GAAG,8CAAU;AAC1B,EAAE,8CAAM;AACR,EAAE,8DAAM;AACR,EAAE,uEAAe;AACjB;AACA,EAAE,2BAAY;AACd;AACA;AACA;AACA;;AAEe,2EAAS,Q;;ACvBxB,IAAI,sDAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,qBAAqB,YAAY,4BAA4B,YAAY,6BAA6B,8BAA8B,gBAAgB,0BAA0B,GAAG,gBAAgB,2BAA2B,cAAc,OAAO,sCAAsC,KAAK,qBAAqB,+BAA+B,6CAA6C,yBAAyB,+BAA+B,gBAAgB,0BAA0B,8DAA8D;AACvoB,IAAI,+DAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmDnB;;AAGA,WAAW,mBAAO,CAAC,MAAY;;AAE/B,IAAI,oCAAM,OAAO,+BAAM;AAER;EACf5F,cADA;EAEAS,cAFA;EAGAR;IAEAwJ,gBAFA;IAGAlI,iBAHA;IAKAmI,kBALA;IAOAC;MACAC,WADA;MAEAjI;IAFA,CAPA;IAYAH;MACAG,WADA;MAEAiI;IAFA,CAZA;IAgBAnI;MACAE,YADA;MAEAiI,gBACA;IAHA;EAhBA,CAHA;EA2BA1J;IACA;MACA2J;IADA;EAGA,CA/BA;EAiCA/H;IACAgI;MACA;IACA;;EAHA,CAjCA;EAuCAC,gBAEA,CAzCA;EA0CA3J;IAEA4J;MACA;MAEA;QACA5G;UAEA6G;YACAC,uBADA;YAEAC;UAFA;QAKA,CAPA;;QAQA/G;MACA,CAVA;IAaA,CAlBA;IAmBA9B;MAAA;;MACAgD;MACAA;MAEA;MACA;MAEA;MAEA;MAEA;MAEA8F;QAEA;;QAEA;UAEAC;YACA1G,YADA;YAEAwG,UAFA;YAGAvJ;UAHA;UAMA0J;UAEA;QACA;;QAEA;UAEAC;UAEA;QAEA,CANA,EAMAhH,IANA,CAMArD;UAEAmK;UACAC;QAEA,CAXA,EAWA5G,KAXA,CAWAqC;UAEAsE;YACA1G,QADA;YAEAwG,UAFA;YAGAvJ;UAHA;UAMA0J;QAEA,CArBA;MAuBA,CAxCA,EAwCAE;QAEA;QACAH;MAEA,CA7CA;IA+CA,CA/EA;IAiFAI;MACA;QACA;MACA;;MAEA;QACA;MACA;IACA,CAzFA;IA2FAC;MACA;QACA;MACA;;MAEA;QACA;MACA;IAEA,CApGA;IAqGAC;MACA;IACA,CAvGA;IAwGAC;MACA;MACA;MAEA;IACA,CA7GA;IA8GAC;MAEA;QACA;MACA;;MAEA;IACA,CArHA;IAsHAC;MAEA;QACA;MACA;;MAEA;IACA,CA7HA;IA8HAC;MACA;IACA,CAhIA;IAiIAC;MACA;QAEA;QAEA;UAGA;QACA,CAJA,EAIAtH,KAJA,CAIAqC;UACA;QACA,CANA;MAQA;;MACA;IACA,CAhJA;IAiJAkF;MAEA;QACA/K;QAEA;MACA,CAJA,EAIAqD,IAJA,CAIArD;QAEA;UACAA;UAEA;QACA,CAJA;;QAMA;UAEA;UAEA;YAEAA;YAEA;UACA,CALA,EAKAwD,KALA,CAKAqC;YACA;UACA,CAPA;QASA;;QACA;MACA,CA3BA;IA8BA;EAjLA;AA1CA,G;;AC3D6V,CAAgB,wGAAG,EAAC,C;;ACAjR;AACvC;AACL;AACpD,SAAS,mBAAY;;AAErB,eAAe,mBAAO,CAAC,MAAuE;AAC9F;;AAEA;;AAEA;AACgG;AAChG,IAAI,gBAAS,GAAG,8CAAU;AAC1B,EAAE,qCAAM;AACR,EAAE,sDAAM;AACR,EAAE,+DAAe;AACjB;AACA,EAAE,mBAAY;AACd;AACA;AACA;AACA;;AAEe,2DAAS,Q;;;;;;;ACvBxB;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACe;EACd/F,IAAI,EAAE,WADQ;EAEdC,KAAK,EAAE;IACNiL,IAAI,EAAEC,MADA;IAENC,CAAC,EAAEC,MAFG;IAGNC,aAAa,EAAEH;EAHT,CAFO;EAQd7K,UAAU,EAAE;IAAEiL,sBAAF;IAAcC,yBAAd;IAAwBC,mCAAxB;IAAiCC,8BAAjC;IAAiDC,wBAAjD;IAA8DrK,cAAMA;EAApE,CARE;EAUdpB,IAAI,EAAE,YAAY;IAEjB,OAAO;MACNoB,MAAM,EAAE,IADF;MAENsK,IAAI,EAAE,EAFA;MAGN/B,OAAO,EAAE,KAHH;MAINjJ,IAAI,EAAE,EAJA;MAKNuJ,IAAI,EAAE,EALA;MAMN0B,QAAQ,EAAE,EANJ;MAON7K,KAAK,EAAE,KAPD;MAQN8K,QAAQ,EAAE,KARJ;MASNC,MAAM,EAAE,EATF;MAUNC,cAAc,EAAE,IAVV;MAWNC,UAAU,EAAEZ,MAXN;MAYNa,aAAa,EAAE,EAZT;MAaNC,QAAQ,EAAE,IAbJ;MAcNC,YAAY,EAAE,CAdR;MAeNC,MAAM,EAAE,IAfF;MAgBNC,aAAa,EAAE,EAhBT;MAiBNvH,WAAW,EAAE,KAjBP;MAmBNwH,aAAa,EAAE,IAnBT;MAoBNC,YAAY,EAAE,IApBR;MAqBNC,aAAa,EAAE,IArBT;MAuBN/E,UAAU,EAAE,CAvBN;MAwBNgF,QAAQ,EAAE,IAxBJ;MAyBNC,aAAa,EAAE,CAzBT;MA0BNC,kBAAkB,EAAE,KA1Bd;MA2BN1H,gBAAgB,EAAE,KA3BZ;MA6BN2H,6BAA6B,EAAE;IA7BzB,CAAP;EAgCA,CA5Ca;EA+CdlM,KAAK,EAAE;IACNmM,gBAAgB,EAAE;MACjB;MACAhM,OAAO,EAAE,YAAY,CACpB;IAHgB,CADZ;IAMN8D,QAAQ,EAAE,YAAY;MAErB,IAAI,CAAC,KAAKA,QAAL,CAAc0C,MAAnB,EAA2B;QAC1B,KAAK8E,YAAL,GAAoB,CAApB;MACA,CAFD,MAEO;QACN,IAAI,KAAKA,YAAL,GAAoB,KAAKxH,QAAL,CAAc0C,MAAd,GAAuB,CAA/C,EAAkD;UACjD,KAAK8E,YAAL,GAAoB,KAAKxH,QAAL,CAAc0C,MAAd,GAAuB,CAA3C;QACA;MACD;IAGD;EAjBK,CA/CO;;EAmEd9B,aAAa,GAAG;IACf,IAAI,KAAKgH,YAAT,EACC,KAAKA,YAAL,CAAkBO,KAAlB;EACD,CAtEa;;EAwEdjL,QAAQ,EAAE;IACTkL,WAAW,GAAG;MACb,OAAO,KAAKC,MAAL,CAAY1H,KAAZ,CAAkB2H,oBAAzB;IACA,CAHQ;;IAKTC,OAAO,EAAE,YAAY;MACpB,OAAO,KAAKF,MAAL,CAAY1H,KAAZ,CAAkB6H,OAAzB;IACA,CAPQ;IAQTC,aAAa,EAAG,YAAU;MACzB,OAAO,KAAKJ,MAAL,CAAY1H,KAAZ,CAAkB8H,aAAzB;IACA,CAVQ;IAWTC,SAAS,EAAE,YAAY;MACtB,IAAIA,SAAS,GAAG,EAAhB;;MAGA,IAAI,CAAC,KAAKhC,aAAV,EAAyB;QAExB,IAAIrJ,MAAM,CAACsL,iBAAP,IAA4BtL,MAAM,CAACsL,iBAAP,CAAyBxL,MAAzB,CAAgCyL,mBAAhC,EAAhC,EAAuF;UACtFF,SAAS,CAACG,IAAV,CAAe;YACdC,KAAK,EAAE,qBADO;YAEdC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,yBAAb,CAFO;YAGdC,IAAI,EAAE;UAHQ,CAAf;QAMA,CAPD,MAQK;UACJR,SAAS,CAACG,IAAV,CAAe;YACdC,KAAK,EAAE,eADO;YAEdC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,yBAAb,CAFO;YAGdC,IAAI,EAAE,eAHQ;YAKdxM,MAAM,EAAE;cACPC,QAAQ,EAAE,IADH;cAEPC,UAAU,EAAE,CAAC,KAAD,EAAQ,MAAR,EAAgB,KAAhB,EAAuB,MAAvB,CAFL;cAGPmI,OAAO,EAAE,GAHF;cAIPlI,MAAM,EAAE;gBACPC,MAAM,EAAE;kBACPC,IAAI,EAAE;gBADC;cADD;YAJD;UALM,CAAf;QAgBA;;QAID2L,SAAS,CAACG,IAAV,CAAe;UACdC,KAAK,EAAE,aADO;UAEdC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,iBAAb,CAFO;UAGdC,IAAI,EAAE,oBAHQ;UAKdxM,MAAM,EAAE;YACPC,QAAQ,EAAE,IADH;YAEPC,UAAU,EAAE,EAFL;YAGPmI,OAAO,EAAE,EAHF;YAIPlI,MAAM,EAAE;cACPC,MAAM,EAAE;gBACPC,IAAI,EAAE;cADC;YADD;UAJD;QALM,CAAf;MAgBA;;MAGD,IAAI,KAAKoM,WAAL,IAAoB,CAAC,KAAKV,aAA9B,EAA6C;QAC5CC,SAAS,CAACU,OAAV,CAAkB;UACjBN,KAAK,EAAE,wBADU;UAEjBC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,kBAAb,CAFU;UAGjBC,IAAI,EAAE;QAHW,CAAlB;MAKA;;MAED,OAAOR,SAAP;IACA,CA1EQ;IA2ET,GAAGhI,oCAAQ,CAAC,CACX,OADW,CAAD,CA3EF;IA+ET2I,QAAQ,EAAE,YAAY;MAGrB,IAAI,CAAC,KAAK/C,IAAV,EAAgB,OAAO,EAAP;MAEhB,OAAO,KAAKgD,IAAL,CAAUC,IAAV,CAAeC,aAAf,CAA6B,KAAKlD,IAAL,CAAUmD,MAAvC,EAA+C,kBAA/C,CAAP;IAEA,CAtFQ;IAwFTN,WAAW,EAAE,YAAY;MACxB,OAAOrJ,4BAAC,CAAC4J,IAAF,CAAOrM,MAAP,EAAe,2CAAf,CAAP;IACA,CA1FQ;IA4FTsM,MAAM,EAAE,YAAY;MACnB,IAAI,KAAKnD,CAAT,EAAY;QACX,OAAO9C,CAAC,CAACkG,GAAF,CAAM,KAAKpD,CAAL,CAAOqD,KAAP,CAAa,GAAb,CAAN,EAA0BrD,CAAD,IAAO;UACtC,OAAOA,CAAP;QACA,CAFM,CAAP;MAGA;;MAED,OAAO,EAAP;IACA,CApGQ;IAqGTsD,MAAM,EAAE,YAAY;MACnB,IAAI,KAAKtD,CAAT,EAAY;QACX,OAAO9C,CAAC,CAACkG,GAAF,CAAM,KAAKpD,CAAL,CAAOqD,KAAP,CAAa,GAAb,CAAN,EAA0BrD,CAAD,IAAO;UACtC,OAAO,KAAK8C,IAAL,CAAUS,IAAV,CAAeC,QAAf,CAAwBxD,CAAxB,CAAP;QACA,CAFM,CAAP;MAGA;;MAED,OAAO,EAAP;IACA,CA7GQ;IA8GTyD,SAAS,EAAE,YAAY;MACtB,IAAIC,EAAE,GAAG,KAAKC,MAAL,CAAYC,KAAZ,CAAkBF,EAA3B;MACA,OAAO,KAAK7B,MAAL,CAAY1H,KAAZ,CAAkB0J,QAAlB,CAA2BH,EAA3B,CAAP;IACA,CAjHQ;IAkHTI,OAAO,EAAE,YAAY;MAEpB,IAAI,CAAC,KAAKhE,IAAV,EAAgB;QACf,IAAI,KAAKE,CAAT,EAAY,OAAO,KAAKsD,MAAZ;QACZ,OAAO,EAAP;MACA;;MAED,OAAOpG,CAAC,CAACkG,GAAF,CAAMlG,CAAC,CAAC6G,MAAF,CAAS,KAAKjE,IAAL,CAAUkE,YAAV,CAAuBC,UAAvB,EAAT,EAA8C,UAAUC,CAAV,EAAaC,CAAb,EAAgB;QAC1E,OAAOD,CAAC,CAACE,UAAF,KAAiB,QAAxB;MACA,CAFY,CAAN,EAEH,UAAUpE,CAAV,EAAa;QAChB,OAAOA,CAAC,CAACW,MAAT;MACA,CAJM,CAAP;IAKA,CA9HQ;IAgIT0D,MAAM,EAAE,YAAY;MAEnB,IAAI,CAAC,KAAKvE,IAAV,EAAgB,OAAO,EAAP;MAEhB,IAAImD,MAAM,GAAG,KAAKnD,IAAL,CAAUmD,MAAvB;MACA,IAAIqB,IAAI,GAAG,IAAX;MACA,IAAIC,GAAG,GAAG,EAAV;MACA,IAAIC,OAAO,GAAG,CAAd;MAEA,KAAK1E,IAAL,CAAUkE,YAAV,CAAuBC,UAAvB,GAAoCQ,OAApC,CAA4C,UAAUlB,IAAV,EAAgB;QAC3D,IAAIA,IAAI,CAACa,UAAL,KAAoB,MAAxB,EAAgC;UAC/BG,GAAG,CAAClC,IAAJ,CAASkB,IAAI,CAAC5C,MAAd;QACA;MACD,CAJD;MAMA,OAAO4D,GAAP;IACA,CAhJQ;IAkJT/K,QAAQ,EAAE,YAAY;MAErB,IAAI,KAAKuH,QAAL,KAAkB,IAAtB,EAA4B,OAAO,EAAP;MAC5B,IAAI,KAAKA,QAAL,KAAkB,EAAtB,EAA0B,OAAO,KAAK8B,QAAZ;MAE1B,IAAI6B,KAAK,GAAG,KAAK3D,QAAL,CAAc4D,WAAd,EAAZ;;MAEA,IAAI3E,CAAC,GAAG9C,CAAC,CAAC6G,MAAF,CAAS,KAAKlB,QAAd,EAAwB,UAAU7C,CAAV,EAAa;QAC5C,OAAOA,CAAC,CAACpL,IAAF,CAAO+P,WAAP,GAAqBC,OAArB,CAA6BF,KAA7B,KAAuC,CAAvC,IAA4C1E,CAAC,CAACpL,IAAF,CAAO+P,WAAP,MAAwBD,KAA3E;MACA,CAFO,CAAR;;MAIA,OAAO1E,CAAP;IAEA,CA/JQ;IAiKT6E,WAAW,EAAE,YAAY;MACxB,IAAI,KAAKrL,QAAL,CAAc0C,MAAlB,EAA0B;QACzB,OAAO,KAAK1C,QAAL,CAAc,KAAKwH,YAAL,IAAqB,CAAnC,CAAP;MACA;;MAED,OAAO,IAAP;IACA;EAvKQ,CAxEI;;EAkPdrC,OAAO,GAAG,CAET,CApPa;;EAsPd;EAEAjF,OAAO,GAAG;IACT,KAAK9D,KAAL,GAAa,IAAb;;IAGA,IAAI,CAAC,KAAKkK,IAAN,IAAc,KAAKgD,IAAL,CAAUC,IAAV,CAAe+B,MAAjC,EAAyC;MACxC,KAAKC,OAAL,GAAezM,KAAf,CAAqBqC,CAAC,IAAI;QACzB,OAAOqK,OAAO,CAACnG,OAAR,EAAP;MACA,CAFD;IAGA;EAED,CAlQa;;EAoQd7J,OAAO,EAAE;IACRiQ,IAAI,EAAE,YAAY;MACjB,OAAO,KAAKC,EAAL,CAAQC,MAAR,CAAe,MAAM;QAC3B,OAAO,KAAKrC,IAAL,CAAUC,IAAV,CAAe+B,MAAf,IAAyB,KAAKhC,IAAL,CAAUC,IAAV,CAAeqC,MAA/C;MACA,CAFM,CAAP;IAGA,CALO;IAORC,SAAS,EAAE,UAAUC,QAAV,EAAoB;MAE9BA,QAAQ,GAAG,KAAKtE,YAAL,EAAH,GAAyB,KAAKA,YAAL,EAAjC;;MAEA,IAAI,KAAKA,YAAL,GAAoB,KAAKxH,QAAL,CAAc0C,MAAd,GAAuB,CAA/C,EAAkD;QACjD,KAAK8E,YAAL,GAAoB,CAApB;MACA;;MAED,IAAI,KAAKA,YAAL,GAAoB,CAAxB,EAA2B;QAC1B,KAAKA,YAAL,GAAoB,KAAKxH,QAAL,CAAc0C,MAAd,GAAuB,CAA3C;MACA;IAED,CAnBO;IAqBRqJ,gBAAgB,EAAE,YAAY;MAC7B,KAAKC,UAAL,CAAgB,KAAKhM,QAAL,CAAc,KAAKwH,YAAL,IAAqB,CAAnC,CAAhB;IACA,CAvBO;IAyBRwE,UAAU,EAAE,YAAqB;MAAA,IAAXjC,IAAW,uEAAJ,EAAI;MAChC,IAAI3O,IAAI,GAAG2O,IAAI,CAAC3O,IAAL,IAAa,EAAxB;MAEA,KAAK6G,KAAL,CAAW,UAAX,EAAuBpC,SAAvB,CAAiCzE,IAAjC;IACA,CA7BO;IA+BR6Q,WAAW,EAAE,UAAUf,KAAV,EAAiB;MAC7B,KAAK3D,QAAL,GAAgB2D,KAAhB;IACA,CAjCO;IAmCRgB,gBAAgB,EAAE,UAAU1D,OAAV,EAAmB2D,MAAnB,EAA2B;MAC5C,KAAKA,MAAL,EAAa3D,OAAb;IACA,CArCO;IAwCR4D,WAAW,EAAE,UAAU9G,MAAV,EAAkB;MAE9B,IAAI+G,KAAK,GAAG/G,MAAM,CAACuE,KAAP,CAAa,GAAb,EAAkB,CAAlB,EAAqBA,KAArB,CAA2B,GAA3B,EAAgC,CAAhC,CAAZ;MACA,IAAIhN,MAAM,GAAG,IAAIyP,+BAAJ,EAAb;MAEA,OAAOzP,MAAM,CAACC,MAAP,CAAc,KAAd,EAAqBwI,MAArB,EAA6B,IAA7B,EAAmC,IAAnC,EAAyC+G,KAAzC,EAAgD,IAAhD,EAAsD1N,IAAtD,CAA2D2G,MAAM,IAAI;QAE3E,OAAOkG,OAAO,CAACnG,OAAR,CAAgBC,MAAhB,CAAP;MACA,CAHM,EAGJxG,KAHI,CAGEqC,CAAC,IAAI;QACb,OAAOqK,OAAO,CAACe,MAAR,CAAepL,CAAf,CAAP;MACA,CALM,CAAP;IAMA,CAnDO;IAqDRqL,mBAAmB,EAAE,YAAY;MAChC,IAAI7G,MAAM,GAAG,EAAb;MAEA,KAAK1D,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;MAEArP,MAAM,CAACsL,iBAAP,CAAyBgE,QAAzB,CAAkCC,EAAlC,CAAqCC,WAArC,CAAiD;QAChDlQ,QAAQ,EAAE,IADsC;QAGhDwP,MAAM,EAAE,OAAa9G,OAAb,KAAyB;UAAA,IAAxB;YAAEC;UAAF,CAAwB;UAGhC,OAAO,KAAK8G,WAAL,CAAiB9G,MAAjB,EAAyB3G,IAAzB,CAA8B2G,MAAM,IAAI;YAE9C,OAAOxF,4BAAC,CAACgN,MAAF,CAASC,MAAT,CAAgBzH,MAAhB,EAAwB3G,IAAxB,CAA6B4G,IAAI,IAAI;cAC3C,IAAIjK,IAAI,GAAG;gBACVgK,MADU;gBAEVC;cAFU,CAAX;cAKAI,MAAM,CAACkD,IAAP,CAAYvN,IAAZ;cAEA,KAAK0R,cAAL,CAAoB,IAApB,EAA0B1R,IAA1B;cAEA+J,OAAO;YACP,CAXM,CAAP;UAaA,CAfM,EAeJvG,KAfI,CAeEqC,CAAC,IAAI;YACbI,OAAO,CAACxC,KAAR,CAAcoC,CAAd;YACAkE,OAAO;UACP,CAlBM,CAAP;QAoBA,CA1B+C;QA4BhD4H,SAAS,EAAGC,IAAD,IAAU;UACpB,KAAKC,iBAAL;QACA;MA9B+C,CAAjD;IAgCA,CA1FO;IA4FRC,sBAAsB,EAAE,YAAY;MAEnC,KAAKC,aAAL,GAAqB,KAArB;;MAEA,IAAIC,KAAK,GAAG5J,CAAC,CAAC6G,MAAF,CAAS7G,CAAC,CAACkG,GAAF,CAAM,KAAKiB,MAAX,EAAoB0C,CAAD,IAAO;QAC9C,OAAO,KAAK7B,EAAL,CAAQhC,IAAR,CAAa,IAAb,EAAmB,wBAAwB,KAAKgC,EAAL,CAAQ8B,WAAR,CAAoBD,CAApB,CAA3C,KAAsE,IAA7E;MACA,CAFoB,CAAT,EAEPE,CAAD,IAAO;QAAA;;QACV,OAAOA,CAAC,IAAIA,CAAC,CAACC,MAAP,IAAiBD,CAAC,CAACvD,EAAF,8BAAQ,KAAKZ,IAAL,CAAUS,IAAV,CAAe4D,QAAvB,0DAAQ,sBAAyBzD,EAAjC,CAAxB;MACA,CAJW,CAAZ;;MAMA,IAAI,CAACoD,KAAK,CAAC5K,MAAX,EAAmB;QAElB,OAAO,cAAP;MACA;;MAED,IAAI4K,KAAK,CAAC5K,MAAN,GAAe,CAAnB,EAAsB;QAErB,KAAK4G,IAAL,CAAUsE,KAAV,CAAgBC,MAAhB,CAAuB,UAAvB,EAAmC;UAClCC,OAAO,EAAE,KAAK9E,KAAL,CAAWC,CAAX,CAAa,2BAAb,CADyB;UAElClM,IAAI,EAAE,gBAF4B;UAGlCzB,IAAI,EAAE;YACLgS,KAAK,EAAEA,KADF;YAELnB,MAAM,EAAE,iBAFH;YAGL4B,YAAY,EAAGxJ,CAAD,IAAO;cACpB,KAAK2H,gBAAL,CAAsB3H,CAAtB,EAAyB,iBAAzB;YACA;UALI;QAH4B,CAAnC;QAYA;AACJ;AACA;AACA;MACI,CAlBD,MAkBO;QACN,KAAKyJ,eAAL,CAAqBV,KAAK,CAAC,CAAD,CAA1B;MACA;;MAGD,KAAKrL,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;IAEA,CApIO;IAsIRsB,eAAe,EAAE,UAAUjE,IAAV,EAAgB;MAChC,IAAIkE,GAAG,GAAG,KAAK9E,WAAf,CADgC,CAGhC;;MAEA8E,GAAG,CAAC;QACHC,MAAM,EAAE,KAAK5H,IAAL,CAAUmD,MADf;QAEH0E,OAAO,EAAEpE,IAAI,CAAC2D,MAAL,CAAYS;MAFlB,CAAD,CAAH;MAKA;AACH;AACA;AACA;AACA;IAEG,CAtJO;IAwJRC,aAAa,EAAE,YAAY;MAC1B,KAAKpN,KAAL,CAAW,YAAX;MACA,KAAKtE,MAAL,GAAc,IAAd;IACA,CA3JO;;IA6JR2R,aAAa,GAAG;MACf,KAAK3R,MAAL,GAAc,KAAd;IACA,CA/JO;;IAiKR4R,OAAO,EAAE,UAAUC,GAAV,EAAe;MACvB,KAAKvN,KAAL,CAAW,YAAX,EAAyBuN,GAAzB;IACA,CAnKO;;IAqKRhD,OAAO,GAAG;MAET,IAAI,KAAK/E,CAAT,EAAY;QACX,KAAK6B,MAAL,CAAY1H,KAAZ,CAAkB6N,eAAlB,GAAoC,IAApC;QACA,IAAIxE,QAAQ,GAAG,IAAf;QACA,IAAIyE,UAAU,GAAG,IAAjB;QACA,IAAInI,IAAI,GAAG,IAAX;QACA,IAAI4D,EAAE,GAAG,EAAT;QAEA,KAAKhD,QAAL,GAAgB,IAAhB;QACA,OAAO,KAAKoC,IAAL,CAAUS,IAAV,CAAe2E,SAAf,CAAyB,KAAK/E,MAA9B,EAAsChL,IAAtC,CAA2CgQ,IAAI,IAAI;UAEzD,IAAI,KAAKhF,MAAL,CAAYjH,MAAZ,IAAsB,CAA1B,EAA6B;YAE5B,IAAIkM,KAAK,GAAGD,IAAI,CAAC,CAAD,CAAhB;;YAEA,IAAI,CAACC,KAAD,IAAU,CAACA,KAAK,CAACC,IAAjB,IAAyBD,KAAK,CAACC,IAAN,CAAWnM,MAAX,GAAoB,EAAjD,EAAqD;cAEpD,KAAK1B,KAAL,CAAW,gBAAX;cACA,OAAOwK,OAAO,CAACe,MAAR,CAAe,KAAf,CAAP;YAEA;UACD;;UAED,IAAI,KAAKjD,IAAL,CAAUS,IAAV,CAAe4D,QAAf,CAAwBkB,IAAxB,CAA6BnM,MAA7B,GAAsC,EAA1C,EAA8C;YAC7C,KAAK1B,KAAL,CAAW,gBAAX;YACA,OAAOwK,OAAO,CAACe,MAAR,CAAe,KAAf,CAAP;UACA,CAjBwD,CAoBzD;;;UAEArC,EAAE,GAAG,KAAKZ,IAAL,CAAUC,IAAV,CAAeuF,GAAf,CAAmBC,SAAnB,CAA6BJ,IAAI,CAAC,CAAD,CAAjC,EAAsC,KAAKrF,IAAL,CAAUS,IAAV,CAAe4D,QAArD,CAAL;UAEA3D,QAAQ,GAAG,KAAKV,IAAL,CAAUS,IAAV,CAAeC,QAAf,CAAwB2E,IAAI,CAAC,CAAD,CAAJ,CAAQzE,EAAhC,CAAX;UACAuE,UAAU,GAAG,KAAKnF,IAAL,CAAUS,IAAV,CAAeC,QAAf,CAAwB,KAAKV,IAAL,CAAUS,IAAV,CAAe4D,QAAf,CAAwBzD,EAAhD,CAAb;UAEA,IAAI8E,YAAY,GAAG,CAAC;YACnB,QAAQ,iBADW;YAEnB,aAAa,EAFM;YAGnB,WAAW;cACVC,SAAS,EAAE;YADD;UAHQ,CAAD,CAAnB;UAQA,OAAO,KAAK3F,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsB4D,UAAtB,CACN;YACCC,eAAe,EAAEjF,EADlB;YAECkF,UAAU,EAAE,SAFb;YAGCC,MAAM,EAAE,CAACrF,QAAD,CAHT;YAIC5O,IAAI,EAAE,MAAM8O,EAJb;YAKCoF,aAAa,EAAEN;UALhB,CADM,CAAP;QAWA,CA9CM,EA8CJrQ,IA9CI,CA8CC4Q,KAAK,IAAI;UAEhBjJ,IAAI,GAAGiJ,KAAP;UACA,KAAKlH,MAAL,CAAY1H,KAAZ,CAAkB6N,eAAlB,GAAoC,KAApC;UAEA,IAAIgB,MAAM,GAAG,KAAKlG,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsBmE,OAAtB,CAA8BF,KAAK,CAACG,OAApC,CAAb;UACA,IAAIhQ,KAAK,GAAG8P,MAAM,CAAChF,YAAP,CAAoBmF,cAApB,CAAmC,qBAAnC,CAAZ;UAEA,OAAO,KAAKrG,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsBsE,aAAtB,CAAoCtJ,IAAI,CAACoJ,OAAzC,EAAkD1F,QAAlD,EAA4D,GAA5D,EAAiEtK,KAAK,CAAC,CAAD,CAAtE,EAA2EZ,KAA3E,CAAiFqC,CAAC,IAAI,CAC5F,CADM,CAAP;QAGA,CAzDM,EAyDJxC,IAzDI,CAyDC8O,CAAC,IAAI;UACZ,KAAKvG,QAAL,GAAgB,KAAhB;;UAGA,IAAI,KAAKqB,OAAL,IAAgB,KAAKA,OAAL,IAAgB2B,EAApC,EAAwC;YACvC,KAAK2F,SAAL;UACA;;UAED,KAAKxH,MAAL,CAAYwF,MAAZ,CAAmB,SAAnB,EAA8B,KAA9B;UAEA,OAAOrC,OAAO,CAACnG,OAAR,EAAP;QAEA,CArEM,EAqEJvG,KArEI,CAqEEqC,CAAC,IAAI;UAEb,KAAK+F,QAAL,GAAgB,KAAhB;UAEA,KAAKmB,MAAL,CAAY1H,KAAZ,CAAkB6N,eAAlB,GAAoC,KAApC;;UAEA,IAAIrN,CAAC,IAAIA,CAAC,CAAC2O,OAAF,IAAa,eAAtB,EAAuC;YAEtC,OAAO,KAAKxG,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsByE,QAAtB,CAA+B,MAAM7F,EAAN,GAAW,GAAX,GAAiB,KAAKZ,IAAL,CAAUC,IAAV,CAAeyG,OAAf,CAAuBC,OAAvB,CAA+B,UAA/B,EAA2C,EAA3C,CAAhD,EAAgGtR,IAAhG,CAAqG,MAAM,CACjH,CADM,EACJG,KADI,CACEqC,CAAC,IAAI,CAEb,CAHM,CAAP;UAKA;;UAED,OAAOqK,OAAO,CAACe,MAAR,CAAepL,CAAf,CAAP;QAEA,CAtFM,CAAP;MAwFA,CAhGD,MAgGO;QACN,OAAOqK,OAAO,CAACe,MAAR,CAAe,GAAf,CAAP;MACA;IAED,CA3QO;;IA6QR2D,cAAc,GAAG;MAChB,OAAO,KAAK5J,IAAL,IAAa,KAAKA,IAAL,CAAU4J,cAAV,EAApB;IACA,CA/QO;;IAiRRL,SAAS,GAAG;MACX,KAAK1T,IAAL,CAAU,IAAV,EAAgBwC,IAAhB,CAAqB8O,CAAC,IAAI;QACzB,OAAOjC,OAAO,CAACnG,OAAR,CAAgBoI,CAAhB,CAAP;MACA,CAFD;IAGA,CArRO;;IAuRR0C,SAAS,CAACnU,IAAD,EAAO;MAEf,KAAKG,IAAL,CAAUH,IAAV,EAAgB2C,IAAhB,CAAqB8O,CAAC,IAAI;QAEzB,OAAOjC,OAAO,CAACnG,OAAR,CAAgBoI,CAAhB,CAAP;MAEA,CAJD;IAMA,CA/RO;;IAiSR2C,YAAY,EAAE,UAAUpU,IAAV,EAAgBqU,KAAhB,EAAuB;MACpCrU,IAAI,GAAGA,IAAI,CAACsU,IAAL,EAAP;MACA,IAAItU,IAAI,CAAC0G,MAAL,IAAe2N,KAAnB,EAA0B,OAAOrU,IAAP;MAE1BA,IAAI,GAAGA,IAAI,CAACuU,KAAL,CAAW,CAAX,EAAcF,KAAd,CAAP;MAEA,OAAOrU,IAAI,CAACsU,IAAL,KAAc,KAArB;IACA,CAxSO;;IA0SRE,eAAe,CAACxU,IAAD,EAAO;MAErB0H,CAAC,CAAC8B,IAAF,CAAO,KAAK6D,QAAZ,EAAsB,UAAUU,IAAV,EAAgB;QACrC/N,IAAI,GAAGA,IAAI,CAACiU,OAAL,CAAa,IAAIQ,MAAJ,CAAW,MAAM1G,IAAI,CAAC3O,IAAtB,EAA4B,GAA5B,CAAb,EAA+C,MAAM2O,IAAI,CAACG,EAAX,GAAgB,GAAhB,GAAsBH,IAAI,CAAC3O,IAA1E,CAAP;MACA,CAFD;;MAIA,OAAOY,IAAP;IACA,CAjTO;;IAmTRG,IAAI,CAACH,IAAD,EAAO;MAEV,IAAI,CAAC,KAAKsK,IAAV,EAAgB;QACf,KAAKiF,OAAL,GAAezM,KAAf,CAAqBqC,CAAC,IAAI,CACzB,CADD;MAEA,CALS,CAOV;MAEA;MAEA;;;MAEA,KAAKH,KAAL,CAAW,SAAX;;MAGA,IAAI,CAAC,KAAK0F,aAAV,EAAyB;QACxB,KAAK7I,KAAL;MACA;;MAED,OAAO,KAAK6N,EAAL,CAAQC,MAAR,CAAe,MAAM;QAE3B,OAAO,KAAKrF,IAAL,IAAa,CAAC,KAAKY,QAA1B;MAEA,CAJM,EAIJvI,IAJI,CAIE8O,CAAD,IAAO;QAEd,KAAKzM,KAAL,CAAW,MAAX;QAEAhF,IAAI,GAAG,KAAKwU,eAAL,CAAqBxU,IAArB,CAAP;;QAEA,IAAI,KAAK0K,aAAT,EAAwB;UAEvB,IAAI,KAAKA,aAAL,CAAmB3J,IAAnB,IAA2B,WAA3B,IAA0C,KAAK2J,aAAL,CAAmBhH,KAAjE,EAAwE;YAEvE,OAAO,KAAK4J,IAAL,CAAUC,IAAV,CAAemH,SAAf,CAAyB,KAAKpK,IAA9B,EAAoCtK,IAApC,EAA0C2C,IAA1C,CAA+C8O,CAAC,IAAI;cAE1DA,CAAC,CAAC,cAAD,CAAD,GAAoB;gBACnB,YAAY,WADO;gBAEnB,YAAY,KAAKnE,IAAL,CAAUC,IAAV,CAAeoH,YAAf,CAA4B,KAAKjK,aAAL,CAAmBhH,KAA/C,KAAyDI,4BAAC,CAAC8Q,MAAF;cAFlD,CAApB;cAKA,IAAIC,SAAS,GAAGpD,CAAhB;cAEA,KAAK/G,aAAL,CAAmBhH,KAAnB,CAAyBA,KAAzB,CAA+BoR,OAA/B,CAAuCC,IAAvC,GAA8CtD,CAAC,CAACsD,IAAhD;cACA,KAAKrK,aAAL,CAAmBhH,KAAnB,CAAyBA,KAAzB,CAA+BoR,OAA/B,CAAuCrU,KAAvC,GAA+CgR,CAAC,CAAChR,KAAjD;cACA,KAAKiK,aAAL,CAAmBhH,KAAnB,CAAyBA,KAAzB,CAA+BoR,OAA/B,CAAuCE,OAAvC,GAAiDvD,CAAC,CAACuD,OAAnD;cAEA,OAAO,KAAKtK,aAAL,CAAmBhH,KAAnB,CAAyBA,KAAzB,CAA+BuR,UAAtC;cACA,OAAO,KAAKvK,aAAL,CAAmBhH,KAAnB,CAAyBA,KAAzB,CAA+BwR,SAAtC;cAEA,OAAO,KAAK5H,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsB6F,SAAtB,CAAgC,KAAK7K,IAAL,CAAUmD,MAA1C,EAAkD,gBAAlD,EAAoEoH,SAApE,CAAP;YAEA,CAlBM,EAkBJlS,IAlBI,CAkBC8O,CAAC,IAAI;cAEZ,KAAKnE,IAAL,CAAUsE,KAAV,CAAgBwD,QAAhB,CAAyB,cAAzB;cAEA,KAAKpQ,KAAL,CAAW,oBAAX;cAEA,KAAKA,KAAL,CAAW,OAAX;cAEA,OAAOwK,OAAO,CAACnG,OAAR,EAAP;YACA,CA3BM,EA2BJvG,KA3BI,CA2BEqC,CAAC,IAAI;cAEbI,OAAO,CAACxC,KAAR,CAAcoC,CAAd;cACA,OAAOqK,OAAO,CAACe,MAAR,CAAepL,CAAf,CAAP;YACA,CA/BM,CAAP;UAiCA;QAED;;QAED,OAAO,KAAKmI,IAAL,CAAUC,IAAV,CAAe8H,QAAf,CAAwB,KAAK/K,IAA7B,EAAmCtK,IAAnC,EAAyC;UAAEsV,QAAQ,EAAE,KAAK5K;QAAjB,CAAzC,CAAP;MAEA,CArDM,EAqDJ5H,KArDI,CAqDEqC,CAAC,IAAI;QAGb,KAAKH,KAAL,CAAW,kBAAX,EAA+B;UAC9BjC,KAAK,EAAEoC;QADuB,CAA/B;MAIA,CA5DM,CAAP;IA8DA,CArYO;;IAuYRoQ,UAAU,CAACjW,IAAD,EAAO;MAChB,KAAKkW,SAAL,CAAe;QAAElM,MAAM,EAAEhK;MAAV,CAAf;IACA,CAzYO;;IA2YRkW,SAAS,EAAE,iBAA4B;MAAA,IAAlB;QAAElM,MAAF;QAAUC;MAAV,CAAkB;MAEtC,IAAI2E,EAAE,GAAGpK,4BAAC,CAAC8Q,MAAF,EAAT;MAEA,IAAIa,IAAI,GAAG;QACV1U,IAAI,EAAE,OADI;QAEVmN,EAAE,EAAEA,EAFM;QAGV5E,MAAM,EAAEA;MAHE,CAAX;MAMA,KAAKtE,KAAL,CAAW,aAAX,EAA0ByQ,IAA1B,EAVsC,CAWtC;;MACA,KAAK/F,EAAL,CAAQC,MAAR,CAAe,MAAM;QAEpB,OAAO,KAAKrF,IAAZ;MAEA,CAJD,EAIG3H,IAJH,CAIQ,MAAM;QACb,IAAI8S,IAAI,CAACC,OAAT,EACC,OAAOlG,OAAO,CAACe,MAAR,CAAe,SAAf,CAAP;QAED,OAAO,KAAKjD,IAAL,CAAUC,IAAV,CAAeiI,SAAf,CAAyB,KAAKlL,IAA9B,EAAoChB,MAApC,EAA4C,IAA5C,EAAkDmM,IAAlD,EAAwD;UAAEH,QAAQ,EAAE,KAAK5K;QAAjB,CAAxD,CAAP;MAEA,CAVD,EAUG/H,IAVH,CAUQ8O,CAAC,IAAI;QAEZ,KAAKzM,KAAL,CAAW,UAAX,EAAuB;UACtBkJ,EAAE,EAAEA;QADkB,CAAvB;QAIA,OAAOsB,OAAO,CAACnG,OAAR,EAAP;MAEA,CAlBD,EAkBGvG,KAlBH,CAkBSqC,CAAC,IAAI;QAEb,KAAKH,KAAL,CAAW,WAAX,EAAwB;UACvBkJ,EAAE,EAAEA,EADmB;UAEvBnL,KAAK,EAAEoC;QAFgB,CAAxB;QAKA,OAAOqK,OAAO,CAACnG,OAAR,EAAP;MAEA,CA3BD,EAZsC,CAwCtC;IAGA,CAtbO;IAwbRsM,kBAAkB,EAAE,UAAUpM,IAAV,EAAgB;MAEnC,IAAIqM,CAAC,GAAG,KAAK,IAAL,GAAY,IAApB;;MAEA,IAAI,CAAC,KAAKtL,IAAL,CAAUuL,OAAV,CAAkBC,YAAlB,EAAL,EAAuC;QACtC,OAAOtG,OAAO,CAACnG,OAAR,CAAgB,KAAhB,CAAP;MACA;;MAED,IAAIE,IAAI,CAACwM,IAAL,GAAYH,CAAhB,EAAmB;QAGlB,OAAO,KAAKI,OAAL,CAAaC,OAAb,CACN,6FADM,EACyF;UAC/FxT,MAAM,EAAE,KADuF;UAE/FC,UAAU,EAAE;QAFmF,CADzF,EAMLC,IANK,CAMCC,MAAD,IAAY;UAEjB,OAAO4M,OAAO,CAACnG,OAAR,CAAgB,IAAhB,CAAP;QAEA,CAVK,EAUHvG,KAVG,CAUGqC,CAAC,IAAI;UACb,OAAOqK,OAAO,CAACe,MAAR,CAAe,QAAf,CAAP;QACA,CAZK,CAAP;MAeA;;MAED,OAAOf,OAAO,CAACnG,OAAR,CAAgB,KAAhB,CAAP;IACA,CArdO;IAudR6M,QAAQ,EAAE,iBAAoB;MAAA,IAAV;QAAE3M;MAAF,CAAU;MAE7B,IAAI2E,EAAE,GAAGpK,4BAAC,CAAC8Q,MAAF,EAAT;MAEA,IAAIa,IAAI,GAAG;QACV1U,IAAI,EAAE,MADI;QAEVmN,EAAE,EAAEA,EAFM;QAGVyE,IAAI,EAAE;UACLvT,IAAI,EAAEmK,IAAI,CAACnK,IADN;UAEL2W,IAAI,EAAExM,IAAI,CAACwM;QAFN;MAHI,CAAX;MASA,KAAK/Q,KAAL,CAAW,aAAX,EAA0ByQ,IAA1B;MAEA,KAAK/F,EAAL,CAAQC,MAAR,CAAe,MAAM;QAEpB,OAAO,KAAKrF,IAAZ;MAEA,CAJD,EAIG3H,IAJH,CAIQ,MAAM;QAEb,OAAO,KAAKgT,kBAAL,CAAwBpM,IAAxB,CAAP;MAGA,CATD,EASG5G,IATH,CASSwT,MAAD,IAAY;QAEnB,OAAO,KAAK7I,IAAL,CAAUC,IAAV,CAAe2I,QAAf,CAAwB,KAAK5L,IAA7B,EAAmCf,IAAnC,EAAyCkM,IAAzC,EAA+C;UAAEH,QAAQ,EAAE,KAAK5K;QAAjB,CAA/C,EAAiFyL,MAAjF,CAAP;MAEA,CAbD,EAaGxT,IAbH,CAaQ,MAAM;QAEb,KAAKqC,KAAL,CAAW,UAAX,EAAuB;UACtBkJ,EAAE,EAAEA;QADkB,CAAvB;QAIA,OAAOsB,OAAO,CAACnG,OAAR,EAAP;MAEA,CArBD,EAqBGvG,KArBH,CAqBSqC,CAAC,IAAI;QAEbI,OAAO,CAACxC,KAAR,CAAcoC,CAAd;QAEA,KAAKH,KAAL,CAAW,WAAX,EAAwB;UACvBkJ,EAAE,EAAEA,EADmB;UAEvBnL,KAAK,EAAEoC;QAFgB,CAAxB;MAIA,CA7BD;IAgCA,CAtgBO;IAwgBRtD,KAAK,EAAE,YAAY;MAClB,IAAI,KAAKoE,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBpE,KAAvB;IACD,CA3gBO;IA6gBRL,OAAO,EAAE,YAAY;MACpB,KAAKwD,KAAL,CAAW,SAAX;IACA,CA/gBO;IAihBRlD,IAAI,EAAE,YAAY;MACjB,IAAI,KAAKmE,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBnE,IAAvB;IACD,CAphBO;IAshBRC,WAAW,EAAE,YAAY;MACxB,IAAI,KAAKkE,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBlE,WAAvB;IACD,CAzhBO;IA2hBRqU,MAAM,EAAE,YAAY,CACnB,CA5hBO;IA8hBR9U,OAAO,EAAE,UAAUtB,IAAV,EAAgB;MACxB,KAAKA,IAAL,GAAYA,IAAZ;MAEA,IAAI,KAAKiG,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuB3E,OAAvB,CAA+BtB,IAA/B;IACD,CAniBO;IAqiBR2D,KAAK,EAAE,UAAU0S,GAAV,EAAe;MACrB,IAAInH,KAAK,GAAGmH,GAAG,CAACC,MAAJ,CAAWpH,KAAvB;;MAEA,IAAIA,KAAK,KAAK,EAAd,EAAkB;QACjB,KAAKlK,KAAL,CAAW,YAAX,EAAyB,KAAzB;QACA;MACA,CAHD,MAGO;QACN,KAAKA,KAAL,CAAW,YAAX,EAAyB,IAAzB;MACA;;MAED,KAAKhF,IAAL,GAAYkP,KAAZ;MACA,KAAK7D,UAAL,GAAkBvH,4BAAC,CAACyS,MAAF,CAAS,KAAKvW,IAAd,CAAlB;;MAGA,IAAI,KAAKqL,UAAL,KAAoBmL,SAAxB,EAAmC;QAClC,KAAKxR,KAAL,CAAW,YAAX,EAAyB,KAAKqG,UAA9B;MACA,CAFD,MAEO;QACN,KAAKrG,KAAL,CAAW,YAAX,EAAyB,KAAzB;MACA;;MAED,IAAI,KAAKsF,IAAT,EACC,KAAKgD,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsBmH,UAAtB,CAAiC,KAAKnM,IAAL,CAAUmD,MAA3C,EAAmD,IAAnD,EAAyD,GAAzD;IACD,CA3jBO;;IA6jBRiJ,aAAa,CAACC,IAAD,EAAOC,SAAP,EAAkB;MAC9B,KAAKD,IAAI,CAAC7J,KAAV,EAAiB8J,SAAjB;IACA,CA/jBO;;IAikBRC,qBAAqB,EAAE,UAAU3H,KAAV,EAAiB;MAEvC,KAAKmC,aAAL,GAAqBnC,KAArB;MAEA,OAAO,KAAKmC,aAAZ;IACA,CAtkBO;;IAwkBRyF,WAAW,CAACH,IAAD,EAAOI,KAAP,EAAc,CAExB,CA1kBO;;IA4kBRC,WAAW,CAACL,IAAD,EAAO5T,KAAP,EAAc;MACxB,KAAKsJ,MAAL,CAAYwF,MAAZ,CAAmB,MAAnB,EAA2B;QAC1B3E,IAAI,EAAE,OADoB;QAE1B+J,OAAO,EAAElU,KAAK,CAAC/C;MAFW,CAA3B;IAIA,CAjlBO;;IAklBRkX,MAAM,GAAG;MACR,OAAO,KAAKhG,IAAL,GAAY,IAAnB;IACA,CAplBO;;IAqlBRiG,eAAe,CAACjI,KAAD,EAAQ;MACtB,IAAI,CAACA,KAAL,EAAY;QACX,KAAKjJ,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;MACA;IACD,CAzlBO;;IA0lBRM,cAAc,CAAC2F,IAAD,EAAOrX,IAAP,EAAa;MAC1B,MAAM8X,eAAe,GAAG,CAAC,WAAD,EAAc,YAAd,EAA4B,WAA5B,EAAyC,YAAzC,CAAxB;;MAGA,IAAI,CAACA,eAAe,CAACC,QAAhB,CAAyB/X,IAAI,CAACiK,IAAL,CAAUxI,IAAnC,CAAL,EAA+C;QAC9C,KAAKmV,QAAL,CAAc5W,IAAd;MACA,CAFD,MAEO;QACN,OAAO,KAAKkW,SAAL,CAAelW,IAAf,CAAP;MACA;IACD,CAnmBO;;IAomBRgY,OAAO,CAAC/N,IAAD,EAAO;MACb,MAAMgO,GAAG,GAAG,IAAIC,KAAJ,EAAZ;MACA,IAAIC,OAAO,GAAG,EAAd;MAEA,OAAO,IAAIjI,OAAJ,CAAY,CAACnG,OAAD,EAAUkH,MAAV,KAAqB;QAEvCgH,GAAG,CAACG,MAAJ,GAAa,YAAY;UACxBD,OAAO,CAACE,CAAR,GAAY,KAAKxQ,KAAjB;UACAsQ,OAAO,CAACG,CAAR,GAAY,KAAKC,MAAjB;UACAxO,OAAO,CAACoO,OAAD,CAAP;QACA,CAJD;;QAMAF,GAAG,CAACO,OAAJ,GAAc,UAAU3S,CAAV,EAAa;UAC1BoL,MAAM,CAACpL,CAAD,CAAN;QACA,CAFD;;QAIAoS,GAAG,CAACQ,GAAJ,GAAUxO,IAAI,CAACD,MAAf;MACA,CAbM,CAAP;IAeA,CAvnBO;;IAwnBR6H,iBAAiB,CAACwF,IAAD,EAAOhN,MAAP,EAAe;MAC/B,KAAK0C,MAAL,CAAY1H,KAAZ,CAAkBsE,OAAlB,GAA4B,KAA5B;MACA,KAAKhD,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;IACA,CA3nBO;;IA6nBRsH,oBAAoB,CAACpO,GAAD,EAAM;MAEzB,IAAIA,GAAG,IAAI,aAAP,IAAyBA,GAAG,CAACqO,QAAJ,IAAgBrO,GAAG,CAACqO,QAAJ,GAAe7I,OAAf,CAAuB,YAAvB,IAAuC,CAAC,CAArF,EAAyF;QACxF,KAAKpD,kBAAL,GAA0B,IAA1B;;QAEA,IAAI3K,MAAM,CAAC6W,OAAX,EAAoB;UACnB,KAAKlC,OAAL,CAAaC,OAAb,CACC,KAAKjJ,KAAL,CAAWC,CAAX,CAAa,kBAAb,CADD,EACmC;YAClCxK,MAAM,EAAE,KAAKuK,KAAL,CAAWC,CAAX,CAAa,WAAb;UAD0B,CADnC;QAIA,CALD,MAMK;UACJ,KAAK+I,OAAL,CAAaC,OAAb,CACC,KAAKjJ,KAAL,CAAWC,CAAX,CAAa,kBAAb,CADD,EACmC;YAClCxK,MAAM,EAAE,KAAKuK,KAAL,CAAWC,CAAX,CAAa,WAAb;UAD0B,CADnC;QAIA;;QAED;MACA;;MAED,IAAKrD,GAAG,CAACqO,QAAJ,IAAgBrO,GAAG,CAACqO,QAAJ,GAAe7I,OAAf,CAAuB,kBAAvB,IAA6C,CAAC,CAAnE,EAAuE;QACtE,KAAK4G,OAAL,CAAaC,OAAb,CACC,KAAKjJ,KAAL,CAAWC,CAAX,CAAa,mBAAb,CADD,EACoC;UACnCxK,MAAM,EAAE,KAAKuK,KAAL,CAAWC,CAAX,CAAa,WAAb;QAD2B,CADpC;QAIA;MACA;;MAGD,KAAK+I,OAAL,CAAaC,OAAb,CACC,KAAKjJ,KAAL,CAAWC,CAAX,CAAa,wBAAb,CADD,EACyC;QACxCxK,MAAM,EAAE,KAAKuK,KAAL,CAAWC,CAAX,CAAa,WAAb;MADgC,CADzC;MAKA1H,OAAO,CAACxC,KAAR,CAAc6G,GAAd;IACA,CAjqBO;;IAmqBRuO,iBAAiB,CAAEC,IAAF,EAAQ;MAExB7S,OAAO,CAACC,GAAR,CAAY,MAAZ,EAAoB4S,IAApB;MAEA,OAAO,IAAI5I,OAAJ,CAAY,CAACnG,OAAD,EAAUkH,MAAV,KAAqB;QACvClP,MAAM,CAACgX,yBAAP,CAAiCD,IAAjC,EAAwCE,KAAD,IAAW;UAGjD,IAAG,CAACA,KAAJ,EAAU;YACT,OAAO/H,MAAM,CAAC,SAAD,CAAb;UACA;;UAED+H,KAAK,CAAC/O,IAAN,CAAYA,IAAD,IAAU;YACpB,IAAI/G,MAAM,GAAG,IAAI+V,UAAJ,EAAb;YAEAhT,OAAO,CAACC,GAAR,CAAY,MAAZ,EAAoB+D,IAApB;;YAEA/G,MAAM,CAACgW,SAAP,GAAmB,YAAW;cAC7B,IAAIC,IAAI,GAAG,IAAIC,IAAJ,CAAS,CAAC,IAAIC,UAAJ,CAAe,KAAKhP,MAApB,CAAD,CAAT,EAAwC;gBAAC5I,IAAI,EAAGwI,IAAI,CAACxI;cAAb,CAAxC,CAAX;cAEAwE,OAAO,CAACC,GAAR,CAAY,MAAZ,EAAoBiT,IAApB;cAEAH,KAAK,CAAChS,MAAN;cAEA+C,OAAO,CAACoP,IAAD,CAAP;YACA,CARD;;YAUAjW,MAAM,CAACsV,OAAP,GAAkB3S,CAAD,IAAO;cAEvBmT,KAAK,CAAChS,MAAN;cAEAiK,MAAM,CAACpL,CAAD,CAAN;YACA,CALD;;YAOA3C,MAAM,CAACoW,iBAAP,CAAyBrP,IAAzB;UACA,CAvBD;QAwBA,CA/BD,EA+BIpE,CAAD,IAAO;UACToL,MAAM,CAACpL,CAAD,CAAN;QACA,CAjCD;MAkCA,CAnCM,CAAP;IAqCA,CA5sBO;;IA8sBR0T,oBAAoB,GAAG;MAEtB,KAAKvU,gBAAL,GAAwBwU,uCAAU,CAAC,KAAKxL,IAAL,CAAUyL,KAAV,CAAgBC,WAAhB,CAA4B;QAAEC,KAAK,EAAE;MAAT,CAA5B,EAA6CtW,IAA7C,CAAkD,MAAM;QAC1F,KAAKqJ,kBAAL,GAA0B,KAA1B;QAEA,OAAOwD,OAAO,CAACnG,OAAR,EAAP;MACA,CAJkC,EAIhCvG,KAJgC,CAI1B8G,GAAG,IAAI;QAEfrE,OAAO,CAACxC,KAAR,CAAc6G,GAAd;QAEA,KAAKoO,oBAAL,CAA0BpO,GAA1B;QAEA,OAAO4F,OAAO,CAACe,MAAR,CAAe3G,GAAf,CAAP;MAEA,CAZkC,CAAD,CAAlC;MAcA,KAAKtF,gBAAL,CAAsB3B,IAAtB,CAA2B,MAAM;QAEhC4C,OAAO,CAACC,GAAR,CAAY,iBAAZ;QAEA,KAAKwG,kBAAL,GAA0B,KAA1B;QAEA,IAAIoM,IAAI,GAAG,eAAX;QAEA,IAAGtU,4BAAC,CAACoV,KAAF,EAAH,EAAcd,IAAI,GAAG,6CAAP;QAEd,IAAI5Q,GAAG,GAAG,CAAV;QAEA,KAAKoE,YAAL,GAAoB,KAAK0B,IAAL,CAAU6L,eAAV,EAApB,CAZgC,CAchC;;QAEA,IAAIJ,KAAK,GAAG,KAAKK,oBAAL,GAA4B,IAAIC,KAAJ,CAAUjB,IAAV,EAAgB,MAAM;UAE7D7S,OAAO,CAACC,GAAR,CAAY,gBAAZ,EAA8B,KAAKyG,6BAAnC;UAEA,KAAKnF,UAAL,GAAkB,CAAlB;UAEAiS,KAAK,CAACO,OAAN;;UAEA,IAAI,KAAKrN,6BAAT,EAAwC;YAEvC,KAAKA,6BAAL,GAAqC,KAArC;YACA;UACA;;UAED,IAAIsN,EAAE,GAAG,IAAT;UAEA;;UAECA,EAAE,GAAG,KAAKpB,iBAAL,CAAuBrU,4BAAC,CAACoV,KAAF,KAAYd,IAAZ,GAAmB/W,MAAM,CAAC6W,OAAP,CAAe3O,IAAf,CAAoBiQ,qBAApB,GAA4CpB,IAAtF,EAA4FzV,IAA5F,CAAiG8V,IAAI,IAAI;YAC7G,OAAOjJ,OAAO,CAACnG,OAAR,CAAgB;cACtB/J,IAAI,EAAGmZ;YADe,CAAhB,CAAP;UAGA,CAJI,CAAL;UAMD;AACL;AACA;AACA;;UAGKc,EAAE,CAAC5W,IAAH,CAAQ8O,CAAC,IAAI;YACZ;;YACA;AACN;AACA;AACA;AACA;AACA;YAIMlM,OAAO,CAACC,GAAR,CAAY,gBAAZ,EAA8BuT,KAAK,CAACU,QAApC;;YAEA,IAAIV,KAAK,CAACU,QAAN,IAAkBV,KAAK,CAACU,QAAN,GAAiB,CAAvC,EAAyC;cACxChI,CAAC,CAACgI,QAAF,GAAaV,KAAK,CAACU,QAAnB;YACA;;YAED,KAAKC,kBAAL,CAAwBjI,CAAxB,EAA2B,IAA3B;YAEA,OAAOjC,OAAO,CAACnG,OAAR,EAAP;UAEA,CArBD,EAqBGvG,KArBH,CAqBSqC,CAAC,IAAI;YAEb,KAAKyD,KAAL;YAEArD,OAAO,CAACxC,KAAR,CAAcoC,CAAd;UACA,CA1BD,EA0BGwU,OA1BH,CA0BW,MAAM,CAEhB,CA5BD;QA8BA,CA5DuC,EA4DpCxU,CAAD,IAAO;UAETI,OAAO,CAACxC,KAAR,CAAcoC,CAAd;UAEA,KAAKhB,WAAL,GAAmB,KAAnB;UACA,KAAKyE,KAAL;QAEA,CAnEuC,CAAxC;QAqEA,IAAIgR,OAAO,GAAG,EAAd;QAEA,IAAIC,cAAc,GAAG,KAAKxN,MAAL,CAAY1H,KAAZ,CAAkBmV,0BAAvC;;QAEA,IAAID,cAAJ,EAAoB;UACnBA,cAAc,CAACE,KAAf;QACA;;QAGD,KAAKjO,QAAL,GAAgBkO,WAAW,CAAC,MAAM;UACjC;UAEA,IAAGlW,4BAAC,CAACoV,KAAF,EAAH,EAAa;YACZU,OAAO,CAAC/M,IAAR,CAAa,CAAb;YAEA,IAAI+M,OAAO,CAAClT,MAAR,GAAiB,EAArB,EAAyBkT,OAAO,GAAGlS,CAAC,CAACC,IAAF,CAAOiS,OAAP,EAAgB,EAAhB,CAAV;YAEzB,KAAKlO,aAAL,GAAqBhE,CAAC,CAACuS,KAAF,CAAQL,OAAR,CAArB;UACA,CAND,MAOI;YACH,KAAKR,oBAAL,CAA0Bc,mBAA1B,EACC;YACCC,GAAD,IAAS;cAERP,OAAO,CAAC/M,IAAR,CAAasN,GAAG,GAAG,IAAnB;cAEA,IAAIP,OAAO,CAAClT,MAAR,GAAiB,EAArB,EAAyBkT,OAAO,GAAGlS,CAAC,CAACC,IAAF,CAAOiS,OAAP,EAAgB,EAAhB,CAAV;cAEzB,KAAKlO,aAAL,GAAqBhE,CAAC,CAACuS,KAAF,CAAQL,OAAR,CAArB;YAGA,CAXF,EAYC,UAAUzU,CAAV,EAAa;cACZI,OAAO,CAACC,GAAR,CAAY,GAAZ,EAAiBL,CAAjB;YACA,CAdF;UAgBA;;UAKDqC,GAAG,GAAGA,GAAG,GAAG,EAAZ;UAEA,IAAIA,GAAG,GAAG,IAAN,KAAe,CAAnB,EAAsB,KAAKV,UAAL,GAAkBU,GAAlB;QAEtB,CApC0B,EAoCxB,EApCwB,CAA3B;QAsCA,KAAKrD,WAAL,GAAmB,IAAnB;QACA,KAAK4H,aAAL,GAAqB,CAArB;QACA,KAAKL,aAAL,GAAqB,EAArB;QACA,KAAK5E,UAAL,GAAkB,CAAlB;QACA,KAAK2E,MAAL,GAAc,IAAd;QAEA,KAAK2N,oBAAL,CAA0BgB,WAA1B;MAEA,CA5ID,EA4IGtX,KA5IH,CA4IUqC,CAAD,IAAO;QACfI,OAAO,CAACxC,KAAR,CAAcoC,CAAd;MAGA,CAhJD,EAgJGwU,OAhJH,CAgJW,MAAM;QAChB,KAAKrV,gBAAL,GAAwB,IAAxB;MACA,CAlJD;IAoJA,CAl3BO;;IAo3BR+V,aAAa,GAAG;MAEf,IAAI,KAAK/V,gBAAL,IAAyB,KAAKH,WAA9B,IAA6C,KAAKiV,oBAAtD,EAA4E;MAE5E7T,OAAO,CAACC,GAAR,CAAY,gBAAZ;;MAEA,IAAInE,MAAM,CAAC6W,OAAX,EAAoB;QACnB,OAAO,KAAKW,oBAAL,EAAP;MACA;;MAED,KAAKvU,gBAAL,GAAwBwU,uCAAU,CAAC,KAAKxL,IAAL,CAAUgN,iBAAV,GAA8B3X,IAA9B,CAAoC4X,QAAD,IAAc;QAEnF,KAAKvO,kBAAL,GAA0B,KAA1B;;QAEA,IAAI,KAAK1H,gBAAT,EAA2B;UAC1B,OAAOkL,OAAO,CAACnG,OAAR,CAAgBkR,QAAhB,CAAP;QACA,CAFD,MAGK;UACJA,QAAQ,CAACC,MAAT,CAAgBC,SAAhB,GAA4BxL,OAA5B,CAAqCyL,KAAD,IAAW;YAC9CA,KAAK,CAACC,IAAN;UACA,CAFD;QAGA;MAED,CAbkC,EAahC7X,KAbgC,CAa1B8G,GAAG,IAAI;QAEf,KAAKoO,oBAAL,CAA0BpO,GAA1B;QACA,OAAO4F,OAAO,CAACe,MAAR,CAAe3G,GAAf,CAAP;MAEA,CAlBkC,CAAD,CAAlC;MAqBA,KAAKtF,gBAAL,CAAsB3B,IAAtB,CAA4B4X,QAAD,IAAc;QAGxC,KAAK5O,aAAL,GAAqB4O,QAArB;QAEA,KAAK3O,YAAL,GAAoB,KAAK0B,IAAL,CAAU6L,eAAV,EAApB;QACA,KAAKtN,aAAL,GAAqB,KAAKD,YAAL,CAAkBgP,cAAlB,EAArB,CANwC,CAQxC;;QAEA,IAAI7C,GAAG,GAAG,KAAKnM,YAAL,CAAkBiP,uBAAlB,CAA0C,KAAKlP,aAAL,CAAmB6O,MAA7D,CAAV;QACAzC,GAAG,CAACxL,OAAJ,CAAY,KAAKV,aAAjB;QAEA,KAAKiP,cAAL;MAEA,CAfD,EAeGhY,KAfH,CAeS,MAAM,CAAG,CAflB,EAeoB6W,OAfpB,CAe4B,MAAM;QACjC,KAAKrV,gBAAL,GAAwB,IAAxB;MACA,CAjBD;IAoBA,CAv6BO;;IAy6BRwW,cAAc,GAAG;MAEhB,IAAIjB,cAAc,GAAG,KAAKxN,MAAL,CAAY1H,KAAZ,CAAkBmV,0BAAvC;;MAEA,IAAID,cAAJ,EAAoB;QACnBA,cAAc,CAACE,KAAf;MACA;;MAED,KAAK1N,MAAL,CAAYwF,MAAZ,CAAmB,oBAAnB,EAAyC,IAAzC;MAEA,KAAK1N,WAAL,GAAmB,IAAnB;MACA,KAAK4H,aAAL,GAAqB,CAArB;MACA,KAAKL,aAAL,GAAqB,EAArB;MACA,KAAK5E,UAAL,GAAkB,CAAlB;MACA,KAAK2E,MAAL,GAAc,IAAd;MACA,KAAKE,aAAL,CAAmB1I,KAAnB;MAEA,IAAIuE,GAAG,GAAG,CAAV;MACA,IAAIoS,OAAO,GAAG,EAAd;MAGA,KAAK9N,QAAL,GAAgBkO,WAAW,CAAC,MAAM;QACjC,IAAIe,SAAS,GAAG,IAAIpC,UAAJ,CAAe,KAAK9M,aAAL,CAAmBmP,iBAAlC,CAAhB;QAEA,KAAKnP,aAAL,CAAmBoP,oBAAnB,CAAwCF,SAAxC;QAGAnB,OAAO,CAAC/M,IAAR,CAAa,KAAKqO,WAAL,CAAiBH,SAAjB,CAAb;QAEA,IAAInB,OAAO,CAAClT,MAAR,GAAiB,EAArB,EAAyBkT,OAAO,GAAGlS,CAAC,CAACC,IAAF,CAAOiS,OAAP,EAAgB,EAAhB,CAAV;QAEzBpS,GAAG,GAAGA,GAAG,GAAG,EAAZ;QAEA,KAAKkE,aAAL,GAAqBhE,CAAC,CAACuS,KAAF,CAAQL,OAAR,CAArB;;QAEA,IAAIpS,GAAG,GAAG,IAAN,KAAe,CAAnB,EAAsB;UACrB,KAAKV,UAAL,GAAkBU,GAAlB;QACA;MAED,CAlB0B,EAkBxB,EAlBwB,CAA3B;IAoBA,CAl9BO;;IAq9BR2T,iBAAiB,EAAE,UAAU1P,MAAV,EAAkB1F,OAAlB,EAA2B;MAE7C,IAAI0F,MAAM,CAACgO,QAAP,GAAkB,CAAtB,EAAyB;QACxB,KAAK7Q,KAAL;MACA,CAFD,MAGK;QACJ,IAAI7C,OAAJ,EAAa;UACZ,KAAKqV,gBAAL,CAAsB3P,MAAtB;QACA,CAFD,MAGI;UACH,KAAKA,MAAL,GAAcA,MAAd;QACA;MACD;IACD,CAl+BO;;IAo+BR4P,WAAW,CAAC9R,IAAD,EAAM;MAEhB,OAAO,IAAIiG,OAAJ,CAAY,CAACnG,OAAD,EAAUkH,MAAV,KAAqB;QACvCzM,4BAAC,CAACwX,QAAF,CAAW/R,IAAX,EAAiB5G,IAAjB,CAAsB4Y,WAAW,IAAI;UACpC,IAAG;YACF,KAAK3P,YAAL,CAAkB4P,eAAlB,CAAkCD,WAAlC,EAAgDE,MAAD,IAAY;cAC1DpS,OAAO,CAACoS,MAAM,CAAChC,QAAR,CAAP;YACA,CAFD;UAGA,CAJD,CAIC,OAAMtU,CAAN,EAAQ;YACRoL,MAAM,CAACpL,CAAD,CAAN;UACA;QAED,CATD,EASGrC,KATH,CASSyN,MATT;MAUA,CAXM,CAAP;IAeA,CAr/BO;;IAu/BRmJ,kBAAkB,CAAChW,KAAD,EAAQqC,OAAR,EAAiB;MAClCR,OAAO,CAACC,GAAR,CAAY,OAAZ,EAAqB9B,KAArB;;MAEA,IAAI6E,CAAC,GAAG,MAAM;QAEb;QAEA,KAAK4S,iBAAL,CAAuB;UACtB5R,IAAI,EAAE7F,KAAK,CAACpE,IADU;UAEtB4O,EAAE,EAAEpK,4BAAC,CAAC8Q,MAAF,EAFkB;UAGtB6E,QAAQ,EAAG/V,KAAK,CAAC+V;QAHK,CAAvB,EAIG1T,OAJH;MAKA,CATD;;MAWA,IAAGrC,KAAK,CAAC+V,QAAT,EAAkB;QAEjBlR,CAAC;MACD,CAHD,MAII;QACH,KAAK8S,WAAL,CAAiB3X,KAAK,CAACpE,IAAvB,EAA6BqD,IAA7B,CAAkC8W,QAAQ,IAAI;UAC7C/V,KAAK,CAAC+V,QAAN,GAAiBA,QAAjB;UAEAlR,CAAC;QACD,CAJD,EAIGzF,KAJH,CAIUqC,CAAD,IAAO;UACfI,OAAO,CAACxC,KAAR,CAAcoC,CAAd;UAEA,KAAKyD,KAAL;QACA,CARD;MASA;MAGD;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IAUG,CAjjCO;;IAmjCRsS,WAAW,CAACQ,WAAD,EAAc;MACxB,OAAO,CAACpU,IAAI,CAACqU,IAAL,CAAUD,WAAW,CAACE,MAAZ,CAAmB,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAAC,IAAI,CAAtC,IAA2CJ,WAAW,CAAChV,MAAjE,EAAyEqV,WAAzE,CAAqF,CAArF,CAAR;IACA,CArjCO;;IAujCRC,aAAa,QAAsB;MAAA,IAArB;QAAE/W,MAAF;QAAUc;MAAV,CAAqB;MAElCR,OAAO,CAACC,GAAR,CAAY,gBAAZ,EAA8B,KAAKrB,WAAnC;MAGA,KAAKkI,MAAL,CAAYwF,MAAZ,CAAmB,oBAAnB,EAAyC,KAAzC;;MAEA,IAAI,KAAKvN,gBAAT,EAA2B;QAE1B,KAAKA,gBAAL,CAAsBW,MAAtB;QACA,KAAKX,gBAAL,GAAwB,IAAxB;QAEA;MACA;;MAED,KAAKH,WAAL,GAAmB,KAAnB;;MAEA,IAAI,KAAK2H,QAAT,EAAmB;QAClBmQ,aAAa,CAAC,KAAKnQ,QAAN,CAAb;QACA,KAAKA,QAAL,GAAgB,IAAhB;MACA;;MAGD,IAAI,KAAKH,aAAT,EAAwB;QAEvB,IAAI1G,MAAJ,EAAY,CACX;QAEA,CAHD,MAIK;UACJ,KAAK0G,aAAL,CAAmB7F,gBAAnB,CAAoC,eAApC,EAAsDpC,KAAD,IAAW;YAC/D,KAAKgW,kBAAL,CAAwBhW,KAAxB,EAA+BqC,OAA/B;UACA,CAFD,EADI,CAGF;QACF;;QAED,KAAK4F,aAAL,CAAmBgP,IAAnB;QAEA,KAAKhP,aAAL,CAAmB6O,MAAnB,CAA0BC,SAA1B,GAAsCxL,OAAtC,CAA+CyL,KAAD,IAAW;UACxDA,KAAK,CAACC,IAAN;QACA,CAFD;QAIA,KAAKhP,aAAL,GAAqB,IAArB;MACA;;MAGD,IAAI,KAAKyN,oBAAT,EAA+B;QAE9B,IAAInU,MAAJ,EAAY;UACX,KAAKgH,6BAAL,GAAqC,IAArC;QACA,CAFD,MAGK;UACJ,KAAKA,6BAAL,GAAqC,KAArC;QACA;;QAED,KAAKmN,oBAAL,CAA0B8C,UAA1B;QACA,KAAK9C,oBAAL,GAA4B,IAA5B;MAEA;IAED,CAlnCO;;IAonCFgC,gBAAN,CAAuB3P,MAAvB,EAA+B;MAAA;;MAAA;QAE9B,IAAG,CAACA,MAAJ,EAAYA,MAAM,GAAG,KAAI,CAACA,MAAd;;QAEZ,IAAG,CAACA,MAAJ,EAAY;UACX,KAAI,CAAC7C,KAAL;QACA;;QAED,KAAI,CAAC8C,aAAL,GAAqB,EAArB;QAEA,MAAMpC,MAAM,SAAS,KAAI,CAACgE,IAAL,CAAU6O,oBAAV,CAA+B1Q,MAAM,CAAClC,IAAtC,CAArB;QAEA,MAAM2E,EAAE,GAAGpK,4BAAC,CAAC8Q,MAAF,EAAX;QAEA,MAAMa,IAAI,GAAG;UACZ1U,IAAI,EAAE,OADM;UAEZmN,EAAE,EAAEA,EAFQ;UAGZ5E,MAAM,EAAEA;QAHI,CAAb;;QAMA,KAAI,CAACV,KAAL;;QAEA,KAAI,CAAC8G,EAAL,CAAQC,MAAR,CAAe,MAAM;UACpB,OAAO,KAAI,CAACrF,IAAZ;QACA,CAFD,EAEG3H,IAFH,CAEQ,MAAM;UACb,OAAO,KAAI,CAAC2K,IAAL,CAAUC,IAAV,CAAe6O,SAAf,CAAyB,KAAI,CAAC9R,IAA9B,EAAoChB,MAApC,EAA4C,IAA5C,EAAkDmM,IAAlD,EAAwD;YAAEH,QAAQ,EAAE,KAAI,CAAC5K;UAAjB,CAAxD,CAAP;QACA,CAJD,EAIG5H,KAJH,CAISqC,CAAC,IAAI;UACb,KAAI,CAACH,KAAL,CAAW,WAAX,EAAwB;YACvBkJ,EAAE,EAAEA,EADmB;YAEvBnL,KAAK,EAAEoC;UAFgB,CAAxB;;UAIA,OAAOqK,OAAO,CAACnG,OAAR,EAAP;QACA,CAVD;MAtB8B;IAmC9B,CAvpCO;;IAypCRT,KAAK,GAAG;MACP,KAAK6C,MAAL,GAAc,IAAd;MACA,KAAKC,aAAL,GAAqB,EAArB;MACA,KAAK5E,UAAL,GAAkB,CAAlB;;MAEA,IAAI,KAAKgF,QAAT,EAAmB;QAClBmQ,aAAa,CAAC,KAAKnQ,QAAN,CAAb;QACA,KAAKA,QAAL,GAAgB,IAAhB;MACA;;MAED,IAAI,KAAKsN,oBAAT,EAA+B;QAC9B,KAAKA,oBAAL,GAA4B,IAA5B;MACA;;MAED,IAAI,KAAKzN,aAAT,EAAwB;QAEvB,KAAKA,aAAL,CAAmBgP,IAAnB;QACA,KAAKhP,aAAL,CAAmB6O,MAAnB,CAA0BC,SAA1B,GAAsCxL,OAAtC,CAA+CyL,KAAD,IAAW;UACxDA,KAAK,CAACC,IAAN;QACA,CAFD;QAGA,KAAKhP,aAAL,GAAqB,IAArB;MACA;MAED;AACH;AACA;;IACG,CAnrCO;;IAqrCR;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IAEE0Q,UAAU,CAACnV,OAAD,EAAU;MACnB,KAAK6E,aAAL,GAAqB7E,OAArB;IACA;;EAjsCO;AApQK,CAAf,E;;ACb2N,CAAgB,sGAAG,EAAC,C;;ACA/I;AACxC;AACL;AACnD,SAAS,kBAAY;;AAErB,eAAe,mBAAO,CAAC,MAAwE;AAC/F;;AAEA;;AAEA;AACgG;AAChG,IAAI,eAAS,GAAG,8CAAU;AAC1B,EAAE,mCAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA,EAAE,kBAAY;AACd;AACA;AACA;AACA;;AAEe,0FAAS,Q","file":"matrix-element.6.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a \r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./picturePreview.vue?vue&type=template&id=4b882d9f&scoped=true&\"\nimport script from \"./picturePreview.vue?vue&type=script&lang=js&\"\nexport * from \"./picturePreview.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./picturePreview.vue?vue&type=style&index=0&id=4b882d9f&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"4b882d9f\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./InputField.vue?vue&type=template&id=b9fd73f0&scoped=true&\"\nimport script from \"./InputField.vue?vue&type=script&lang=js&\"\nexport * from \"./InputField.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./InputField.vue?vue&type=style&index=0&id=b9fd73f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"b9fd73f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordButton_wrapper\"},[_c('div',{ref:\"holder\",staticClass:\"recordButton_holder\",class:{hold: _vm.isHold}},[_c('i',{staticClass:\"icon fas\",class:_vm.isHold ? 'fa-lock': 'fa-lock-open'})]),(!_vm.isHold)?_c('div',{ref:\"toggle\",staticClass:\"recordButton_micro recordButton_main\",class:{active: _vm.isRecording, disabled: _vm.disabled},on:{\"mousedown\":_vm.mousedown,\"mouseup\":_vm.mouseup,\"touchstart\":_vm.handleTouchStart,\"touchend\":_vm.handleTouchEnd,\"touchcancel\":_vm.handleTouchEnd}},[_c('i',{staticClass:\"icon fas fa-microphone\"})]):_vm._e(),(_vm.isHold)?_c('div',{ref:\"stop\",staticClass:\"recordButton_stop recordButton_main\",on:{\"click\":_vm.recordEnd}},[_c('i',{staticClass:\"icon fas fa-stop\"})]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n\tname: \"recordVoice\",\r\n\tprops: {\r\n\t\tisRecording: {\r\n\t\t\ttype: Boolean,\r\n\t\t\trequired: true\r\n\t\t},\r\n\t\tprepareRecording: {\r\n\t\t\ttype: Boolean\r\n\t\t},\r\n\t\tdisabled: Boolean,\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tstart: 0,\r\n\t\t\tisHold: false,\r\n\t\t\tdirection: null\r\n\t\t}\r\n\t},\r\n\tcomputed: {\r\n\t\t...mapState({\r\n\t\t\tmobile: state => state.mobile,\r\n\t\t})\r\n\t},\r\n\tmounted() {\r\n\t\r\n\t},\r\n\tbeforeDestroy() {\r\n\r\n\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\tif (this.isRecording) {\r\n\t\t\tthis.$emit('onRecordingStop', {cancel : true})\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\r\n\t\tmouseup : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchEnd(e)\r\n\t\t},\r\n\r\n\t\tmousedown : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchStart(e)\r\n\t\t},\r\n\t\t\r\n\t\thandleTouchStart(e) {\r\n\r\n\t\t\tconsole.log(\"E\", e, this.isHold, this.isRecording)\r\n\r\n\r\n\t\t\tif(!this.isRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStart')\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tif(this.isHold) return\r\n\t\t\t}\r\n\r\n\t\t\tthis.start = {\r\n\t\t\t\tY: e.changedTouches ? e.changedTouches[0].pageY : e.pageY,\r\n\t\t\t\tX: e.changedTouches ? e.changedTouches[0].pageX : e.pageX\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tdocument.addEventListener('mousemove', this.handleMove)\r\n\t\t\telse\r\n\t\t\t\tdocument.addEventListener('touchmove', this.handleMove)\r\n\r\n\t\t},\r\n\t\thandleTouchEnd(e) {\r\n\t\t\tconsole.log(\"E\", e, this.isHold)\r\n\r\n\t\t\tif (this.isHold) return\r\n\r\n\t\t\tif (this.isRecording || this.prepareRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStop', {\r\n\t\t\t\t\tsendnow : true\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t},\r\n\r\n\t\tclearStyle(){\r\n\r\n\t\t\tif (this.$refs.toggle){\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\tthis.$refs.toggle.classList.remove('outside')\r\n\t\t\t}\r\n\r\n\t\t\tif (this.$refs.holder){\r\n\t\t\t\tthis.$refs.holder.classList.remove('active')\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\thandleMove(e) {\r\n\r\n\t\t\tconsole.log(\"E\", e, this.isRecording)\r\n\r\n\t\t\tif(!this.isRecording) return\r\n\r\n\t\t\tlet deltaY = this.start.Y - e.pageY\r\n\t\t\tlet deltaX = this.start.X - e.pageX\r\n\r\n\t\t\tif (e?.changedTouches?.length) {\r\n\t\t\t\tdeltaY = this.start.Y - e.changedTouches[0].pageY\r\n\t\t\t\tdeltaX = this.start.X - e.changedTouches[0].pageX\r\n\t\t\t}\r\n\r\n\t\t\tif (deltaY > 5 && deltaX < 5) {\r\n\t\t\t\tthis.direction = 'Y'\r\n\t\t\t} else {\r\n\t\t\t\tthis.direction = 'X'\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (deltaY > 5 && this.direction === 'Y') {\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('active'))\r\n\t\t\t\t\tthis.$refs.holder.classList.add('active')\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,-${deltaY}px)`\r\n\r\n\t\t\t\tif (deltaY > 70) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\r\n\t\t\t\t\tthis.isHold = true\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t} else if (deltaX > 5 && this.direction === 'X') {\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(-${deltaX}px, 0)`\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('outside'))\r\n\t\t\t\t\tthis.$refs.toggle.classList.add('outside')\r\n\r\n\t\t\t\tthis.$emit('canceling', (deltaX - 5) / 130)\r\n\t\t\t\t\r\n\t\t\t\tif (deltaX > 130) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\t\t\t\t\tthis.$emit('onRecordingStop', { cancel: true })\r\n\t\t\t\t\tthis.$emit('onClear')\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.clearStyle()\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\trecordEnd(e) {\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t\tif (this.isRecording && this.isHold) {\r\n\r\n\t\t\t\tthis.$emit('onRecordingStop', {})\r\n\t\t\t\tthis.isHold = false\r\n\r\n\t\t\t\treturn\r\n\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t\r\n\t}\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=34d15f18&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=34d15f18&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"34d15f18\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordProgress\"},[(_vm.isRecording)?_c('div',{staticClass:\"indicatorWrapper\"},[_c('div',{staticClass:\"indicator\",class:{'recording': _vm.isRecording}})]):_c('div',{staticClass:\"del\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-trash\"})]),_c('div',{staticClass:\"timer\"},[_vm._v(_vm._s(_vm.timer))]),_c('div',{ref:\"graph\",staticClass:\"graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"id\":\"canvas\",\"width\":_vm.width,\"height\":\"20\"}})]),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isRecording && _vm.opacity),expression:\"isRecording && opacity\"}],ref:\"cancel\",staticClass:\"cancel\"},[_c('span',[_vm._v(\"Slide left to cancel\")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default {\r\n name: \"recordProgress\",\r\n props: {\r\n recordTime: {\r\n type: Number,\r\n required: true\r\n },\r\n rmsData: {\r\n type: Array,\r\n required: true\r\n },\r\n isRecording: {\r\n type: Boolean\r\n },\r\n opacity: {}\r\n },\r\n data() {\r\n return {\r\n width: 0,\r\n }\r\n },\r\n computed: {\r\n timer() {\r\n let minute = Math.floor(this.recordTime / 60000)\r\n let sec = Math.floor(this.recordTime / 1000) % 60\r\n return `${minute ? minute + ':' : '0:'}${(sec < 10) ? '0' + sec : sec}`\r\n },\r\n\r\n rmsDataLast(){\r\n return _.last(this.rmsData, 25)\r\n }\r\n },\r\n\r\n watch : {\r\n rmsData : _.throttle(function(){\r\n this.draw()\r\n }, 30),\r\n\r\n opacity : function(){\r\n this.$refs.cancel.style.opacity = this.opacity\r\n }\r\n },\r\n\r\n mounted() {\r\n this.$refs.cancel.style.opacity = 0\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n\r\n window.addEventListener(\"resize\", this.resize);\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.resize)\r\n },\r\n\r\n methods: {\r\n resize() {\r\n let timer = null\r\n\r\n var re = () => {\r\n if (!timer) {\r\n timer = setTimeout(() => {\r\n timer = null\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n }, 50)\r\n }\r\n }\r\n\r\n re()\r\n },\r\n draw() {\r\n\r\n if(!this.$refs.canvas) return\r\n\r\n const ctx = this.$refs.canvas.getContext(`2d`);\r\n let x = 0\r\n let count = 50\r\n let width = 2 //this.width / 200\r\n var l = this.rmsDataLast.length\r\n var c = Math.max(Math.floor(l / count), 1)\r\n\r\n ctx.clearRect(0, 0, this.width, 20);\r\n\r\n for (let i = 0; i < l; i = i + c) {\r\n ctx.fillStyle = '#00a4ff'\r\n ctx.fillRect(i * 2 * width, 10 - this.rmsDataLast[i] / 8, width, this.rmsDataLast[i] / 4 + 1)\r\n }\r\n\r\n },\r\n clear() {\r\n this.$emit('onClear')\r\n }\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3f87c0fa&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=3f87c0fa&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3f87c0fa\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"upload\"},[_c('div',{staticClass:\"uploadWrapper\"},[_c('div',{staticClass:\"contentWrapper\"},[_vm._t(\"content\",function(){return [_c('i',{staticClass:\"fas fa-plus\"})]})],2),_c('div',{staticClass:\"inputWrapper\"},[_c('input',{attrs:{\"type\":\"file\",\"multiple\":_vm.multiple},on:{\"change\":_vm.upload}})])]),(_vm.dropzone)?_c('div',{ref:\"dropzone\",staticClass:\"dropzone\",class:{dropzone : _vm.dropzone}},[_vm._t(\"dropzone\",function(){return [_c('i',{staticClass:\"fas fa-plus\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.dragAndDropAFile\"))+\" \")]})],2):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a28e80a8&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=a28e80a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a28e80a8\",\n null\n ,true\n)\n\nexport default component.exports","import f from \"@/application/functions\";\r\nimport InputField from './InputField/InputField.vue'\r\nimport recordVoice from '@/components/assets/recordVoice/index.vue';\r\nimport { mapState } from \"vuex\";\r\nimport Images from '@/application/utils/images.js'\r\n\r\nimport contacts from '@/components/contacts/list/index.vue'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport recordProgress from '@/components/assets/recordProgress/index.vue';\r\n\r\nimport upload from '@/components/assets/upload/index.vue';\r\n\r\nimport { cancelable } from 'cancelable-promise';\r\nexport default {\r\n\tname: 'chatInput',\r\n\tprops: {\r\n\t\tchat: Object,\r\n\t\tu: String,\r\n\t\trelationEvent: Object\r\n\t},\r\n\r\n\tcomponents: { InputField, contacts, preview, recordProgress, recordVoice, upload },\r\n\r\n\tdata: function () {\r\n\r\n\t\treturn {\r\n\t\t\tupload: true,\r\n\t\t\ttest: [],\r\n\t\t\tloading: false,\r\n\t\t\ttext: '',\r\n\t\t\tfile: {},\r\n\t\t\tfileInfo: {},\r\n\t\t\tready: false,\r\n\t\t\tcreating: false,\r\n\t\t\tuserId: '',\r\n\t\t\tshowuserselect: null,\r\n\t\t\tanyUrlMeta: String,\r\n\t\t\tjoinedMembers: [],\r\n\t\t\ttipvalue: null,\r\n\t\t\ttipuserindex: 0,\r\n\t\t\trecord: null,\r\n\t\t\trecordRmsData: [],\r\n\t\t\tisRecording: false,\r\n\r\n\t\t\tmediaRecorder: null,\r\n\t\t\taudioContext: null,\r\n\t\t\taudioAnalyser: null,\r\n\r\n\t\t\trecordTime: 0,\r\n\t\t\tinterval: null,\r\n\t\t\tcancelOpacity: 0,\r\n\t\t\tmicrophoneDisabled: false,\r\n\t\t\tprepareRecording: false,\r\n\r\n\t\t\tcancelledCordovaMediaRecorder: false\r\n\t\t}\r\n\r\n\t},\r\n\r\n\r\n\twatch: {\r\n\t\tusersForKeysHash: {\r\n\t\t\t//immediate: true,\r\n\t\t\thandler: function () {\r\n\t\t\t}\r\n\t\t},\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (!this.tipusers.length) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t} else {\r\n\t\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeDestroy() {\r\n\t\tif (this.audioContext)\r\n\t\t\tthis.audioContext.close()\r\n\t},\r\n\r\n\tcomputed: {\r\n\t\tvoiceEnable() {\r\n\t\t\treturn this.$store.state.voiceMessagesEnabled\r\n\t\t},\r\n\r\n\t\tconnect: function () {\r\n\t\t\treturn this.$store.state.contact\r\n\t\t},\r\n\t\tpkoindisabled : function(){\r\n\t\t\treturn this.$store.state.pkoindisabled\r\n\t\t},\r\n\t\tmenuItems: function () {\r\n\t\t\tvar menuItems = []\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\r\n\t\t\t\tif (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.mobile.supportimagegallery()) {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandlerCustom\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandler\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t\tupload: {\r\n\t\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\t\textensions: ['jpg', 'jpeg', 'png', 'webp'],\r\n\t\t\t\t\t\t\tmaxsize: 100,\r\n\t\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\tmenuItems.push({\r\n\t\t\t\t\tclick: \"fileHandler\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendFile\"),\r\n\t\t\t\t\ticon: \"fas fa-sticky-note\",\r\n\r\n\t\t\t\t\tupload: {\r\n\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\textensions: [],\r\n\t\t\t\t\t\tmaxsize: 25,\r\n\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.transaction && !this.pkoindisabled) {\r\n\t\t\t\tmenuItems.unshift({\r\n\t\t\t\t\tclick: \"sendtransactionWrapper\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendCoins\"),\r\n\t\t\t\t\ticon: \"fas fa-wallet\"\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn menuItems\r\n\t\t},\r\n\t\t...mapState([\r\n\t\t\t'chats'\r\n\t\t]),\r\n\r\n\t\tuserlist: function () {\r\n\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\treturn this.core.mtrx.chatUsersInfo(this.chat.roomId, 'anotherChatUsers')\r\n\r\n\t\t},\r\n\r\n\t\ttransaction: function () {\r\n\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.ui.wallet.send')\r\n\t\t},\r\n\r\n\t\tuusers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn u\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tausers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn this.core.user.matrixId(u)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tstateChat: function () {\r\n\t\t\tvar id = this.$route.query.id\r\n\t\t\treturn this.$store.state.chatsMap[id]\r\n\t\t},\r\n\t\tinvited: function () {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tif (this.u) return this.ausers\r\n\t\t\t\treturn []\r\n\t\t\t}\r\n\r\n\t\t\treturn _.map(_.filter(this.chat.currentState.getMembers(), function (m, v) {\r\n\t\t\t\treturn m.membership === 'invite'\r\n\t\t\t}), function (u) {\r\n\t\t\t\treturn u.userId\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tjoined: function () {\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\tlet roomId = this.chat.roomId\r\n\t\t\tlet self = this\r\n\t\t\tlet arr = []\r\n\t\t\tlet members = 0\r\n\r\n\t\t\tthis.chat.currentState.getMembers().forEach(function (user) {\r\n\t\t\t\tif (user.membership === 'join') {\r\n\t\t\t\t\tarr.push(user.userId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\treturn arr\r\n\t\t},\r\n\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (this.tipvalue === null) return []\r\n\t\t\tif (this.tipvalue === '') return this.userlist\r\n\r\n\t\t\tvar value = this.tipvalue.toLowerCase()\r\n\r\n\t\t\tvar u = _.filter(this.userlist, function (u) {\r\n\t\t\t\treturn u.name.toLowerCase().indexOf(value) == 0 && u.name.toLowerCase() != value\r\n\t\t\t})\r\n\r\n\t\t\treturn u\r\n\r\n\t\t},\r\n\r\n\t\tmaintipuser: function () {\r\n\t\t\tif (this.tipusers.length) {\r\n\t\t\t\treturn this.tipusers[this.tipuserindex || 0]\r\n\t\t\t}\r\n\r\n\t\t\treturn null\r\n\t\t},\r\n\t},\r\n\r\n\tcreated() {\r\n\r\n\t},\r\n\r\n\t///\r\n\r\n\tmounted() {\r\n\t\tthis.ready = true\r\n\r\n\r\n\t\tif (!this.chat && this.core.mtrx.client) {\r\n\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t},\r\n\r\n\tmethods: {\r\n\t\twait: function () {\r\n\t\t\treturn this.$f.pretry(() => {\r\n\t\t\t\treturn this.core.mtrx.client && this.core.mtrx.access\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tbrowsetip: function (increase) {\r\n\r\n\t\t\tincrease ? this.tipuserindex++ : this.tipuserindex--\r\n\r\n\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t}\r\n\r\n\t\t\tif (this.tipuserindex < 0) {\r\n\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tselectcurrenttip: function () {\r\n\t\t\tthis.insertuser(this.tipusers[this.tipuserindex || 0])\r\n\t\t},\r\n\r\n\t\tinsertuser: function (user = {}) {\r\n\t\t\tvar name = user.name || ''\r\n\r\n\t\t\tthis.$refs['newinput'].inserttip(name)\r\n\t\t},\r\n\r\n\t\ttipBySearch: function (value) {\r\n\t\t\tthis.tipvalue = value\r\n\t\t},\r\n\r\n\t\tshowuserselected: function (contact, action) {\r\n\t\t\tthis[action](contact)\r\n\t\t},\r\n\r\n\r\n\t\tresizeImage: function (base64) {\r\n\r\n\t\t\tvar ftype = base64.split(';')[0].split('/')[1];\r\n\t\t\tvar images = new Images()\r\n\r\n\t\t\treturn images.resize['fit'](base64, 1024, 1024, ftype, 0.95).then(base64 => {\r\n\r\n\t\t\t\treturn Promise.resolve(base64)\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.reject(e)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tcameraHandlerCustom: function () {\r\n\t\t\tvar result = []\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t\twindow.POCKETNETINSTANCE.platform.ui.uploadImage({\r\n\t\t\t\tmultiple: true,\r\n\r\n\t\t\t\taction: ({ base64 }, resolve) => {\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\treturn this.resizeImage(base64).then(base64 => {\r\n\r\n\t\t\t\t\t\treturn f.Base64.toFile(base64).then(file => {\r\n\t\t\t\t\t\t\tvar data = {\r\n\t\t\t\t\t\t\t\tbase64,\r\n\t\t\t\t\t\t\t\tfile\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tresult.push(data)\r\n\r\n\t\t\t\t\t\t\tthis.uploadUploaded(null, data)\r\n\r\n\t\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonSuccess: (imgs) => {\r\n\t\t\t\t\tthis.uploadUploadedAll()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendtransactionWrapper: function () {\r\n\r\n\t\t\tthis.menuIsVisible = false\r\n\r\n\t\t\tvar users = _.filter(_.map(this.joined, (j) => {\r\n\t\t\t\treturn this.$f.deep(this, '$store.state.users.' + this.$f.getmatrixid(j)) || null\r\n\t\t\t}), (r) => {\r\n\t\t\t\treturn r && r.source && r.id != this.core.user.userinfo?.id\r\n\t\t\t})\r\n\r\n\t\t\tif (!users.length) {\r\n\r\n\t\t\t\treturn 'users.length'\r\n\t\t\t}\r\n\r\n\t\t\tif (users.length > 1) {\r\n\r\n\t\t\t\tthis.core.store.commit('setmodal', {\r\n\t\t\t\t\tcaption: this.$i18n.t(\"caption.sendTransactionTo\"),\r\n\t\t\t\t\ttype: 'showuserselect',\r\n\t\t\t\t\tdata: {\r\n\t\t\t\t\t\tusers: users,\r\n\t\t\t\t\t\taction: 'sendtransaction',\r\n\t\t\t\t\t\tuserselected: (c) => {\r\n\t\t\t\t\t\t\tthis.showuserselected(c, 'sendtransaction')\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\t/*this.showuserselect = {\r\n\t\t\t\t users : users,\r\n\t\t\t\t action : 'sendtransaction'\r\n\t\t\t\t}*/\r\n\t\t\t} else {\r\n\t\t\t\tthis.sendtransaction(users[0])\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t},\r\n\r\n\t\tsendtransaction: function (user) {\r\n\t\t\tvar api = this.transaction\r\n\r\n\t\t\t//TODO get address and send transaction\r\n\r\n\t\t\tapi({\r\n\t\t\t\troomid: this.chat.roomId,\r\n\t\t\t\taddress: user.source.address\r\n\t\t\t})\r\n\r\n\t\t\t/*.then(({txid, from}) => {\r\n\t \r\n\t\t\t return this.core.mtrx.transaction(this.chat.roomId, txid)\r\n\t \r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\temitInputData: function () {\r\n\t\t\tthis.$emit('emptyInput')\r\n\t\t\tthis.upload = true\r\n\t\t},\r\n\r\n\t\tHideUploadPic() {\r\n\t\t\tthis.upload = false\r\n\t\t},\r\n\r\n\t\temitUrl: function (url) {\r\n\t\t\tthis.$emit('setMetaUrl', url)\r\n\t\t},\r\n\r\n\t\tnewchat() {\r\n\r\n\t\t\tif (this.u) {\r\n\t\t\t\tthis.$store.state.globalpreloader = true\r\n\t\t\t\tvar matrixId = null\r\n\t\t\t\tvar myMatrixId = null\r\n\t\t\t\tvar chat = null\r\n\t\t\t\tvar id = ''\r\n\r\n\t\t\t\tthis.creating = true\r\n\t\t\t\treturn this.core.user.usersInfo(this.uusers).then(info => {\r\n\r\n\t\t\t\t\tif (this.uusers.length == 1) {\r\n\r\n\t\t\t\t\t\tvar _info = info[0]\r\n\r\n\t\t\t\t\t\tif (!_info || !_info.keys || _info.keys.length < 12) {\r\n\r\n\t\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.core.user.userinfo.keys.length < 12) {\r\n\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t//return Promise.reject('ny3')\r\n\r\n\t\t\t\t\tid = this.core.mtrx.kit.tetatetid(info[0], this.core.user.userinfo)\r\n\r\n\t\t\t\t\tmatrixId = this.core.user.matrixId(info[0].id)\r\n\t\t\t\t\tmyMatrixId = this.core.user.matrixId(this.core.user.userinfo.id)\r\n\r\n\t\t\t\t\tvar initialstate = [{\r\n\t\t\t\t\t\t\"type\": \"m.set.encrypted\",\r\n\t\t\t\t\t\t\"state_key\": \"\",\r\n\t\t\t\t\t\t\"content\": {\r\n\t\t\t\t\t\t\tencrypted: true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}]\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.createRoom(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\troom_alias_name: id,\r\n\t\t\t\t\t\t\tvisibility: 'private',\r\n\t\t\t\t\t\t\tinvite: [matrixId],\r\n\t\t\t\t\t\t\tname: '#' + id,\r\n\t\t\t\t\t\t\tinitial_state: initialstate\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\r\n\t\t\t\t}).then(_chat => {\r\n\r\n\t\t\t\t\tchat = _chat\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tlet m_chat = this.core.mtrx.client.getRoom(_chat.room_id)\r\n\t\t\t\t\tlet event = m_chat.currentState.getStateEvents(\"m.room.power_levels\")\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.setPowerLevel(chat.room_id, matrixId, 100, event[0]).catch(e => {\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\r\n\t\t\t\t\tif (this.connect && this.connect == id) {\r\n\t\t\t\t\t\tthis.greetings()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.$store.commit('CONTACT', false)\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tif (e && e.errcode == 'M_ROOM_IN_USE') {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.client.joinRoom('#' + id + ':' + this.core.mtrx.baseUrl.replace(\"https://\", \"\")).then(() => {\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn Promise.reject('u')\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tmaySendMessage() {\r\n\t\t\treturn this.chat && this.chat.maySendMessage()\r\n\t\t},\r\n\r\n\t\tgreetings() {\r\n\t\t\tthis.send('👋').then(r => {\r\n\t\t\t\treturn Promise.resolve(r)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendinput(text) {\r\n\r\n\t\t\tthis.send(text).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\ttextCutLimit: function (text, limit) {\r\n\t\t\ttext = text.trim();\r\n\t\t\tif (text.length <= limit) return text;\r\n\r\n\t\t\ttext = text.slice(0, limit);\r\n\r\n\t\t\treturn text.trim() + \"...\";\r\n\t\t},\r\n\r\n\t\treplaceMentions(text) {\r\n\r\n\t\t\t_.each(this.userlist, function (user) {\r\n\t\t\t\ttext = text.replace(new RegExp('@' + user.name, 'g'), '@' + user.id + ':' + user.name)\r\n\t\t\t})\r\n\r\n\t\t\treturn text\r\n\t\t},\r\n\r\n\t\tsend(text) {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\t//return this.chat.pcrypto.getOrCreateCommonKey()\r\n\r\n\t\t\t//return this.chat.pcrypto.sendCommonKey()\r\n\r\n\t\t\t//return\r\n\r\n\t\t\tthis.$emit(\"sending\")\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\t\t\t\tthis.focus()\r\n\t\t\t}\r\n\r\n\t\t\treturn this.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat && !this.creating\r\n\r\n\t\t\t}).then((r) => {\r\n\r\n\t\t\t\tthis.$emit('sent')\r\n\r\n\t\t\t\ttext = this.replaceMentions(text)\r\n\r\n\t\t\t\tif (this.relationEvent) {\r\n\r\n\t\t\t\t\tif (this.relationEvent.type == 'm.replace' && this.relationEvent.event) {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.textEvent(this.chat, text).then(r => {\r\n\r\n\t\t\t\t\t\t\tr['m.relates_to'] = {\r\n\t\t\t\t\t\t\t\t\"rel_type\": \"m.replace\",\r\n\t\t\t\t\t\t\t\t\"event_id\": this.core.mtrx.clearEventId(this.relationEvent.event) || f.makeid(),\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar editEvent = r\r\n\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.body = r.body\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.block = r.block\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.msgtype = r.msgtype\r\n\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decryptKey\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decrypted\r\n\r\n\t\t\t\t\t\t\treturn this.core.mtrx.client.sendEvent(this.chat.roomId, 'm.room.message', editEvent)\r\n\r\n\t\t\t\t\t\t}).then(r => {\r\n\r\n\t\t\t\t\t\t\tthis.core.store.dispatch('FETCH_EVENTS')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('clearRelationEvent')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('force')\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\t\treturn Promise.reject(e)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.core.mtrx.sendtext(this.chat, text, { relation: this.relationEvent })\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\r\n\t\t\t\tthis.$emit('sentMessageError', {\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tpasteImage(data) {\r\n\t\t\tthis.sendImage({ base64: data })\r\n\t\t},\r\n\r\n\t\tsendImage: function ({ base64, file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"image\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\t\t\t//setTimeout(() => {\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\t\t\t\tif (meta.aborted)\r\n\t\t\t\t\treturn Promise.reject('aborted')\r\n\r\n\t\t\t\treturn this.core.mtrx.sendImage(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t})\r\n\t\t\t//}, 5000)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tcanencryptfilesize: function (file) {\r\n\r\n\t\t\tvar s = 10 * 1024 * 1024\r\n\r\n\t\t\tif (!this.chat.pcrypto.canBeEncrypt()) {\r\n\t\t\t\treturn Promise.resolve(false)\r\n\t\t\t}\r\n\r\n\t\t\tif (file.size > s) {\r\n\r\n\r\n\t\t\t\treturn this.$dialog.confirm(\r\n\t\t\t\t\t'Files larger than 10 megabytes are not encrypted. Do you want to send the file unencrypted?', {\r\n\t\t\t\t\tokText: 'Yes',\r\n\t\t\t\t\tcancelText: 'No, cancel'\r\n\t\t\t\t})\r\n\r\n\t\t\t\t\t.then((dialog) => {\r\n\r\n\t\t\t\t\t\treturn Promise.resolve(true)\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.reject('cancel')\r\n\t\t\t\t\t})\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve(false)\r\n\t\t},\r\n\r\n\t\tsendFile: function ({ file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"file\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tinfo: {\r\n\t\t\t\t\tname: file.name,\r\n\t\t\t\t\tsize: file.size\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\treturn this.canencryptfilesize(file)\r\n\r\n\r\n\t\t\t}).then((notenc) => {\r\n\r\n\t\t\t\treturn this.core.mtrx.sendFile(this.chat, file, meta, { relation: this.relationEvent }, notenc)\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].focus()\r\n\t\t},\r\n\r\n\t\tfocused: function () {\r\n\t\t\tthis.$emit('focused')\r\n\t\t},\r\n\r\n\t\tblur: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blur()\r\n\t\t},\r\n\r\n\t\tblurifempty: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blurifempty()\r\n\t\t},\r\n\r\n\t\tchange: function () {\r\n\t\t},\r\n\r\n\t\tsetText: function (text) {\r\n\t\t\tthis.text = text\r\n\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].setText(text)\r\n\t\t},\r\n\r\n\t\tkeyup: function (evt) {\r\n\t\t\tvar value = evt.target.value\r\n\r\n\t\t\tif (value === '') {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t\treturn\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', true)\r\n\t\t\t}\r\n\r\n\t\t\tthis.text = value\r\n\t\t\tthis.anyUrlMeta = f.getUrl(this.text)\r\n\r\n\r\n\t\t\tif (this.anyUrlMeta !== undefined) {\r\n\t\t\t\tthis.$emit('setMetaUrl', this.anyUrlMeta)\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t}\r\n\r\n\t\t\tif (this.chat)\r\n\t\t\t\tthis.core.mtrx.client.sendTyping(this.chat.roomId, true, 100)\r\n\t\t},\r\n\r\n\t\tmenuItemClick(item, rowObject) {\r\n\t\t\tthis[item.click](rowObject);\r\n\t\t},\r\n\r\n\t\tmenuItemLoadedHandler: function (value) {\r\n\r\n\t\t\tthis.menuIsVisible = value\r\n\r\n\t\t\treturn this.menuIsVisible\r\n\t\t},\r\n\r\n\t\tuploadStart(item, files) {\r\n\r\n\t\t},\r\n\r\n\t\tuploadError(item, error) {\r\n\t\t\tthis.$store.commit('icon', {\r\n\t\t\t\ticon: 'error',\r\n\t\t\t\tmessage: error.text\r\n\t\t\t})\r\n\t\t},\r\n\t\tgetImg() {\r\n\t\t\treturn this.imgs = true\r\n\t\t},\r\n\t\tuploadSizeError(value) {\r\n\t\t\tif (!value) {\r\n\t\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t\t}\r\n\t\t},\r\n\t\tuploadUploaded(item, data) {\r\n\t\t\tconst validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/webp'];\r\n\r\n\r\n\t\t\tif (!validImageTypes.includes(data.file.type)) {\r\n\t\t\t\tthis.sendFile(data)\r\n\t\t\t} else {\r\n\t\t\t\treturn this.sendImage(data)\r\n\t\t\t}\r\n\t\t},\r\n\t\timageWH(file) {\r\n\t\t\tconst img = new Image();\r\n\t\t\tvar imgInfo = {};\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\timg.onload = function () {\r\n\t\t\t\t\timgInfo.w = this.width\r\n\t\t\t\t\timgInfo.h = this.height\r\n\t\t\t\t\tresolve(imgInfo)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.onerror = function (e) {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.src = file.base64\r\n\t\t\t})\r\n\r\n\t\t},\r\n\t\tuploadUploadedAll(item, result) {\r\n\t\t\tthis.$store.state.loading = false\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t},\r\n\r\n\t\tcatchPermissonsError(err) {\r\n\r\n\t\t\tif (err == 'permissions' || (err.toString && err.toString().indexOf('Permission') > -1)) {\r\n\t\t\t\tthis.microphoneDisabled = true\r\n\r\n\t\t\t\tif (window.cordova) {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccesscordova'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccessbrowser'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif ((err.toString && err.toString().indexOf('device not found') > -1)) {\r\n\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\tthis.$i18n.t('micdevicenotfound'), {\r\n\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t})\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$dialog.confirm(\r\n\t\t\t\tthis.$i18n.t('micaccesscommonproblem'), {\r\n\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t})\r\n\r\n\t\t\tconsole.error(err)\r\n\t\t},\r\n\r\n\t\tgetFileIosCordova (path) {\r\n\r\n\t\t\tconsole.log('load', path)\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\twindow.resolveLocalFileSystemURL(path, (entry) => {\r\n\r\n\r\n\t\t\t\t\tif(!entry){\r\n\t\t\t\t\t\treturn reject('noentry')\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tentry.file((file) => {\r\n\t\t\t\t\t\tvar reader = new FileReader()\r\n\r\n\t\t\t\t\t\tconsole.log('file', file)\r\n\t\r\n\t\t\t\t\t\treader.onloadend = function() {\r\n\t\t\t\t\t\t\tvar blob = new Blob([new Uint8Array(this.result)], {type : file.type})\r\n\r\n\t\t\t\t\t\t\tconsole.log('blob', blob)\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\r\n\t\t\t\t\t\t\tresolve(blob)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treader.onerror = (e) => {\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file)\r\n\t\t\t\t\t})\r\n\t\t\t\t}, (e) => {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t\t\r\n\t\t},\r\n\r\n\t\tinitRecordingCordova() {\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.media.permissions({ audio: true }).then(() => {\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tconsole.error(err)\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\t\t\tthis.prepareRecording.then(() => {\r\n\r\n\t\t\t\tconsole.log(\"START RECORDING\")\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tvar path = 'recording.mp3'\r\n\r\n\t\t\t\tif(f.isios()) path = 'cdvfile://localhost/temporary/recording.m4a'\r\n\r\n\t\t\t\tvar sec = 0\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\r\n\t\t\t\t//var startedTime = (new Date()).getTime() / 1000\r\n\r\n\t\t\t\tvar media = this.cordovaMediaRecorder = new Media(path, () => {\r\n\r\n\t\t\t\t\tconsole.log(\"MEDIA PREPARED\", this.cancelledCordovaMediaRecorder)\r\n\r\n\t\t\t\t\tthis.recordTime = 0\r\n\r\n\t\t\t\t\tmedia.release()\r\n\r\n\t\t\t\t\tif (this.cancelledCordovaMediaRecorder) {\r\n\r\n\t\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar fu = null\r\n\r\n\t\t\t\t\t/*if(f.isios()){ */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfu = this.getFileIosCordova(f.isios() ? path : window.cordova.file.externalDataDirectory + path).then(blob => {\r\n\t\t\t\t\t\t\treturn Promise.resolve({\r\n\t\t\t\t\t\t\t\tdata : blob\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*}\r\n\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tfu = f.fetchLocal(path)\r\n\t\t\t\t\t}*/\r\n\r\n\t\t\t\t\tfu.then(r => {\r\n\t\t\t\t\t\t///temp\r\n\t\t\t\t\t\t/*if (f.isios())\r\n\t\t\t\t\t\t\tr.duration = (new Date()).getTime() / 1000 - startedTime\r\n\r\n\t\t\t\t\t\tconsole.log(\"R\", r)\r\n\r\n\t\t\t\t\t\t/*var e = {\r\n\t\t\t\t\t\t\tdata : r.data\r\n\t\t\t\t\t\t}*/\r\n\r\n\t\t\t\t\t\tconsole.log('media.duration', media.duration)\r\n\r\n\t\t\t\t\t\tif (media.duration && media.duration > 0){\r\n\t\t\t\t\t\t\tr.duration = media.duration\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.createVoiceMessage(r, true)\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t}).finally(() => {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}, (e) => {\r\n\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.isRecording = false\r\n\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\tvar rmsdata = []\r\n\r\n\t\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\t\tif (currentPlaying) {\r\n\t\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\t\t// get media amplitude\r\n\r\n\t\t\t\t\tif(f.isios()){\r\n\t\t\t\t\t\trmsdata.push(1)\r\n\r\n\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tthis.cordovaMediaRecorder.getCurrentAmplitude(\r\n\t\t\t\t\t\t\t// success callback\r\n\t\t\t\t\t\t\t(amp) => {\r\n\t\r\n\t\t\t\t\t\t\t\trmsdata.push(amp * 1000)\r\n\t\r\n\t\t\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\r\n\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tfunction (e) {\r\n\t\t\t\t\t\t\t\tconsole.log(\"E\", e)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\t\tif (sec % 1000 === 0) this.recordTime = sec\r\n\r\n\t\t\t\t}, 50);\r\n\r\n\t\t\t\tthis.isRecording = true\r\n\t\t\t\tthis.cancelOpacity = 0\r\n\t\t\t\tthis.recordRmsData = []\r\n\t\t\t\tthis.recordTime = 0\r\n\t\t\t\tthis.record = null\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.startRecord();\r\n\r\n\t\t\t}).catch((e) => { \r\n\t\t\t\tconsole.error(e)\r\n\r\n\r\n\t\t\t}).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tinitRecording() {\r\n\r\n\t\t\tif (this.prepareRecording || this.isRecording || this.cordovaMediaRecorder) return\r\n\r\n\t\t\tconsole.log(\"INIT RECORDING\")\r\n\r\n\t\t\tif (window.cordova) {\r\n\t\t\t\treturn this.initRecordingCordova()\r\n\t\t\t}\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.initMediaRecorder().then((recorder) => {\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tif (this.prepareRecording) {\r\n\t\t\t\t\treturn Promise.resolve(recorder)\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\t\ttrack.stop();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\r\n\t\t\tthis.prepareRecording.then((recorder) => {\r\n\r\n\r\n\t\t\t\tthis.mediaRecorder = recorder\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\t\t\t\tthis.audioAnalyser = this.audioContext.createAnalyser()\r\n\r\n\t\t\t\t//var audioDataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tvar src = this.audioContext.createMediaStreamSource(this.mediaRecorder.stream)\r\n\t\t\t\tsrc.connect(this.audioAnalyser)\r\n\r\n\t\t\t\tthis.startRecording()\r\n\r\n\t\t\t}).catch(() => { }).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tstartRecording() {\r\n\r\n\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\tif (currentPlaying) {\r\n\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t}\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', true)\r\n\r\n\t\t\tthis.isRecording = true\r\n\t\t\tthis.cancelOpacity = 0\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\t\t\tthis.record = null\r\n\t\t\tthis.mediaRecorder.start()\r\n\r\n\t\t\tvar sec = 0\r\n\t\t\tvar rmsdata = []\r\n\r\n\r\n\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\tvar dataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tthis.audioAnalyser.getByteFrequencyData(dataArray)\r\n\r\n\r\n\t\t\t\trmsdata.push(this.generateRms(dataArray))\r\n\r\n\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\r\n\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\r\n\t\t\t\tif (sec % 1000 === 0) {\r\n\t\t\t\t\tthis.recordTime = sec\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 50)\r\n\r\n\t\t},\r\n\r\n\r\n\t\tcheckaudioForSend: function (record, sendnow) {\r\n\r\n\t\t\tif (record.duration < 1) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (sendnow) {\r\n\t\t\t\t\tthis.sendVoiceMessage(record)\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.record = record\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetduration(file){\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\tf.readFile(file).then(arraybuffer => {\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\t\t\t\t\t\t\tresolve(buffer.duration)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}).catch(reject)\r\n\t\t\t})\r\n\r\n\t\t\t\r\n\r\n\t\t},\r\n\r\n\t\tcreateVoiceMessage(event, sendnow) {\r\n\t\t\tconsole.log('event', event)\r\n\r\n\t\t\tvar c = () => {\r\n\r\n\t\t\t\t//this.record = \r\n\r\n\t\t\t\tthis.checkaudioForSend({\r\n\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\tid: f.makeid(),\r\n\t\t\t\t\tduration : event.duration\r\n\t\t\t\t}, sendnow)\r\n\t\t\t}\r\n\r\n\t\t\tif(event.duration){\r\n\r\n\t\t\t\tc()\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.getduration(event.data).then(duration => {\r\n\t\t\t\t\tevent.duration = duration\r\n\r\n\t\t\t\t\tc()\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.clear()\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/*f.readFile(event.data).then(arraybuffer => {\r\n\r\n\t\t\t\tconsole.log('arraybuffer', arraybuffer)\r\n\r\n\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\r\n\t\t\t\t\tconsole.log('this.record', this.record)\r\n\t\t\t\t\tconsole.log('this.buffer', buffer)\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tthis.record = {\r\n\t\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\t\tid: f.makeid()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.record.duration = buffer.duration\r\n\r\n\t\t\t\t\tthis.checkaudioForSend(sendnow)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tconsole.error('e', e)\r\n\t\t\t\tthis.clear()\r\n\t\t\t\t//\r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\tgenerateRms(frequencies) {\r\n\t\t\treturn +Math.sqrt(frequencies.reduce((a, b) => a + b ** 2) / frequencies.length).toPrecision(4)\r\n\t\t},\r\n\r\n\t\tstopRecording({ cancel, sendnow }) {\r\n\r\n\t\t\tconsole.log(\"STOP RECORDING\", this.isRecording)\r\n\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', false)\r\n\r\n\t\t\tif (this.prepareRecording) {\r\n\r\n\t\t\t\tthis.prepareRecording.cancel()\r\n\t\t\t\tthis.prepareRecording = null\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tthis.isRecording = false\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\t//this.mediaRecorder.ondataavailable = () => { }\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.mediaRecorder.addEventListener('dataavailable', (event) => {\r\n\t\t\t\t\t\tthis.createVoiceMessage(event, sendnow)\r\n\t\t\t\t\t})//ondataavailable = (event) => this.createVoiceMessage(event, sendnow)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = true\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.stopRecord()\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tasync sendVoiceMessage(record) {\r\n\r\n\t\t\tif(!record) record = this.record\r\n\r\n\t\t\tif(!record) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\r\n\t\t\tthis.recordRmsData = []\r\n\r\n\t\t\tconst base64 = await this.core.convertAudioToBase64(record.file)\r\n\r\n\t\t\tconst id = f.makeid()\r\n\r\n\t\t\tconst meta = {\r\n\t\t\t\ttype: \"audio\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.clear()\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\t\t\t\treturn this.chat\r\n\t\t\t}).then(() => {\r\n\t\t\t\treturn this.core.mtrx.sendAudio(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tclear() {\r\n\t\t\tthis.record = null\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\t/*if (this.audioContext){\r\n\t\t\t\tthis.audioContext.close()\r\n\t\t\t}*/\r\n\t\t},\r\n\r\n\t\t/*async convertAudioToBase64(blob) {\r\n\t\t\tconst reader = new FileReader()\r\n\t\t\treader.readAsDataURL(blob)\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\treader.onloadend = () => {\r\n\t\t\t\t\tresolve(reader.result)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},*/\r\n\r\n\t\tsetOpacity(opacity) {\r\n\t\t\tthis.cancelOpacity = opacity\r\n\t\t}\r\n\r\n\t},\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e8b463ac&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e8b463ac&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e8b463ac\",\n null\n ,true\n)\n\nexport default component.exports"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?6dbd","webpack:///./src/components/assets/recordProgress/index.scss?7174","webpack:///./src/components/chat/input/InputField/InputField.vue?f020","webpack:///./src/components/assets/upload/index.vue?4a8e","webpack:///./src/components/assets/recordProgress/index.scss?cee1","webpack:///./src/components/chat/input/index.sass?2730","webpack:///./src/components/chat/input/InputField/InputField.vue?fce9","webpack:///./src/components/assets/upload/index.vue?6d1f","webpack:///./src/components/assets/recordVoice/index.scss?ad6e","webpack:///./src/components/chat/input/index.sass?ea34","webpack:///./src/components/assets/recordVoice/index.scss?76f8","webpack:///./src/components/assets/upload/index.vue?fdd5","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?9ee5","webpack:///./src/components/chat/input/index.sass","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?90c5","webpack:///./src/components/assets/recordVoice/index.scss","webpack:///./src/components/assets/recordProgress/index.scss","webpack:///./src/components/chat/input/InputField/InputField.vue?1d64","webpack:///./src/components/chat/input/index.vue?56ea","webpack:///./src/components/chat/input/InputField/InputField.vue?d728","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?0090","webpack:///src/components/chat/input/picturePreview/picturePreview.vue","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?3bda","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue","webpack:///src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/chat/input/InputField/InputField.vue?3335","webpack:///./src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/assets/recordVoice/index.vue?97db","webpack:///./src/components/assets/recordVoice/index.js","webpack:///./src/components/assets/recordVoice","webpack:///./src/components/assets/recordVoice/index.vue","webpack:///./src/components/assets/recordProgress/index.vue?083f","webpack:///./src/components/assets/recordProgress/index.js","webpack:///./src/components/assets/recordProgress","webpack:///./src/components/assets/recordProgress/index.vue","webpack:///./src/components/assets/upload/index.vue?1a6d","webpack:///src/components/assets/upload/index.vue","webpack:///./src/components/assets/upload/index.vue?f5f6","webpack:///./src/components/assets/upload/index.vue","webpack:///./src/components/chat/input/index.js","webpack:///./src/components/chat/input","webpack:///./src/components/chat/input/index.vue"],"names":["name","props","data","is_opened","methods","hide","components","Picker","picturePreview","directives","clickOutside","watch","text","immediately","handler","send","ready","exclude","display_emoji","content_height","pasted_data","block","upload","multiple","extensions","images","resize","type","hidden_previews","emojiIndex","computed","mobile","prepareemoji","window","setText","setTimeout","focused","textchange","savetextinstorage","localStorage","send_empty_array","focus","blur","blurifempty","close_emoji_picker","textarea_resize","textarea_resize_reset","toggle_emoji_picker","send_text","insert_emoji","paste_image","get_base64","reader","okText","cancelText","then","dialog","resize_image","catch","error","getsearchposition","start","middle","end","sposition","br","dg","i","getsearch","keydown","event","keyup","blured","inserttip","f","storagekey","tipusers","creared","mounted","isRecording","Boolean","required","prepareRecording","disabled","isHold","direction","mapState","state","beforeDestroy","document","removeEventListener","handleMove","$emit","cancel","mouseup","e","handleTouchEnd","mousedown","handleTouchStart","Y","changedTouches","pageY","X","pageX","addEventListener","sendnow","clearStyle","$refs","toggle","style","transform","classList","remove","holder","deltaY","deltaX","length","contains","add","recordEnd","recordTime","Number","rmsData","Array","opacity","width","timer","minute","Math","floor","sec","rmsDataLast","_","last","throttle","draw","graph","offsetWidth","re","canvas","ctx","getContext","x","count","l","c","max","clearRect","fillStyle","fillRect","clear","dropzone","onlyimage","maxsize","default","loading","maxSize","created","read","resolve","base64","file","each","ha","next","result","err","errorText","check","checkSize","getExtension","checkExtension","handle","sendAnyFile","resizeIfNeed","handleImages","chat","Object","u","String","relationEvent","InputField","contacts","preview","recordProgress","recordVoice","test","fileInfo","creating","userId","showuserselect","anyUrlMeta","joinedMembers","tipvalue","tipuserindex","record","recordRmsData","mediaRecorder","audioContext","audioAnalyser","interval","cancelOpacity","microphoneDisabled","cancelledCordovaMediaRecorder","usersForKeysHash","close","voiceEnable","$store","voiceMessagesEnabled","connect","contact","pkoindisabled","menuItems","POCKETNETINSTANCE","supportimagegallery","push","click","title","$i18n","t","icon","transaction","unshift","userlist","core","mtrx","chatUsersInfo","roomId","deep","uusers","map","split","ausers","user","matrixId","stateChat","id","$route","query","chatsMap","invited","filter","currentState","getMembers","m","v","membership","joined","self","arr","members","forEach","value","toLowerCase","indexOf","maintipuser","client","newchat","Promise","wait","$f","pretry","access","browsetip","increase","selectcurrenttip","insertuser","tipBySearch","showuserselected","action","resizeImage","ftype","Images","reject","cameraHandlerCustom","dropdownMenu","hidePopup","platform","ui","uploadImage","Base64","toFile","uploadUploaded","console","onSuccess","imgs","uploadUploadedAll","sendtransactionWrapper","menuIsVisible","users","j","getmatrixid","r","source","userinfo","store","commit","caption","userselected","sendtransaction","api","roomid","address","emitInputData","HideUploadPic","emitUrl","url","globalpreloader","myMatrixId","usersInfo","info","_info","keys","kit","tetatetid","initialstate","encrypted","createRoom","room_alias_name","visibility","invite","initial_state","_chat","m_chat","getRoom","room_id","getStateEvents","setPowerLevel","greetings","errcode","joinRoom","baseUrl","replace","maySendMessage","sendinput","textCutLimit","limit","trim","slice","replaceMentions","RegExp","textEvent","clearEventId","makeid","editEvent","content","body","msgtype","decryptKey","decrypted","sendEvent","dispatch","sendtext","relation","pasteImage","sendImage","meta","aborted","canencryptfilesize","s","pcrypto","canBeEncrypt","size","$dialog","confirm","sendFile","notenc","change","evt","target","getUrl","undefined","sendTyping","menuItemClick","item","rowObject","menuItemLoadedHandler","uploadStart","files","uploadError","message","getImg","uploadSizeError","validImageTypes","includes","imageWH","img","Image","imgInfo","onload","w","h","height","onerror","src","catchPermissonsError","toString","cordova","getFileIosCordova","path","resolveLocalFileSystemURL","entry","FileReader","onloadend","blob","Blob","Uint8Array","readAsArrayBuffer","initRecordingCordova","cancelable","media","permissions","audio","isios","getAudioContext","cordovaMediaRecorder","Media","release","fu","externalDataDirectory","duration","createVoiceMessage","finally","rmsdata","currentPlaying","currentPlayingVoiceMessage","pause","setInterval","clone","getCurrentAmplitude","amp","log","startRecord","initRecording","initMediaRecorder","recorder","stream","getTracks","track","stop","createAnalyser","createMediaStreamSource","startRecording","dataArray","frequencyBinCount","getByteFrequencyData","generateRms","checkaudioForSend","sendVoiceMessage","getduration","readFile","arraybuffer","decodeAudioData","buffer","frequencies","sqrt","reduce","a","b","toPrecision","stopRecording","clearInterval","stopRecord","convertAudioToBase64","sendAudio","setOpacity"],"mappings":";;;;;AAAA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAkkB;AACxlB;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAsE;AACxF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAga;AACtb;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAA8jB;AACplB;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAsE;AACxF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAoiB;AAC1jB;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;;ACXA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;;ACAA;AAAA;AAAA;AAAA;;;;;;;;ACAA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAoa;AAC1b;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;ACXA;;AAEA;AACA,cAAc,mBAAO,CAAC,MAAga;AACtb;AACA,4CAA4C,QAAS;AACrD;AACA;AACA,UAAU,mBAAO,CAAC,MAAmE;AACrF;AACA;AACA,E;;;;;;;ACXA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,4BAA4B,WAAW,gCAAgC,kBAAkB,kGAAkG,kBAAkB,OAAO,QAAQ,MAAM,SAAS,UAAU;AAC5Q;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAA4D;AACtG;AACA;AACA,cAAc,QAAS,6BAA6B,kBAAkB,sBAAsB,kBAAkB,WAAW,SAAS,kCAAkC,WAAW,YAAY,mBAAmB;AAC9M;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,+BAA+B,oBAAoB,kDAAkD,OAAO,kCAAkC,4BAA4B,6BAA6B,+BAA+B,aAAa,qCAAqC,WAAW,aAAa,yBAAyB,mBAAmB,kBAAkB,iDAAiD,aAAa,mBAAmB,uBAAuB,YAAY,WAAW,wCAAwC,yCAAyC,WAAW,gBAAgB,0CAA0C,WAAW,mCAAmC,eAAe,uCAAuC,iBAAiB,eAAe,aAAa,8BAA8B,mBAAmB,YAAY,6BAA6B,mBAAmB,kDAAkD,qCAAqC,4CAA4C,2CAA2C,mBAAmB,WAAW,iBAAiB,wDAAwD,eAAe,kBAAkB,kCAAkC,eAAe,4BAA4B,eAAe,2DAA2D,kBAAkB,4BAA4B,aAAa,8CAA8C,iBAAiB,kBAAkB,aAAa,mCAAmC,YAAY,mBAAmB,kBAAkB,yCAAyC,WAAW,2BAA2B,kBAAkB,iBAAiB,mBAAmB,gDAAgD,mBAAmB,yDAAyD,0BAA0B,kCAAkC,gBAAgB,YAAY,mBAAmB,WAAW,YAAY,8CAA8C,oBAAoB,kBAAkB,mBAAmB,kBAAkB,qBAAqB,8DAA8D,6BAA6B,8BAA8B,uDAAuD,uCAAuC,2BAA2B,aAAa,uBAAuB,mBAAmB,WAAW,YAAY,iCAAiC,6BAA6B,gBAAgB;AACj/E;AACA;;;;;;;;;ACNA;AAAA;AAAA;AAAA;;;;;;;;ACAA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,0CAA0C,kBAAkB,sCAAsC,kBAAkB,kBAAkB,aAAa,uBAAuB,mBAAmB,YAAY,WAAW,gBAAgB,kBAAkB,YAAY,eAAe,UAAU,4CAA4C,WAAW,cAAc,6CAA6C,mBAAmB,2CAA2C,gBAAgB,mBAAmB,YAAY,iDAAiD,WAAW,oCAAoC,gBAAgB,kBAAkB,aAAa,mBAAmB,uBAAuB,WAAW,YAAY,2BAA2B,uBAAuB,kBAAkB,aAAa,kBAAkB,2CAA2C,mCAAmC,sDAAsD,8CAA8C,iDAAiD,0CAA0C,kDAAkD,kBAAkB,WAAW,aAAa,YAAY,UAAU,aAAa,kBAAkB,8CAA8C,sDAAsD,8CAA8C,mDAAmD,iCAAiC,gFAAgF,iCAAiC,oCAAoC,0CAA0C,eAAe,yCAAyC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW,iCAAiC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW;AACpzD;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAAyD;AACnG;AACA;AACA,cAAc,QAAS,oCAAoC,aAAa,YAAY,2BAA2B,cAAc,mBAAmB,cAAc,YAAY,mDAAmD,eAAe,WAAW,iBAAiB,aAAa,uBAAuB,mBAAmB,4CAA4C,WAAW,UAAU,mBAAmB,kBAAkB,sDAAsD,2DAA2D,mDAAmD,sCAAsC,eAAe,eAAe,aAAa,uBAAuB,mBAAmB,WAAW,YAAY,iBAAiB,wCAAwC,UAAU,eAAe,wCAAwC,iBAAiB,wCAAwC,cAAc,YAAY,gBAAgB,mBAAmB,iEAAiE,aAAa,uBAAuB,yBAAyB,kBAAkB,OAAO,QAAQ,MAAM,SAAS,kDAAkD,UAAU,kBAAkB,mBAAmB,8BAA8B,mBAAmB,eAAe,yCAAyC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW,iCAAiC,GAAG,UAAU,IAAI,WAAW,GAAG,WAAW;AACx7C;AACA;;;;;;;;ACNA;AACA,kCAAkC,mBAAO,CAAC,MAA4D;AACtG;AACA;AACA,cAAc,QAAS,qCAAqC,WAAW,aAAa,uBAAuB,mBAAmB,cAAc,gBAAgB,gEAAgE,UAAU,YAAY,eAAe,qEAAqE,eAAe,sEAAsE,gBAAgB,gBAAgB,6EAA6E,aAAa,iDAAiD,aAAa,sBAAsB,uBAAuB,uBAAuB,kBAAkB,WAAW,yCAAyC,cAAc,yDAAyD,WAAW,0DAA0D,WAAW,sDAAsD,WAAW,YAAY,iBAAiB,wDAAwD,2BAA2B,4CAA4C,WAAW,gBAAgB,YAAY,aAAa,uBAAuB,cAAc,gBAAgB,wDAAwD,cAAc,4CAA4C,WAAW,aAAa,2BAA2B,mBAAmB,6BAA6B,WAAW,iBAAiB,gBAAgB,YAAY,gDAAgD,kBAAkB,wEAAwE,2BAA2B,6DAA6D,UAAU;AACnrD;AACA;;;;;;;;;;;;;ACNA,0BAA0B,aAAa,0BAA0B,wBAAwB,iBAAiB,gCAAgC,kBAAkB,wBAAwB,mBAAmB,uBAAuB,2BAA2B,kCAAkC,uBAAuB,wCAAwC,iBAAiB,mDAAmD,iCAAiC,KAAK,yBAAyB,8BAA8B,gBAAgB,OAAO,0BAA0B,MAAM,wBAAwB,qBAAqB,6EAA6E,OAAO,kHAAkH,KAAK,qBAAqB,mBAAmB,sBAAsB,mEAAmE,KAAK,+OAA+O,qCAAqC,0BAA0B,2BAA2B,8CAA8C,yBAAyB,qBAAqB,0BAA0B,wCAAwC,sBAAsB,sBAAsB,qCAAqC,2CAA2C,4BAA4B,yBAAyB,2CAA2C,YAAY,0BAA0B,gCAAgC,0BAA0B,uBAAuB,oBAAoB,gEAAgE,OAAO,0KAA0K,KAAK,0BAA0B,+CAA+C,EAAE,6BAA6B,iDAAiD,EAAE,kCAAkC,sDAAsD,EAAE,2BAA2B,+CAA+C,GAAG,sBAAsB,4BAA4B,kBAAkB,wBAAwB,YAAY,0BAA0B,gCAAgC,0BAA0B,uBAAuB,oBAAoB,oDAAoD,YAAY,EAAE,6BAA6B,iBAAiB,YAAY,aAAa,IAAI,yBAAyB,4CAA4C,aAAa,4GAA4G,2BAA2B,oBAAoB,OAAO,uHAAuH,KAAK,yHAAyH,2DAA2D,6BAA6B,sBAAsB,yBAAyB,+DAA+D,uBAAuB;AACh3G,oCAAoC,aAAa,0BAA0B,wBAAwB,yBAAyB,sCAAsC,IAAI;;;;;;;;;;;;;;;ACDtK,IAAI,0DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,8BAA8B,YAAY,4BAA4B,YAAY,uBAAuB,iBAAiB,+CAA+C,4HAA4H,WAAW,iBAAiB,KAAK,gJAAgJ,mDAAmD,OAAO,+BAA+B,eAAe,aAAa,kFAAkF,EAAE,8GAA8G,UAAU,kHAAkH,SAAS,kHAAkH,KAAK,2BAA2B,6CAA6C,yCAAyC,yBAAyB,mCAAmC,YAAY,wBAAwB,YAAY,qBAAqB,8BAA8B,2BAA2B,UAAU,2BAA2B,sCAAsC,6BAA6B,yBAAyB,+BAA+B;AAC9jD,IAAI,mEAAe,iBAAiB,aAAa,0BAA0B,wBAAwB,iBAAiB,yBAAyB,YAAY,qBAAqB,UAAU,iCAAiC,MAAM;;;;;;;;;;;;;;;;;;;ACD/N,IAAI,8DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iCAAiC,sBAAsB,YAAY,qCAAqC,0CAA0C,UAAU,qCAAqC,kBAAkB;AAC5S,IAAI,uEAAe;;;;;;;;;;;;;ACQJ;EACfA,sBADA;EAEAC,iBAFA;;EAIAC;IACA;MACAC;IADA;EAGA,CARA;;EAUAC;IACAC;MACA;IACA;;EAHA;AAVA,G;;ACTqX,CAAgB,gIAAG,EAAC,C;;;;;ACAhS;AACvC;AACL;AAC7D;;AAEA,eAAe,mBAAO,CAAC,OAAgF;AACvG;;AAEA;;AAEA;AACmG;AACnG,gBAAgB,8CAAU;AAC1B,EAAE,qDAAM;AACR,EAAE,8DAAM;AACR,EAAE,uEAAe;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEe,oE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqCf;AACgD;AACR;AACxC;AAEA;AAEA;AAEA,IAAI,wCAAM,OAAO,+BAAM;AAER;EACfL,kBADA;EAEAM;IACAC,iCADA;IAEAC;EAFA,CAFA;EAOAC;IACAC;EADA,CAPA;EAWAC;IACAC;MACAC,iBADA;MAEAC;QAEA;UAEA;UACA;QAEA,CALA,MAKA;UAEA;UACA;QACA;;QAEA;MACA;IAhBA;EADA,CAXA;;EAgCAZ;IACA;MACAa,WADA;MAGAC,YAHA;MAIAJ,QAJA;MAKAK,kBALA;MAMAC,oBANA;MAOAC,kBAPA;MAQAC,eARA;MASAC,YATA;MAWAC;QACAC,cADA;QAEAC,oDAFA;QAGAC;UACAC;YACAC;UADA;QADA;MAHA,CAXA;MAoBAC,qBApBA;MAqBAC;IArBA;EAuBA,CAxDA;;EA0DAC;IACAC;MACA;IACA;IAEA;;;;;EALA,CA1DA;EAyEA3B;IAEA4B;MAEA;QACA,gEAEA;UAEA;;UACAC;UACA;QAIA;MACA;IACA,CAjBA;IAmBAC;MACA;MAEA;MAEAC;QACA;QACA;MACA,CAHA;IAKA,CA7BA;IA+BAC;MACA;IACA,CAjCA;IAmCAC;MACA;IAEA,CAtCA;IAyCAC;MACA;QACAC;MACA;IACA,CA7CA;;IA8CAC;MACA;IACA,CAhDA;;IAkDAC;MACA;IACA,CApDA;;IAsDAC;MACA;IACA,CAxDA;;IA0DAC;MACA,gBACA;IACA,CA7DA;;IA+DAC;MACA;QACA;UACA;QACA;MACA;IACA,CArEA;;IAuEAC;MAEA;QACA;MACA,CAFA,MAEA;QACA;QACA;QACA;MACA;IAGA,CAlFA;;IAoFAC;MACA;IACA,CAtFA;;IAuFAC;MACA;IACA,CAzFA;;IA2FAC;MAEA;QAEA;QACA;QACA;QACA;QACA;MAEA;;MAEA;IAEA,CAzGA;;IA2GAC;MACA;MAEA;IACA,CA/GA;;IAgHAC;MAEA;IAEA,CApHA;;IAqHAC;MACA;;MAEA;QAEA;UACA;UAEA;;UAEA;YAGA;YACA;;YAEAC;cAEA,qBACA,wCADA,EACA;gBACAC,aADA;gBAEAC;cAFA,CADA,EAMAC,IANA,CAMAC;gBACA;gBACA;cAEA,CAVA;YAWA,CAbA;;YAcAJ;UAGA;QACA;MAEA;IACA,CA1JA;;IA2JAK;MACA;QACA;;QAEA;UAEA;QAEA,CAJA,EAIAC,KAJA,CAIAC,uDAJA;MAKA,CARA,EAQAD,KARA,CAQAC,uDARA;IASA,CArKA;;IAuKAC;MAEA;MAEA;QAAAC;QAAAC;QAAAC;MAAA;MAEA;MACA;MACA;MAEA;MAEAC;;MAEA;QAEA;;QAEA;UAEA;YACAC;UACA,CAFA,MAEA;YACAC;UACA;QACA,CAPA,MAOA;UAEA;YACAF;UACA,CAFA,MAEAC;QACA;;QAEAE;MAEA,CApBA,QAoBAA,2CApBA;;MAsBA;QACAH;MACA,CAFA,MAEA;QAEAC;QACAE;;QAEA;UACA;YACAH;UACA,CAFA,MAEA;YACAC;UACA;;UAEAE;QAEA,CATA,QASAA,4BATA;MAUA;;MAEA;IAEA,CAhOA;;IAmOAC;MAEA;MAEA;MAEA;IAEA,CA3OA;;IA8OAC;MAEA;QAEA;UAEA;UAEAC;UAEA;QACA;MAEA;;MAGA;QAEA;UAEA;UAEAA;UAEA;QAEA;MAEA;;MAEA;QACA;UACA;QACA,CAFA,MAEA;UACA;QACA;;QAEAA;QAEA;MACA;IACA,CAvRA;;IAyRAC;MAEA;QACAD;QAEA;MACA;;MAEA;MAEA;MAEA;MAEA;IACA,CAxSA;;IA0SAE;MAEArC;QACA;MACA,CAFA,EAEA,GAFA;IAIA,CAhTA;;IAkTAsC;MAEA;MAEA;MACA;MAEA;MAEA;;MAGA;QACA;MACA;;MAEA;MAEAC;MAEAvC;QACA;MACA,CAFA,EAEA,GAFA;IAIA;;EA1UA,CAzEA;EAsZAlC;IACA0E,kBADA;IAEAC;EAFA,CAtZA;;EA6ZAC,WAEA,CA/ZA;;EAiaAC;IAEA;MACA;IACA;;IAEA;IAGA;;IAEA;MACA;IACA;EACA;;AA/aA,G;;ACvEiX,CAAgB,oHAAG,EAAC,C;;ACAhS;AACvC;AACL;AACzD,SAAS,uBAAY;;AAErB,eAAe,mBAAO,CAAC,MAA4E;AACnG;;AAEA;;AAEA;AACmG;AACnG,IAAI,oBAAS,GAAG,8CAAU;AAC1B,EAAE,6CAAM;AACR,EAAE,0DAAM;AACR,EAAE,mEAAe;AACjB;AACA,EAAE,uBAAY;AACd;AACA;AACA;AACA;;AAEe,mEAAS,Q;;ACvBxB,IAAI,2DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,mCAAmC,YAAY,sDAAsD,kBAAkB,UAAU,oEAAoE,4BAA4B,uEAAuE,gDAAgD,KAAK,kJAAkJ,UAAU,qCAAqC,oCAAoC,iEAAiE,uBAAuB,UAAU,+BAA+B;AAC7yB,IAAI,oEAAe;;;;;;;;;ACDnB;AAEe;EACd9E,IAAI,EAAE,aADQ;EAEdC,KAAK,EAAE;IACN8E,WAAW,EAAE;MACZpD,IAAI,EAAEqD,OADM;MAEZC,QAAQ,EAAE;IAFE,CADP;IAKNC,gBAAgB,EAAE;MACjBvD,IAAI,EAAEqD;IADW,CALZ;IAQNG,QAAQ,EAAEH;EARJ,CAFO;;EAYd9E,IAAI,GAAG;IACN,OAAO;MACN2D,KAAK,EAAE,CADD;MAENuB,MAAM,EAAE,KAFF;MAGNC,SAAS,EAAE;IAHL,CAAP;EAKA,CAlBa;;EAmBdvD,QAAQ,EAAE,EACT,GAAGwD,oCAAQ,CAAC;MACXvD,MAAM,EAAEwD,KAAK,IAAIA,KAAK,CAACxD;IADZ,CAAD;EADF,CAnBI;;EAwBd+C,OAAO,GAAG,CAET,CA1Ba;;EA2BdU,aAAa,GAAG;IAEfC,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;IACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;;IAEA,IAAI,KAAKZ,WAAT,EAAsB;MACrB,KAAKa,KAAL,CAAW,iBAAX,EAA8B;QAACC,MAAM,EAAG;MAAV,CAA9B;IACA;EACD,CAnCa;;EAoCdzF,OAAO,EAAE;IAER0F,OAAO,EAAG,UAASC,CAAT,EAAW;MACpB,IAAG,CAAC,KAAKhE,MAAT,EACC,KAAKiE,cAAL,CAAoBD,CAApB;IACD,CALO;IAORE,SAAS,EAAG,UAASF,CAAT,EAAW;MACtB,IAAG,CAAC,KAAKhE,MAAT,EACC,KAAKmE,gBAAL,CAAsBH,CAAtB;IACD,CAVO;;IAYRG,gBAAgB,CAACH,CAAD,EAAI;MAGnB,IAAG,CAAC,KAAKhB,WAAT,EAAsB;QACrB,KAAKa,KAAL,CAAW,kBAAX;MACA,CAFD,MAII;QACH,IAAG,KAAKR,MAAR,EAAgB;MAChB;;MAED,KAAKvB,KAAL,GAAa;QACZsC,CAAC,EAAEJ,CAAC,CAACK,cAAF,GAAmBL,CAAC,CAACK,cAAF,CAAiB,CAAjB,EAAoBC,KAAvC,GAA+CN,CAAC,CAACM,KADxC;QAEZC,CAAC,EAAEP,CAAC,CAACK,cAAF,GAAmBL,CAAC,CAACK,cAAF,CAAiB,CAAjB,EAAoBG,KAAvC,GAA+CR,CAAC,CAACQ;MAFxC,CAAb;MAKA,IAAG,CAAC,KAAKxE,MAAT,EACC0D,QAAQ,CAACe,gBAAT,CAA0B,WAA1B,EAAuC,KAAKb,UAA5C,EADD,KAGCF,QAAQ,CAACe,gBAAT,CAA0B,WAA1B,EAAuC,KAAKb,UAA5C;IAED,CAjCO;;IAkCRK,cAAc,CAACD,CAAD,EAAI;MAEjB,IAAI,KAAKX,MAAT,EAAiB;;MAEjB,IAAI,KAAKL,WAAL,IAAoB,KAAKG,gBAA7B,EAA+C;QAC9C,KAAKU,KAAL,CAAW,iBAAX,EAA8B;UAC7Ba,OAAO,EAAG;QADmB,CAA9B;MAGA;;MAEDhB,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;MACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;MAEA,KAAKe,UAAL;IAEA,CAjDO;;IAmDRA,UAAU,GAAE;MAEX,IAAI,KAAKC,KAAL,CAAWC,MAAf,EAAsB;QACrB,KAAKD,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAArC;QACA,KAAKH,KAAL,CAAWC,MAAX,CAAkBG,SAAlB,CAA4BC,MAA5B,CAAmC,SAAnC;MACA;;MAED,IAAI,KAAKL,KAAL,CAAWM,MAAf,EAAsB;QACrB,KAAKN,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BC,MAA5B,CAAmC,QAAnC;MACA;IACD,CA7DO;;IA+DRrB,UAAU,CAACI,CAAD,EAAI;MAAA;;MAEb,IAAG,CAAC,KAAKhB,WAAT,EAAsB;MAEtB,IAAImC,MAAM,GAAG,KAAKrD,KAAL,CAAWsC,CAAX,GAAeJ,CAAC,CAACM,KAA9B;MACA,IAAIc,MAAM,GAAG,KAAKtD,KAAL,CAAWyC,CAAX,GAAeP,CAAC,CAACQ,KAA9B;;MAEA,IAAIR,CAAJ,aAAIA,CAAJ,oCAAIA,CAAC,CAAEK,cAAP,8CAAI,kBAAmBgB,MAAvB,EAA+B;QAC9BF,MAAM,GAAG,KAAKrD,KAAL,CAAWsC,CAAX,GAAeJ,CAAC,CAACK,cAAF,CAAiB,CAAjB,EAAoBC,KAA5C;QACAc,MAAM,GAAG,KAAKtD,KAAL,CAAWyC,CAAX,GAAeP,CAAC,CAACK,cAAF,CAAiB,CAAjB,EAAoBG,KAA5C;MACA;;MAED,IAAIW,MAAM,GAAG,CAAT,IAAcC,MAAM,GAAG,CAA3B,EAA8B;QAC7B,KAAK9B,SAAL,GAAiB,GAAjB;MACA,CAFD,MAEO;QACN,KAAKA,SAAL,GAAiB,GAAjB;MACA;;MAGD,IAAI6B,MAAM,GAAG,CAAT,IAAc,KAAK7B,SAAL,KAAmB,GAArC,EAA0C;QAEzC,IAAG,CAAC,KAAKsB,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BM,QAA5B,CAAqC,QAArC,CAAJ,EACC,KAAKV,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BO,GAA5B,CAAgC,QAAhC;QAED,KAAKX,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAAeI,MAAO,KAA3D;;QAEA,IAAIA,MAAM,GAAG,EAAb,EAAiB;UAChB,KAAKP,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAArC;UAEArB,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;UACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C,EAJgB,CAKhB;;UAEA,KAAKP,MAAL,GAAc,IAAd;QACA;MAGD,CAlBD,MAkBO,IAAI+B,MAAM,GAAG,CAAT,IAAc,KAAK9B,SAAL,KAAmB,GAArC,EAA0C;QAEhD,KAAKsB,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,cAAaK,MAAO,QAAzD;QAEA,IAAG,CAAC,KAAKR,KAAL,CAAWM,MAAX,CAAkBF,SAAlB,CAA4BM,QAA5B,CAAqC,SAArC,CAAJ,EACC,KAAKV,KAAL,CAAWC,MAAX,CAAkBG,SAAlB,CAA4BO,GAA5B,CAAgC,SAAhC;QAED,KAAK1B,KAAL,CAAW,WAAX,EAAwB,CAACuB,MAAM,GAAG,CAAV,IAAe,GAAvC;;QAEA,IAAIA,MAAM,GAAG,GAAb,EAAkB;UACjB,KAAKR,KAAL,CAAWC,MAAX,CAAkBC,KAAlB,CAAwBC,SAAxB,GAAqC,gBAArC;UACArB,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C;UACAF,QAAQ,CAACC,mBAAT,CAA6B,WAA7B,EAA0C,KAAKC,UAA/C,EAHiB,CAIjB;;UACA,KAAKC,KAAL,CAAW,iBAAX,EAA8B;YAAEC,MAAM,EAAE;UAAV,CAA9B;UACA,KAAKD,KAAL,CAAW,SAAX;QACA;MAED,CAlBM,MAmBF;QACJ,KAAKc,UAAL;MACA;IACD,CA1HO;;IA4HRa,SAAS,CAACxB,CAAD,EAAI;MAEZ,KAAKW,UAAL;;MAEA,IAAI,KAAK3B,WAAL,IAAoB,KAAKK,MAA7B,EAAqC;QAEpC,KAAKQ,KAAL,CAAW,iBAAX,EAA8B,EAA9B;QACA,KAAKR,MAAL,GAAc,KAAd;QAEA;MAEA;IAED;;EAzIO;AApCK,CAAf,E;;ACF2N,CAAgB,oHAAG,EAAC,C;;ACA/I;AACxC;AACL;AACnD,SAAS,wBAAY;;AAErB,eAAe,mBAAO,CAAC,MAAwE;AAC/F;;AAEA;;AAEA;AACgG;AAChG,IAAI,qBAAS,GAAG,8CAAU;AAC1B,EAAE,2CAAM;AACR,EAAE,2DAAM;AACR,EAAE,oEAAe;AACjB;AACA,EAAE,wBAAY;AACd;AACA;AACA;AACA;;AAEe,qEAAS,Q;;;;;;;;ACvBxB,IAAI,8DAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,6BAA6B,8BAA8B,+BAA+B,YAAY,+BAA+B,8BAA8B,cAAc,sBAAsB,mBAAmB,UAAU,2BAA2B,cAAc,oBAAoB,wCAAwC,gCAAgC,eAAe,oBAAoB,+CAA+C,cAAc,aAAa,wGAAwG,oCAAoC;AAC5sB,IAAI,uEAAe;;;;;;ACDJ;EACbpF,IAAI,EAAE,gBADO;EAEbC,KAAK,EAAE;IACLuH,UAAU,EAAE;MACV7F,IAAI,EAAE8F,MADI;MAEVxC,QAAQ,EAAE;IAFA,CADP;IAKLyC,OAAO,EAAE;MACP/F,IAAI,EAAEgG,KADC;MAEP1C,QAAQ,EAAE;IAFH,CALJ;IASLF,WAAW,EAAE;MACXpD,IAAI,EAAEqD;IADK,CATR;IAYL4C,OAAO,EAAE;EAZJ,CAFM;;EAgBb1H,IAAI,GAAG;IACL,OAAO;MACL2H,KAAK,EAAE;IADF,CAAP;EAGD,CApBY;;EAqBb/F,QAAQ,EAAE;IACRgG,KAAK,GAAG;MACN,IAAIC,MAAM,GAAGC,IAAI,CAACC,KAAL,CAAW,KAAKT,UAAL,GAAkB,KAA7B,CAAb;MACA,IAAIU,GAAG,GAAGF,IAAI,CAACC,KAAL,CAAW,KAAKT,UAAL,GAAkB,IAA7B,IAAqC,EAA/C;MACA,OAAQ,GAAEO,MAAM,GAAGA,MAAM,GAAG,GAAZ,GAAkB,IAAK,GAAGG,GAAG,GAAG,EAAP,GAAa,MAAMA,GAAnB,GAAyBA,GAAI,EAAtE;IACD,CALO;;IAORC,WAAW,GAAE;MACX,OAAOC,CAAC,CAACC,IAAF,CAAO,KAAKX,OAAZ,EAAqB,EAArB,CAAP;IACD;;EATO,CArBG;EAiCb/G,KAAK,EAAG;IACN+G,OAAO,EAAGU,CAAC,CAACE,QAAF,CAAW,YAAU;MAC7B,KAAKC,IAAL;IACD,CAFS,EAEP,EAFO,CADJ;IAKNX,OAAO,EAAG,YAAU;MAClB,KAAKjB,KAAL,CAAWd,MAAX,CAAkBgB,KAAlB,CAAwBe,OAAxB,GAAkC,KAAKA,OAAvC;IACD;EAPK,CAjCK;;EA2Cb9C,OAAO,GAAG;IACR,KAAK6B,KAAL,CAAWd,MAAX,CAAkBgB,KAAlB,CAAwBe,OAAxB,GAAkC,CAAlC;IACA,IAAIC,KAAK,GAAG,KAAKlB,KAAL,CAAW6B,KAAX,CAAiBC,WAA7B;IACA,KAAKZ,KAAL,GAAaA,KAAK,GAAGA,KAAK,GAAG,GAA7B;IAEA5F,MAAM,CAACuE,gBAAP,CAAwB,QAAxB,EAAkC,KAAK9E,MAAvC;EACD,CAjDY;;EAkDb8D,aAAa,GAAG;IACdvD,MAAM,CAACyD,mBAAP,CAA2B,QAA3B,EAAqC,KAAKhE,MAA1C;EACD,CApDY;;EAsDbtB,OAAO,EAAE;IACPsB,MAAM,GAAG;MACP,IAAIoG,KAAK,GAAG,IAAZ;;MAEA,IAAIY,EAAE,GAAG,MAAM;QACb,IAAI,CAACZ,KAAL,EAAY;UACVA,KAAK,GAAG3F,UAAU,CAAC,MAAM;YACvB2F,KAAK,GAAG,IAAR;YACA,IAAID,KAAK,GAAG,KAAKlB,KAAL,CAAW6B,KAAX,CAAiBC,WAA7B;YACA,KAAKZ,KAAL,GAAaA,KAAK,GAAGA,KAAK,GAAG,GAA7B;UACD,CAJiB,EAIf,EAJe,CAAlB;QAKD;MACF,CARD;;MAUAa,EAAE;IACH,CAfM;;IAgBPH,IAAI,GAAG;MAEL,IAAG,CAAC,KAAK5B,KAAL,CAAWgC,MAAf,EAAuB;MAEvB,MAAMC,GAAG,GAAG,KAAKjC,KAAL,CAAWgC,MAAX,CAAkBE,UAAlB,CAA8B,IAA9B,CAAZ;MACA,IAAIC,CAAC,GAAG,CAAR;MACA,IAAIC,KAAK,GAAG,EAAZ;MACA,IAAIlB,KAAK,GAAG,CAAZ,CAPK,CAOS;;MACd,IAAImB,CAAC,GAAG,KAAKb,WAAL,CAAiBf,MAAzB;MACA,IAAI6B,CAAC,GAAGjB,IAAI,CAACkB,GAAL,CAASlB,IAAI,CAACC,KAAL,CAAWe,CAAC,GAAGD,KAAf,CAAT,EAAgC,CAAhC,CAAR;MAEAH,GAAG,CAACO,SAAJ,CAAc,CAAd,EAAiB,CAAjB,EAAoB,KAAKtB,KAAzB,EAAgC,EAAhC;;MAEA,KAAK,IAAI1D,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG6E,CAApB,EAAuB7E,CAAC,GAAGA,CAAC,GAAG8E,CAA/B,EAAkC;QAChCL,GAAG,CAACQ,SAAJ,GAAgB,SAAhB;QACAR,GAAG,CAACS,QAAJ,CAAalF,CAAC,GAAG,CAAJ,GAAQ0D,KAArB,EAA4B,KAAK,KAAKM,WAAL,CAAiBhE,CAAjB,IAAsB,CAAvD,EAA0D0D,KAA1D,EAAiE,KAAKM,WAAL,CAAiBhE,CAAjB,IAAsB,CAAtB,GAA0B,CAA3F;MACD;IAEF,CAlCM;;IAmCPmF,KAAK,GAAG;MACN,KAAK1D,KAAL,CAAW,SAAX;IACD;;EArCM;AAtDI,CAAf,E;;ACA2N,CAAgB,0HAAG,EAAC,C;;ACA/I;AACxC;AACL;AACnD,SAAS,2BAAY;;AAErB,eAAe,mBAAO,CAAC,MAAwE;AAC/F;;AAEA;;AAEA;AACgG;AAChG,IAAI,wBAAS,GAAG,8CAAU;AAC1B,EAAE,8CAAM;AACR,EAAE,8DAAM;AACR,EAAE,uEAAe;AACjB;AACA,EAAE,2BAAY;AACd;AACA;AACA;AACA;;AAEe,2EAAS,Q;;ACvBxB,IAAI,sDAAM,gBAAgB,aAAa,0BAA0B,wBAAwB,iBAAiB,qBAAqB,YAAY,4BAA4B,YAAY,6BAA6B,8BAA8B,gBAAgB,0BAA0B,GAAG,gBAAgB,2BAA2B,cAAc,OAAO,sCAAsC,KAAK,qBAAqB,+BAA+B,6CAA6C,yBAAyB,+BAA+B,gBAAgB,0BAA0B,8DAA8D;AACvoB,IAAI,+DAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmDnB;;AAGA,WAAW,mBAAO,CAAC,MAAY;;AAE/B,IAAI,oCAAM,OAAO,+BAAM;AAER;EACf5F,cADA;EAEAS,cAFA;EAGAR;IAEAsJ,gBAFA;IAGAhI,iBAHA;IAKAiI,kBALA;IAOAC;MACAC,WADA;MAEA/H;IAFA,CAPA;IAYAH;MACAG,WADA;MAEA+H;IAFA,CAZA;IAgBAjI;MACAE,YADA;MAEA+H,gBACA;IAHA;EAhBA,CAHA;EA2BAxJ;IACA;MACAyJ;IADA;EAGA,CA/BA;EAiCA7H;IACA8H;MACA;IACA;;EAHA,CAjCA;EAuCAC,gBAEA,CAzCA;EA0CAzJ;IAEA0J;MACA;MAEA;QACA1G;UAEA2G;YACAC,uBADA;YAEAC;UAFA;QAKA,CAPA;;QAQA7G;MACA,CAVA;IAaA,CAlBA;IAmBA9B;MAAA;;MACAgD;MACAA;MAEA;MACA;MAEA;MAEA;MAEA;MAEA4F;QAEA;;QAEA;UAEAC;YACAxG,YADA;YAEAsG,UAFA;YAGArJ;UAHA;UAMAwJ;UAEA;QACA;;QAEA;UAEAC;UAEA;QAEA,CANA,EAMA9G,IANA,CAMArD;UAEAiK;UACAC;QAEA,CAXA,EAWA1G,KAXA,CAWAqC;UAEAoE;YACAxG,QADA;YAEAsG,UAFA;YAGArJ;UAHA;UAMAwJ;QAEA,CArBA;MAuBA,CAxCA,EAwCAE;QAEA;QACAH;MAEA,CA7CA;IA+CA,CA/EA;IAiFAI;MACA;QACA;MACA;;MAEA;QACA;MACA;IACA,CAzFA;IA2FAC;MACA;QACA;MACA;;MAEA;QACA;MACA;IAEA,CApGA;IAqGAC;MACA;IACA,CAvGA;IAwGAC;MACA;MACA;MAEA;IACA,CA7GA;IA8GAC;MAEA;QACA;MACA;;MAEA;IACA,CArHA;IAsHAC;MAEA;QACA;MACA;;MAEA;IACA,CA7HA;IA8HAC;MACA;IACA,CAhIA;IAiIAC;MACA;QAEA;QAEA;UAGA;QACA,CAJA,EAIApH,KAJA,CAIAqC;UACA;QACA,CANA;MAQA;;MACA;IACA,CAhJA;IAiJAgF;MAEA;QACA7K;QAEA;MACA,CAJA,EAIAqD,IAJA,CAIArD;QAEA;UACAA;UAEA;QACA,CAJA;;QAMA;UAEA;UAEA;YAEAA;YAEA;UACA,CALA,EAKAwD,KALA,CAKAqC;YACA;UACA,CAPA;QASA;;QACA;MACA,CA3BA;IA8BA;EAjLA;AA1CA,G;;AC3D6V,CAAgB,wGAAG,EAAC,C;;ACAjR;AACvC;AACL;AACpD,SAAS,mBAAY;;AAErB,eAAe,mBAAO,CAAC,MAAuE;AAC9F;;AAEA;;AAEA;AACgG;AAChG,IAAI,gBAAS,GAAG,8CAAU;AAC1B,EAAE,qCAAM;AACR,EAAE,sDAAM;AACR,EAAE,+DAAe;AACjB;AACA,EAAE,mBAAY;AACd;AACA;AACA;AACA;;AAEe,2DAAS,Q;;;;;;;ACvBxB;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACe;EACd/F,IAAI,EAAE,WADQ;EAEdC,KAAK,EAAE;IACN+K,IAAI,EAAEC,MADA;IAENC,CAAC,EAAEC,MAFG;IAGNC,aAAa,EAAEH;EAHT,CAFO;EAQd3K,UAAU,EAAE;IAAE+K,sBAAF;IAAcC,yBAAd;IAAwBC,mCAAxB;IAAiCC,8BAAjC;IAAiDC,wBAAjD;IAA8DnK,cAAMA;EAApE,CARE;EAUdpB,IAAI,EAAE,YAAY;IAEjB,OAAO;MACNoB,MAAM,EAAE,IADF;MAENoK,IAAI,EAAE,EAFA;MAGN/B,OAAO,EAAE,KAHH;MAIN/I,IAAI,EAAE,EAJA;MAKNqJ,IAAI,EAAE,EALA;MAMN0B,QAAQ,EAAE,EANJ;MAON3K,KAAK,EAAE,KAPD;MAQN4K,QAAQ,EAAE,KARJ;MASNC,MAAM,EAAE,EATF;MAUNC,cAAc,EAAE,IAVV;MAWNC,UAAU,EAAEZ,MAXN;MAYNa,aAAa,EAAE,EAZT;MAaNC,QAAQ,EAAE,IAbJ;MAcNC,YAAY,EAAE,CAdR;MAeNC,MAAM,EAAE,IAfF;MAgBNC,aAAa,EAAE,EAhBT;MAiBNrH,WAAW,EAAE,KAjBP;MAmBNsH,aAAa,EAAE,IAnBT;MAoBNC,YAAY,EAAE,IApBR;MAqBNC,aAAa,EAAE,IArBT;MAuBN/E,UAAU,EAAE,CAvBN;MAwBNgF,QAAQ,EAAE,IAxBJ;MAyBNC,aAAa,EAAE,CAzBT;MA0BNC,kBAAkB,EAAE,KA1Bd;MA2BNxH,gBAAgB,EAAE,KA3BZ;MA6BNyH,6BAA6B,EAAE;IA7BzB,CAAP;EAgCA,CA5Ca;EA+CdhM,KAAK,EAAE;IACNiM,gBAAgB,EAAE;MACjB;MACA9L,OAAO,EAAE,YAAY,CACpB;IAHgB,CADZ;IAMN8D,QAAQ,EAAE,YAAY;MAErB,IAAI,CAAC,KAAKA,QAAL,CAAcwC,MAAnB,EAA2B;QAC1B,KAAK8E,YAAL,GAAoB,CAApB;MACA,CAFD,MAEO;QACN,IAAI,KAAKA,YAAL,GAAoB,KAAKtH,QAAL,CAAcwC,MAAd,GAAuB,CAA/C,EAAkD;UACjD,KAAK8E,YAAL,GAAoB,KAAKtH,QAAL,CAAcwC,MAAd,GAAuB,CAA3C;QACA;MACD;IAGD;EAjBK,CA/CO;;EAmEd5B,aAAa,GAAG;IACf,IAAI,KAAK8G,YAAT,EACC,KAAKA,YAAL,CAAkBO,KAAlB;EACD,CAtEa;;EAwEd/K,QAAQ,EAAE;IACTgL,WAAW,GAAG;MACb,OAAO,KAAKC,MAAL,CAAYxH,KAAZ,CAAkByH,oBAAzB;IACA,CAHQ;;IAKTC,OAAO,EAAE,YAAY;MACpB,OAAO,KAAKF,MAAL,CAAYxH,KAAZ,CAAkB2H,OAAzB;IACA,CAPQ;IAQTC,aAAa,EAAG,YAAU;MACzB,OAAO,KAAKJ,MAAL,CAAYxH,KAAZ,CAAkB4H,aAAzB;IACA,CAVQ;IAWTC,SAAS,EAAE,YAAY;MACtB,IAAIA,SAAS,GAAG,EAAhB;;MAGA,IAAI,CAAC,KAAKhC,aAAV,EAAyB;QAExB,IAAInJ,MAAM,CAACoL,iBAAP,IAA4BpL,MAAM,CAACoL,iBAAP,CAAyBtL,MAAzB,CAAgCuL,mBAAhC,EAAhC,EAAuF;UACtFF,SAAS,CAACG,IAAV,CAAe;YACdC,KAAK,EAAE,qBADO;YAEdC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,yBAAb,CAFO;YAGdC,IAAI,EAAE;UAHQ,CAAf;QAMA,CAPD,MAQK;UACJR,SAAS,CAACG,IAAV,CAAe;YACdC,KAAK,EAAE,eADO;YAEdC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,yBAAb,CAFO;YAGdC,IAAI,EAAE,eAHQ;YAKdtM,MAAM,EAAE;cACPC,QAAQ,EAAE,IADH;cAEPC,UAAU,EAAE,CAAC,KAAD,EAAQ,MAAR,EAAgB,KAAhB,EAAuB,MAAvB,CAFL;cAGPiI,OAAO,EAAE,GAHF;cAIPhI,MAAM,EAAE;gBACPC,MAAM,EAAE;kBACPC,IAAI,EAAE;gBADC;cADD;YAJD;UALM,CAAf;QAgBA;;QAIDyL,SAAS,CAACG,IAAV,CAAe;UACdC,KAAK,EAAE,aADO;UAEdC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,iBAAb,CAFO;UAGdC,IAAI,EAAE,oBAHQ;UAKdtM,MAAM,EAAE;YACPC,QAAQ,EAAE,IADH;YAEPC,UAAU,EAAE,EAFL;YAGPiI,OAAO,EAAE,EAHF;YAIPhI,MAAM,EAAE;cACPC,MAAM,EAAE;gBACPC,IAAI,EAAE;cADC;YADD;UAJD;QALM,CAAf;MAgBA;;MAGD,IAAI,KAAKkM,WAAL,IAAoB,CAAC,KAAKV,aAA9B,EAA6C;QAC5CC,SAAS,CAACU,OAAV,CAAkB;UACjBN,KAAK,EAAE,wBADU;UAEjBC,KAAK,EAAE,KAAKC,KAAL,CAAWC,CAAX,CAAa,kBAAb,CAFU;UAGjBC,IAAI,EAAE;QAHW,CAAlB;MAKA;;MAED,OAAOR,SAAP;IACA,CA1EQ;IA2ET,GAAG9H,oCAAQ,CAAC,CACX,OADW,CAAD,CA3EF;IA+ETyI,QAAQ,EAAE,YAAY;MAGrB,IAAI,CAAC,KAAK/C,IAAV,EAAgB,OAAO,EAAP;MAEhB,OAAO,KAAKgD,IAAL,CAAUC,IAAV,CAAeC,aAAf,CAA6B,KAAKlD,IAAL,CAAUmD,MAAvC,EAA+C,kBAA/C,CAAP;IAEA,CAtFQ;IAwFTN,WAAW,EAAE,YAAY;MACxB,OAAOnJ,4BAAC,CAAC0J,IAAF,CAAOnM,MAAP,EAAe,2CAAf,CAAP;IACA,CA1FQ;IA4FToM,MAAM,EAAE,YAAY;MACnB,IAAI,KAAKnD,CAAT,EAAY;QACX,OAAO9C,CAAC,CAACkG,GAAF,CAAM,KAAKpD,CAAL,CAAOqD,KAAP,CAAa,GAAb,CAAN,EAA0BrD,CAAD,IAAO;UACtC,OAAOA,CAAP;QACA,CAFM,CAAP;MAGA;;MAED,OAAO,EAAP;IACA,CApGQ;IAqGTsD,MAAM,EAAE,YAAY;MACnB,IAAI,KAAKtD,CAAT,EAAY;QACX,OAAO9C,CAAC,CAACkG,GAAF,CAAM,KAAKpD,CAAL,CAAOqD,KAAP,CAAa,GAAb,CAAN,EAA0BrD,CAAD,IAAO;UACtC,OAAO,KAAK8C,IAAL,CAAUS,IAAV,CAAeC,QAAf,CAAwBxD,CAAxB,CAAP;QACA,CAFM,CAAP;MAGA;;MAED,OAAO,EAAP;IACA,CA7GQ;IA8GTyD,SAAS,EAAE,YAAY;MACtB,IAAIC,EAAE,GAAG,KAAKC,MAAL,CAAYC,KAAZ,CAAkBF,EAA3B;MACA,OAAO,KAAK7B,MAAL,CAAYxH,KAAZ,CAAkBwJ,QAAlB,CAA2BH,EAA3B,CAAP;IACA,CAjHQ;IAkHTI,OAAO,EAAE,YAAY;MAEpB,IAAI,CAAC,KAAKhE,IAAV,EAAgB;QACf,IAAI,KAAKE,CAAT,EAAY,OAAO,KAAKsD,MAAZ;QACZ,OAAO,EAAP;MACA;;MAED,OAAOpG,CAAC,CAACkG,GAAF,CAAMlG,CAAC,CAAC6G,MAAF,CAAS,KAAKjE,IAAL,CAAUkE,YAAV,CAAuBC,UAAvB,EAAT,EAA8C,UAAUC,CAAV,EAAaC,CAAb,EAAgB;QAC1E,OAAOD,CAAC,CAACE,UAAF,KAAiB,QAAxB;MACA,CAFY,CAAN,EAEH,UAAUpE,CAAV,EAAa;QAChB,OAAOA,CAAC,CAACW,MAAT;MACA,CAJM,CAAP;IAKA,CA9HQ;IAgIT0D,MAAM,EAAE,YAAY;MAEnB,IAAI,CAAC,KAAKvE,IAAV,EAAgB,OAAO,EAAP;MAEhB,IAAImD,MAAM,GAAG,KAAKnD,IAAL,CAAUmD,MAAvB;MACA,IAAIqB,IAAI,GAAG,IAAX;MACA,IAAIC,GAAG,GAAG,EAAV;MACA,IAAIC,OAAO,GAAG,CAAd;MAEA,KAAK1E,IAAL,CAAUkE,YAAV,CAAuBC,UAAvB,GAAoCQ,OAApC,CAA4C,UAAUlB,IAAV,EAAgB;QAC3D,IAAIA,IAAI,CAACa,UAAL,KAAoB,MAAxB,EAAgC;UAC/BG,GAAG,CAAClC,IAAJ,CAASkB,IAAI,CAAC5C,MAAd;QACA;MACD,CAJD;MAMA,OAAO4D,GAAP;IACA,CAhJQ;IAkJT7K,QAAQ,EAAE,YAAY;MAErB,IAAI,KAAKqH,QAAL,KAAkB,IAAtB,EAA4B,OAAO,EAAP;MAC5B,IAAI,KAAKA,QAAL,KAAkB,EAAtB,EAA0B,OAAO,KAAK8B,QAAZ;MAE1B,IAAI6B,KAAK,GAAG,KAAK3D,QAAL,CAAc4D,WAAd,EAAZ;;MAEA,IAAI3E,CAAC,GAAG9C,CAAC,CAAC6G,MAAF,CAAS,KAAKlB,QAAd,EAAwB,UAAU7C,CAAV,EAAa;QAC5C,OAAOA,CAAC,CAAClL,IAAF,CAAO6P,WAAP,GAAqBC,OAArB,CAA6BF,KAA7B,KAAuC,CAAvC,IAA4C1E,CAAC,CAAClL,IAAF,CAAO6P,WAAP,MAAwBD,KAA3E;MACA,CAFO,CAAR;;MAIA,OAAO1E,CAAP;IAEA,CA/JQ;IAiKT6E,WAAW,EAAE,YAAY;MACxB,IAAI,KAAKnL,QAAL,CAAcwC,MAAlB,EAA0B;QACzB,OAAO,KAAKxC,QAAL,CAAc,KAAKsH,YAAL,IAAqB,CAAnC,CAAP;MACA;;MAED,OAAO,IAAP;IACA;EAvKQ,CAxEI;;EAkPdrC,OAAO,GAAG,CAET,CApPa;;EAsPd;EAEA/E,OAAO,GAAG;IACT,KAAK9D,KAAL,GAAa,IAAb;;IAGA,IAAI,CAAC,KAAKgK,IAAN,IAAc,KAAKgD,IAAL,CAAUC,IAAV,CAAe+B,MAAjC,EAAyC;MACxC,KAAKC,OAAL,GAAevM,KAAf,CAAqBqC,CAAC,IAAI;QACzB,OAAOmK,OAAO,CAACnG,OAAR,EAAP;MACA,CAFD;IAGA;EAED,CAlQa;;EAoQd3J,OAAO,EAAE;IACR+P,IAAI,EAAE,YAAY;MACjB,OAAO,KAAKC,EAAL,CAAQC,MAAR,CAAe,MAAM;QAC3B,OAAO,KAAKrC,IAAL,CAAUC,IAAV,CAAe+B,MAAf,IAAyB,KAAKhC,IAAL,CAAUC,IAAV,CAAeqC,MAA/C;MACA,CAFM,CAAP;IAGA,CALO;IAORC,SAAS,EAAE,UAAUC,QAAV,EAAoB;MAE9BA,QAAQ,GAAG,KAAKtE,YAAL,EAAH,GAAyB,KAAKA,YAAL,EAAjC;;MAEA,IAAI,KAAKA,YAAL,GAAoB,KAAKtH,QAAL,CAAcwC,MAAd,GAAuB,CAA/C,EAAkD;QACjD,KAAK8E,YAAL,GAAoB,CAApB;MACA;;MAED,IAAI,KAAKA,YAAL,GAAoB,CAAxB,EAA2B;QAC1B,KAAKA,YAAL,GAAoB,KAAKtH,QAAL,CAAcwC,MAAd,GAAuB,CAA3C;MACA;IAED,CAnBO;IAqBRqJ,gBAAgB,EAAE,YAAY;MAC7B,KAAKC,UAAL,CAAgB,KAAK9L,QAAL,CAAc,KAAKsH,YAAL,IAAqB,CAAnC,CAAhB;IACA,CAvBO;IAyBRwE,UAAU,EAAE,YAAqB;MAAA,IAAXjC,IAAW,uEAAJ,EAAI;MAChC,IAAIzO,IAAI,GAAGyO,IAAI,CAACzO,IAAL,IAAa,EAAxB;MAEA,KAAK2G,KAAL,CAAW,UAAX,EAAuBlC,SAAvB,CAAiCzE,IAAjC;IACA,CA7BO;IA+BR2Q,WAAW,EAAE,UAAUf,KAAV,EAAiB;MAC7B,KAAK3D,QAAL,GAAgB2D,KAAhB;IACA,CAjCO;IAmCRgB,gBAAgB,EAAE,UAAU1D,OAAV,EAAmB2D,MAAnB,EAA2B;MAC5C,KAAKA,MAAL,EAAa3D,OAAb;IACA,CArCO;IAwCR4D,WAAW,EAAE,UAAU9G,MAAV,EAAkB;MAE9B,IAAI+G,KAAK,GAAG/G,MAAM,CAACuE,KAAP,CAAa,GAAb,EAAkB,CAAlB,EAAqBA,KAArB,CAA2B,GAA3B,EAAgC,CAAhC,CAAZ;MACA,IAAI9M,MAAM,GAAG,IAAIuP,+BAAJ,EAAb;MAEA,OAAOvP,MAAM,CAACC,MAAP,CAAc,KAAd,EAAqBsI,MAArB,EAA6B,IAA7B,EAAmC,IAAnC,EAAyC+G,KAAzC,EAAgD,IAAhD,EAAsDxN,IAAtD,CAA2DyG,MAAM,IAAI;QAE3E,OAAOkG,OAAO,CAACnG,OAAR,CAAgBC,MAAhB,CAAP;MACA,CAHM,EAGJtG,KAHI,CAGEqC,CAAC,IAAI;QACb,OAAOmK,OAAO,CAACe,MAAR,CAAelL,CAAf,CAAP;MACA,CALM,CAAP;IAMA,CAnDO;IAqDRmL,mBAAmB,EAAE,YAAY;MAChC,IAAI7G,MAAM,GAAG,EAAb;MAEA,KAAK1D,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;MAEAnP,MAAM,CAACoL,iBAAP,CAAyBgE,QAAzB,CAAkCC,EAAlC,CAAqCC,WAArC,CAAiD;QAChDhQ,QAAQ,EAAE,IADsC;QAGhDsP,MAAM,EAAE,OAAa9G,OAAb,KAAyB;UAAA,IAAxB;YAAEC;UAAF,CAAwB;UAGhC,OAAO,KAAK8G,WAAL,CAAiB9G,MAAjB,EAAyBzG,IAAzB,CAA8ByG,MAAM,IAAI;YAE9C,OAAOtF,4BAAC,CAAC8M,MAAF,CAASC,MAAT,CAAgBzH,MAAhB,EAAwBzG,IAAxB,CAA6B0G,IAAI,IAAI;cAC3C,IAAI/J,IAAI,GAAG;gBACV8J,MADU;gBAEVC;cAFU,CAAX;cAKAI,MAAM,CAACkD,IAAP,CAAYrN,IAAZ;cAEA,KAAKwR,cAAL,CAAoB,IAApB,EAA0BxR,IAA1B;cAEA6J,OAAO;YACP,CAXM,CAAP;UAaA,CAfM,EAeJrG,KAfI,CAeEqC,CAAC,IAAI;YACb4L,OAAO,CAAChO,KAAR,CAAcoC,CAAd;YACAgE,OAAO;UACP,CAlBM,CAAP;QAoBA,CA1B+C;QA4BhD6H,SAAS,EAAGC,IAAD,IAAU;UACpB,KAAKC,iBAAL;QACA;MA9B+C,CAAjD;IAgCA,CA1FO;IA4FRC,sBAAsB,EAAE,YAAY;MAEnC,KAAKC,aAAL,GAAqB,KAArB;;MAEA,IAAIC,KAAK,GAAG7J,CAAC,CAAC6G,MAAF,CAAS7G,CAAC,CAACkG,GAAF,CAAM,KAAKiB,MAAX,EAAoB2C,CAAD,IAAO;QAC9C,OAAO,KAAK9B,EAAL,CAAQhC,IAAR,CAAa,IAAb,EAAmB,wBAAwB,KAAKgC,EAAL,CAAQ+B,WAAR,CAAoBD,CAApB,CAA3C,KAAsE,IAA7E;MACA,CAFoB,CAAT,EAEPE,CAAD,IAAO;QAAA;;QACV,OAAOA,CAAC,IAAIA,CAAC,CAACC,MAAP,IAAiBD,CAAC,CAACxD,EAAF,8BAAQ,KAAKZ,IAAL,CAAUS,IAAV,CAAe6D,QAAvB,0DAAQ,sBAAyB1D,EAAjC,CAAxB;MACA,CAJW,CAAZ;;MAMA,IAAI,CAACqD,KAAK,CAAC7K,MAAX,EAAmB;QAElB,OAAO,cAAP;MACA;;MAED,IAAI6K,KAAK,CAAC7K,MAAN,GAAe,CAAnB,EAAsB;QAErB,KAAK4G,IAAL,CAAUuE,KAAV,CAAgBC,MAAhB,CAAuB,UAAvB,EAAmC;UAClCC,OAAO,EAAE,KAAK/E,KAAL,CAAWC,CAAX,CAAa,2BAAb,CADyB;UAElChM,IAAI,EAAE,gBAF4B;UAGlCzB,IAAI,EAAE;YACL+R,KAAK,EAAEA,KADF;YAELpB,MAAM,EAAE,iBAFH;YAGL6B,YAAY,EAAGzJ,CAAD,IAAO;cACpB,KAAK2H,gBAAL,CAAsB3H,CAAtB,EAAyB,iBAAzB;YACA;UALI;QAH4B,CAAnC;QAYA;AACJ;AACA;AACA;MACI,CAlBD,MAkBO;QACN,KAAK0J,eAAL,CAAqBV,KAAK,CAAC,CAAD,CAA1B;MACA;;MAGD,KAAKtL,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;IAEA,CApIO;IAsIRuB,eAAe,EAAE,UAAUlE,IAAV,EAAgB;MAChC,IAAImE,GAAG,GAAG,KAAK/E,WAAf,CADgC,CAGhC;;MAEA+E,GAAG,CAAC;QACHC,MAAM,EAAE,KAAK7H,IAAL,CAAUmD,MADf;QAEH2E,OAAO,EAAErE,IAAI,CAAC4D,MAAL,CAAYS;MAFlB,CAAD,CAAH;MAKA;AACH;AACA;AACA;AACA;IAEG,CAtJO;IAwJRC,aAAa,EAAE,YAAY;MAC1B,KAAKnN,KAAL,CAAW,YAAX;MACA,KAAKtE,MAAL,GAAc,IAAd;IACA,CA3JO;;IA6JR0R,aAAa,GAAG;MACf,KAAK1R,MAAL,GAAc,KAAd;IACA,CA/JO;;IAiKR2R,OAAO,EAAE,UAAUC,GAAV,EAAe;MACvB,KAAKtN,KAAL,CAAW,YAAX,EAAyBsN,GAAzB;IACA,CAnKO;;IAqKRjD,OAAO,GAAG;MAET,IAAI,KAAK/E,CAAT,EAAY;QACX,KAAK6B,MAAL,CAAYxH,KAAZ,CAAkB4N,eAAlB,GAAoC,IAApC;QACA,IAAIzE,QAAQ,GAAG,IAAf;QACA,IAAI0E,UAAU,GAAG,IAAjB;QACA,IAAIpI,IAAI,GAAG,IAAX;QACA,IAAI4D,EAAE,GAAG,EAAT;QAEA,KAAKhD,QAAL,GAAgB,IAAhB;QACA,OAAO,KAAKoC,IAAL,CAAUS,IAAV,CAAe4E,SAAf,CAAyB,KAAKhF,MAA9B,EAAsC9K,IAAtC,CAA2C+P,IAAI,IAAI;UAEzD,IAAI,KAAKjF,MAAL,CAAYjH,MAAZ,IAAsB,CAA1B,EAA6B;YAE5B,IAAImM,KAAK,GAAGD,IAAI,CAAC,CAAD,CAAhB;;YAEA,IAAI,CAACC,KAAD,IAAU,CAACA,KAAK,CAACC,IAAjB,IAAyBD,KAAK,CAACC,IAAN,CAAWpM,MAAX,GAAoB,EAAjD,EAAqD;cAEpD,KAAKxB,KAAL,CAAW,gBAAX;cACA,OAAOsK,OAAO,CAACe,MAAR,CAAe,KAAf,CAAP;YAEA;UACD;;UAED,IAAI,KAAKjD,IAAL,CAAUS,IAAV,CAAe6D,QAAf,CAAwBkB,IAAxB,CAA6BpM,MAA7B,GAAsC,EAA1C,EAA8C;YAC7C,KAAKxB,KAAL,CAAW,gBAAX;YACA,OAAOsK,OAAO,CAACe,MAAR,CAAe,KAAf,CAAP;UACA,CAjBwD,CAoBzD;;;UAEArC,EAAE,GAAG,KAAKZ,IAAL,CAAUC,IAAV,CAAewF,GAAf,CAAmBC,SAAnB,CAA6BJ,IAAI,CAAC,CAAD,CAAjC,EAAsC,KAAKtF,IAAL,CAAUS,IAAV,CAAe6D,QAArD,CAAL;UAEA5D,QAAQ,GAAG,KAAKV,IAAL,CAAUS,IAAV,CAAeC,QAAf,CAAwB4E,IAAI,CAAC,CAAD,CAAJ,CAAQ1E,EAAhC,CAAX;UACAwE,UAAU,GAAG,KAAKpF,IAAL,CAAUS,IAAV,CAAeC,QAAf,CAAwB,KAAKV,IAAL,CAAUS,IAAV,CAAe6D,QAAf,CAAwB1D,EAAhD,CAAb;UAEA,IAAI+E,YAAY,GAAG,CAAC;YACnB,QAAQ,iBADW;YAEnB,aAAa,EAFM;YAGnB,WAAW;cACVC,SAAS,EAAE;YADD;UAHQ,CAAD,CAAnB;UAQA,OAAO,KAAK5F,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsB6D,UAAtB,CACN;YACCC,eAAe,EAAElF,EADlB;YAECmF,UAAU,EAAE,SAFb;YAGCC,MAAM,EAAE,CAACtF,QAAD,CAHT;YAIC1O,IAAI,EAAE,MAAM4O,EAJb;YAKCqF,aAAa,EAAEN;UALhB,CADM,CAAP;QAWA,CA9CM,EA8CJpQ,IA9CI,CA8CC2Q,KAAK,IAAI;UAEhBlJ,IAAI,GAAGkJ,KAAP;UACA,KAAKnH,MAAL,CAAYxH,KAAZ,CAAkB4N,eAAlB,GAAoC,KAApC;UAEA,IAAIgB,MAAM,GAAG,KAAKnG,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsBoE,OAAtB,CAA8BF,KAAK,CAACG,OAApC,CAAb;UACA,IAAI/P,KAAK,GAAG6P,MAAM,CAACjF,YAAP,CAAoBoF,cAApB,CAAmC,qBAAnC,CAAZ;UAEA,OAAO,KAAKtG,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsBuE,aAAtB,CAAoCvJ,IAAI,CAACqJ,OAAzC,EAAkD3F,QAAlD,EAA4D,GAA5D,EAAiEpK,KAAK,CAAC,CAAD,CAAtE,EAA2EZ,KAA3E,CAAiFqC,CAAC,IAAI,CAC5F,CADM,CAAP;QAGA,CAzDM,EAyDJxC,IAzDI,CAyDC6O,CAAC,IAAI;UACZ,KAAKxG,QAAL,GAAgB,KAAhB;;UAGA,IAAI,KAAKqB,OAAL,IAAgB,KAAKA,OAAL,IAAgB2B,EAApC,EAAwC;YACvC,KAAK4F,SAAL;UACA;;UAED,KAAKzH,MAAL,CAAYyF,MAAZ,CAAmB,SAAnB,EAA8B,KAA9B;UAEA,OAAOtC,OAAO,CAACnG,OAAR,EAAP;QAEA,CArEM,EAqEJrG,KArEI,CAqEEqC,CAAC,IAAI;UAEb,KAAK6F,QAAL,GAAgB,KAAhB;UAEA,KAAKmB,MAAL,CAAYxH,KAAZ,CAAkB4N,eAAlB,GAAoC,KAApC;;UAEA,IAAIpN,CAAC,IAAIA,CAAC,CAAC0O,OAAF,IAAa,eAAtB,EAAuC;YAEtC,OAAO,KAAKzG,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsB0E,QAAtB,CAA+B,MAAM9F,EAAN,GAAW,GAAX,GAAiB,KAAKZ,IAAL,CAAUC,IAAV,CAAe0G,OAAf,CAAuBC,OAAvB,CAA+B,UAA/B,EAA2C,EAA3C,CAAhD,EAAgGrR,IAAhG,CAAqG,MAAM,CACjH,CADM,EACJG,KADI,CACEqC,CAAC,IAAI,CAEb,CAHM,CAAP;UAKA;;UAED,OAAOmK,OAAO,CAACe,MAAR,CAAelL,CAAf,CAAP;QAEA,CAtFM,CAAP;MAwFA,CAhGD,MAgGO;QACN,OAAOmK,OAAO,CAACe,MAAR,CAAe,GAAf,CAAP;MACA;IAED,CA3QO;;IA6QR4D,cAAc,GAAG;MAChB,OAAO,KAAK7J,IAAL,IAAa,KAAKA,IAAL,CAAU6J,cAAV,EAApB;IACA,CA/QO;;IAiRRL,SAAS,GAAG;MACX,KAAKzT,IAAL,CAAU,IAAV,EAAgBwC,IAAhB,CAAqB6O,CAAC,IAAI;QACzB,OAAOlC,OAAO,CAACnG,OAAR,CAAgBqI,CAAhB,CAAP;MACA,CAFD;IAGA,CArRO;;IAuRR0C,SAAS,CAAClU,IAAD,EAAO;MAEf,KAAKG,IAAL,CAAUH,IAAV,EAAgB2C,IAAhB,CAAqB6O,CAAC,IAAI;QAEzB,OAAOlC,OAAO,CAACnG,OAAR,CAAgBqI,CAAhB,CAAP;MAEA,CAJD;IAMA,CA/RO;;IAiSR2C,YAAY,EAAE,UAAUnU,IAAV,EAAgBoU,KAAhB,EAAuB;MACpCpU,IAAI,GAAGA,IAAI,CAACqU,IAAL,EAAP;MACA,IAAIrU,IAAI,CAACwG,MAAL,IAAe4N,KAAnB,EAA0B,OAAOpU,IAAP;MAE1BA,IAAI,GAAGA,IAAI,CAACsU,KAAL,CAAW,CAAX,EAAcF,KAAd,CAAP;MAEA,OAAOpU,IAAI,CAACqU,IAAL,KAAc,KAArB;IACA,CAxSO;;IA0SRE,eAAe,CAACvU,IAAD,EAAO;MAErBwH,CAAC,CAAC8B,IAAF,CAAO,KAAK6D,QAAZ,EAAsB,UAAUU,IAAV,EAAgB;QACrC7N,IAAI,GAAGA,IAAI,CAACgU,OAAL,CAAa,IAAIQ,MAAJ,CAAW,MAAM3G,IAAI,CAACzO,IAAtB,EAA4B,GAA5B,CAAb,EAA+C,MAAMyO,IAAI,CAACG,EAAX,GAAgB,GAAhB,GAAsBH,IAAI,CAACzO,IAA1E,CAAP;MACA,CAFD;;MAIA,OAAOY,IAAP;IACA,CAjTO;;IAmTRG,IAAI,CAACH,IAAD,EAAO;MAEV,IAAI,CAAC,KAAKoK,IAAV,EAAgB;QACf,KAAKiF,OAAL,GAAevM,KAAf,CAAqBqC,CAAC,IAAI,CACzB,CADD;MAEA,CALS,CAOV;MAEA;MAEA;;;MAEA,KAAKH,KAAL,CAAW,SAAX;;MAGA,IAAI,CAAC,KAAKwF,aAAV,EAAyB;QACxB,KAAK3I,KAAL;MACA;;MAED,OAAO,KAAK2N,EAAL,CAAQC,MAAR,CAAe,MAAM;QAE3B,OAAO,KAAKrF,IAAL,IAAa,CAAC,KAAKY,QAA1B;MAEA,CAJM,EAIJrI,IAJI,CAIE6O,CAAD,IAAO;QAEd,KAAKxM,KAAL,CAAW,MAAX;QAEAhF,IAAI,GAAG,KAAKuU,eAAL,CAAqBvU,IAArB,CAAP;;QAEA,IAAI,KAAKwK,aAAT,EAAwB;UAEvB,IAAI,KAAKA,aAAL,CAAmBzJ,IAAnB,IAA2B,WAA3B,IAA0C,KAAKyJ,aAAL,CAAmB9G,KAAjE,EAAwE;YAEvE,OAAO,KAAK0J,IAAL,CAAUC,IAAV,CAAeoH,SAAf,CAAyB,KAAKrK,IAA9B,EAAoCpK,IAApC,EAA0C2C,IAA1C,CAA+C6O,CAAC,IAAI;cAE1DA,CAAC,CAAC,cAAD,CAAD,GAAoB;gBACnB,YAAY,WADO;gBAEnB,YAAY,KAAKpE,IAAL,CAAUC,IAAV,CAAeqH,YAAf,CAA4B,KAAKlK,aAAL,CAAmB9G,KAA/C,KAAyDI,4BAAC,CAAC6Q,MAAF;cAFlD,CAApB;cAKA,IAAIC,SAAS,GAAGpD,CAAhB;cAEA,KAAKhH,aAAL,CAAmB9G,KAAnB,CAAyBA,KAAzB,CAA+BmR,OAA/B,CAAuCC,IAAvC,GAA8CtD,CAAC,CAACsD,IAAhD;cACA,KAAKtK,aAAL,CAAmB9G,KAAnB,CAAyBA,KAAzB,CAA+BmR,OAA/B,CAAuCpU,KAAvC,GAA+C+Q,CAAC,CAAC/Q,KAAjD;cACA,KAAK+J,aAAL,CAAmB9G,KAAnB,CAAyBA,KAAzB,CAA+BmR,OAA/B,CAAuCE,OAAvC,GAAiDvD,CAAC,CAACuD,OAAnD;cAEA,OAAO,KAAKvK,aAAL,CAAmB9G,KAAnB,CAAyBA,KAAzB,CAA+BsR,UAAtC;cACA,OAAO,KAAKxK,aAAL,CAAmB9G,KAAnB,CAAyBA,KAAzB,CAA+BuR,SAAtC;cAEA,OAAO,KAAK7H,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsB8F,SAAtB,CAAgC,KAAK9K,IAAL,CAAUmD,MAA1C,EAAkD,gBAAlD,EAAoEqH,SAApE,CAAP;YAEA,CAlBM,EAkBJjS,IAlBI,CAkBC6O,CAAC,IAAI;cAEZ,KAAKpE,IAAL,CAAUuE,KAAV,CAAgBwD,QAAhB,CAAyB,cAAzB;cAEA,KAAKnQ,KAAL,CAAW,oBAAX;cAEA,KAAKA,KAAL,CAAW,OAAX;cAEA,OAAOsK,OAAO,CAACnG,OAAR,EAAP;YACA,CA3BM,EA2BJrG,KA3BI,CA2BEqC,CAAC,IAAI;cAEb4L,OAAO,CAAChO,KAAR,CAAcoC,CAAd;cACA,OAAOmK,OAAO,CAACe,MAAR,CAAelL,CAAf,CAAP;YACA,CA/BM,CAAP;UAiCA;QAED;;QAED,OAAO,KAAKiI,IAAL,CAAUC,IAAV,CAAe+H,QAAf,CAAwB,KAAKhL,IAA7B,EAAmCpK,IAAnC,EAAyC;UAAEqV,QAAQ,EAAE,KAAK7K;QAAjB,CAAzC,CAAP;MAEA,CArDM,EAqDJ1H,KArDI,CAqDEqC,CAAC,IAAI;QAGb,KAAKH,KAAL,CAAW,kBAAX,EAA+B;UAC9BjC,KAAK,EAAEoC;QADuB,CAA/B;MAIA,CA5DM,CAAP;IA8DA,CArYO;;IAuYRmQ,UAAU,CAAChW,IAAD,EAAO;MAChB,KAAKiW,SAAL,CAAe;QAAEnM,MAAM,EAAE9J;MAAV,CAAf;IACA,CAzYO;;IA2YRiW,SAAS,EAAE,iBAA4B;MAAA,IAAlB;QAAEnM,MAAF;QAAUC;MAAV,CAAkB;MAEtC,IAAI2E,EAAE,GAAGlK,4BAAC,CAAC6Q,MAAF,EAAT;MAEA,IAAIa,IAAI,GAAG;QACVzU,IAAI,EAAE,OADI;QAEViN,EAAE,EAAEA,EAFM;QAGV5E,MAAM,EAAEA;MAHE,CAAX;MAMA,KAAKpE,KAAL,CAAW,aAAX,EAA0BwQ,IAA1B,EAVsC,CAWtC;;MACA,KAAKhG,EAAL,CAAQC,MAAR,CAAe,MAAM;QAEpB,OAAO,KAAKrF,IAAZ;MAEA,CAJD,EAIGzH,IAJH,CAIQ,MAAM;QACb,IAAI6S,IAAI,CAACC,OAAT,EACC,OAAOnG,OAAO,CAACe,MAAR,CAAe,SAAf,CAAP;QAED,OAAO,KAAKjD,IAAL,CAAUC,IAAV,CAAekI,SAAf,CAAyB,KAAKnL,IAA9B,EAAoChB,MAApC,EAA4C,IAA5C,EAAkDoM,IAAlD,EAAwD;UAAEH,QAAQ,EAAE,KAAK7K;QAAjB,CAAxD,CAAP;MAEA,CAVD,EAUG7H,IAVH,CAUQ6O,CAAC,IAAI;QAEZ,KAAKxM,KAAL,CAAW,UAAX,EAAuB;UACtBgJ,EAAE,EAAEA;QADkB,CAAvB;QAIA,OAAOsB,OAAO,CAACnG,OAAR,EAAP;MAEA,CAlBD,EAkBGrG,KAlBH,CAkBSqC,CAAC,IAAI;QAEb,KAAKH,KAAL,CAAW,WAAX,EAAwB;UACvBgJ,EAAE,EAAEA,EADmB;UAEvBjL,KAAK,EAAEoC;QAFgB,CAAxB;QAKA,OAAOmK,OAAO,CAACnG,OAAR,EAAP;MAEA,CA3BD,EAZsC,CAwCtC;IAGA,CAtbO;IAwbRuM,kBAAkB,EAAE,UAAUrM,IAAV,EAAgB;MAEnC,IAAIsM,CAAC,GAAG,KAAK,IAAL,GAAY,IAApB;;MAEA,IAAI,CAAC,KAAKvL,IAAL,CAAUwL,OAAV,CAAkBC,YAAlB,EAAL,EAAuC;QACtC,OAAOvG,OAAO,CAACnG,OAAR,CAAgB,KAAhB,CAAP;MACA;;MAED,IAAIE,IAAI,CAACyM,IAAL,GAAYH,CAAhB,EAAmB;QAGlB,OAAO,KAAKI,OAAL,CAAaC,OAAb,CACN,6FADM,EACyF;UAC/FvT,MAAM,EAAE,KADuF;UAE/FC,UAAU,EAAE;QAFmF,CADzF,EAMLC,IANK,CAMCC,MAAD,IAAY;UAEjB,OAAO0M,OAAO,CAACnG,OAAR,CAAgB,IAAhB,CAAP;QAEA,CAVK,EAUHrG,KAVG,CAUGqC,CAAC,IAAI;UACb,OAAOmK,OAAO,CAACe,MAAR,CAAe,QAAf,CAAP;QACA,CAZK,CAAP;MAeA;;MAED,OAAOf,OAAO,CAACnG,OAAR,CAAgB,KAAhB,CAAP;IACA,CArdO;IAudR8M,QAAQ,EAAE,iBAAoB;MAAA,IAAV;QAAE5M;MAAF,CAAU;MAE7B,IAAI2E,EAAE,GAAGlK,4BAAC,CAAC6Q,MAAF,EAAT;MAEA,IAAIa,IAAI,GAAG;QACVzU,IAAI,EAAE,MADI;QAEViN,EAAE,EAAEA,EAFM;QAGV0E,IAAI,EAAE;UACLtT,IAAI,EAAEiK,IAAI,CAACjK,IADN;UAEL0W,IAAI,EAAEzM,IAAI,CAACyM;QAFN;MAHI,CAAX;MASA,KAAK9Q,KAAL,CAAW,aAAX,EAA0BwQ,IAA1B;MAEA,KAAKhG,EAAL,CAAQC,MAAR,CAAe,MAAM;QAEpB,OAAO,KAAKrF,IAAZ;MAEA,CAJD,EAIGzH,IAJH,CAIQ,MAAM;QAEb,OAAO,KAAK+S,kBAAL,CAAwBrM,IAAxB,CAAP;MAGA,CATD,EASG1G,IATH,CASSuT,MAAD,IAAY;QAEnB,OAAO,KAAK9I,IAAL,CAAUC,IAAV,CAAe4I,QAAf,CAAwB,KAAK7L,IAA7B,EAAmCf,IAAnC,EAAyCmM,IAAzC,EAA+C;UAAEH,QAAQ,EAAE,KAAK7K;QAAjB,CAA/C,EAAiF0L,MAAjF,CAAP;MAEA,CAbD,EAaGvT,IAbH,CAaQ,MAAM;QAEb,KAAKqC,KAAL,CAAW,UAAX,EAAuB;UACtBgJ,EAAE,EAAEA;QADkB,CAAvB;QAIA,OAAOsB,OAAO,CAACnG,OAAR,EAAP;MAEA,CArBD,EAqBGrG,KArBH,CAqBSqC,CAAC,IAAI;QAEb4L,OAAO,CAAChO,KAAR,CAAcoC,CAAd;QAEA,KAAKH,KAAL,CAAW,WAAX,EAAwB;UACvBgJ,EAAE,EAAEA,EADmB;UAEvBjL,KAAK,EAAEoC;QAFgB,CAAxB;MAIA,CA7BD;IAgCA,CAtgBO;IAwgBRtD,KAAK,EAAE,YAAY;MAClB,IAAI,KAAKkE,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBlE,KAAvB;IACD,CA3gBO;IA6gBRL,OAAO,EAAE,YAAY;MACpB,KAAKwD,KAAL,CAAW,SAAX;IACA,CA/gBO;IAihBRlD,IAAI,EAAE,YAAY;MACjB,IAAI,KAAKiE,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBjE,IAAvB;IACD,CAphBO;IAshBRC,WAAW,EAAE,YAAY;MACxB,IAAI,KAAKgE,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBhE,WAAvB;IACD,CAzhBO;IA2hBRoU,MAAM,EAAE,YAAY,CACnB,CA5hBO;IA8hBR7U,OAAO,EAAE,UAAUtB,IAAV,EAAgB;MACxB,KAAKA,IAAL,GAAYA,IAAZ;MAEA,IAAI,KAAK+F,KAAL,CAAW,UAAX,CAAJ,EACC,KAAKA,KAAL,CAAW,UAAX,EAAuBzE,OAAvB,CAA+BtB,IAA/B;IACD,CAniBO;IAqiBR2D,KAAK,EAAE,UAAUyS,GAAV,EAAe;MACrB,IAAIpH,KAAK,GAAGoH,GAAG,CAACC,MAAJ,CAAWrH,KAAvB;;MAEA,IAAIA,KAAK,KAAK,EAAd,EAAkB;QACjB,KAAKhK,KAAL,CAAW,YAAX,EAAyB,KAAzB;QACA;MACA,CAHD,MAGO;QACN,KAAKA,KAAL,CAAW,YAAX,EAAyB,IAAzB;MACA;;MAED,KAAKhF,IAAL,GAAYgP,KAAZ;MACA,KAAK7D,UAAL,GAAkBrH,4BAAC,CAACwS,MAAF,CAAS,KAAKtW,IAAd,CAAlB;;MAGA,IAAI,KAAKmL,UAAL,KAAoBoL,SAAxB,EAAmC;QAClC,KAAKvR,KAAL,CAAW,YAAX,EAAyB,KAAKmG,UAA9B;MACA,CAFD,MAEO;QACN,KAAKnG,KAAL,CAAW,YAAX,EAAyB,KAAzB;MACA;;MAED,IAAI,KAAKoF,IAAT,EACC,KAAKgD,IAAL,CAAUC,IAAV,CAAe+B,MAAf,CAAsBoH,UAAtB,CAAiC,KAAKpM,IAAL,CAAUmD,MAA3C,EAAmD,IAAnD,EAAyD,GAAzD;IACD,CA3jBO;;IA6jBRkJ,aAAa,CAACC,IAAD,EAAOC,SAAP,EAAkB;MAC9B,KAAKD,IAAI,CAAC9J,KAAV,EAAiB+J,SAAjB;IACA,CA/jBO;;IAikBRC,qBAAqB,EAAE,UAAU5H,KAAV,EAAiB;MAEvC,KAAKoC,aAAL,GAAqBpC,KAArB;MAEA,OAAO,KAAKoC,aAAZ;IACA,CAtkBO;;IAwkBRyF,WAAW,CAACH,IAAD,EAAOI,KAAP,EAAc,CAExB,CA1kBO;;IA4kBRC,WAAW,CAACL,IAAD,EAAO3T,KAAP,EAAc;MACxB,KAAKoJ,MAAL,CAAYyF,MAAZ,CAAmB,MAAnB,EAA2B;QAC1B5E,IAAI,EAAE,OADoB;QAE1BgK,OAAO,EAAEjU,KAAK,CAAC/C;MAFW,CAA3B;IAIA,CAjlBO;;IAklBRiX,MAAM,GAAG;MACR,OAAO,KAAKhG,IAAL,GAAY,IAAnB;IACA,CAplBO;;IAqlBRiG,eAAe,CAAClI,KAAD,EAAQ;MACtB,IAAI,CAACA,KAAL,EAAY;QACX,KAAKjJ,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;MACA;IACD,CAzlBO;;IA0lBRM,cAAc,CAAC4F,IAAD,EAAOpX,IAAP,EAAa;MAC1B,MAAM6X,eAAe,GAAG,CAAC,WAAD,EAAc,YAAd,EAA4B,WAA5B,EAAyC,YAAzC,CAAxB;;MAGA,IAAI,CAACA,eAAe,CAACC,QAAhB,CAAyB9X,IAAI,CAAC+J,IAAL,CAAUtI,IAAnC,CAAL,EAA+C;QAC9C,KAAKkV,QAAL,CAAc3W,IAAd;MACA,CAFD,MAEO;QACN,OAAO,KAAKiW,SAAL,CAAejW,IAAf,CAAP;MACA;IACD,CAnmBO;;IAomBR+X,OAAO,CAAChO,IAAD,EAAO;MACb,MAAMiO,GAAG,GAAG,IAAIC,KAAJ,EAAZ;MACA,IAAIC,OAAO,GAAG,EAAd;MAEA,OAAO,IAAIlI,OAAJ,CAAY,CAACnG,OAAD,EAAUkH,MAAV,KAAqB;QAEvCiH,GAAG,CAACG,MAAJ,GAAa,YAAY;UACxBD,OAAO,CAACE,CAAR,GAAY,KAAKzQ,KAAjB;UACAuQ,OAAO,CAACG,CAAR,GAAY,KAAKC,MAAjB;UACAzO,OAAO,CAACqO,OAAD,CAAP;QACA,CAJD;;QAMAF,GAAG,CAACO,OAAJ,GAAc,UAAU1S,CAAV,EAAa;UAC1BkL,MAAM,CAAClL,CAAD,CAAN;QACA,CAFD;;QAIAmS,GAAG,CAACQ,GAAJ,GAAUzO,IAAI,CAACD,MAAf;MACA,CAbM,CAAP;IAeA,CAvnBO;;IAwnBR8H,iBAAiB,CAACwF,IAAD,EAAOjN,MAAP,EAAe;MAC/B,KAAK0C,MAAL,CAAYxH,KAAZ,CAAkBoE,OAAlB,GAA4B,KAA5B;MACA,KAAKhD,KAAL,CAAWwK,YAAX,CAAwBC,SAAxB;IACA,CA3nBO;;IA6nBRuH,oBAAoB,CAACrO,GAAD,EAAM;MAEzB,IAAIA,GAAG,IAAI,aAAP,IAAyBA,GAAG,CAACsO,QAAJ,IAAgBtO,GAAG,CAACsO,QAAJ,GAAe9I,OAAf,CAAuB,YAAvB,IAAuC,CAAC,CAArF,EAAyF;QACxF,KAAKpD,kBAAL,GAA0B,IAA1B;;QAEA,IAAIzK,MAAM,CAAC4W,OAAX,EAAoB;UACnB,KAAKlC,OAAL,CAAaC,OAAb,CACC,KAAKlJ,KAAL,CAAWC,CAAX,CAAa,kBAAb,CADD,EACmC;YAClCtK,MAAM,EAAE,KAAKqK,KAAL,CAAWC,CAAX,CAAa,WAAb;UAD0B,CADnC;QAIA,CALD,MAMK;UACJ,KAAKgJ,OAAL,CAAaC,OAAb,CACC,KAAKlJ,KAAL,CAAWC,CAAX,CAAa,kBAAb,CADD,EACmC;YAClCtK,MAAM,EAAE,KAAKqK,KAAL,CAAWC,CAAX,CAAa,WAAb;UAD0B,CADnC;QAIA;;QAED;MACA;;MAED,IAAKrD,GAAG,CAACsO,QAAJ,IAAgBtO,GAAG,CAACsO,QAAJ,GAAe9I,OAAf,CAAuB,kBAAvB,IAA6C,CAAC,CAAnE,EAAuE;QACtE,KAAK6G,OAAL,CAAaC,OAAb,CACC,KAAKlJ,KAAL,CAAWC,CAAX,CAAa,mBAAb,CADD,EACoC;UACnCtK,MAAM,EAAE,KAAKqK,KAAL,CAAWC,CAAX,CAAa,WAAb;QAD2B,CADpC;QAIA;MACA;;MAGD,KAAKgJ,OAAL,CAAaC,OAAb,CACC,KAAKlJ,KAAL,CAAWC,CAAX,CAAa,wBAAb,CADD,EACyC;QACxCtK,MAAM,EAAE,KAAKqK,KAAL,CAAWC,CAAX,CAAa,WAAb;MADgC,CADzC;MAKAgE,OAAO,CAAChO,KAAR,CAAc2G,GAAd;IACA,CAjqBO;;IAmqBRwO,iBAAiB,CAAEC,IAAF,EAAQ;MAExB,OAAO,IAAI7I,OAAJ,CAAY,CAACnG,OAAD,EAAUkH,MAAV,KAAqB;QACvChP,MAAM,CAAC+W,yBAAP,CAAiCD,IAAjC,EAAwCE,KAAD,IAAW;UAGjD,IAAG,CAACA,KAAJ,EAAU;YACT,OAAOhI,MAAM,CAAC,SAAD,CAAb;UACA;;UAEDgI,KAAK,CAAChP,IAAN,CAAYA,IAAD,IAAU;YACpB,IAAI7G,MAAM,GAAG,IAAI8V,UAAJ,EAAb;;YAEA9V,MAAM,CAAC+V,SAAP,GAAmB,YAAW;cAC7B,IAAIC,IAAI,GAAG,IAAIC,IAAJ,CAAS,CAAC,IAAIC,UAAJ,CAAe,KAAKjP,MAApB,CAAD,CAAT,EAAwC;gBAAC1I,IAAI,EAAGsI,IAAI,CAACtI;cAAb,CAAxC,CAAX;cAEAsX,KAAK,CAACjS,MAAN;cAEA+C,OAAO,CAACqP,IAAD,CAAP;YACA,CAND;;YAQAhW,MAAM,CAACqV,OAAP,GAAkB1S,CAAD,IAAO;cAEvBkT,KAAK,CAACjS,MAAN;cAEAiK,MAAM,CAAClL,CAAD,CAAN;YACA,CALD;;YAOA3C,MAAM,CAACmW,iBAAP,CAAyBtP,IAAzB;UACA,CAnBD;QAoBA,CA3BD,EA2BIlE,CAAD,IAAO;UACTkL,MAAM,CAAClL,CAAD,CAAN;QACA,CA7BD;MA8BA,CA/BM,CAAP;IAiCA,CAtsBO;;IAwsBRyT,oBAAoB,GAAG;MAEtB,KAAKtU,gBAAL,GAAwBuU,uCAAU,CAAC,KAAKzL,IAAL,CAAU0L,KAAV,CAAgBC,WAAhB,CAA4B;QAAEC,KAAK,EAAE;MAAT,CAA5B,EAA6CrW,IAA7C,CAAkD,MAAM;QAC1F,KAAKmJ,kBAAL,GAA0B,KAA1B;QAEA,OAAOwD,OAAO,CAACnG,OAAR,EAAP;MACA,CAJkC,EAIhCrG,KAJgC,CAI1B4G,GAAG,IAAI;QAEfqH,OAAO,CAAChO,KAAR,CAAc2G,GAAd;QAEA,KAAKqO,oBAAL,CAA0BrO,GAA1B;QAEA,OAAO4F,OAAO,CAACe,MAAR,CAAe3G,GAAf,CAAP;MAEA,CAZkC,CAAD,CAAlC;MAcA,KAAKpF,gBAAL,CAAsB3B,IAAtB,CAA2B,MAAM;QAEhC,KAAKmJ,kBAAL,GAA0B,KAA1B;QAEA,IAAIqM,IAAI,GAAG,eAAX;QAEA,IAAGrU,4BAAC,CAACmV,KAAF,EAAH,EAAcd,IAAI,GAAG,6CAAP;QAEd,IAAI7Q,GAAG,GAAG,CAAV;QAEA,KAAKoE,YAAL,GAAoB,KAAK0B,IAAL,CAAU8L,eAAV,EAApB,CAVgC,CAYhC;;QAEA,IAAIJ,KAAK,GAAG,KAAKK,oBAAL,GAA4B,IAAIC,KAAJ,CAAUjB,IAAV,EAAgB,MAAM;UAE7D,KAAKvR,UAAL,GAAkB,CAAlB;UAEAkS,KAAK,CAACO,OAAN;;UAEA,IAAI,KAAKtN,6BAAT,EAAwC;YAEvC,KAAKA,6BAAL,GAAqC,KAArC;YACA;UACA;;UAED,IAAIuN,EAAE,GAAG,IAAT;UAEA;;UAECA,EAAE,GAAG,KAAKpB,iBAAL,CAAuBpU,4BAAC,CAACmV,KAAF,KAAYd,IAAZ,GAAmB9W,MAAM,CAAC4W,OAAP,CAAe5O,IAAf,CAAoBkQ,qBAApB,GAA4CpB,IAAtF,EAA4FxV,IAA5F,CAAiG6V,IAAI,IAAI;YAC7G,OAAOlJ,OAAO,CAACnG,OAAR,CAAgB;cACtB7J,IAAI,EAAGkZ;YADe,CAAhB,CAAP;UAGA,CAJI,CAAL;UAMD;AACL;AACA;AACA;;UAGKc,EAAE,CAAC3W,IAAH,CAAQ6O,CAAC,IAAI;YACZ;;YACA;AACN;AACA;AACA;AACA;AACA;YAKM,IAAIsH,KAAK,CAACU,QAAN,IAAkBV,KAAK,CAACU,QAAN,GAAiB,CAAvC,EAAyC;cACxChI,CAAC,CAACgI,QAAF,GAAaV,KAAK,CAACU,QAAnB;YACA;;YAED,KAAKC,kBAAL,CAAwBjI,CAAxB,EAA2B,IAA3B;YAEA,OAAOlC,OAAO,CAACnG,OAAR,EAAP;UAEA,CApBD,EAoBGrG,KApBH,CAoBSqC,CAAC,IAAI;YAEb,KAAKuD,KAAL;YAEAqI,OAAO,CAAChO,KAAR,CAAcoC,CAAd;UACA,CAzBD,EAyBGuU,OAzBH,CAyBW,MAAM,CAEhB,CA3BD;QA6BA,CAzDuC,EAyDpCvU,CAAD,IAAO;UAET4L,OAAO,CAAChO,KAAR,CAAcoC,CAAd;UAEA,KAAKhB,WAAL,GAAmB,KAAnB;UACA,KAAKuE,KAAL;QAEA,CAhEuC,CAAxC;QAkEA,IAAIiR,OAAO,GAAG,EAAd;QAEA,IAAIC,cAAc,GAAG,KAAKzN,MAAL,CAAYxH,KAAZ,CAAkBkV,0BAAvC;;QAEA,IAAID,cAAJ,EAAoB;UACnBA,cAAc,CAACE,KAAf;QACA;;QAGD,KAAKlO,QAAL,GAAgBmO,WAAW,CAAC,MAAM;UACjC;UAEA,IAAGjW,4BAAC,CAACmV,KAAF,EAAH,EAAa;YACZU,OAAO,CAAChN,IAAR,CAAa,CAAb;YAEA,IAAIgN,OAAO,CAACnT,MAAR,GAAiB,EAArB,EAAyBmT,OAAO,GAAGnS,CAAC,CAACC,IAAF,CAAOkS,OAAP,EAAgB,EAAhB,CAAV;YAEzB,KAAKnO,aAAL,GAAqBhE,CAAC,CAACwS,KAAF,CAAQL,OAAR,CAArB;UACA,CAND,MAOI;YACH,KAAKR,oBAAL,CAA0Bc,mBAA1B,EACC;YACCC,GAAD,IAAS;cAERP,OAAO,CAAChN,IAAR,CAAauN,GAAG,GAAG,IAAnB;cAEA,IAAIP,OAAO,CAACnT,MAAR,GAAiB,EAArB,EAAyBmT,OAAO,GAAGnS,CAAC,CAACC,IAAF,CAAOkS,OAAP,EAAgB,EAAhB,CAAV;cAEzB,KAAKnO,aAAL,GAAqBhE,CAAC,CAACwS,KAAF,CAAQL,OAAR,CAArB;YAGA,CAXF,EAYC,UAAUxU,CAAV,EAAa;cACZ4L,OAAO,CAACoJ,GAAR,CAAY,GAAZ,EAAiBhV,CAAjB;YACA,CAdF;UAgBA;;UAKDmC,GAAG,GAAGA,GAAG,GAAG,EAAZ;UAEA,IAAIA,GAAG,GAAG,IAAN,KAAe,CAAnB,EAAsB,KAAKV,UAAL,GAAkBU,GAAlB;QAEtB,CApC0B,EAoCxB,EApCwB,CAA3B;QAsCA,KAAKnD,WAAL,GAAmB,IAAnB;QACA,KAAK0H,aAAL,GAAqB,CAArB;QACA,KAAKL,aAAL,GAAqB,EAArB;QACA,KAAK5E,UAAL,GAAkB,CAAlB;QACA,KAAK2E,MAAL,GAAc,IAAd;QAEA,KAAK4N,oBAAL,CAA0BiB,WAA1B;MAEA,CAvID,EAuIGtX,KAvIH,CAuIUqC,CAAD,IAAO;QACf4L,OAAO,CAAChO,KAAR,CAAcoC,CAAd;MAGA,CA3ID,EA2IGuU,OA3IH,CA2IW,MAAM;QAChB,KAAKpV,gBAAL,GAAwB,IAAxB;MACA,CA7ID;IA+IA,CAv2BO;;IAy2BR+V,aAAa,GAAG;MAEf,IAAI,KAAK/V,gBAAL,IAAyB,KAAKH,WAA9B,IAA6C,KAAKgV,oBAAtD,EAA4E;;MAE5E,IAAI9X,MAAM,CAAC4W,OAAX,EAAoB;QACnB,OAAO,KAAKW,oBAAL,EAAP;MACA;;MAED,KAAKtU,gBAAL,GAAwBuU,uCAAU,CAAC,KAAKzL,IAAL,CAAUkN,iBAAV,GAA8B3X,IAA9B,CAAoC4X,QAAD,IAAc;QAEnF,KAAKzO,kBAAL,GAA0B,KAA1B;;QAEA,IAAI,KAAKxH,gBAAT,EAA2B;UAC1B,OAAOgL,OAAO,CAACnG,OAAR,CAAgBoR,QAAhB,CAAP;QACA,CAFD,MAGK;UACJA,QAAQ,CAACC,MAAT,CAAgBC,SAAhB,GAA4B1L,OAA5B,CAAqC2L,KAAD,IAAW;YAC9CA,KAAK,CAACC,IAAN;UACA,CAFD;QAGA;MAED,CAbkC,EAahC7X,KAbgC,CAa1B4G,GAAG,IAAI;QAEf,KAAKqO,oBAAL,CAA0BrO,GAA1B;QACA,OAAO4F,OAAO,CAACe,MAAR,CAAe3G,GAAf,CAAP;MAEA,CAlBkC,CAAD,CAAlC;MAqBA,KAAKpF,gBAAL,CAAsB3B,IAAtB,CAA4B4X,QAAD,IAAc;QAGxC,KAAK9O,aAAL,GAAqB8O,QAArB;QAEA,KAAK7O,YAAL,GAAoB,KAAK0B,IAAL,CAAU8L,eAAV,EAApB;QACA,KAAKvN,aAAL,GAAqB,KAAKD,YAAL,CAAkBkP,cAAlB,EAArB,CANwC,CAQxC;;QAEA,IAAI9C,GAAG,GAAG,KAAKpM,YAAL,CAAkBmP,uBAAlB,CAA0C,KAAKpP,aAAL,CAAmB+O,MAA7D,CAAV;QACA1C,GAAG,CAACzL,OAAJ,CAAY,KAAKV,aAAjB;QAEA,KAAKmP,cAAL;MAEA,CAfD,EAeGhY,KAfH,CAeS,MAAM,CAAG,CAflB,EAeoB4W,OAfpB,CAe4B,MAAM;QACjC,KAAKpV,gBAAL,GAAwB,IAAxB;MACA,CAjBD;IAoBA,CA15BO;;IA45BRwW,cAAc,GAAG;MAEhB,IAAIlB,cAAc,GAAG,KAAKzN,MAAL,CAAYxH,KAAZ,CAAkBkV,0BAAvC;;MAEA,IAAID,cAAJ,EAAoB;QACnBA,cAAc,CAACE,KAAf;MACA;;MAED,KAAK3N,MAAL,CAAYyF,MAAZ,CAAmB,oBAAnB,EAAyC,IAAzC;MAEA,KAAKzN,WAAL,GAAmB,IAAnB;MACA,KAAK0H,aAAL,GAAqB,CAArB;MACA,KAAKL,aAAL,GAAqB,EAArB;MACA,KAAK5E,UAAL,GAAkB,CAAlB;MACA,KAAK2E,MAAL,GAAc,IAAd;MACA,KAAKE,aAAL,CAAmBxI,KAAnB;MAEA,IAAIqE,GAAG,GAAG,CAAV;MACA,IAAIqS,OAAO,GAAG,EAAd;MAGA,KAAK/N,QAAL,GAAgBmO,WAAW,CAAC,MAAM;QACjC,IAAIgB,SAAS,GAAG,IAAIrC,UAAJ,CAAe,KAAK/M,aAAL,CAAmBqP,iBAAlC,CAAhB;QAEA,KAAKrP,aAAL,CAAmBsP,oBAAnB,CAAwCF,SAAxC;QAGApB,OAAO,CAAChN,IAAR,CAAa,KAAKuO,WAAL,CAAiBH,SAAjB,CAAb;QAEA,IAAIpB,OAAO,CAACnT,MAAR,GAAiB,EAArB,EAAyBmT,OAAO,GAAGnS,CAAC,CAACC,IAAF,CAAOkS,OAAP,EAAgB,EAAhB,CAAV;QAEzBrS,GAAG,GAAGA,GAAG,GAAG,EAAZ;QAEA,KAAKkE,aAAL,GAAqBhE,CAAC,CAACwS,KAAF,CAAQL,OAAR,CAArB;;QAEA,IAAIrS,GAAG,GAAG,IAAN,KAAe,CAAnB,EAAsB;UACrB,KAAKV,UAAL,GAAkBU,GAAlB;QACA;MAED,CAlB0B,EAkBxB,EAlBwB,CAA3B;IAoBA,CAr8BO;;IAw8BR6T,iBAAiB,EAAE,UAAU5P,MAAV,EAAkB1F,OAAlB,EAA2B;MAE7C,IAAI0F,MAAM,CAACiO,QAAP,GAAkB,CAAtB,EAAyB;QACxB,KAAK9Q,KAAL;MACA,CAFD,MAGK;QACJ,IAAI7C,OAAJ,EAAa;UACZ,KAAKuV,gBAAL,CAAsB7P,MAAtB;QACA,CAFD,MAGI;UACH,KAAKA,MAAL,GAAcA,MAAd;QACA;MACD;IACD,CAr9BO;;IAu9BR8P,WAAW,CAAChS,IAAD,EAAM;MAEhB,OAAO,IAAIiG,OAAJ,CAAY,CAACnG,OAAD,EAAUkH,MAAV,KAAqB;QACvCvM,4BAAC,CAACwX,QAAF,CAAWjS,IAAX,EAAiB1G,IAAjB,CAAsB4Y,WAAW,IAAI;UACpC,IAAG;YACF,KAAK7P,YAAL,CAAkB8P,eAAlB,CAAkCD,WAAlC,EAAgDE,MAAD,IAAY;cAC1DtS,OAAO,CAACsS,MAAM,CAACjC,QAAR,CAAP;YACA,CAFD;UAGA,CAJD,CAIC,OAAMrU,CAAN,EAAQ;YACRkL,MAAM,CAAClL,CAAD,CAAN;UACA;QAED,CATD,EASGrC,KATH,CASSuN,MATT;MAUA,CAXM,CAAP;IAeA,CAx+BO;;IA0+BRoJ,kBAAkB,CAAC/V,KAAD,EAAQmC,OAAR,EAAiB;MAClC,IAAIwC,CAAC,GAAG,MAAM;QAEb;QAEA,KAAK8S,iBAAL,CAAuB;UACtB9R,IAAI,EAAE3F,KAAK,CAACpE,IADU;UAEtB0O,EAAE,EAAElK,4BAAC,CAAC6Q,MAAF,EAFkB;UAGtB6E,QAAQ,EAAG9V,KAAK,CAAC8V;QAHK,CAAvB,EAIG3T,OAJH;MAKA,CATD;;MAWA,IAAGnC,KAAK,CAAC8V,QAAT,EAAkB;QAEjBnR,CAAC;MACD,CAHD,MAII;QACH,KAAKgT,WAAL,CAAiB3X,KAAK,CAACpE,IAAvB,EAA6BqD,IAA7B,CAAkC6W,QAAQ,IAAI;UAC7C9V,KAAK,CAAC8V,QAAN,GAAiBA,QAAjB;UAEAnR,CAAC;QACD,CAJD,EAIGvF,KAJH,CAIUqC,CAAD,IAAO;UACf4L,OAAO,CAAChO,KAAR,CAAcoC,CAAd;UAEA,KAAKuD,KAAL;QACA,CARD;MASA;MAGD;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IAUG,CAliCO;;IAoiCRwS,WAAW,CAACQ,WAAD,EAAc;MACxB,OAAO,CAACtU,IAAI,CAACuU,IAAL,CAAUD,WAAW,CAACE,MAAZ,CAAmB,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAAC,IAAI,CAAtC,IAA2CJ,WAAW,CAAClV,MAAjE,EAAyEuV,WAAzE,CAAqF,CAArF,CAAR;IACA,CAtiCO;;IAwiCRC,aAAa,QAAsB;MAAA,IAArB;QAAE/W,MAAF;QAAUY;MAAV,CAAqB;MAElCkL,OAAO,CAACoJ,GAAR,CAAY,gBAAZ,EAA8B,KAAKhW,WAAnC;MAGA,KAAKgI,MAAL,CAAYyF,MAAZ,CAAmB,oBAAnB,EAAyC,KAAzC;;MAEA,IAAI,KAAKtN,gBAAT,EAA2B;QAE1B,KAAKA,gBAAL,CAAsBW,MAAtB;QACA,KAAKX,gBAAL,GAAwB,IAAxB;QAEA;MACA;;MAED,KAAKH,WAAL,GAAmB,KAAnB;;MAEA,IAAI,KAAKyH,QAAT,EAAmB;QAClBqQ,aAAa,CAAC,KAAKrQ,QAAN,CAAb;QACA,KAAKA,QAAL,GAAgB,IAAhB;MACA;;MAGD,IAAI,KAAKH,aAAT,EAAwB;QAEvB,IAAIxG,MAAJ,EAAY,CACX;QAEA,CAHD,MAIK;UACJ,KAAKwG,aAAL,CAAmB7F,gBAAnB,CAAoC,eAApC,EAAsDlC,KAAD,IAAW;YAC/D,KAAK+V,kBAAL,CAAwB/V,KAAxB,EAA+BmC,OAA/B;UACA,CAFD,EADI,CAGF;QACF;;QAED,KAAK4F,aAAL,CAAmBkP,IAAnB;QAEA,KAAKlP,aAAL,CAAmB+O,MAAnB,CAA0BC,SAA1B,GAAsC1L,OAAtC,CAA+C2L,KAAD,IAAW;UACxDA,KAAK,CAACC,IAAN;QACA,CAFD;QAIA,KAAKlP,aAAL,GAAqB,IAArB;MACA;;MAGD,IAAI,KAAK0N,oBAAT,EAA+B;QAE9B,IAAIlU,MAAJ,EAAY;UACX,KAAK8G,6BAAL,GAAqC,IAArC;QACA,CAFD,MAGK;UACJ,KAAKA,6BAAL,GAAqC,KAArC;QACA;;QAED,KAAKoN,oBAAL,CAA0B+C,UAA1B;QACA,KAAK/C,oBAAL,GAA4B,IAA5B;MAEA;IAED,CAnmCO;;IAqmCFiC,gBAAN,CAAuB7P,MAAvB,EAA+B;MAAA;;MAAA;QAE9B,IAAG,CAACA,MAAJ,EAAYA,MAAM,GAAG,KAAI,CAACA,MAAd;;QAEZ,IAAG,CAACA,MAAJ,EAAY;UACX,KAAI,CAAC7C,KAAL;QACA;;QAED,KAAI,CAAC8C,aAAL,GAAqB,EAArB;QAEA,MAAMpC,MAAM,SAAS,KAAI,CAACgE,IAAL,CAAU+O,oBAAV,CAA+B5Q,MAAM,CAAClC,IAAtC,CAArB;QAEA,MAAM2E,EAAE,GAAGlK,4BAAC,CAAC6Q,MAAF,EAAX;QAEA,MAAMa,IAAI,GAAG;UACZzU,IAAI,EAAE,OADM;UAEZiN,EAAE,EAAEA,EAFQ;UAGZ5E,MAAM,EAAEA;QAHI,CAAb;;QAMA,KAAI,CAACV,KAAL;;QAEA,KAAI,CAAC8G,EAAL,CAAQC,MAAR,CAAe,MAAM;UACpB,OAAO,KAAI,CAACrF,IAAZ;QACA,CAFD,EAEGzH,IAFH,CAEQ,MAAM;UACb,OAAO,KAAI,CAACyK,IAAL,CAAUC,IAAV,CAAe+O,SAAf,CAAyB,KAAI,CAAChS,IAA9B,EAAoChB,MAApC,EAA4C,IAA5C,EAAkDoM,IAAlD,EAAwD;YAAEH,QAAQ,EAAE,KAAI,CAAC7K;UAAjB,CAAxD,CAAP;QACA,CAJD,EAIG1H,KAJH,CAISqC,CAAC,IAAI;UACb,KAAI,CAACH,KAAL,CAAW,WAAX,EAAwB;YACvBgJ,EAAE,EAAEA,EADmB;YAEvBjL,KAAK,EAAEoC;UAFgB,CAAxB;;UAIA,OAAOmK,OAAO,CAACnG,OAAR,EAAP;QACA,CAVD;MAtB8B;IAmC9B,CAxoCO;;IA0oCRT,KAAK,GAAG;MACP,KAAK6C,MAAL,GAAc,IAAd;MACA,KAAKC,aAAL,GAAqB,EAArB;MACA,KAAK5E,UAAL,GAAkB,CAAlB;;MAEA,IAAI,KAAKgF,QAAT,EAAmB;QAClBqQ,aAAa,CAAC,KAAKrQ,QAAN,CAAb;QACA,KAAKA,QAAL,GAAgB,IAAhB;MACA;;MAED,IAAI,KAAKuN,oBAAT,EAA+B;QAC9B,KAAKA,oBAAL,GAA4B,IAA5B;MACA;;MAED,IAAI,KAAK1N,aAAT,EAAwB;QAEvB,KAAKA,aAAL,CAAmBkP,IAAnB;QACA,KAAKlP,aAAL,CAAmB+O,MAAnB,CAA0BC,SAA1B,GAAsC1L,OAAtC,CAA+C2L,KAAD,IAAW;UACxDA,KAAK,CAACC,IAAN;QACA,CAFD;QAGA,KAAKlP,aAAL,GAAqB,IAArB;MACA;MAED;AACH;AACA;;IACG,CApqCO;;IAsqCR;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IAEE4Q,UAAU,CAACrV,OAAD,EAAU;MACnB,KAAK6E,aAAL,GAAqB7E,OAArB;IACA;;EAlrCO;AApQK,CAAf,E;;ACb2N,CAAgB,sGAAG,EAAC,C;;ACA/I;AACxC;AACL;AACnD,SAAS,kBAAY;;AAErB,eAAe,mBAAO,CAAC,MAAwE;AAC/F;;AAEA;;AAEA;AACgG;AAChG,IAAI,eAAS,GAAG,8CAAU;AAC1B,EAAE,mCAAM;AACR,EAAE,MAAM;AACR,EAAE,eAAe;AACjB;AACA,EAAE,kBAAY;AACd;AACA;AACA;AACA;;AAEe,0FAAS,Q","file":"matrix-element.6.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a \r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./picturePreview.vue?vue&type=template&id=4b882d9f&scoped=true&\"\nimport script from \"./picturePreview.vue?vue&type=script&lang=js&\"\nexport * from \"./picturePreview.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./picturePreview.vue?vue&type=style&index=0&id=4b882d9f&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"4b882d9f\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./InputField.vue?vue&type=template&id=b9fd73f0&scoped=true&\"\nimport script from \"./InputField.vue?vue&type=script&lang=js&\"\nexport * from \"./InputField.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./InputField.vue?vue&type=style&index=0&id=b9fd73f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"b9fd73f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordButton_wrapper\"},[_c('div',{ref:\"holder\",staticClass:\"recordButton_holder\",class:{hold: _vm.isHold}},[_c('i',{staticClass:\"icon fas\",class:_vm.isHold ? 'fa-lock': 'fa-lock-open'})]),(!_vm.isHold)?_c('div',{ref:\"toggle\",staticClass:\"recordButton_micro recordButton_main\",class:{active: _vm.isRecording, disabled: _vm.disabled},on:{\"mousedown\":_vm.mousedown,\"mouseup\":_vm.mouseup,\"touchstart\":_vm.handleTouchStart,\"touchend\":_vm.handleTouchEnd,\"touchcancel\":_vm.handleTouchEnd}},[_c('i',{staticClass:\"icon fas fa-microphone\"})]):_vm._e(),(_vm.isHold)?_c('div',{ref:\"stop\",staticClass:\"recordButton_stop recordButton_main\",on:{\"click\":_vm.recordEnd}},[_c('i',{staticClass:\"icon fas fa-stop\"})]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n\tname: \"recordVoice\",\r\n\tprops: {\r\n\t\tisRecording: {\r\n\t\t\ttype: Boolean,\r\n\t\t\trequired: true\r\n\t\t},\r\n\t\tprepareRecording: {\r\n\t\t\ttype: Boolean\r\n\t\t},\r\n\t\tdisabled: Boolean,\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tstart: 0,\r\n\t\t\tisHold: false,\r\n\t\t\tdirection: null\r\n\t\t}\r\n\t},\r\n\tcomputed: {\r\n\t\t...mapState({\r\n\t\t\tmobile: state => state.mobile,\r\n\t\t})\r\n\t},\r\n\tmounted() {\r\n\t\r\n\t},\r\n\tbeforeDestroy() {\r\n\r\n\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\tif (this.isRecording) {\r\n\t\t\tthis.$emit('onRecordingStop', {cancel : true})\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\r\n\t\tmouseup : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchEnd(e)\r\n\t\t},\r\n\r\n\t\tmousedown : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchStart(e)\r\n\t\t},\r\n\t\t\r\n\t\thandleTouchStart(e) {\r\n\r\n\r\n\t\t\tif(!this.isRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStart')\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tif(this.isHold) return\r\n\t\t\t}\r\n\r\n\t\t\tthis.start = {\r\n\t\t\t\tY: e.changedTouches ? e.changedTouches[0].pageY : e.pageY,\r\n\t\t\t\tX: e.changedTouches ? e.changedTouches[0].pageX : e.pageX\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tdocument.addEventListener('mousemove', this.handleMove)\r\n\t\t\telse\r\n\t\t\t\tdocument.addEventListener('touchmove', this.handleMove)\r\n\r\n\t\t},\r\n\t\thandleTouchEnd(e) {\r\n\r\n\t\t\tif (this.isHold) return\r\n\r\n\t\t\tif (this.isRecording || this.prepareRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStop', {\r\n\t\t\t\t\tsendnow : true\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t},\r\n\r\n\t\tclearStyle(){\r\n\r\n\t\t\tif (this.$refs.toggle){\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\tthis.$refs.toggle.classList.remove('outside')\r\n\t\t\t}\r\n\r\n\t\t\tif (this.$refs.holder){\r\n\t\t\t\tthis.$refs.holder.classList.remove('active')\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\thandleMove(e) {\r\n\r\n\t\t\tif(!this.isRecording) return\r\n\r\n\t\t\tlet deltaY = this.start.Y - e.pageY\r\n\t\t\tlet deltaX = this.start.X - e.pageX\r\n\r\n\t\t\tif (e?.changedTouches?.length) {\r\n\t\t\t\tdeltaY = this.start.Y - e.changedTouches[0].pageY\r\n\t\t\t\tdeltaX = this.start.X - e.changedTouches[0].pageX\r\n\t\t\t}\r\n\r\n\t\t\tif (deltaY > 5 && deltaX < 5) {\r\n\t\t\t\tthis.direction = 'Y'\r\n\t\t\t} else {\r\n\t\t\t\tthis.direction = 'X'\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (deltaY > 5 && this.direction === 'Y') {\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('active'))\r\n\t\t\t\t\tthis.$refs.holder.classList.add('active')\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,-${deltaY}px)`\r\n\r\n\t\t\t\tif (deltaY > 70) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\r\n\t\t\t\t\tthis.isHold = true\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t} else if (deltaX > 5 && this.direction === 'X') {\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(-${deltaX}px, 0)`\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('outside'))\r\n\t\t\t\t\tthis.$refs.toggle.classList.add('outside')\r\n\r\n\t\t\t\tthis.$emit('canceling', (deltaX - 5) / 130)\r\n\t\t\t\t\r\n\t\t\t\tif (deltaX > 130) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\t\t\t\t\tthis.$emit('onRecordingStop', { cancel: true })\r\n\t\t\t\t\tthis.$emit('onClear')\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.clearStyle()\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\trecordEnd(e) {\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t\tif (this.isRecording && this.isHold) {\r\n\r\n\t\t\t\tthis.$emit('onRecordingStop', {})\r\n\t\t\t\tthis.isHold = false\r\n\r\n\t\t\t\treturn\r\n\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t\r\n\t}\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=34d15f18&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=34d15f18&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"34d15f18\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordProgress\"},[(_vm.isRecording)?_c('div',{staticClass:\"indicatorWrapper\"},[_c('div',{staticClass:\"indicator\",class:{'recording': _vm.isRecording}})]):_c('div',{staticClass:\"del\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-trash\"})]),_c('div',{staticClass:\"timer\"},[_vm._v(_vm._s(_vm.timer))]),_c('div',{ref:\"graph\",staticClass:\"graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"id\":\"canvas\",\"width\":_vm.width,\"height\":\"20\"}})]),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isRecording && _vm.opacity),expression:\"isRecording && opacity\"}],ref:\"cancel\",staticClass:\"cancel\"},[_c('span',[_vm._v(\"Slide left to cancel\")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default {\r\n name: \"recordProgress\",\r\n props: {\r\n recordTime: {\r\n type: Number,\r\n required: true\r\n },\r\n rmsData: {\r\n type: Array,\r\n required: true\r\n },\r\n isRecording: {\r\n type: Boolean\r\n },\r\n opacity: {}\r\n },\r\n data() {\r\n return {\r\n width: 0,\r\n }\r\n },\r\n computed: {\r\n timer() {\r\n let minute = Math.floor(this.recordTime / 60000)\r\n let sec = Math.floor(this.recordTime / 1000) % 60\r\n return `${minute ? minute + ':' : '0:'}${(sec < 10) ? '0' + sec : sec}`\r\n },\r\n\r\n rmsDataLast(){\r\n return _.last(this.rmsData, 25)\r\n }\r\n },\r\n\r\n watch : {\r\n rmsData : _.throttle(function(){\r\n this.draw()\r\n }, 30),\r\n\r\n opacity : function(){\r\n this.$refs.cancel.style.opacity = this.opacity\r\n }\r\n },\r\n\r\n mounted() {\r\n this.$refs.cancel.style.opacity = 0\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n\r\n window.addEventListener(\"resize\", this.resize);\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.resize)\r\n },\r\n\r\n methods: {\r\n resize() {\r\n let timer = null\r\n\r\n var re = () => {\r\n if (!timer) {\r\n timer = setTimeout(() => {\r\n timer = null\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n }, 50)\r\n }\r\n }\r\n\r\n re()\r\n },\r\n draw() {\r\n\r\n if(!this.$refs.canvas) return\r\n\r\n const ctx = this.$refs.canvas.getContext(`2d`);\r\n let x = 0\r\n let count = 50\r\n let width = 2 //this.width / 200\r\n var l = this.rmsDataLast.length\r\n var c = Math.max(Math.floor(l / count), 1)\r\n\r\n ctx.clearRect(0, 0, this.width, 20);\r\n\r\n for (let i = 0; i < l; i = i + c) {\r\n ctx.fillStyle = '#00a4ff'\r\n ctx.fillRect(i * 2 * width, 10 - this.rmsDataLast[i] / 8, width, this.rmsDataLast[i] / 4 + 1)\r\n }\r\n\r\n },\r\n clear() {\r\n this.$emit('onClear')\r\n }\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3f87c0fa&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=3f87c0fa&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3f87c0fa\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"upload\"},[_c('div',{staticClass:\"uploadWrapper\"},[_c('div',{staticClass:\"contentWrapper\"},[_vm._t(\"content\",function(){return [_c('i',{staticClass:\"fas fa-plus\"})]})],2),_c('div',{staticClass:\"inputWrapper\"},[_c('input',{attrs:{\"type\":\"file\",\"multiple\":_vm.multiple},on:{\"change\":_vm.upload}})])]),(_vm.dropzone)?_c('div',{ref:\"dropzone\",staticClass:\"dropzone\",class:{dropzone : _vm.dropzone}},[_vm._t(\"dropzone\",function(){return [_c('i',{staticClass:\"fas fa-plus\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.dragAndDropAFile\"))+\" \")]})],2):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a28e80a8&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=a28e80a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a28e80a8\",\n null\n ,true\n)\n\nexport default component.exports","import f from \"@/application/functions\";\r\nimport InputField from './InputField/InputField.vue'\r\nimport recordVoice from '@/components/assets/recordVoice/index.vue';\r\nimport { mapState } from \"vuex\";\r\nimport Images from '@/application/utils/images.js'\r\n\r\nimport contacts from '@/components/contacts/list/index.vue'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport recordProgress from '@/components/assets/recordProgress/index.vue';\r\n\r\nimport upload from '@/components/assets/upload/index.vue';\r\n\r\nimport { cancelable } from 'cancelable-promise';\r\nexport default {\r\n\tname: 'chatInput',\r\n\tprops: {\r\n\t\tchat: Object,\r\n\t\tu: String,\r\n\t\trelationEvent: Object\r\n\t},\r\n\r\n\tcomponents: { InputField, contacts, preview, recordProgress, recordVoice, upload },\r\n\r\n\tdata: function () {\r\n\r\n\t\treturn {\r\n\t\t\tupload: true,\r\n\t\t\ttest: [],\r\n\t\t\tloading: false,\r\n\t\t\ttext: '',\r\n\t\t\tfile: {},\r\n\t\t\tfileInfo: {},\r\n\t\t\tready: false,\r\n\t\t\tcreating: false,\r\n\t\t\tuserId: '',\r\n\t\t\tshowuserselect: null,\r\n\t\t\tanyUrlMeta: String,\r\n\t\t\tjoinedMembers: [],\r\n\t\t\ttipvalue: null,\r\n\t\t\ttipuserindex: 0,\r\n\t\t\trecord: null,\r\n\t\t\trecordRmsData: [],\r\n\t\t\tisRecording: false,\r\n\r\n\t\t\tmediaRecorder: null,\r\n\t\t\taudioContext: null,\r\n\t\t\taudioAnalyser: null,\r\n\r\n\t\t\trecordTime: 0,\r\n\t\t\tinterval: null,\r\n\t\t\tcancelOpacity: 0,\r\n\t\t\tmicrophoneDisabled: false,\r\n\t\t\tprepareRecording: false,\r\n\r\n\t\t\tcancelledCordovaMediaRecorder: false\r\n\t\t}\r\n\r\n\t},\r\n\r\n\r\n\twatch: {\r\n\t\tusersForKeysHash: {\r\n\t\t\t//immediate: true,\r\n\t\t\thandler: function () {\r\n\t\t\t}\r\n\t\t},\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (!this.tipusers.length) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t} else {\r\n\t\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeDestroy() {\r\n\t\tif (this.audioContext)\r\n\t\t\tthis.audioContext.close()\r\n\t},\r\n\r\n\tcomputed: {\r\n\t\tvoiceEnable() {\r\n\t\t\treturn this.$store.state.voiceMessagesEnabled\r\n\t\t},\r\n\r\n\t\tconnect: function () {\r\n\t\t\treturn this.$store.state.contact\r\n\t\t},\r\n\t\tpkoindisabled : function(){\r\n\t\t\treturn this.$store.state.pkoindisabled\r\n\t\t},\r\n\t\tmenuItems: function () {\r\n\t\t\tvar menuItems = []\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\r\n\t\t\t\tif (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.mobile.supportimagegallery()) {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandlerCustom\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandler\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t\tupload: {\r\n\t\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\t\textensions: ['jpg', 'jpeg', 'png', 'webp'],\r\n\t\t\t\t\t\t\tmaxsize: 100,\r\n\t\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\tmenuItems.push({\r\n\t\t\t\t\tclick: \"fileHandler\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendFile\"),\r\n\t\t\t\t\ticon: \"fas fa-sticky-note\",\r\n\r\n\t\t\t\t\tupload: {\r\n\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\textensions: [],\r\n\t\t\t\t\t\tmaxsize: 25,\r\n\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.transaction && !this.pkoindisabled) {\r\n\t\t\t\tmenuItems.unshift({\r\n\t\t\t\t\tclick: \"sendtransactionWrapper\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendCoins\"),\r\n\t\t\t\t\ticon: \"fas fa-wallet\"\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn menuItems\r\n\t\t},\r\n\t\t...mapState([\r\n\t\t\t'chats'\r\n\t\t]),\r\n\r\n\t\tuserlist: function () {\r\n\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\treturn this.core.mtrx.chatUsersInfo(this.chat.roomId, 'anotherChatUsers')\r\n\r\n\t\t},\r\n\r\n\t\ttransaction: function () {\r\n\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.ui.wallet.send')\r\n\t\t},\r\n\r\n\t\tuusers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn u\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tausers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn this.core.user.matrixId(u)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tstateChat: function () {\r\n\t\t\tvar id = this.$route.query.id\r\n\t\t\treturn this.$store.state.chatsMap[id]\r\n\t\t},\r\n\t\tinvited: function () {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tif (this.u) return this.ausers\r\n\t\t\t\treturn []\r\n\t\t\t}\r\n\r\n\t\t\treturn _.map(_.filter(this.chat.currentState.getMembers(), function (m, v) {\r\n\t\t\t\treturn m.membership === 'invite'\r\n\t\t\t}), function (u) {\r\n\t\t\t\treturn u.userId\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tjoined: function () {\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\tlet roomId = this.chat.roomId\r\n\t\t\tlet self = this\r\n\t\t\tlet arr = []\r\n\t\t\tlet members = 0\r\n\r\n\t\t\tthis.chat.currentState.getMembers().forEach(function (user) {\r\n\t\t\t\tif (user.membership === 'join') {\r\n\t\t\t\t\tarr.push(user.userId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\treturn arr\r\n\t\t},\r\n\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (this.tipvalue === null) return []\r\n\t\t\tif (this.tipvalue === '') return this.userlist\r\n\r\n\t\t\tvar value = this.tipvalue.toLowerCase()\r\n\r\n\t\t\tvar u = _.filter(this.userlist, function (u) {\r\n\t\t\t\treturn u.name.toLowerCase().indexOf(value) == 0 && u.name.toLowerCase() != value\r\n\t\t\t})\r\n\r\n\t\t\treturn u\r\n\r\n\t\t},\r\n\r\n\t\tmaintipuser: function () {\r\n\t\t\tif (this.tipusers.length) {\r\n\t\t\t\treturn this.tipusers[this.tipuserindex || 0]\r\n\t\t\t}\r\n\r\n\t\t\treturn null\r\n\t\t},\r\n\t},\r\n\r\n\tcreated() {\r\n\r\n\t},\r\n\r\n\t///\r\n\r\n\tmounted() {\r\n\t\tthis.ready = true\r\n\r\n\r\n\t\tif (!this.chat && this.core.mtrx.client) {\r\n\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t},\r\n\r\n\tmethods: {\r\n\t\twait: function () {\r\n\t\t\treturn this.$f.pretry(() => {\r\n\t\t\t\treturn this.core.mtrx.client && this.core.mtrx.access\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tbrowsetip: function (increase) {\r\n\r\n\t\t\tincrease ? this.tipuserindex++ : this.tipuserindex--\r\n\r\n\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t}\r\n\r\n\t\t\tif (this.tipuserindex < 0) {\r\n\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tselectcurrenttip: function () {\r\n\t\t\tthis.insertuser(this.tipusers[this.tipuserindex || 0])\r\n\t\t},\r\n\r\n\t\tinsertuser: function (user = {}) {\r\n\t\t\tvar name = user.name || ''\r\n\r\n\t\t\tthis.$refs['newinput'].inserttip(name)\r\n\t\t},\r\n\r\n\t\ttipBySearch: function (value) {\r\n\t\t\tthis.tipvalue = value\r\n\t\t},\r\n\r\n\t\tshowuserselected: function (contact, action) {\r\n\t\t\tthis[action](contact)\r\n\t\t},\r\n\r\n\r\n\t\tresizeImage: function (base64) {\r\n\r\n\t\t\tvar ftype = base64.split(';')[0].split('/')[1];\r\n\t\t\tvar images = new Images()\r\n\r\n\t\t\treturn images.resize['fit'](base64, 1024, 1024, ftype, 0.95).then(base64 => {\r\n\r\n\t\t\t\treturn Promise.resolve(base64)\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.reject(e)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tcameraHandlerCustom: function () {\r\n\t\t\tvar result = []\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t\twindow.POCKETNETINSTANCE.platform.ui.uploadImage({\r\n\t\t\t\tmultiple: true,\r\n\r\n\t\t\t\taction: ({ base64 }, resolve) => {\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\treturn this.resizeImage(base64).then(base64 => {\r\n\r\n\t\t\t\t\t\treturn f.Base64.toFile(base64).then(file => {\r\n\t\t\t\t\t\t\tvar data = {\r\n\t\t\t\t\t\t\t\tbase64,\r\n\t\t\t\t\t\t\t\tfile\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tresult.push(data)\r\n\r\n\t\t\t\t\t\t\tthis.uploadUploaded(null, data)\r\n\r\n\t\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonSuccess: (imgs) => {\r\n\t\t\t\t\tthis.uploadUploadedAll()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendtransactionWrapper: function () {\r\n\r\n\t\t\tthis.menuIsVisible = false\r\n\r\n\t\t\tvar users = _.filter(_.map(this.joined, (j) => {\r\n\t\t\t\treturn this.$f.deep(this, '$store.state.users.' + this.$f.getmatrixid(j)) || null\r\n\t\t\t}), (r) => {\r\n\t\t\t\treturn r && r.source && r.id != this.core.user.userinfo?.id\r\n\t\t\t})\r\n\r\n\t\t\tif (!users.length) {\r\n\r\n\t\t\t\treturn 'users.length'\r\n\t\t\t}\r\n\r\n\t\t\tif (users.length > 1) {\r\n\r\n\t\t\t\tthis.core.store.commit('setmodal', {\r\n\t\t\t\t\tcaption: this.$i18n.t(\"caption.sendTransactionTo\"),\r\n\t\t\t\t\ttype: 'showuserselect',\r\n\t\t\t\t\tdata: {\r\n\t\t\t\t\t\tusers: users,\r\n\t\t\t\t\t\taction: 'sendtransaction',\r\n\t\t\t\t\t\tuserselected: (c) => {\r\n\t\t\t\t\t\t\tthis.showuserselected(c, 'sendtransaction')\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\t/*this.showuserselect = {\r\n\t\t\t\t users : users,\r\n\t\t\t\t action : 'sendtransaction'\r\n\t\t\t\t}*/\r\n\t\t\t} else {\r\n\t\t\t\tthis.sendtransaction(users[0])\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t},\r\n\r\n\t\tsendtransaction: function (user) {\r\n\t\t\tvar api = this.transaction\r\n\r\n\t\t\t//TODO get address and send transaction\r\n\r\n\t\t\tapi({\r\n\t\t\t\troomid: this.chat.roomId,\r\n\t\t\t\taddress: user.source.address\r\n\t\t\t})\r\n\r\n\t\t\t/*.then(({txid, from}) => {\r\n\t \r\n\t\t\t return this.core.mtrx.transaction(this.chat.roomId, txid)\r\n\t \r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\temitInputData: function () {\r\n\t\t\tthis.$emit('emptyInput')\r\n\t\t\tthis.upload = true\r\n\t\t},\r\n\r\n\t\tHideUploadPic() {\r\n\t\t\tthis.upload = false\r\n\t\t},\r\n\r\n\t\temitUrl: function (url) {\r\n\t\t\tthis.$emit('setMetaUrl', url)\r\n\t\t},\r\n\r\n\t\tnewchat() {\r\n\r\n\t\t\tif (this.u) {\r\n\t\t\t\tthis.$store.state.globalpreloader = true\r\n\t\t\t\tvar matrixId = null\r\n\t\t\t\tvar myMatrixId = null\r\n\t\t\t\tvar chat = null\r\n\t\t\t\tvar id = ''\r\n\r\n\t\t\t\tthis.creating = true\r\n\t\t\t\treturn this.core.user.usersInfo(this.uusers).then(info => {\r\n\r\n\t\t\t\t\tif (this.uusers.length == 1) {\r\n\r\n\t\t\t\t\t\tvar _info = info[0]\r\n\r\n\t\t\t\t\t\tif (!_info || !_info.keys || _info.keys.length < 12) {\r\n\r\n\t\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.core.user.userinfo.keys.length < 12) {\r\n\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t//return Promise.reject('ny3')\r\n\r\n\t\t\t\t\tid = this.core.mtrx.kit.tetatetid(info[0], this.core.user.userinfo)\r\n\r\n\t\t\t\t\tmatrixId = this.core.user.matrixId(info[0].id)\r\n\t\t\t\t\tmyMatrixId = this.core.user.matrixId(this.core.user.userinfo.id)\r\n\r\n\t\t\t\t\tvar initialstate = [{\r\n\t\t\t\t\t\t\"type\": \"m.set.encrypted\",\r\n\t\t\t\t\t\t\"state_key\": \"\",\r\n\t\t\t\t\t\t\"content\": {\r\n\t\t\t\t\t\t\tencrypted: true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}]\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.createRoom(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\troom_alias_name: id,\r\n\t\t\t\t\t\t\tvisibility: 'private',\r\n\t\t\t\t\t\t\tinvite: [matrixId],\r\n\t\t\t\t\t\t\tname: '#' + id,\r\n\t\t\t\t\t\t\tinitial_state: initialstate\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\r\n\t\t\t\t}).then(_chat => {\r\n\r\n\t\t\t\t\tchat = _chat\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tlet m_chat = this.core.mtrx.client.getRoom(_chat.room_id)\r\n\t\t\t\t\tlet event = m_chat.currentState.getStateEvents(\"m.room.power_levels\")\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.setPowerLevel(chat.room_id, matrixId, 100, event[0]).catch(e => {\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\r\n\t\t\t\t\tif (this.connect && this.connect == id) {\r\n\t\t\t\t\t\tthis.greetings()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.$store.commit('CONTACT', false)\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tif (e && e.errcode == 'M_ROOM_IN_USE') {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.client.joinRoom('#' + id + ':' + this.core.mtrx.baseUrl.replace(\"https://\", \"\")).then(() => {\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn Promise.reject('u')\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tmaySendMessage() {\r\n\t\t\treturn this.chat && this.chat.maySendMessage()\r\n\t\t},\r\n\r\n\t\tgreetings() {\r\n\t\t\tthis.send('👋').then(r => {\r\n\t\t\t\treturn Promise.resolve(r)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendinput(text) {\r\n\r\n\t\t\tthis.send(text).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\ttextCutLimit: function (text, limit) {\r\n\t\t\ttext = text.trim();\r\n\t\t\tif (text.length <= limit) return text;\r\n\r\n\t\t\ttext = text.slice(0, limit);\r\n\r\n\t\t\treturn text.trim() + \"...\";\r\n\t\t},\r\n\r\n\t\treplaceMentions(text) {\r\n\r\n\t\t\t_.each(this.userlist, function (user) {\r\n\t\t\t\ttext = text.replace(new RegExp('@' + user.name, 'g'), '@' + user.id + ':' + user.name)\r\n\t\t\t})\r\n\r\n\t\t\treturn text\r\n\t\t},\r\n\r\n\t\tsend(text) {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\t//return this.chat.pcrypto.getOrCreateCommonKey()\r\n\r\n\t\t\t//return this.chat.pcrypto.sendCommonKey()\r\n\r\n\t\t\t//return\r\n\r\n\t\t\tthis.$emit(\"sending\")\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\t\t\t\tthis.focus()\r\n\t\t\t}\r\n\r\n\t\t\treturn this.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat && !this.creating\r\n\r\n\t\t\t}).then((r) => {\r\n\r\n\t\t\t\tthis.$emit('sent')\r\n\r\n\t\t\t\ttext = this.replaceMentions(text)\r\n\r\n\t\t\t\tif (this.relationEvent) {\r\n\r\n\t\t\t\t\tif (this.relationEvent.type == 'm.replace' && this.relationEvent.event) {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.textEvent(this.chat, text).then(r => {\r\n\r\n\t\t\t\t\t\t\tr['m.relates_to'] = {\r\n\t\t\t\t\t\t\t\t\"rel_type\": \"m.replace\",\r\n\t\t\t\t\t\t\t\t\"event_id\": this.core.mtrx.clearEventId(this.relationEvent.event) || f.makeid(),\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar editEvent = r\r\n\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.body = r.body\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.block = r.block\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.msgtype = r.msgtype\r\n\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decryptKey\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decrypted\r\n\r\n\t\t\t\t\t\t\treturn this.core.mtrx.client.sendEvent(this.chat.roomId, 'm.room.message', editEvent)\r\n\r\n\t\t\t\t\t\t}).then(r => {\r\n\r\n\t\t\t\t\t\t\tthis.core.store.dispatch('FETCH_EVENTS')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('clearRelationEvent')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('force')\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\t\treturn Promise.reject(e)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.core.mtrx.sendtext(this.chat, text, { relation: this.relationEvent })\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\r\n\t\t\t\tthis.$emit('sentMessageError', {\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tpasteImage(data) {\r\n\t\t\tthis.sendImage({ base64: data })\r\n\t\t},\r\n\r\n\t\tsendImage: function ({ base64, file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"image\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\t\t\t//setTimeout(() => {\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\t\t\t\tif (meta.aborted)\r\n\t\t\t\t\treturn Promise.reject('aborted')\r\n\r\n\t\t\t\treturn this.core.mtrx.sendImage(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t})\r\n\t\t\t//}, 5000)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tcanencryptfilesize: function (file) {\r\n\r\n\t\t\tvar s = 10 * 1024 * 1024\r\n\r\n\t\t\tif (!this.chat.pcrypto.canBeEncrypt()) {\r\n\t\t\t\treturn Promise.resolve(false)\r\n\t\t\t}\r\n\r\n\t\t\tif (file.size > s) {\r\n\r\n\r\n\t\t\t\treturn this.$dialog.confirm(\r\n\t\t\t\t\t'Files larger than 10 megabytes are not encrypted. Do you want to send the file unencrypted?', {\r\n\t\t\t\t\tokText: 'Yes',\r\n\t\t\t\t\tcancelText: 'No, cancel'\r\n\t\t\t\t})\r\n\r\n\t\t\t\t\t.then((dialog) => {\r\n\r\n\t\t\t\t\t\treturn Promise.resolve(true)\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.reject('cancel')\r\n\t\t\t\t\t})\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve(false)\r\n\t\t},\r\n\r\n\t\tsendFile: function ({ file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"file\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tinfo: {\r\n\t\t\t\t\tname: file.name,\r\n\t\t\t\t\tsize: file.size\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\treturn this.canencryptfilesize(file)\r\n\r\n\r\n\t\t\t}).then((notenc) => {\r\n\r\n\t\t\t\treturn this.core.mtrx.sendFile(this.chat, file, meta, { relation: this.relationEvent }, notenc)\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].focus()\r\n\t\t},\r\n\r\n\t\tfocused: function () {\r\n\t\t\tthis.$emit('focused')\r\n\t\t},\r\n\r\n\t\tblur: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blur()\r\n\t\t},\r\n\r\n\t\tblurifempty: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blurifempty()\r\n\t\t},\r\n\r\n\t\tchange: function () {\r\n\t\t},\r\n\r\n\t\tsetText: function (text) {\r\n\t\t\tthis.text = text\r\n\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].setText(text)\r\n\t\t},\r\n\r\n\t\tkeyup: function (evt) {\r\n\t\t\tvar value = evt.target.value\r\n\r\n\t\t\tif (value === '') {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t\treturn\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', true)\r\n\t\t\t}\r\n\r\n\t\t\tthis.text = value\r\n\t\t\tthis.anyUrlMeta = f.getUrl(this.text)\r\n\r\n\r\n\t\t\tif (this.anyUrlMeta !== undefined) {\r\n\t\t\t\tthis.$emit('setMetaUrl', this.anyUrlMeta)\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t}\r\n\r\n\t\t\tif (this.chat)\r\n\t\t\t\tthis.core.mtrx.client.sendTyping(this.chat.roomId, true, 100)\r\n\t\t},\r\n\r\n\t\tmenuItemClick(item, rowObject) {\r\n\t\t\tthis[item.click](rowObject);\r\n\t\t},\r\n\r\n\t\tmenuItemLoadedHandler: function (value) {\r\n\r\n\t\t\tthis.menuIsVisible = value\r\n\r\n\t\t\treturn this.menuIsVisible\r\n\t\t},\r\n\r\n\t\tuploadStart(item, files) {\r\n\r\n\t\t},\r\n\r\n\t\tuploadError(item, error) {\r\n\t\t\tthis.$store.commit('icon', {\r\n\t\t\t\ticon: 'error',\r\n\t\t\t\tmessage: error.text\r\n\t\t\t})\r\n\t\t},\r\n\t\tgetImg() {\r\n\t\t\treturn this.imgs = true\r\n\t\t},\r\n\t\tuploadSizeError(value) {\r\n\t\t\tif (!value) {\r\n\t\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t\t}\r\n\t\t},\r\n\t\tuploadUploaded(item, data) {\r\n\t\t\tconst validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/webp'];\r\n\r\n\r\n\t\t\tif (!validImageTypes.includes(data.file.type)) {\r\n\t\t\t\tthis.sendFile(data)\r\n\t\t\t} else {\r\n\t\t\t\treturn this.sendImage(data)\r\n\t\t\t}\r\n\t\t},\r\n\t\timageWH(file) {\r\n\t\t\tconst img = new Image();\r\n\t\t\tvar imgInfo = {};\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\timg.onload = function () {\r\n\t\t\t\t\timgInfo.w = this.width\r\n\t\t\t\t\timgInfo.h = this.height\r\n\t\t\t\t\tresolve(imgInfo)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.onerror = function (e) {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.src = file.base64\r\n\t\t\t})\r\n\r\n\t\t},\r\n\t\tuploadUploadedAll(item, result) {\r\n\t\t\tthis.$store.state.loading = false\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t},\r\n\r\n\t\tcatchPermissonsError(err) {\r\n\r\n\t\t\tif (err == 'permissions' || (err.toString && err.toString().indexOf('Permission') > -1)) {\r\n\t\t\t\tthis.microphoneDisabled = true\r\n\r\n\t\t\t\tif (window.cordova) {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccesscordova'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccessbrowser'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif ((err.toString && err.toString().indexOf('device not found') > -1)) {\r\n\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\tthis.$i18n.t('micdevicenotfound'), {\r\n\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t})\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$dialog.confirm(\r\n\t\t\t\tthis.$i18n.t('micaccesscommonproblem'), {\r\n\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t})\r\n\r\n\t\t\tconsole.error(err)\r\n\t\t},\r\n\r\n\t\tgetFileIosCordova (path) {\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\twindow.resolveLocalFileSystemURL(path, (entry) => {\r\n\r\n\r\n\t\t\t\t\tif(!entry){\r\n\t\t\t\t\t\treturn reject('noentry')\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tentry.file((file) => {\r\n\t\t\t\t\t\tvar reader = new FileReader()\r\n\t\r\n\t\t\t\t\t\treader.onloadend = function() {\r\n\t\t\t\t\t\t\tvar blob = new Blob([new Uint8Array(this.result)], {type : file.type})\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\r\n\t\t\t\t\t\t\tresolve(blob)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treader.onerror = (e) => {\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file)\r\n\t\t\t\t\t})\r\n\t\t\t\t}, (e) => {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t\t\r\n\t\t},\r\n\r\n\t\tinitRecordingCordova() {\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.media.permissions({ audio: true }).then(() => {\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tconsole.error(err)\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\t\t\tthis.prepareRecording.then(() => {\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tvar path = 'recording.mp3'\r\n\r\n\t\t\t\tif(f.isios()) path = 'cdvfile://localhost/temporary/recording.m4a'\r\n\r\n\t\t\t\tvar sec = 0\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\r\n\t\t\t\t//var startedTime = (new Date()).getTime() / 1000\r\n\r\n\t\t\t\tvar media = this.cordovaMediaRecorder = new Media(path, () => {\r\n\r\n\t\t\t\t\tthis.recordTime = 0\r\n\r\n\t\t\t\t\tmedia.release()\r\n\r\n\t\t\t\t\tif (this.cancelledCordovaMediaRecorder) {\r\n\r\n\t\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar fu = null\r\n\r\n\t\t\t\t\t/*if(f.isios()){ */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfu = this.getFileIosCordova(f.isios() ? path : window.cordova.file.externalDataDirectory + path).then(blob => {\r\n\t\t\t\t\t\t\treturn Promise.resolve({\r\n\t\t\t\t\t\t\t\tdata : blob\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*}\r\n\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tfu = f.fetchLocal(path)\r\n\t\t\t\t\t}*/\r\n\r\n\t\t\t\t\tfu.then(r => {\r\n\t\t\t\t\t\t///temp\r\n\t\t\t\t\t\t/*if (f.isios())\r\n\t\t\t\t\t\t\tr.duration = (new Date()).getTime() / 1000 - startedTime\r\n\r\n\t\t\t\t\t\tconsole.log(\"R\", r)\r\n\r\n\t\t\t\t\t\t/*var e = {\r\n\t\t\t\t\t\t\tdata : r.data\r\n\t\t\t\t\t\t}*/\r\n\r\n\r\n\t\t\t\t\t\tif (media.duration && media.duration > 0){\r\n\t\t\t\t\t\t\tr.duration = media.duration\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.createVoiceMessage(r, true)\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t}).finally(() => {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}, (e) => {\r\n\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.isRecording = false\r\n\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\tvar rmsdata = []\r\n\r\n\t\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\t\tif (currentPlaying) {\r\n\t\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\t\t// get media amplitude\r\n\r\n\t\t\t\t\tif(f.isios()){\r\n\t\t\t\t\t\trmsdata.push(1)\r\n\r\n\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tthis.cordovaMediaRecorder.getCurrentAmplitude(\r\n\t\t\t\t\t\t\t// success callback\r\n\t\t\t\t\t\t\t(amp) => {\r\n\t\r\n\t\t\t\t\t\t\t\trmsdata.push(amp * 1000)\r\n\t\r\n\t\t\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\r\n\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tfunction (e) {\r\n\t\t\t\t\t\t\t\tconsole.log(\"E\", e)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\t\tif (sec % 1000 === 0) this.recordTime = sec\r\n\r\n\t\t\t\t}, 50);\r\n\r\n\t\t\t\tthis.isRecording = true\r\n\t\t\t\tthis.cancelOpacity = 0\r\n\t\t\t\tthis.recordRmsData = []\r\n\t\t\t\tthis.recordTime = 0\r\n\t\t\t\tthis.record = null\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.startRecord();\r\n\r\n\t\t\t}).catch((e) => { \r\n\t\t\t\tconsole.error(e)\r\n\r\n\r\n\t\t\t}).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tinitRecording() {\r\n\r\n\t\t\tif (this.prepareRecording || this.isRecording || this.cordovaMediaRecorder) return\r\n\r\n\t\t\tif (window.cordova) {\r\n\t\t\t\treturn this.initRecordingCordova()\r\n\t\t\t}\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.initMediaRecorder().then((recorder) => {\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tif (this.prepareRecording) {\r\n\t\t\t\t\treturn Promise.resolve(recorder)\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\t\ttrack.stop();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\r\n\t\t\tthis.prepareRecording.then((recorder) => {\r\n\r\n\r\n\t\t\t\tthis.mediaRecorder = recorder\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\t\t\t\tthis.audioAnalyser = this.audioContext.createAnalyser()\r\n\r\n\t\t\t\t//var audioDataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tvar src = this.audioContext.createMediaStreamSource(this.mediaRecorder.stream)\r\n\t\t\t\tsrc.connect(this.audioAnalyser)\r\n\r\n\t\t\t\tthis.startRecording()\r\n\r\n\t\t\t}).catch(() => { }).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tstartRecording() {\r\n\r\n\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\tif (currentPlaying) {\r\n\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t}\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', true)\r\n\r\n\t\t\tthis.isRecording = true\r\n\t\t\tthis.cancelOpacity = 0\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\t\t\tthis.record = null\r\n\t\t\tthis.mediaRecorder.start()\r\n\r\n\t\t\tvar sec = 0\r\n\t\t\tvar rmsdata = []\r\n\r\n\r\n\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\tvar dataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tthis.audioAnalyser.getByteFrequencyData(dataArray)\r\n\r\n\r\n\t\t\t\trmsdata.push(this.generateRms(dataArray))\r\n\r\n\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\r\n\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\r\n\t\t\t\tif (sec % 1000 === 0) {\r\n\t\t\t\t\tthis.recordTime = sec\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 50)\r\n\r\n\t\t},\r\n\r\n\r\n\t\tcheckaudioForSend: function (record, sendnow) {\r\n\r\n\t\t\tif (record.duration < 1) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (sendnow) {\r\n\t\t\t\t\tthis.sendVoiceMessage(record)\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.record = record\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetduration(file){\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\tf.readFile(file).then(arraybuffer => {\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\t\t\t\t\t\t\tresolve(buffer.duration)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}).catch(reject)\r\n\t\t\t})\r\n\r\n\t\t\t\r\n\r\n\t\t},\r\n\r\n\t\tcreateVoiceMessage(event, sendnow) {\r\n\t\t\tvar c = () => {\r\n\r\n\t\t\t\t//this.record = \r\n\r\n\t\t\t\tthis.checkaudioForSend({\r\n\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\tid: f.makeid(),\r\n\t\t\t\t\tduration : event.duration\r\n\t\t\t\t}, sendnow)\r\n\t\t\t}\r\n\r\n\t\t\tif(event.duration){\r\n\r\n\t\t\t\tc()\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.getduration(event.data).then(duration => {\r\n\t\t\t\t\tevent.duration = duration\r\n\r\n\t\t\t\t\tc()\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.clear()\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/*f.readFile(event.data).then(arraybuffer => {\r\n\r\n\t\t\t\tconsole.log('arraybuffer', arraybuffer)\r\n\r\n\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\r\n\t\t\t\t\tconsole.log('this.record', this.record)\r\n\t\t\t\t\tconsole.log('this.buffer', buffer)\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tthis.record = {\r\n\t\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\t\tid: f.makeid()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.record.duration = buffer.duration\r\n\r\n\t\t\t\t\tthis.checkaudioForSend(sendnow)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tconsole.error('e', e)\r\n\t\t\t\tthis.clear()\r\n\t\t\t\t//\r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\tgenerateRms(frequencies) {\r\n\t\t\treturn +Math.sqrt(frequencies.reduce((a, b) => a + b ** 2) / frequencies.length).toPrecision(4)\r\n\t\t},\r\n\r\n\t\tstopRecording({ cancel, sendnow }) {\r\n\r\n\t\t\tconsole.log(\"STOP RECORDING\", this.isRecording)\r\n\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', false)\r\n\r\n\t\t\tif (this.prepareRecording) {\r\n\r\n\t\t\t\tthis.prepareRecording.cancel()\r\n\t\t\t\tthis.prepareRecording = null\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tthis.isRecording = false\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\t//this.mediaRecorder.ondataavailable = () => { }\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.mediaRecorder.addEventListener('dataavailable', (event) => {\r\n\t\t\t\t\t\tthis.createVoiceMessage(event, sendnow)\r\n\t\t\t\t\t})//ondataavailable = (event) => this.createVoiceMessage(event, sendnow)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = true\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.stopRecord()\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tasync sendVoiceMessage(record) {\r\n\r\n\t\t\tif(!record) record = this.record\r\n\r\n\t\t\tif(!record) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\r\n\t\t\tthis.recordRmsData = []\r\n\r\n\t\t\tconst base64 = await this.core.convertAudioToBase64(record.file)\r\n\r\n\t\t\tconst id = f.makeid()\r\n\r\n\t\t\tconst meta = {\r\n\t\t\t\ttype: \"audio\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.clear()\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\t\t\t\treturn this.chat\r\n\t\t\t}).then(() => {\r\n\t\t\t\treturn this.core.mtrx.sendAudio(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tclear() {\r\n\t\t\tthis.record = null\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\t/*if (this.audioContext){\r\n\t\t\t\tthis.audioContext.close()\r\n\t\t\t}*/\r\n\t\t},\r\n\r\n\t\t/*async convertAudioToBase64(blob) {\r\n\t\t\tconst reader = new FileReader()\r\n\t\t\treader.readAsDataURL(blob)\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\treader.onloadend = () => {\r\n\t\t\t\t\tresolve(reader.result)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},*/\r\n\r\n\t\tsetOpacity(opacity) {\r\n\t\t\tthis.cancelOpacity = opacity\r\n\t\t}\r\n\r\n\t},\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e8b463ac&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e8b463ac&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e8b463ac\",\n null\n ,true\n)\n\nexport default component.exports"],"sourceRoot":""} \ No newline at end of file diff --git a/chat/matrix-element.6.min.js b/chat/matrix-element.6.min.js index 2adbb83002..23a01a8f36 100644 --- a/chat/matrix-element.6.min.js +++ b/chat/matrix-element.6.min.js @@ -1,2 +1,2 @@ -(window["matrixElement_jsonp"]=window["matrixElement_jsonp"]||[]).push([[6],{"0a92":function(e,t,i){var r=i("5ce7");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("06c84aee",r,e)}},1097:function(e,t,i){var r=i("f2bc");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("2ab77a92",r,e)}},"16df":function(e,t,i){var r=i("f72e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("0245fe41",r,e)}},"16e59":function(e,t,i){var r=i("5c95");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("cb65d9a2",r,e)}},"2e53":function(e,t,i){"use strict";i.r(t);var r=i("1097");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},3136:function(e,t,i){"use strict";i.r(t);var r=i("53b4");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},"3e3c":function(e,t,i){"use strict";i.r(t);var r=i("16df");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},"439c":function(e,t,i){"use strict";i.r(t);var r=i("16e59");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},4994:function(e,t,i){"use strict";i.r(t);var r=i("5a58");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},"53b4":function(e,t,i){var r=i("aeb2");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("3160b183",r,e)}},"5a58":function(e,t,i){var r=i("ead2");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("0810035e",r,e)}},"5c95":function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".upload[data-v-a28e80a8]{width:100%}.uploadWrapper[data-v-a28e80a8]{position:relative}.uploadWrapper .inputWrapper[data-v-a28e80a8],.uploadWrapper .inputWrapper input[data-v-a28e80a8]{position:absolute;left:0;right:0;top:0;bottom:0;opacity:0}",""]),e.exports=t},"5ce7":function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".wrapper[data-v-4b882d9f]{position:relative}.fas[data-v-4b882d9f]{position:absolute;right:-8px;top:-8px}.preview-picture[data-v-4b882d9f]{width:50px;height:50px;border-radius:10px}",""]),e.exports=t},aeb2:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,"#chatInput[data-v-e8b463ac]{padding-bottom:.5em}[data-v-e8b463ac] #modal.minimized .modal-wrapper{left:0}[data-v-e8b463ac] .previewWrapper{padding-left:.5em!important;padding-right:.5em!important}.inputWrapper[data-v-e8b463ac]{display:flex}.inputWrapper .left[data-v-e8b463ac]{width:35px;display:flex;justify-content:flex-end;align-items:center;text-align:center}.inputWrapper .left .iconbutton[data-v-e8b463ac]{display:flex;align-items:center;justify-content:center;height:35px;width:35px;-webkit-tap-highlight-color:transparent}.inputWrapper .extended[data-v-e8b463ac]{width:70px;margin-left:7px}.inputWrapper .leftdummy[data-v-e8b463ac]{width:.5em}.inputWrapper>div[data-v-e8b463ac]{transition:.3s}.inputWrapper .center[data-v-e8b463ac]{max-height:110px;max-width:100%;display:flex;justify-content:space-between;align-items:center;flex-grow:1;border:1px solid transparent;border-radius:30px;background:rgb(var(--background-secondary-theme))}.inputWrapper input[data-v-e8b463ac]{border:1px solid rgb(var(--neutral-grad-0));background:rgba(var(--background-main),.5);border-radius:30px;width:100%;padding:.5em 1em}.notready[data-v-e8b463ac],.waitjoined[data-v-e8b463ac]{padding:.5em 0;text-align:center}.waitjoined span[data-v-e8b463ac]{font-size:.8em}.greetings[data-v-e8b463ac]{padding:.5em 0}.greetings[data-v-e8b463ac],[data-v-e8b463ac] .iconWrapper{text-align:center}.menu-item[data-v-e8b463ac]{padding:.5em;background:rgb(var(--background-total-theme));line-height:44px;border-radius:5px;display:flex}.menu-item .title[data-v-e8b463ac]{flex-grow:2;padding-right:44px;text-align:center}.menu-item .iconWrapper[data-v-e8b463ac]{width:44px}.tipusers[data-v-e8b463ac]{position:absolute;max-height:300px;border-radius:.5em;border:1px solid rgba(var(--neutral-grad-0),.9);overflow-y:overlay;background-color:rgba(var(--background-total-theme),.95);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);padding:.25em 0;bottom:100%;margin-bottom:.5em;left:.25em;right:.25em}.tipusers .previewWrapperExt[data-v-e8b463ac]{border-radius:.75em;margin-left:.25em;margin-right:.25em;padding-top:.25em;padding-bottom:.25em}.tipusers .previewWrapperExt[data-v-e8b463ac] .previewWrapper{padding-left:.25em!important;padding-right:.25em!important}.tipusers .previewWrapperExt.selected[data-v-e8b463ac]{background:rgb(var(--background-main))}.disabled[data-v-e8b463ac]{display:flex;justify-content:center;align-items:center;width:35px;height:35px;color:rgb(var(--neutral-grad-3))}.disabled i[data-v-e8b463ac]{padding-top:1px}",""]),e.exports=t},cff80:function(e,t,i){"use strict";i.r(t);var r=i("0a92");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},ead2:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,'.recordButton_wrapper[data-v-34d15f18]{position:relative}.recordButton_holder[data-v-34d15f18]{visibility:hidden;position:absolute;display:flex;justify-content:center;align-items:center;height:16px;width:16px;background:#789;border-radius:50%;bottom:98px;transition:.1s;right:9px}.recordButton_holder .icon[data-v-34d15f18]{color:#fff;font-size:7px}.recordButton_holder.active[data-v-34d15f18]{visibility:visible}.recordButton_holder.hold[data-v-34d15f18]{background:#789;visibility:visible;bottom:38px}.recordButton_holder.hold .icon[data-v-34d15f18]{color:#fff}.recordButton_main[data-v-34d15f18]{padding-top:1px;touch-action:none;display:flex;align-items:center;justify-content:center;width:35px;height:35px;line-height:35px!important;background:transparent;border-radius:50%;outline:none;position:relative}.recordButton_main.active[data-v-34d15f18]{background:rgb(var(--color-bg-ac));-webkit-animation:pulse-data-v-34d15f18 1.2s infinite;animation:pulse-data-v-34d15f18 1.2s infinite}.recordButton_main.active .icon[data-v-34d15f18]{color:rgb(var(--text-on-bg-shadow-color))}.recordButton_main.active[data-v-34d15f18]:before{position:absolute;left:-30px;bottom:-30px;right:-30px;top:-30px;content:"";border-radius:50%;border:35px solid rgba(var(--color-bg-ac),.5);-webkit-animation:pulse-data-v-34d15f18 1.2s infinite;animation:pulse-data-v-34d15f18 1.2s infinite}.recordButton_main.disabled .icon[data-v-34d15f18]{color:rgb(var(--neutral-grad-2))}.recordButton_main.outside[data-v-34d15f18],.recordButton_stop[data-v-34d15f18]{background:rgb(var(--color-bad))}.recordButton_stop[data-v-34d15f18]{color:rgb(var(--text-on-bg-shadow-color));font-size:.7em}@-webkit-keyframes pulse-data-v-34d15f18{0%{opacity:1}50%{opacity:.8}to{opacity:1}}@keyframes pulse-data-v-34d15f18{0%{opacity:1}50%{opacity:.8}to{opacity:1}}',""]),e.exports=t},f2bc:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".recordProgress[data-v-3f87c0fa]{display:flex;height:20px;justify-content:flex-start;padding:0 1em;align-items:center;max-width:80%;flex-grow:2}.recordProgress .indicatorWrapper[data-v-3f87c0fa]{min-width:20px;width:20px;margin-right:1em;display:flex;justify-content:center;align-items:center}.recordProgress .indicator[data-v-3f87c0fa]{height:6px;width:6px;background:#ff033e;border-radius:50%}.recordProgress .indicator.recording[data-v-3f87c0fa]{-webkit-animation:pulse-data-v-3f87c0fa 1.2s ease infinite;animation:pulse-data-v-3f87c0fa 1.2s ease infinite}.recordProgress .del[data-v-3f87c0fa]{min-width:20px;cursor:pointer;display:flex;justify-content:center;align-items:center;width:20px;height:20px;margin-right:1em}.recordProgress .del i[data-v-3f87c0fa]{color:red;font-size:13px}.recordProgress .timer[data-v-3f87c0fa]{margin-right:1em}.recordProgress .graph[data-v-3f87c0fa]{margin:0 auto;width:100px;overflow:hidden;border-radius:15px}.cancel[data-v-3f87c0fa],.recordProgress .graph[data-v-3f87c0fa]{display:flex;justify-content:center}.cancel[data-v-3f87c0fa]{position:absolute;left:0;right:0;top:0;bottom:0;background:rgb(var(--background-secondary-theme));opacity:0;text-align:center;align-items:center}.cancel span[data-v-3f87c0fa]{white-space:nowrap;font-size:.9em}@-webkit-keyframes pulse-data-v-3f87c0fa{0%{opacity:1}50%{opacity:.1}to{opacity:1}}@keyframes pulse-data-v-3f87c0fa{0%{opacity:1}50%{opacity:.1}to{opacity:1}}",""]),e.exports=t},f72e:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".input_component[data-v-b9fd73f0]{width:100%;display:flex;justify-content:center;align-items:center;padding:0 1em;padding-right:0}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji{width:25%;height:40px;cursor:pointer}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji span{cursor:pointer}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji:hover{background:none;box-shadow:none}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji:hover:before{display:none}.input_component .input-wrapper[data-v-b9fd73f0]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;position:relative;width:100%}.input_component .right[data-v-b9fd73f0]{margin:0 .5em}.input_component .iconbutton .leftdummy[data-v-b9fd73f0]{width:20px}.input_component .iconbutton .rightdummy[data-v-b9fd73f0]{width:35px}.input_component .iconbutton .idummy[data-v-b9fd73f0]{width:100%;height:35px;line-height:35px}.input_component .iconbutton .idummy i[data-v-b9fd73f0]{line-height:35px!important}.input_component .previews[data-v-b9fd73f0]{width:100%;max-width:198px;height:30px;display:flex;align-items:flex-start;padding:2px 0;overflow:hidden}.input_component .previews[data-v-b9fd73f0]:first-child{margin-left:0}.input_component .textarea[data-v-b9fd73f0]{width:100%;display:flex;justify-content:flex-start;align-items:center}.chat-input[data-v-b9fd73f0]{width:100%;max-height:100px;overflow-y:auto;resize:none}.chat-input[data-v-b9fd73f0]::-webkit-scrollbar{width:0!important}.fade-enter-active[data-v-b9fd73f0],.fade-leave-active[data-v-b9fd73f0]{transition:all .2s ease-in}.fade-enter[data-v-b9fd73f0],.fade-leave-to[data-v-b9fd73f0]{opacity:0}",""]),e.exports=t},fe01:function(e,t,i){"use strict";i.r(t);var r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"noswipepnt",attrs:{id:"chatInput"}},[e.ready?i("div",{staticClass:"work"},[e.chat?i("div",{staticClass:"inputWrapper"},[e.tipusers.length?i("div",{staticClass:"tipusers"},e._l(e.tipusers,(function(t,r){return i("div",{key:t.id,staticClass:"previewWrapperExt",class:{selected:e.tipuserindex==r},on:{click:function(i){return e.insertuser(t)}}},[i("preview",{attrs:{contact:t,mode:""}})],1)})),0):e._e(),i("div",{staticClass:"center"},[e.voiceEnable&&(e.isRecording||e.record)?i("record-progress",{attrs:{recordTime:e.recordTime,isRecording:e.isRecording,rmsData:e.recordRmsData,opacity:e.cancelOpacity},on:{onClear:e.clear}}):i("InputField",{ref:"newinput",attrs:{storagekey:"chatinput"+e.chat.roomId,tipusers:e.tipusers},on:{chatMessage:e.sendinput,emptyInput:e.emitInputData,FilledInput:e.HideUploadPic,base64:e.pasteImage,focused:e.focused,tipsearchrequest:e.tipBySearch,browsetip:e.browsetip,selectcurrenttip:e.selectcurrenttip}}),e.upload&&e.chat?i("div",{staticClass:"left",class:{extended:e.voiceEnable}},[e.isRecording||e.record?e._e():i("div",{staticClass:"iconbutton"},[i("dropdownMenu",{ref:"dropdownMenu",attrs:{menuItems:e.menuItems,rowObject:{},icon:"fas fa-plus"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.item.upload?i("upload",{attrs:{onlyimage:t.item.upload.onlyimage,multiple:t.item.upload.multiple,extensions:t.item.upload.extensions,images:t.item.upload.images},on:{start:function(i){return e.uploadStart(t.item,i)},uploaded:function(i){return e.uploadUploaded(t.item,i)},uploadedAll:function(i){return e.uploadUploadedAll(t.item,i)},error:function(i){return e.uploadError(t.item,i)}},scopedSlots:e._u([{key:"content",fn:function(){return[i("div",{staticClass:"menu-item"},[i("div",{staticClass:"iconWrapper"},[t.item.icon?i("i",{class:t.item.icon}):e._e()]),i("div",{staticClass:"title"},[e._v(" "+e._s(t.item.title)+" ")])])]},proxy:!0},{key:"dropzone",fn:function(){},proxy:!0}],null,!0)}):i("div",{staticClass:"menu-item",on:{click:function(i){return e.menuItemClick(t.item)}}},[i("div",{staticClass:"iconWrapper"},[t.item.icon?i("i",{class:t.item.icon}):e._e()]),i("div",{staticClass:"title"},[e._v(" "+e._s(t.item.title)+" ")])])]}}],null,!1,3187246467)})],1),e.voiceEnable?[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isRecording||!e.record,expression:"(isRecording || !record)"}],staticClass:"iconbutton"},[i("recordVoice",{attrs:{prepareRecording:!!e.prepareRecording,isRecording:e.isRecording,disabled:e.microphoneDisabled},on:{onRecordingStart:e.initRecording,onRecordingStop:e.stopRecording,onClear:e.clear,canceling:e.setOpacity}})],1)]:e._e(),!e.isRecording&&e.record?i("div",{staticClass:"iconbutton",on:{click:function(t){e.sendVoiceMessage()}}},[e._m(0)]):e._e()],2):e._e()],1)]):e._e()]):i("div",{staticClass:"notready"},[i("linepreloader")],1)])},s=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("i",{staticClass:"icon fas fa-paper-plane"})])}],a=i("1da1"),n=(i("907a"),i("3139")),o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"input_component"},[i("div",{staticClass:"input-wrapper"},[i("div",{staticClass:"textarea"},[i("textarea",{ref:"textarea",staticClass:"chat-input",attrs:{id:"textInput",type:"text",row:"1",spellcheck:"true",autocorrect:"on",placeholder:e.$t("caption.sendmessage")},domProps:{value:e.text},on:{focus:e.focused,blur:e.blured,keydown:e.keydown,input:e.textchange,keyup:e.keyup,click:e.keyup,paste:e.paste_image}}),!e.mobile&&e.emojiIndex?i("transition",{attrs:{name:"fade",mode:"out-in"}},[i("picker",{directives:[{name:"show",rawName:"v-show",value:e.display_emoji,expression:"display_emoji"},{name:"click-outside",rawName:"v-click-outside",value:e.close_emoji_picker,expression:"close_emoji_picker"}],style:{width:"325px",position:"absolute",bottom:"32px",right:"-60px",fontSize:"0.8em",fontFamily:"Segoe UI"},attrs:{data:e.emojiIndex,exclude:e.exclude,showPreview:!1,showSearch:!1,native:!0,set:"emojione"},on:{select:e.insert_emoji}})],1):e._e()],1)]),e.mobile?e._e():i("div",{staticClass:"iconbutton emojipicker",on:{click:function(t){return e.toggle_emoji_picker()}}},[i("div",{staticClass:"leftdummy"},[i("div",{staticClass:"idummy"},[e.display_emoji?i("i",{staticClass:"fas fa-times"}):i("i",{staticClass:"far fa-smile"})])])]),e.send?i("div",{staticClass:"iconbutton",on:{click:function(t){return e.send_text(t)}}},[e._m(0)]):e._e()])},c=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"rightdummy"},[i("div",{staticClass:"idummy"},[i("i",{staticClass:"far fa-paper-plane"})])])}],d=i("5059"),l=(i("01ce"),i("41fb")),h=i("c28b"),u=i.n(h),p=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.is_opened?i("div",{staticClass:"wrapper"},[i("img",{staticClass:"preview-picture",attrs:{src:e.base64,alt:"picture preview"}}),i("i",{staticClass:"fas fa-times fa-sm",on:{click:e.hide}})]):e._e()},m=[],f={name:"picturePreview",props:["base64"],data(){return{is_opened:!0}},methods:{hide(){this.is_opened=!1}}},v=f,g=i("2877");function x(e){var t=i("cff80");t.__inject__&&t.__inject__(e)}var b=Object(g["a"])(v,p,m,!1,x,"4b882d9f",null,!0),y=b.exports;let w=new d["a"];var $={name:"InputField",components:{Picker:l["Picker"],picturePreview:y},directives:{clickOutside:u.a.directive},watch:{text:{immediately:!0,handler:function(e,t){e?(this.send=!0,this.$emit("FilledInput")):(this.send=!1,this.$emit("emptyInput")),this.textarea_resize()}}},data(){return{send:!1,ready:!1,text:"",exclude:["flags"],display_emoji:!1,content_height:26,pasted_data:[],block:!1,upload:{multiple:!0,extensions:["image/jpg","image/jpeg","image/png"],images:{resize:{type:"fit"}}},hidden_previews:null,emojiIndex:null}},computed:{mobile:function(){return!this.$store.state.pocketnet&&this.$store.state.mobile}},methods:{prepareemoji:function(){if(!this.mobile)if(window.emojiIndex)this.emojiIndex=window.emojiIndex;else{var e=i("364d");window.emojiIndex=new l["EmojiIndex"](e),this.emojiIndex=window.emojiIndex}},setText:function(e){this.text=e,this.savetextinstorage(),setTimeout(()=>{this.textarea_resize(),this.focus()})},focused:function(){this.$emit("focused")},textchange:function(e){this.text=e.target.value||""},savetextinstorage:function(){this.storagekey&&(localStorage[this.storagekey]=this.text||"")},send_empty_array(){this.$emit("userSearched",[])},focus(){this.$refs["textarea"].focus()},blur(){this.$refs["textarea"].blur()},blurifempty(){this.text||this.blur()},close_emoji_picker(e){"i"!==e.target.localName&&"matrix-element"!==e.target.localName&&(this.display_emoji=!1)},textarea_resize(){this.text?(this.$refs.textarea.style.height="1px",this.$refs.textarea.style.height=this.$refs.textarea.scrollHeight+"px",this.display_emoji=!1):this.textarea_resize_reset()},textarea_resize_reset(){this.$refs.textarea.style.height=this.content_height+"px"},toggle_emoji_picker(){this.display_emoji=!this.display_emoji},send_text(e){this.text&&"\n"!==this.text&&(this.display_emoji=!1,this.$emit("chatMessage",this.text),this.$emit("emptyInput"),this.send=!1,this.text=""),this.savetextinstorage()},insert_emoji(e){this.text+=e.native,this.savetextinstorage()},paste_image(e){this.get_base64(e)},get_base64(e){if(this.pasted_data=e.clipboardData.items,this.pasted_data.length)for(let r in this.pasted_data){let e=this.pasted_data[r],s=this.upload.extensions.includes(e.type);if(s){var t=e.getAsFile(),i=new FileReader;i.onload=t=>{this.$dialog.confirm("Do you really want to send attachment?",{okText:"Yes",cancelText:"No, cancel"}).then(i=>{var r=t.target.result;this.resize_image(r,e.type)})},i.readAsDataURL(t)}}},resize_image(e,t){return w.autorotation(null,e).then(e=>{let i=this.upload.images.resize.type||"def";return w.resize[i](e,1024,1024,t,.9).then(e=>{this.$emit("base64",e)}).catch(e=>console.error("Failed to resize image",e))}).catch(e=>console.error("Failed to resize image",e))},getsearchposition(e){if(!e.start||!this.text.length)return null;var t={start:e.start,middle:0,end:e.end},i=e.start,r=!1,s=!1,a=/[a-zA-Z0-9]{1}/;t.middle=i;do{var n=this.text[i];"@"==n?e.start==i||i>0&&a.test(this.text[i-1])?s=!0:r=!0:a.test(n)?t.start=i:s=!0,i--}while(i>=0&&i<=e.start&&!r&&!s);if(r){s=!1,i=e.end;do{!this.text[i]||a.test(this.text[i])?t.end=i:s=!0,i++}while(i<=this.text.length&&!s)}else t=null;return t},getsearch(e){var t=this.getsearchposition(e);return t?this.text.substring(t.start,t.middle):null},keydown(e){return(40===e.keyCode||38===e.keyCode)&&this.tipusers&&this.tipusers.length?(this.$emit("browsetip",40===e.keyCode),e.preventDefault(),!1):(39===e.keyCode||13===e.keyCode)&&this.tipusers&&this.tipusers.length?(this.$emit("selectcurrenttip"),e.preventDefault(),!1):13===e.keyCode?(this.mobile?this.text=this.text+"\n":this.send_text(e),e.preventDefault(),!1):void 0},keyup(e){if(this.block)return e.preventDefault(),!1;var t=n["a"].getCaretPosition(this.$refs["textarea"]),i=this.getsearch(t);this.$emit("tipsearchrequest",i),this.savetextinstorage()},blured(){setTimeout(()=>{this.$emit("tipsearchrequest",null)},300)},inserttip(e){this.$emit("tipsearchrequest",null),this.block=!0,this.$refs["textarea"];var t=this.getsearchposition(n["a"].getCaretPosition(this.$refs["textarea"]));this.text=this.text.substring(0,t.start)+e+this.text.substring(t.end+1),this.text[t.end+1]||(this.text=this.text+" ")," "==!this.text[t.end+1]&&t.end++,n["a"].setCaretPosition(this.$refs["textarea"],t.end+1,t.end+1),setTimeout(()=>{this.block=!1},350)}},props:{storagekey:String,tipusers:Array},creared(){},mounted(){this.mobile||this.focus(),this.prepareemoji(),this.$refs.textarea.style.height="26px",this.storagekey&&localStorage[this.storagekey]&&(this.text=localStorage[this.storagekey])}},k=$;function R(e){var t=i("3e3c");t.__inject__&&t.__inject__(e)}var C=Object(g["a"])(k,o,c,!1,R,"b9fd73f0",null,!0),E=C.exports,j=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"recordButton_wrapper"},[i("div",{ref:"holder",staticClass:"recordButton_holder",class:{hold:e.isHold}},[i("i",{staticClass:"icon fas",class:e.isHold?"fa-lock":"fa-lock-open"})]),e.isHold?e._e():i("div",{ref:"toggle",staticClass:"recordButton_micro recordButton_main",class:{active:e.isRecording,disabled:e.disabled},on:{mousedown:e.mousedown,mouseup:e.mouseup,touchstart:e.handleTouchStart,touchend:e.handleTouchEnd,touchcancel:e.handleTouchEnd}},[i("i",{staticClass:"icon fas fa-microphone"})]),e.isHold?i("div",{ref:"stop",staticClass:"recordButton_stop recordButton_main",on:{click:e.recordEnd}},[i("i",{staticClass:"icon fas fa-stop"})]):e._e()])},I=[],P=i("2f62"),T={name:"recordVoice",props:{isRecording:{type:Boolean,required:!0},prepareRecording:{type:Boolean},disabled:Boolean},data(){return{start:0,isHold:!1,direction:null}},computed:{...Object(P["c"])({mobile:e=>e.mobile})},mounted(){},beforeDestroy(){document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.isRecording&&this.$emit("onRecordingStop",{cancel:!0})},methods:{mouseup:function(e){this.mobile||this.handleTouchEnd(e)},mousedown:function(e){this.mobile||this.handleTouchStart(e)},handleTouchStart(e){if(console.log("E",e,this.isHold,this.isRecording),this.isRecording){if(this.isHold)return}else this.$emit("onRecordingStart");this.start={Y:e.changedTouches?e.changedTouches[0].pageY:e.pageY,X:e.changedTouches?e.changedTouches[0].pageX:e.pageX},this.mobile?document.addEventListener("touchmove",this.handleMove):document.addEventListener("mousemove",this.handleMove)},handleTouchEnd(e){console.log("E",e,this.isHold),this.isHold||((this.isRecording||this.prepareRecording)&&this.$emit("onRecordingStop",{sendnow:!0}),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.clearStyle())},clearStyle(){this.$refs.toggle&&(this.$refs.toggle.style.transform="translate(0,0)",this.$refs.toggle.classList.remove("outside")),this.$refs.holder&&this.$refs.holder.classList.remove("active")},handleMove(e){var t;if(console.log("E",e,this.isRecording),!this.isRecording)return;let i=this.start.Y-e.pageY,r=this.start.X-e.pageX;null!==e&&void 0!==e&&null!==(t=e.changedTouches)&&void 0!==t&&t.length&&(i=this.start.Y-e.changedTouches[0].pageY,r=this.start.X-e.changedTouches[0].pageX),this.direction=i>5&&r<5?"Y":"X",i>5&&"Y"===this.direction?(this.$refs.holder.classList.contains("active")||this.$refs.holder.classList.add("active"),this.$refs.toggle.style.transform=`translate(0,-${i}px)`,i>70&&(this.$refs.toggle.style.transform="translate(0,0)",document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.isHold=!0)):r>5&&"X"===this.direction?(this.$refs.toggle.style.transform=`translate(-${r}px, 0)`,this.$refs.holder.classList.contains("outside")||this.$refs.toggle.classList.add("outside"),this.$emit("canceling",(r-5)/130),r>130&&(this.$refs.toggle.style.transform="translate(0,0)",document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.$emit("onRecordingStop",{cancel:!0}),this.$emit("onClear"))):this.clearStyle()},recordEnd(e){if(this.clearStyle(),this.isRecording&&this.isHold)return this.$emit("onRecordingStop",{}),void(this.isHold=!1)}}},M=T;function z(e){var t=i("4994");t.__inject__&&t.__inject__(e)}var S=Object(g["a"])(M,j,I,!1,z,"34d15f18",null,!0),D=S.exports,O=i("f978"),A=i("92a6"),B=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"recordProgress"},[e.isRecording?i("div",{staticClass:"indicatorWrapper"},[i("div",{staticClass:"indicator",class:{recording:e.isRecording}})]):i("div",{staticClass:"del",on:{click:e.clear}},[i("i",{staticClass:"fas fa-trash"})]),i("div",{staticClass:"timer"},[e._v(e._s(e.timer))]),i("div",{ref:"graph",staticClass:"graph"},[i("canvas",{ref:"canvas",attrs:{id:"canvas",width:e.width,height:"20"}})]),i("div",{directives:[{name:"show",rawName:"v-show",value:e.isRecording&&e.opacity,expression:"isRecording && opacity"}],ref:"cancel",staticClass:"cancel"},[i("span",[e._v("Slide left to cancel")])])])},L=[],W={name:"recordProgress",props:{recordTime:{type:Number,required:!0},rmsData:{type:Array,required:!0},isRecording:{type:Boolean},opacity:{}},data(){return{width:0}},computed:{timer(){let e=Math.floor(this.recordTime/6e4),t=Math.floor(this.recordTime/1e3)%60;return`${e?e+":":"0:"}${t<10?"0"+t:t}`},rmsDataLast(){return _.last(this.rmsData,25)}},watch:{rmsData:_.throttle((function(){this.draw()}),30),opacity:function(){this.$refs.cancel.style.opacity=this.opacity}},mounted(){this.$refs.cancel.style.opacity=0;let e=this.$refs.graph.offsetWidth;this.width=e-e%100,window.addEventListener("resize",this.resize)},beforeDestroy(){window.removeEventListener("resize",this.resize)},methods:{resize(){let e=null;var t=()=>{e||(e=setTimeout(()=>{e=null;let t=this.$refs.graph.offsetWidth;this.width=t-t%100},50))};t()},draw(){if(!this.$refs.canvas)return;const e=this.$refs.canvas.getContext("2d");let t=50,i=2;var r=this.rmsDataLast.length,s=Math.max(Math.floor(r/t),1);e.clearRect(0,0,this.width,20);for(let a=0;a[]},images:{type:Object,default:()=>{}}},data:function(){return{loading:!1}},computed:{maxSize(){return 1024*this.maxsize*1024}},created:()=>{},methods:{read:function(e){var t=new FileReader;return new Promise((i,r)=>{t.onloadend=function(t){i({base64:t.target.result,file:e})},t.readAsDataURL(e)})},upload:function(e){var t,i;e.stopPropagation(),e.preventDefault();var r=(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)||(null===(i=e.target)||void 0===i?void 0:i.files)||e.files||[],s={};this.loading=!0,this.$emit("start",r);var a=this;Y(_.toArray(r),(e,t)=>{var i=this.check(e);if(i)return a.$emit("error",{error:i,file:e,text:this.errorText(i,e)}),void t(new Error(i));this.read(e).then(e=>(s[e.file.name]=e,this.handle(e))).then(e=>{a.$emit("uploaded",e),t()}).catch(r=>{a.$emit("error",{error:r,file:e,text:this.errorText(r,e)}),t(new Error(i))})},e=>{this.loading=!1,a.$emit("uploadedAll",s)})},errorText:function(e,t){return"filesize"===e?"File Size Error: ("+t.name+"). The File can't be more than "+this.maxsize+" mbytes":"fileext"===e?"File Extension Error:"+t.name:void 0},check:function(e){return this.checkSize(e)?this.checkExtension(e)?void 0:"fileext":"filesize"},checkSize:function(e){return e.size<=this.maxSize},getExtension:function(e){var t=e.name.split("."),i=t[t.length-1].toLowerCase();return i},checkExtension:function(e){return!this.extensions.length||-1!=_.indexOf(this.extensions,this.getExtension(e))},handle:function(e){return"image/jpeg"===e.file.type||"image/png"===e.file.type||"image/webp"===e.file.type?this.handleImages(e):Promise.resolve(e)},sendAnyFile:function(e){this.$emit("anyFile",e)},resizeIfNeed:function(e,t){if(this.images.resize){var i=this.images.resize.type||"def";return X.resize[i](e,this.images.resize.width||1024,this.images.resize.height||1024,t,this.images.resize.quality||.85).then(e=>Promise.resolve(e)).catch(e=>Promise.reject(e))}return Promise.resolve(e)},handleImages:function(e){return X.autorotation(e.file,e.base64).then(t=>(e.base64=t,Promise.resolve(e))).then(e=>this.resizeIfNeed(e.base64,e.file.type).then(t=>(e.base64=t,Promise.resolve(e))))}}},G=K;function Z(e){var t=i("439c");t.__inject__&&t.__inject__(e)}var J=Object(g["a"])(G,V,q,!1,Z,"a28e80a8",null,!0),Q=J.exports,ee=i("0bb9"),te={name:"chatInput",props:{chat:Object,u:String,relationEvent:Object},components:{InputField:E,contacts:O["default"],preview:A["a"],recordProgress:H,recordVoice:D,upload:Q},data:function(){return{upload:!0,test:[],loading:!1,text:"",file:{},fileInfo:{},ready:!1,creating:!1,userId:"",showuserselect:null,anyUrlMeta:String,joinedMembers:[],tipvalue:null,tipuserindex:0,record:null,recordRmsData:[],isRecording:!1,mediaRecorder:null,audioContext:null,audioAnalyser:null,recordTime:0,interval:null,cancelOpacity:0,microphoneDisabled:!1,prepareRecording:!1,cancelledCordovaMediaRecorder:!1}},watch:{usersForKeysHash:{handler:function(){}},tipusers:function(){this.tipusers.length?this.tipuserindex>this.tipusers.length-1&&(this.tipuserindex=this.tipusers.length-1):this.tipuserindex=0}},beforeDestroy(){this.audioContext&&this.audioContext.close()},computed:{voiceEnable(){return this.$store.state.voiceMessagesEnabled},connect:function(){return this.$store.state.contact},pkoindisabled:function(){return this.$store.state.pkoindisabled},menuItems:function(){var e=[];return this.relationEvent||(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.mobile.supportimagegallery()?e.push({click:"cameraHandlerCustom",title:this.$i18n.t("button.takePhotoOrVideo"),icon:"fas fa-camera"}):e.push({click:"cameraHandler",title:this.$i18n.t("button.takePhotoOrVideo"),icon:"fas fa-camera",upload:{multiple:!0,extensions:["jpg","jpeg","png","webp"],maxsize:100,images:{resize:{type:"fit"}}}}),e.push({click:"fileHandler",title:this.$i18n.t("button.sendFile"),icon:"fas fa-sticky-note",upload:{multiple:!0,extensions:[],maxsize:25,images:{resize:{type:"fit"}}}})),this.transaction&&!this.pkoindisabled&&e.unshift({click:"sendtransactionWrapper",title:this.$i18n.t("button.sendCoins"),icon:"fas fa-wallet"}),e},...Object(P["c"])(["chats"]),userlist:function(){return this.chat?this.core.mtrx.chatUsersInfo(this.chat.roomId,"anotherChatUsers"):[]},transaction:function(){return n["a"].deep(window,"POCKETNETINSTANCE.platform.ui.wallet.send")},uusers:function(){return this.u?_.map(this.u.split(","),e=>e):[]},ausers:function(){return this.u?_.map(this.u.split(","),e=>this.core.user.matrixId(e)):[]},stateChat:function(){var e=this.$route.query.id;return this.$store.state.chatsMap[e]},invited:function(){return this.chat?_.map(_.filter(this.chat.currentState.getMembers(),(function(e,t){return"invite"===e.membership})),(function(e){return e.userId})):this.u?this.ausers:[]},joined:function(){if(!this.chat)return[];this.chat.roomId;let e=[];return this.chat.currentState.getMembers().forEach((function(t){"join"===t.membership&&e.push(t.userId)})),e},tipusers:function(){if(null===this.tipvalue)return[];if(""===this.tipvalue)return this.userlist;var e=this.tipvalue.toLowerCase(),t=_.filter(this.userlist,(function(t){return 0==t.name.toLowerCase().indexOf(e)&&t.name.toLowerCase()!=e}));return t},maintipuser:function(){return this.tipusers.length?this.tipusers[this.tipuserindex||0]:null}},created(){},mounted(){this.ready=!0,!this.chat&&this.core.mtrx.client&&this.newchat().catch(e=>Promise.resolve())},methods:{wait:function(){return this.$f.pretry(()=>this.core.mtrx.client&&this.core.mtrx.access)},browsetip:function(e){e?this.tipuserindex++:this.tipuserindex--,this.tipuserindex>this.tipusers.length-1&&(this.tipuserindex=0),this.tipuserindex<0&&(this.tipuserindex=this.tipusers.length-1)},selectcurrenttip:function(){this.insertuser(this.tipusers[this.tipuserindex||0])},insertuser:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=e.name||"";this.$refs["newinput"].inserttip(t)},tipBySearch:function(e){this.tipvalue=e},showuserselected:function(e,t){this[t](e)},resizeImage:function(e){var t=e.split(";")[0].split("/")[1],i=new d["a"];return i.resize["fit"](e,1024,1024,t,.95).then(e=>Promise.resolve(e)).catch(e=>Promise.reject(e))},cameraHandlerCustom:function(){var e=[];this.$refs.dropdownMenu.hidePopup(),window.POCKETNETINSTANCE.platform.ui.uploadImage({multiple:!0,action:(t,i)=>{let{base64:r}=t;return this.resizeImage(r).then(t=>n["a"].Base64.toFile(t).then(r=>{var s={base64:t,file:r};e.push(s),this.uploadUploaded(null,s),i()})).catch(e=>{console.error(e),i()})},onSuccess:e=>{this.uploadUploadedAll()}})},sendtransactionWrapper:function(){this.menuIsVisible=!1;var e=_.filter(_.map(this.joined,e=>this.$f.deep(this,"$store.state.users."+this.$f.getmatrixid(e))||null),e=>{var t;return e&&e.source&&e.id!=(null===(t=this.core.user.userinfo)||void 0===t?void 0:t.id)});if(!e.length)return"users.length";e.length>1?this.core.store.commit("setmodal",{caption:this.$i18n.t("caption.sendTransactionTo"),type:"showuserselect",data:{users:e,action:"sendtransaction",userselected:e=>{this.showuserselected(e,"sendtransaction")}}}):this.sendtransaction(e[0]),this.$refs.dropdownMenu.hidePopup()},sendtransaction:function(e){var t=this.transaction;t({roomid:this.chat.roomId,address:e.source.address})},emitInputData:function(){this.$emit("emptyInput"),this.upload=!0},HideUploadPic(){this.upload=!1},emitUrl:function(e){this.$emit("setMetaUrl",e)},newchat(){if(this.u){this.$store.state.globalpreloader=!0;var e=null,t=null,i="";return this.creating=!0,this.core.user.usersInfo(this.uusers).then(t=>{if(1==this.uusers.length){var r=t[0];if(!r||!r.keys||r.keys.length<12)return this.$emit("cantchatcrypto"),Promise.reject("ny2")}if(this.core.user.userinfo.keys.length<12)return this.$emit("cantchatcrypto"),Promise.reject("ny2");i=this.core.mtrx.kit.tetatetid(t[0],this.core.user.userinfo),e=this.core.user.matrixId(t[0].id),this.core.user.matrixId(this.core.user.userinfo.id);var s=[{type:"m.set.encrypted",state_key:"",content:{encrypted:!0}}];return this.core.mtrx.client.createRoom({room_alias_name:i,visibility:"private",invite:[e],name:"#"+i,initial_state:s})}).then(i=>{t=i,this.$store.state.globalpreloader=!1;let r=this.core.mtrx.client.getRoom(i.room_id),s=r.currentState.getStateEvents("m.room.power_levels");return this.core.mtrx.client.setPowerLevel(t.room_id,e,100,s[0]).catch(e=>{})}).then(e=>(this.creating=!1,this.connect&&this.connect==i&&this.greetings(),this.$store.commit("CONTACT",!1),Promise.resolve())).catch(e=>(this.creating=!1,this.$store.state.globalpreloader=!1,e&&"M_ROOM_IN_USE"==e.errcode?this.core.mtrx.client.joinRoom("#"+i+":"+this.core.mtrx.baseUrl.replace("https://","")).then(()=>{}).catch(e=>{}):Promise.reject(e)))}return Promise.reject("u")},maySendMessage(){return this.chat&&this.chat.maySendMessage()},greetings(){this.send("👋").then(e=>Promise.resolve(e))},sendinput(e){this.send(e).then(e=>Promise.resolve(e))},textCutLimit:function(e,t){return e=e.trim(),e.length<=t?e:(e=e.slice(0,t),e.trim()+"...")},replaceMentions(e){return _.each(this.userlist,(function(t){e=e.replace(new RegExp("@"+t.name,"g"),"@"+t.id+":"+t.name)})),e},send(e){return this.chat||this.newchat().catch(e=>{}),this.$emit("sending"),this.relationEvent||this.focus(),this.$f.pretry(()=>this.chat&&!this.creating).then(t=>(this.$emit("sent"),e=this.replaceMentions(e),this.relationEvent&&"m.replace"==this.relationEvent.type&&this.relationEvent.event?this.core.mtrx.textEvent(this.chat,e).then(e=>{e["m.relates_to"]={rel_type:"m.replace",event_id:this.core.mtrx.clearEventId(this.relationEvent.event)||n["a"].makeid()};var t=e;return this.relationEvent.event.event.content.body=e.body,this.relationEvent.event.event.content.block=e.block,this.relationEvent.event.event.content.msgtype=e.msgtype,delete this.relationEvent.event.event.decryptKey,delete this.relationEvent.event.event.decrypted,this.core.mtrx.client.sendEvent(this.chat.roomId,"m.room.message",t)}).then(e=>(this.core.store.dispatch("FETCH_EVENTS"),this.$emit("clearRelationEvent"),this.$emit("force"),Promise.resolve())).catch(e=>(console.error(e),Promise.reject(e))):this.core.mtrx.sendtext(this.chat,e,{relation:this.relationEvent}))).catch(e=>{this.$emit("sentMessageError",{error:e})})},pasteImage(e){this.sendImage({base64:e})},sendImage:function(e){let{base64:t,file:i}=e;var r=n["a"].makeid(),s={type:"image",id:r,base64:t};this.$emit("sendingData",s),this.$f.pretry(()=>this.chat).then(()=>s.aborted?Promise.reject("aborted"):this.core.mtrx.sendImage(this.chat,t,null,s,{relation:this.relationEvent})).then(e=>(this.$emit("sentData",{id:r}),Promise.resolve())).catch(e=>(this.$emit("sentError",{id:r,error:e}),Promise.resolve()))},canencryptfilesize:function(e){var t=10485760;return this.chat.pcrypto.canBeEncrypt()&&e.size>t?this.$dialog.confirm("Files larger than 10 megabytes are not encrypted. Do you want to send the file unencrypted?",{okText:"Yes",cancelText:"No, cancel"}).then(e=>Promise.resolve(!0)).catch(e=>Promise.reject("cancel")):Promise.resolve(!1)},sendFile:function(e){let{file:t}=e;var i=n["a"].makeid(),r={type:"file",id:i,info:{name:t.name,size:t.size}};this.$emit("sendingData",r),this.$f.pretry(()=>this.chat).then(()=>this.canencryptfilesize(t)).then(e=>this.core.mtrx.sendFile(this.chat,t,r,{relation:this.relationEvent},e)).then(()=>(this.$emit("sentData",{id:i}),Promise.resolve())).catch(e=>{console.error(e),this.$emit("sentError",{id:i,error:e})})},focus:function(){this.$refs["newinput"]&&this.$refs["newinput"].focus()},focused:function(){this.$emit("focused")},blur:function(){this.$refs["newinput"]&&this.$refs["newinput"].blur()},blurifempty:function(){this.$refs["newinput"]&&this.$refs["newinput"].blurifempty()},change:function(){},setText:function(e){this.text=e,this.$refs["newinput"]&&this.$refs["newinput"].setText(e)},keyup:function(e){var t=e.target.value;""!==t?(this.$emit("inputClean",!0),this.text=t,this.anyUrlMeta=n["a"].getUrl(this.text),void 0!==this.anyUrlMeta?this.$emit("setMetaUrl",this.anyUrlMeta):this.$emit("inputClean",!1),this.chat&&this.core.mtrx.client.sendTyping(this.chat.roomId,!0,100)):this.$emit("inputClean",!1)},menuItemClick(e,t){this[e.click](t)},menuItemLoadedHandler:function(e){return this.menuIsVisible=e,this.menuIsVisible},uploadStart(e,t){},uploadError(e,t){this.$store.commit("icon",{icon:"error",message:t.text})},getImg(){return this.imgs=!0},uploadSizeError(e){e||this.$refs.dropdownMenu.hidePopup()},uploadUploaded(e,t){const i=["image/gif","image/jpeg","image/png","image/webp"];if(i.includes(t.file.type))return this.sendImage(t);this.sendFile(t)},imageWH(e){const t=new Image;var i={};return new Promise((r,s)=>{t.onload=function(){i.w=this.width,i.h=this.height,r(i)},t.onerror=function(e){s(e)},t.src=e.base64})},uploadUploadedAll(e,t){this.$store.state.loading=!1,this.$refs.dropdownMenu.hidePopup()},catchPermissonsError(e){if("permissions"==e||e.toString&&e.toString().indexOf("Permission")>-1)return this.microphoneDisabled=!0,void(window.cordova?this.$dialog.confirm(this.$i18n.t("micaccesscordova"),{okText:this.$i18n.t("button.ok")}):this.$dialog.confirm(this.$i18n.t("micaccessbrowser"),{okText:this.$i18n.t("button.ok")}));e.toString&&e.toString().indexOf("device not found")>-1?this.$dialog.confirm(this.$i18n.t("micdevicenotfound"),{okText:this.$i18n.t("button.ok")}):(this.$dialog.confirm(this.$i18n.t("micaccesscommonproblem"),{okText:this.$i18n.t("button.ok")}),console.error(e))},getFileIosCordova(e){return console.log("load",e),new Promise((t,i)=>{window.resolveLocalFileSystemURL(e,e=>{if(!e)return i("noentry");e.file(r=>{var s=new FileReader;console.log("file",r),s.onloadend=function(){var i=new Blob([new Uint8Array(this.result)],{type:r.type});console.log("blob",i),e.remove(),t(i)},s.onerror=t=>{e.remove(),i(t)},s.readAsArrayBuffer(r)})},e=>{i(e)})})},initRecordingCordova(){this.prepareRecording=Object(ee["cancelable"])(this.core.media.permissions({audio:!0}).then(()=>(this.microphoneDisabled=!1,Promise.resolve())).catch(e=>(console.error(e),this.catchPermissonsError(e),Promise.reject(e)))),this.prepareRecording.then(()=>{console.log("START RECORDING"),this.microphoneDisabled=!1;var e="recording.mp3";n["a"].isios()&&(e="cdvfile://localhost/temporary/recording.m4a");var t=0;this.audioContext=this.core.getAudioContext();var i=this.cordovaMediaRecorder=new Media(e,()=>{if(console.log("MEDIA PREPARED",this.cancelledCordovaMediaRecorder),this.recordTime=0,i.release(),this.cancelledCordovaMediaRecorder)this.cancelledCordovaMediaRecorder=!1;else{var t=null;t=this.getFileIosCordova(n["a"].isios()?e:window.cordova.file.externalDataDirectory+e).then(e=>Promise.resolve({data:e})),t.then(e=>(console.log("media.duration",i.duration),i.duration&&i.duration>0&&(e.duration=i.duration),this.createVoiceMessage(e,!0),Promise.resolve())).catch(e=>{this.clear(),console.error(e)}).finally(()=>{})}},e=>{console.error(e),this.isRecording=!1,this.clear()}),r=[];let s=this.$store.state.currentPlayingVoiceMessage;s&&s.pause(),this.interval=setInterval(()=>{n["a"].isios()?(r.push(1),r.length>50&&(r=_.last(r,50)),this.recordRmsData=_.clone(r)):this.cordovaMediaRecorder.getCurrentAmplitude(e=>{r.push(1e3*e),r.length>50&&(r=_.last(r,50)),this.recordRmsData=_.clone(r)},(function(e){console.log("E",e)})),t+=50,t%1e3===0&&(this.recordTime=t)},50),this.isRecording=!0,this.cancelOpacity=0,this.recordRmsData=[],this.recordTime=0,this.record=null,this.cordovaMediaRecorder.startRecord()}).catch(e=>{console.error(e)}).finally(()=>{this.prepareRecording=null})},initRecording(){if(!(this.prepareRecording||this.isRecording||this.cordovaMediaRecorder)){if(console.log("INIT RECORDING"),window.cordova)return this.initRecordingCordova();this.prepareRecording=Object(ee["cancelable"])(this.core.initMediaRecorder().then(e=>{if(this.microphoneDisabled=!1,this.prepareRecording)return Promise.resolve(e);e.stream.getTracks().forEach(e=>{e.stop()})}).catch(e=>(this.catchPermissonsError(e),Promise.reject(e)))),this.prepareRecording.then(e=>{this.mediaRecorder=e,this.audioContext=this.core.getAudioContext(),this.audioAnalyser=this.audioContext.createAnalyser();var t=this.audioContext.createMediaStreamSource(this.mediaRecorder.stream);t.connect(this.audioAnalyser),this.startRecording()}).catch(()=>{}).finally(()=>{this.prepareRecording=null})}},startRecording(){let e=this.$store.state.currentPlayingVoiceMessage;e&&e.pause(),this.$store.commit("SET_VOICERECORDING",!0),this.isRecording=!0,this.cancelOpacity=0,this.recordRmsData=[],this.recordTime=0,this.record=null,this.mediaRecorder.start();var t=0,i=[];this.interval=setInterval(()=>{var e=new Uint8Array(this.audioAnalyser.frequencyBinCount);this.audioAnalyser.getByteFrequencyData(e),i.push(this.generateRms(e)),i.length>50&&(i=_.last(i,50)),t+=50,this.recordRmsData=_.clone(i),t%1e3===0&&(this.recordTime=t)},50)},checkaudioForSend:function(e,t){e.duration<1?this.clear():t?this.sendVoiceMessage(e):this.record=e},getduration(e){return new Promise((t,i)=>{n["a"].readFile(e).then(e=>{try{this.audioContext.decodeAudioData(e,e=>{t(e.duration)})}catch(r){i(r)}}).catch(i)})},createVoiceMessage(e,t){console.log("event",e);var i=()=>{this.checkaudioForSend({file:e.data,id:n["a"].makeid(),duration:e.duration},t)};e.duration?i():this.getduration(e.data).then(t=>{e.duration=t,i()}).catch(e=>{console.error(e),this.clear()})},generateRms(e){return+Math.sqrt(e.reduce((e,t)=>e+t**2)/e.length).toPrecision(4)},stopRecording(e){let{cancel:t,sendnow:i}=e;if(console.log("STOP RECORDING",this.isRecording),this.$store.commit("SET_VOICERECORDING",!1),this.prepareRecording)return this.prepareRecording.cancel(),void(this.prepareRecording=null);this.isRecording=!1,this.interval&&(clearInterval(this.interval),this.interval=null),this.mediaRecorder&&(t||this.mediaRecorder.addEventListener("dataavailable",e=>{this.createVoiceMessage(e,i)}),this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(e=>{e.stop()}),this.mediaRecorder=null),this.cordovaMediaRecorder&&(this.cancelledCordovaMediaRecorder=!!t,this.cordovaMediaRecorder.stopRecord(),this.cordovaMediaRecorder=null)},sendVoiceMessage(e){var t=this;return Object(a["a"])((function*(){e||(e=t.record),e||t.clear(),t.recordRmsData=[];const i=yield t.core.convertAudioToBase64(e.file),r=n["a"].makeid(),s={type:"audio",id:r,base64:i};t.clear(),t.$f.pretry(()=>t.chat).then(()=>t.core.mtrx.sendAudio(t.chat,i,null,s,{relation:t.relationEvent})).catch(e=>(t.$emit("sentError",{id:r,error:e}),Promise.resolve()))}))()},clear(){this.record=null,this.recordRmsData=[],this.recordTime=0,this.interval&&(clearInterval(this.interval),this.interval=null),this.cordovaMediaRecorder&&(this.cordovaMediaRecorder=null),this.mediaRecorder&&(this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(e=>{e.stop()}),this.mediaRecorder=null)},setOpacity(e){this.cancelOpacity=e}}},ie=te;function re(e){var t=i("3136");t.__inject__&&t.__inject__(e)}var se=Object(g["a"])(ie,r,s,!1,re,"e8b463ac",null,!0);t["default"]=se.exports}}]); +(window["matrixElement_jsonp"]=window["matrixElement_jsonp"]||[]).push([[6],{"0a92":function(e,t,i){var r=i("5ce7");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("06c84aee",r,e)}},1097:function(e,t,i){var r=i("f2bc");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("2ab77a92",r,e)}},"16df":function(e,t,i){var r=i("f72e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("0245fe41",r,e)}},"16e59":function(e,t,i){var r=i("5c95");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("cb65d9a2",r,e)}},"2e53":function(e,t,i){"use strict";i.r(t);var r=i("1097");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},3136:function(e,t,i){"use strict";i.r(t);var r=i("53b4");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},"3e3c":function(e,t,i){"use strict";i.r(t);var r=i("16df");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},"439c":function(e,t,i){"use strict";i.r(t);var r=i("16e59");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},4994:function(e,t,i){"use strict";i.r(t);var r=i("5a58");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},"53b4":function(e,t,i){var r=i("aeb2");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("3160b183",r,e)}},"5a58":function(e,t,i){var r=i("ead2");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var s=i("35d6").default;e.exports.__inject__=function(e){s("0810035e",r,e)}},"5c95":function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".upload[data-v-a28e80a8]{width:100%}.uploadWrapper[data-v-a28e80a8]{position:relative}.uploadWrapper .inputWrapper[data-v-a28e80a8],.uploadWrapper .inputWrapper input[data-v-a28e80a8]{position:absolute;left:0;right:0;top:0;bottom:0;opacity:0}",""]),e.exports=t},"5ce7":function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".wrapper[data-v-4b882d9f]{position:relative}.fas[data-v-4b882d9f]{position:absolute;right:-8px;top:-8px}.preview-picture[data-v-4b882d9f]{width:50px;height:50px;border-radius:10px}",""]),e.exports=t},aeb2:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,"#chatInput[data-v-e8b463ac]{padding-bottom:.5em}[data-v-e8b463ac] #modal.minimized .modal-wrapper{left:0}[data-v-e8b463ac] .previewWrapper{padding-left:.5em!important;padding-right:.5em!important}.inputWrapper[data-v-e8b463ac]{display:flex}.inputWrapper .left[data-v-e8b463ac]{width:35px;display:flex;justify-content:flex-end;align-items:center;text-align:center}.inputWrapper .left .iconbutton[data-v-e8b463ac]{display:flex;align-items:center;justify-content:center;height:35px;width:35px;-webkit-tap-highlight-color:transparent}.inputWrapper .extended[data-v-e8b463ac]{width:70px;margin-left:7px}.inputWrapper .leftdummy[data-v-e8b463ac]{width:.5em}.inputWrapper>div[data-v-e8b463ac]{transition:.3s}.inputWrapper .center[data-v-e8b463ac]{max-height:110px;max-width:100%;display:flex;justify-content:space-between;align-items:center;flex-grow:1;border:1px solid transparent;border-radius:30px;background:rgb(var(--background-secondary-theme))}.inputWrapper input[data-v-e8b463ac]{border:1px solid rgb(var(--neutral-grad-0));background:rgba(var(--background-main),.5);border-radius:30px;width:100%;padding:.5em 1em}.notready[data-v-e8b463ac],.waitjoined[data-v-e8b463ac]{padding:.5em 0;text-align:center}.waitjoined span[data-v-e8b463ac]{font-size:.8em}.greetings[data-v-e8b463ac]{padding:.5em 0}.greetings[data-v-e8b463ac],[data-v-e8b463ac] .iconWrapper{text-align:center}.menu-item[data-v-e8b463ac]{padding:.5em;background:rgb(var(--background-total-theme));line-height:44px;border-radius:5px;display:flex}.menu-item .title[data-v-e8b463ac]{flex-grow:2;padding-right:44px;text-align:center}.menu-item .iconWrapper[data-v-e8b463ac]{width:44px}.tipusers[data-v-e8b463ac]{position:absolute;max-height:300px;border-radius:.5em;border:1px solid rgba(var(--neutral-grad-0),.9);overflow-y:overlay;background-color:rgba(var(--background-total-theme),.95);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);padding:.25em 0;bottom:100%;margin-bottom:.5em;left:.25em;right:.25em}.tipusers .previewWrapperExt[data-v-e8b463ac]{border-radius:.75em;margin-left:.25em;margin-right:.25em;padding-top:.25em;padding-bottom:.25em}.tipusers .previewWrapperExt[data-v-e8b463ac] .previewWrapper{padding-left:.25em!important;padding-right:.25em!important}.tipusers .previewWrapperExt.selected[data-v-e8b463ac]{background:rgb(var(--background-main))}.disabled[data-v-e8b463ac]{display:flex;justify-content:center;align-items:center;width:35px;height:35px;color:rgb(var(--neutral-grad-3))}.disabled i[data-v-e8b463ac]{padding-top:1px}",""]),e.exports=t},cff80:function(e,t,i){"use strict";i.r(t);var r=i("0a92");for(var s in r)["default"].indexOf(s)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(s)},ead2:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,'.recordButton_wrapper[data-v-34d15f18]{position:relative}.recordButton_holder[data-v-34d15f18]{visibility:hidden;position:absolute;display:flex;justify-content:center;align-items:center;height:16px;width:16px;background:#789;border-radius:50%;bottom:98px;transition:.1s;right:9px}.recordButton_holder .icon[data-v-34d15f18]{color:#fff;font-size:7px}.recordButton_holder.active[data-v-34d15f18]{visibility:visible}.recordButton_holder.hold[data-v-34d15f18]{background:#789;visibility:visible;bottom:38px}.recordButton_holder.hold .icon[data-v-34d15f18]{color:#fff}.recordButton_main[data-v-34d15f18]{padding-top:1px;touch-action:none;display:flex;align-items:center;justify-content:center;width:35px;height:35px;line-height:35px!important;background:transparent;border-radius:50%;outline:none;position:relative}.recordButton_main.active[data-v-34d15f18]{background:rgb(var(--color-bg-ac));-webkit-animation:pulse-data-v-34d15f18 1.2s infinite;animation:pulse-data-v-34d15f18 1.2s infinite}.recordButton_main.active .icon[data-v-34d15f18]{color:rgb(var(--text-on-bg-shadow-color))}.recordButton_main.active[data-v-34d15f18]:before{position:absolute;left:-30px;bottom:-30px;right:-30px;top:-30px;content:"";border-radius:50%;border:35px solid rgba(var(--color-bg-ac),.5);-webkit-animation:pulse-data-v-34d15f18 1.2s infinite;animation:pulse-data-v-34d15f18 1.2s infinite}.recordButton_main.disabled .icon[data-v-34d15f18]{color:rgb(var(--neutral-grad-2))}.recordButton_main.outside[data-v-34d15f18],.recordButton_stop[data-v-34d15f18]{background:rgb(var(--color-bad))}.recordButton_stop[data-v-34d15f18]{color:rgb(var(--text-on-bg-shadow-color));font-size:.7em}@-webkit-keyframes pulse-data-v-34d15f18{0%{opacity:1}50%{opacity:.8}to{opacity:1}}@keyframes pulse-data-v-34d15f18{0%{opacity:1}50%{opacity:.8}to{opacity:1}}',""]),e.exports=t},f2bc:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".recordProgress[data-v-3f87c0fa]{display:flex;height:20px;justify-content:flex-start;padding:0 1em;align-items:center;max-width:80%;flex-grow:2}.recordProgress .indicatorWrapper[data-v-3f87c0fa]{min-width:20px;width:20px;margin-right:1em;display:flex;justify-content:center;align-items:center}.recordProgress .indicator[data-v-3f87c0fa]{height:6px;width:6px;background:#ff033e;border-radius:50%}.recordProgress .indicator.recording[data-v-3f87c0fa]{-webkit-animation:pulse-data-v-3f87c0fa 1.2s ease infinite;animation:pulse-data-v-3f87c0fa 1.2s ease infinite}.recordProgress .del[data-v-3f87c0fa]{min-width:20px;cursor:pointer;display:flex;justify-content:center;align-items:center;width:20px;height:20px;margin-right:1em}.recordProgress .del i[data-v-3f87c0fa]{color:red;font-size:13px}.recordProgress .timer[data-v-3f87c0fa]{margin-right:1em}.recordProgress .graph[data-v-3f87c0fa]{margin:0 auto;width:100px;overflow:hidden;border-radius:15px}.cancel[data-v-3f87c0fa],.recordProgress .graph[data-v-3f87c0fa]{display:flex;justify-content:center}.cancel[data-v-3f87c0fa]{position:absolute;left:0;right:0;top:0;bottom:0;background:rgb(var(--background-secondary-theme));opacity:0;text-align:center;align-items:center}.cancel span[data-v-3f87c0fa]{white-space:nowrap;font-size:.9em}@-webkit-keyframes pulse-data-v-3f87c0fa{0%{opacity:1}50%{opacity:.1}to{opacity:1}}@keyframes pulse-data-v-3f87c0fa{0%{opacity:1}50%{opacity:.1}to{opacity:1}}",""]),e.exports=t},f72e:function(e,t,i){var r=i("24fb");t=r(!1),t.push([e.i,".input_component[data-v-b9fd73f0]{width:100%;display:flex;justify-content:center;align-items:center;padding:0 1em;padding-right:0}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji{width:25%;height:40px;cursor:pointer}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji span{cursor:pointer}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji:hover{background:none;box-shadow:none}.input_component[data-v-b9fd73f0] .emoji-mart .emoji-mart-emoji:hover:before{display:none}.input_component .input-wrapper[data-v-b9fd73f0]{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;position:relative;width:100%}.input_component .right[data-v-b9fd73f0]{margin:0 .5em}.input_component .iconbutton .leftdummy[data-v-b9fd73f0]{width:20px}.input_component .iconbutton .rightdummy[data-v-b9fd73f0]{width:35px}.input_component .iconbutton .idummy[data-v-b9fd73f0]{width:100%;height:35px;line-height:35px}.input_component .iconbutton .idummy i[data-v-b9fd73f0]{line-height:35px!important}.input_component .previews[data-v-b9fd73f0]{width:100%;max-width:198px;height:30px;display:flex;align-items:flex-start;padding:2px 0;overflow:hidden}.input_component .previews[data-v-b9fd73f0]:first-child{margin-left:0}.input_component .textarea[data-v-b9fd73f0]{width:100%;display:flex;justify-content:flex-start;align-items:center}.chat-input[data-v-b9fd73f0]{width:100%;max-height:100px;overflow-y:auto;resize:none}.chat-input[data-v-b9fd73f0]::-webkit-scrollbar{width:0!important}.fade-enter-active[data-v-b9fd73f0],.fade-leave-active[data-v-b9fd73f0]{transition:all .2s ease-in}.fade-enter[data-v-b9fd73f0],.fade-leave-to[data-v-b9fd73f0]{opacity:0}",""]),e.exports=t},fe01:function(e,t,i){"use strict";i.r(t);var r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"noswipepnt",attrs:{id:"chatInput"}},[e.ready?i("div",{staticClass:"work"},[e.chat?i("div",{staticClass:"inputWrapper"},[e.tipusers.length?i("div",{staticClass:"tipusers"},e._l(e.tipusers,(function(t,r){return i("div",{key:t.id,staticClass:"previewWrapperExt",class:{selected:e.tipuserindex==r},on:{click:function(i){return e.insertuser(t)}}},[i("preview",{attrs:{contact:t,mode:""}})],1)})),0):e._e(),i("div",{staticClass:"center"},[e.voiceEnable&&(e.isRecording||e.record)?i("record-progress",{attrs:{recordTime:e.recordTime,isRecording:e.isRecording,rmsData:e.recordRmsData,opacity:e.cancelOpacity},on:{onClear:e.clear}}):i("InputField",{ref:"newinput",attrs:{storagekey:"chatinput"+e.chat.roomId,tipusers:e.tipusers},on:{chatMessage:e.sendinput,emptyInput:e.emitInputData,FilledInput:e.HideUploadPic,base64:e.pasteImage,focused:e.focused,tipsearchrequest:e.tipBySearch,browsetip:e.browsetip,selectcurrenttip:e.selectcurrenttip}}),e.upload&&e.chat?i("div",{staticClass:"left",class:{extended:e.voiceEnable}},[e.isRecording||e.record?e._e():i("div",{staticClass:"iconbutton"},[i("dropdownMenu",{ref:"dropdownMenu",attrs:{menuItems:e.menuItems,rowObject:{},icon:"fas fa-plus"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.item.upload?i("upload",{attrs:{onlyimage:t.item.upload.onlyimage,multiple:t.item.upload.multiple,extensions:t.item.upload.extensions,images:t.item.upload.images},on:{start:function(i){return e.uploadStart(t.item,i)},uploaded:function(i){return e.uploadUploaded(t.item,i)},uploadedAll:function(i){return e.uploadUploadedAll(t.item,i)},error:function(i){return e.uploadError(t.item,i)}},scopedSlots:e._u([{key:"content",fn:function(){return[i("div",{staticClass:"menu-item"},[i("div",{staticClass:"iconWrapper"},[t.item.icon?i("i",{class:t.item.icon}):e._e()]),i("div",{staticClass:"title"},[e._v(" "+e._s(t.item.title)+" ")])])]},proxy:!0},{key:"dropzone",fn:function(){},proxy:!0}],null,!0)}):i("div",{staticClass:"menu-item",on:{click:function(i){return e.menuItemClick(t.item)}}},[i("div",{staticClass:"iconWrapper"},[t.item.icon?i("i",{class:t.item.icon}):e._e()]),i("div",{staticClass:"title"},[e._v(" "+e._s(t.item.title)+" ")])])]}}],null,!1,3187246467)})],1),e.voiceEnable?[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isRecording||!e.record,expression:"(isRecording || !record)"}],staticClass:"iconbutton"},[i("recordVoice",{attrs:{prepareRecording:!!e.prepareRecording,isRecording:e.isRecording,disabled:e.microphoneDisabled},on:{onRecordingStart:e.initRecording,onRecordingStop:e.stopRecording,onClear:e.clear,canceling:e.setOpacity}})],1)]:e._e(),!e.isRecording&&e.record?i("div",{staticClass:"iconbutton",on:{click:function(t){e.sendVoiceMessage()}}},[e._m(0)]):e._e()],2):e._e()],1)]):e._e()]):i("div",{staticClass:"notready"},[i("linepreloader")],1)])},s=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("i",{staticClass:"icon fas fa-paper-plane"})])}],a=i("1da1"),n=(i("907a"),i("3139")),o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"input_component"},[i("div",{staticClass:"input-wrapper"},[i("div",{staticClass:"textarea"},[i("textarea",{ref:"textarea",staticClass:"chat-input",attrs:{id:"textInput",type:"text",row:"1",spellcheck:"true",autocorrect:"on",placeholder:e.$t("caption.sendmessage")},domProps:{value:e.text},on:{focus:e.focused,blur:e.blured,keydown:e.keydown,input:e.textchange,keyup:e.keyup,click:e.keyup,paste:e.paste_image}}),!e.mobile&&e.emojiIndex?i("transition",{attrs:{name:"fade",mode:"out-in"}},[i("picker",{directives:[{name:"show",rawName:"v-show",value:e.display_emoji,expression:"display_emoji"},{name:"click-outside",rawName:"v-click-outside",value:e.close_emoji_picker,expression:"close_emoji_picker"}],style:{width:"325px",position:"absolute",bottom:"32px",right:"-60px",fontSize:"0.8em",fontFamily:"Segoe UI"},attrs:{data:e.emojiIndex,exclude:e.exclude,showPreview:!1,showSearch:!1,native:!0,set:"emojione"},on:{select:e.insert_emoji}})],1):e._e()],1)]),e.mobile?e._e():i("div",{staticClass:"iconbutton emojipicker",on:{click:function(t){return e.toggle_emoji_picker()}}},[i("div",{staticClass:"leftdummy"},[i("div",{staticClass:"idummy"},[e.display_emoji?i("i",{staticClass:"fas fa-times"}):i("i",{staticClass:"far fa-smile"})])])]),e.send?i("div",{staticClass:"iconbutton",on:{click:function(t){return e.send_text(t)}}},[e._m(0)]):e._e()])},c=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"rightdummy"},[i("div",{staticClass:"idummy"},[i("i",{staticClass:"far fa-paper-plane"})])])}],d=i("5059"),l=(i("01ce"),i("41fb")),h=i("c28b"),u=i.n(h),p=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.is_opened?i("div",{staticClass:"wrapper"},[i("img",{staticClass:"preview-picture",attrs:{src:e.base64,alt:"picture preview"}}),i("i",{staticClass:"fas fa-times fa-sm",on:{click:e.hide}})]):e._e()},m=[],f={name:"picturePreview",props:["base64"],data(){return{is_opened:!0}},methods:{hide(){this.is_opened=!1}}},v=f,g=i("2877");function x(e){var t=i("cff80");t.__inject__&&t.__inject__(e)}var b=Object(g["a"])(v,p,m,!1,x,"4b882d9f",null,!0),y=b.exports;let w=new d["a"];var $={name:"InputField",components:{Picker:l["Picker"],picturePreview:y},directives:{clickOutside:u.a.directive},watch:{text:{immediately:!0,handler:function(e,t){e?(this.send=!0,this.$emit("FilledInput")):(this.send=!1,this.$emit("emptyInput")),this.textarea_resize()}}},data(){return{send:!1,ready:!1,text:"",exclude:["flags"],display_emoji:!1,content_height:26,pasted_data:[],block:!1,upload:{multiple:!0,extensions:["image/jpg","image/jpeg","image/png"],images:{resize:{type:"fit"}}},hidden_previews:null,emojiIndex:null}},computed:{mobile:function(){return!this.$store.state.pocketnet&&this.$store.state.mobile}},methods:{prepareemoji:function(){if(!this.mobile)if(window.emojiIndex)this.emojiIndex=window.emojiIndex;else{var e=i("364d");window.emojiIndex=new l["EmojiIndex"](e),this.emojiIndex=window.emojiIndex}},setText:function(e){this.text=e,this.savetextinstorage(),setTimeout(()=>{this.textarea_resize(),this.focus()})},focused:function(){this.$emit("focused")},textchange:function(e){this.text=e.target.value||""},savetextinstorage:function(){this.storagekey&&(localStorage[this.storagekey]=this.text||"")},send_empty_array(){this.$emit("userSearched",[])},focus(){this.$refs["textarea"].focus()},blur(){this.$refs["textarea"].blur()},blurifempty(){this.text||this.blur()},close_emoji_picker(e){"i"!==e.target.localName&&"matrix-element"!==e.target.localName&&(this.display_emoji=!1)},textarea_resize(){this.text?(this.$refs.textarea.style.height="1px",this.$refs.textarea.style.height=this.$refs.textarea.scrollHeight+"px",this.display_emoji=!1):this.textarea_resize_reset()},textarea_resize_reset(){this.$refs.textarea.style.height=this.content_height+"px"},toggle_emoji_picker(){this.display_emoji=!this.display_emoji},send_text(e){this.text&&"\n"!==this.text&&(this.display_emoji=!1,this.$emit("chatMessage",this.text),this.$emit("emptyInput"),this.send=!1,this.text=""),this.savetextinstorage()},insert_emoji(e){this.text+=e.native,this.savetextinstorage()},paste_image(e){this.get_base64(e)},get_base64(e){if(this.pasted_data=e.clipboardData.items,this.pasted_data.length)for(let r in this.pasted_data){let e=this.pasted_data[r],s=this.upload.extensions.includes(e.type);if(s){var t=e.getAsFile(),i=new FileReader;i.onload=t=>{this.$dialog.confirm("Do you really want to send attachment?",{okText:"Yes",cancelText:"No, cancel"}).then(i=>{var r=t.target.result;this.resize_image(r,e.type)})},i.readAsDataURL(t)}}},resize_image(e,t){return w.autorotation(null,e).then(e=>{let i=this.upload.images.resize.type||"def";return w.resize[i](e,1024,1024,t,.9).then(e=>{this.$emit("base64",e)}).catch(e=>console.error("Failed to resize image",e))}).catch(e=>console.error("Failed to resize image",e))},getsearchposition(e){if(!e.start||!this.text.length)return null;var t={start:e.start,middle:0,end:e.end},i=e.start,r=!1,s=!1,a=/[a-zA-Z0-9]{1}/;t.middle=i;do{var n=this.text[i];"@"==n?e.start==i||i>0&&a.test(this.text[i-1])?s=!0:r=!0:a.test(n)?t.start=i:s=!0,i--}while(i>=0&&i<=e.start&&!r&&!s);if(r){s=!1,i=e.end;do{!this.text[i]||a.test(this.text[i])?t.end=i:s=!0,i++}while(i<=this.text.length&&!s)}else t=null;return t},getsearch(e){var t=this.getsearchposition(e);return t?this.text.substring(t.start,t.middle):null},keydown(e){return(40===e.keyCode||38===e.keyCode)&&this.tipusers&&this.tipusers.length?(this.$emit("browsetip",40===e.keyCode),e.preventDefault(),!1):(39===e.keyCode||13===e.keyCode)&&this.tipusers&&this.tipusers.length?(this.$emit("selectcurrenttip"),e.preventDefault(),!1):13===e.keyCode?(this.mobile?this.text=this.text+"\n":this.send_text(e),e.preventDefault(),!1):void 0},keyup(e){if(this.block)return e.preventDefault(),!1;var t=n["a"].getCaretPosition(this.$refs["textarea"]),i=this.getsearch(t);this.$emit("tipsearchrequest",i),this.savetextinstorage()},blured(){setTimeout(()=>{this.$emit("tipsearchrequest",null)},300)},inserttip(e){this.$emit("tipsearchrequest",null),this.block=!0,this.$refs["textarea"];var t=this.getsearchposition(n["a"].getCaretPosition(this.$refs["textarea"]));this.text=this.text.substring(0,t.start)+e+this.text.substring(t.end+1),this.text[t.end+1]||(this.text=this.text+" ")," "==!this.text[t.end+1]&&t.end++,n["a"].setCaretPosition(this.$refs["textarea"],t.end+1,t.end+1),setTimeout(()=>{this.block=!1},350)}},props:{storagekey:String,tipusers:Array},creared(){},mounted(){this.mobile||this.focus(),this.prepareemoji(),this.$refs.textarea.style.height="26px",this.storagekey&&localStorage[this.storagekey]&&(this.text=localStorage[this.storagekey])}},k=$;function C(e){var t=i("3e3c");t.__inject__&&t.__inject__(e)}var R=Object(g["a"])(k,o,c,!1,C,"b9fd73f0",null,!0),j=R.exports,E=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"recordButton_wrapper"},[i("div",{ref:"holder",staticClass:"recordButton_holder",class:{hold:e.isHold}},[i("i",{staticClass:"icon fas",class:e.isHold?"fa-lock":"fa-lock-open"})]),e.isHold?e._e():i("div",{ref:"toggle",staticClass:"recordButton_micro recordButton_main",class:{active:e.isRecording,disabled:e.disabled},on:{mousedown:e.mousedown,mouseup:e.mouseup,touchstart:e.handleTouchStart,touchend:e.handleTouchEnd,touchcancel:e.handleTouchEnd}},[i("i",{staticClass:"icon fas fa-microphone"})]),e.isHold?i("div",{ref:"stop",staticClass:"recordButton_stop recordButton_main",on:{click:e.recordEnd}},[i("i",{staticClass:"icon fas fa-stop"})]):e._e()])},I=[],P=i("2f62"),M={name:"recordVoice",props:{isRecording:{type:Boolean,required:!0},prepareRecording:{type:Boolean},disabled:Boolean},data(){return{start:0,isHold:!1,direction:null}},computed:{...Object(P["c"])({mobile:e=>e.mobile})},mounted(){},beforeDestroy(){document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.isRecording&&this.$emit("onRecordingStop",{cancel:!0})},methods:{mouseup:function(e){this.mobile||this.handleTouchEnd(e)},mousedown:function(e){this.mobile||this.handleTouchStart(e)},handleTouchStart(e){if(this.isRecording){if(this.isHold)return}else this.$emit("onRecordingStart");this.start={Y:e.changedTouches?e.changedTouches[0].pageY:e.pageY,X:e.changedTouches?e.changedTouches[0].pageX:e.pageX},this.mobile?document.addEventListener("touchmove",this.handleMove):document.addEventListener("mousemove",this.handleMove)},handleTouchEnd(e){this.isHold||((this.isRecording||this.prepareRecording)&&this.$emit("onRecordingStop",{sendnow:!0}),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.clearStyle())},clearStyle(){this.$refs.toggle&&(this.$refs.toggle.style.transform="translate(0,0)",this.$refs.toggle.classList.remove("outside")),this.$refs.holder&&this.$refs.holder.classList.remove("active")},handleMove(e){var t;if(!this.isRecording)return;let i=this.start.Y-e.pageY,r=this.start.X-e.pageX;null!==e&&void 0!==e&&null!==(t=e.changedTouches)&&void 0!==t&&t.length&&(i=this.start.Y-e.changedTouches[0].pageY,r=this.start.X-e.changedTouches[0].pageX),this.direction=i>5&&r<5?"Y":"X",i>5&&"Y"===this.direction?(this.$refs.holder.classList.contains("active")||this.$refs.holder.classList.add("active"),this.$refs.toggle.style.transform=`translate(0,-${i}px)`,i>70&&(this.$refs.toggle.style.transform="translate(0,0)",document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.isHold=!0)):r>5&&"X"===this.direction?(this.$refs.toggle.style.transform=`translate(-${r}px, 0)`,this.$refs.holder.classList.contains("outside")||this.$refs.toggle.classList.add("outside"),this.$emit("canceling",(r-5)/130),r>130&&(this.$refs.toggle.style.transform="translate(0,0)",document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("touchmove",this.handleMove),this.$emit("onRecordingStop",{cancel:!0}),this.$emit("onClear"))):this.clearStyle()},recordEnd(e){if(this.clearStyle(),this.isRecording&&this.isHold)return this.$emit("onRecordingStop",{}),void(this.isHold=!1)}}},T=M;function z(e){var t=i("4994");t.__inject__&&t.__inject__(e)}var S=Object(g["a"])(T,E,I,!1,z,"34d15f18",null,!0),D=S.exports,O=i("f978"),A=i("92a6"),B=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"recordProgress"},[e.isRecording?i("div",{staticClass:"indicatorWrapper"},[i("div",{staticClass:"indicator",class:{recording:e.isRecording}})]):i("div",{staticClass:"del",on:{click:e.clear}},[i("i",{staticClass:"fas fa-trash"})]),i("div",{staticClass:"timer"},[e._v(e._s(e.timer))]),i("div",{ref:"graph",staticClass:"graph"},[i("canvas",{ref:"canvas",attrs:{id:"canvas",width:e.width,height:"20"}})]),i("div",{directives:[{name:"show",rawName:"v-show",value:e.isRecording&&e.opacity,expression:"isRecording && opacity"}],ref:"cancel",staticClass:"cancel"},[i("span",[e._v("Slide left to cancel")])])])},L=[],W={name:"recordProgress",props:{recordTime:{type:Number,required:!0},rmsData:{type:Array,required:!0},isRecording:{type:Boolean},opacity:{}},data(){return{width:0}},computed:{timer(){let e=Math.floor(this.recordTime/6e4),t=Math.floor(this.recordTime/1e3)%60;return`${e?e+":":"0:"}${t<10?"0"+t:t}`},rmsDataLast(){return _.last(this.rmsData,25)}},watch:{rmsData:_.throttle((function(){this.draw()}),30),opacity:function(){this.$refs.cancel.style.opacity=this.opacity}},mounted(){this.$refs.cancel.style.opacity=0;let e=this.$refs.graph.offsetWidth;this.width=e-e%100,window.addEventListener("resize",this.resize)},beforeDestroy(){window.removeEventListener("resize",this.resize)},methods:{resize(){let e=null;var t=()=>{e||(e=setTimeout(()=>{e=null;let t=this.$refs.graph.offsetWidth;this.width=t-t%100},50))};t()},draw(){if(!this.$refs.canvas)return;const e=this.$refs.canvas.getContext("2d");let t=50,i=2;var r=this.rmsDataLast.length,s=Math.max(Math.floor(r/t),1);e.clearRect(0,0,this.width,20);for(let a=0;a[]},images:{type:Object,default:()=>{}}},data:function(){return{loading:!1}},computed:{maxSize(){return 1024*this.maxsize*1024}},created:()=>{},methods:{read:function(e){var t=new FileReader;return new Promise((i,r)=>{t.onloadend=function(t){i({base64:t.target.result,file:e})},t.readAsDataURL(e)})},upload:function(e){var t,i;e.stopPropagation(),e.preventDefault();var r=(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)||(null===(i=e.target)||void 0===i?void 0:i.files)||e.files||[],s={};this.loading=!0,this.$emit("start",r);var a=this;Y(_.toArray(r),(e,t)=>{var i=this.check(e);if(i)return a.$emit("error",{error:i,file:e,text:this.errorText(i,e)}),void t(new Error(i));this.read(e).then(e=>(s[e.file.name]=e,this.handle(e))).then(e=>{a.$emit("uploaded",e),t()}).catch(r=>{a.$emit("error",{error:r,file:e,text:this.errorText(r,e)}),t(new Error(i))})},e=>{this.loading=!1,a.$emit("uploadedAll",s)})},errorText:function(e,t){return"filesize"===e?"File Size Error: ("+t.name+"). The File can't be more than "+this.maxsize+" mbytes":"fileext"===e?"File Extension Error:"+t.name:void 0},check:function(e){return this.checkSize(e)?this.checkExtension(e)?void 0:"fileext":"filesize"},checkSize:function(e){return e.size<=this.maxSize},getExtension:function(e){var t=e.name.split("."),i=t[t.length-1].toLowerCase();return i},checkExtension:function(e){return!this.extensions.length||-1!=_.indexOf(this.extensions,this.getExtension(e))},handle:function(e){return"image/jpeg"===e.file.type||"image/png"===e.file.type||"image/webp"===e.file.type?this.handleImages(e):Promise.resolve(e)},sendAnyFile:function(e){this.$emit("anyFile",e)},resizeIfNeed:function(e,t){if(this.images.resize){var i=this.images.resize.type||"def";return X.resize[i](e,this.images.resize.width||1024,this.images.resize.height||1024,t,this.images.resize.quality||.85).then(e=>Promise.resolve(e)).catch(e=>Promise.reject(e))}return Promise.resolve(e)},handleImages:function(e){return X.autorotation(e.file,e.base64).then(t=>(e.base64=t,Promise.resolve(e))).then(e=>this.resizeIfNeed(e.base64,e.file.type).then(t=>(e.base64=t,Promise.resolve(e))))}}},G=K;function Z(e){var t=i("439c");t.__inject__&&t.__inject__(e)}var J=Object(g["a"])(G,V,q,!1,Z,"a28e80a8",null,!0),Q=J.exports,ee=i("0bb9"),te={name:"chatInput",props:{chat:Object,u:String,relationEvent:Object},components:{InputField:j,contacts:O["default"],preview:A["a"],recordProgress:H,recordVoice:D,upload:Q},data:function(){return{upload:!0,test:[],loading:!1,text:"",file:{},fileInfo:{},ready:!1,creating:!1,userId:"",showuserselect:null,anyUrlMeta:String,joinedMembers:[],tipvalue:null,tipuserindex:0,record:null,recordRmsData:[],isRecording:!1,mediaRecorder:null,audioContext:null,audioAnalyser:null,recordTime:0,interval:null,cancelOpacity:0,microphoneDisabled:!1,prepareRecording:!1,cancelledCordovaMediaRecorder:!1}},watch:{usersForKeysHash:{handler:function(){}},tipusers:function(){this.tipusers.length?this.tipuserindex>this.tipusers.length-1&&(this.tipuserindex=this.tipusers.length-1):this.tipuserindex=0}},beforeDestroy(){this.audioContext&&this.audioContext.close()},computed:{voiceEnable(){return this.$store.state.voiceMessagesEnabled},connect:function(){return this.$store.state.contact},pkoindisabled:function(){return this.$store.state.pkoindisabled},menuItems:function(){var e=[];return this.relationEvent||(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.mobile.supportimagegallery()?e.push({click:"cameraHandlerCustom",title:this.$i18n.t("button.takePhotoOrVideo"),icon:"fas fa-camera"}):e.push({click:"cameraHandler",title:this.$i18n.t("button.takePhotoOrVideo"),icon:"fas fa-camera",upload:{multiple:!0,extensions:["jpg","jpeg","png","webp"],maxsize:100,images:{resize:{type:"fit"}}}}),e.push({click:"fileHandler",title:this.$i18n.t("button.sendFile"),icon:"fas fa-sticky-note",upload:{multiple:!0,extensions:[],maxsize:25,images:{resize:{type:"fit"}}}})),this.transaction&&!this.pkoindisabled&&e.unshift({click:"sendtransactionWrapper",title:this.$i18n.t("button.sendCoins"),icon:"fas fa-wallet"}),e},...Object(P["c"])(["chats"]),userlist:function(){return this.chat?this.core.mtrx.chatUsersInfo(this.chat.roomId,"anotherChatUsers"):[]},transaction:function(){return n["a"].deep(window,"POCKETNETINSTANCE.platform.ui.wallet.send")},uusers:function(){return this.u?_.map(this.u.split(","),e=>e):[]},ausers:function(){return this.u?_.map(this.u.split(","),e=>this.core.user.matrixId(e)):[]},stateChat:function(){var e=this.$route.query.id;return this.$store.state.chatsMap[e]},invited:function(){return this.chat?_.map(_.filter(this.chat.currentState.getMembers(),(function(e,t){return"invite"===e.membership})),(function(e){return e.userId})):this.u?this.ausers:[]},joined:function(){if(!this.chat)return[];this.chat.roomId;let e=[];return this.chat.currentState.getMembers().forEach((function(t){"join"===t.membership&&e.push(t.userId)})),e},tipusers:function(){if(null===this.tipvalue)return[];if(""===this.tipvalue)return this.userlist;var e=this.tipvalue.toLowerCase(),t=_.filter(this.userlist,(function(t){return 0==t.name.toLowerCase().indexOf(e)&&t.name.toLowerCase()!=e}));return t},maintipuser:function(){return this.tipusers.length?this.tipusers[this.tipuserindex||0]:null}},created(){},mounted(){this.ready=!0,!this.chat&&this.core.mtrx.client&&this.newchat().catch(e=>Promise.resolve())},methods:{wait:function(){return this.$f.pretry(()=>this.core.mtrx.client&&this.core.mtrx.access)},browsetip:function(e){e?this.tipuserindex++:this.tipuserindex--,this.tipuserindex>this.tipusers.length-1&&(this.tipuserindex=0),this.tipuserindex<0&&(this.tipuserindex=this.tipusers.length-1)},selectcurrenttip:function(){this.insertuser(this.tipusers[this.tipuserindex||0])},insertuser:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=e.name||"";this.$refs["newinput"].inserttip(t)},tipBySearch:function(e){this.tipvalue=e},showuserselected:function(e,t){this[t](e)},resizeImage:function(e){var t=e.split(";")[0].split("/")[1],i=new d["a"];return i.resize["fit"](e,1024,1024,t,.95).then(e=>Promise.resolve(e)).catch(e=>Promise.reject(e))},cameraHandlerCustom:function(){var e=[];this.$refs.dropdownMenu.hidePopup(),window.POCKETNETINSTANCE.platform.ui.uploadImage({multiple:!0,action:(t,i)=>{let{base64:r}=t;return this.resizeImage(r).then(t=>n["a"].Base64.toFile(t).then(r=>{var s={base64:t,file:r};e.push(s),this.uploadUploaded(null,s),i()})).catch(e=>{console.error(e),i()})},onSuccess:e=>{this.uploadUploadedAll()}})},sendtransactionWrapper:function(){this.menuIsVisible=!1;var e=_.filter(_.map(this.joined,e=>this.$f.deep(this,"$store.state.users."+this.$f.getmatrixid(e))||null),e=>{var t;return e&&e.source&&e.id!=(null===(t=this.core.user.userinfo)||void 0===t?void 0:t.id)});if(!e.length)return"users.length";e.length>1?this.core.store.commit("setmodal",{caption:this.$i18n.t("caption.sendTransactionTo"),type:"showuserselect",data:{users:e,action:"sendtransaction",userselected:e=>{this.showuserselected(e,"sendtransaction")}}}):this.sendtransaction(e[0]),this.$refs.dropdownMenu.hidePopup()},sendtransaction:function(e){var t=this.transaction;t({roomid:this.chat.roomId,address:e.source.address})},emitInputData:function(){this.$emit("emptyInput"),this.upload=!0},HideUploadPic(){this.upload=!1},emitUrl:function(e){this.$emit("setMetaUrl",e)},newchat(){if(this.u){this.$store.state.globalpreloader=!0;var e=null,t=null,i="";return this.creating=!0,this.core.user.usersInfo(this.uusers).then(t=>{if(1==this.uusers.length){var r=t[0];if(!r||!r.keys||r.keys.length<12)return this.$emit("cantchatcrypto"),Promise.reject("ny2")}if(this.core.user.userinfo.keys.length<12)return this.$emit("cantchatcrypto"),Promise.reject("ny2");i=this.core.mtrx.kit.tetatetid(t[0],this.core.user.userinfo),e=this.core.user.matrixId(t[0].id),this.core.user.matrixId(this.core.user.userinfo.id);var s=[{type:"m.set.encrypted",state_key:"",content:{encrypted:!0}}];return this.core.mtrx.client.createRoom({room_alias_name:i,visibility:"private",invite:[e],name:"#"+i,initial_state:s})}).then(i=>{t=i,this.$store.state.globalpreloader=!1;let r=this.core.mtrx.client.getRoom(i.room_id),s=r.currentState.getStateEvents("m.room.power_levels");return this.core.mtrx.client.setPowerLevel(t.room_id,e,100,s[0]).catch(e=>{})}).then(e=>(this.creating=!1,this.connect&&this.connect==i&&this.greetings(),this.$store.commit("CONTACT",!1),Promise.resolve())).catch(e=>(this.creating=!1,this.$store.state.globalpreloader=!1,e&&"M_ROOM_IN_USE"==e.errcode?this.core.mtrx.client.joinRoom("#"+i+":"+this.core.mtrx.baseUrl.replace("https://","")).then(()=>{}).catch(e=>{}):Promise.reject(e)))}return Promise.reject("u")},maySendMessage(){return this.chat&&this.chat.maySendMessage()},greetings(){this.send("👋").then(e=>Promise.resolve(e))},sendinput(e){this.send(e).then(e=>Promise.resolve(e))},textCutLimit:function(e,t){return e=e.trim(),e.length<=t?e:(e=e.slice(0,t),e.trim()+"...")},replaceMentions(e){return _.each(this.userlist,(function(t){e=e.replace(new RegExp("@"+t.name,"g"),"@"+t.id+":"+t.name)})),e},send(e){return this.chat||this.newchat().catch(e=>{}),this.$emit("sending"),this.relationEvent||this.focus(),this.$f.pretry(()=>this.chat&&!this.creating).then(t=>(this.$emit("sent"),e=this.replaceMentions(e),this.relationEvent&&"m.replace"==this.relationEvent.type&&this.relationEvent.event?this.core.mtrx.textEvent(this.chat,e).then(e=>{e["m.relates_to"]={rel_type:"m.replace",event_id:this.core.mtrx.clearEventId(this.relationEvent.event)||n["a"].makeid()};var t=e;return this.relationEvent.event.event.content.body=e.body,this.relationEvent.event.event.content.block=e.block,this.relationEvent.event.event.content.msgtype=e.msgtype,delete this.relationEvent.event.event.decryptKey,delete this.relationEvent.event.event.decrypted,this.core.mtrx.client.sendEvent(this.chat.roomId,"m.room.message",t)}).then(e=>(this.core.store.dispatch("FETCH_EVENTS"),this.$emit("clearRelationEvent"),this.$emit("force"),Promise.resolve())).catch(e=>(console.error(e),Promise.reject(e))):this.core.mtrx.sendtext(this.chat,e,{relation:this.relationEvent}))).catch(e=>{this.$emit("sentMessageError",{error:e})})},pasteImage(e){this.sendImage({base64:e})},sendImage:function(e){let{base64:t,file:i}=e;var r=n["a"].makeid(),s={type:"image",id:r,base64:t};this.$emit("sendingData",s),this.$f.pretry(()=>this.chat).then(()=>s.aborted?Promise.reject("aborted"):this.core.mtrx.sendImage(this.chat,t,null,s,{relation:this.relationEvent})).then(e=>(this.$emit("sentData",{id:r}),Promise.resolve())).catch(e=>(this.$emit("sentError",{id:r,error:e}),Promise.resolve()))},canencryptfilesize:function(e){var t=10485760;return this.chat.pcrypto.canBeEncrypt()&&e.size>t?this.$dialog.confirm("Files larger than 10 megabytes are not encrypted. Do you want to send the file unencrypted?",{okText:"Yes",cancelText:"No, cancel"}).then(e=>Promise.resolve(!0)).catch(e=>Promise.reject("cancel")):Promise.resolve(!1)},sendFile:function(e){let{file:t}=e;var i=n["a"].makeid(),r={type:"file",id:i,info:{name:t.name,size:t.size}};this.$emit("sendingData",r),this.$f.pretry(()=>this.chat).then(()=>this.canencryptfilesize(t)).then(e=>this.core.mtrx.sendFile(this.chat,t,r,{relation:this.relationEvent},e)).then(()=>(this.$emit("sentData",{id:i}),Promise.resolve())).catch(e=>{console.error(e),this.$emit("sentError",{id:i,error:e})})},focus:function(){this.$refs["newinput"]&&this.$refs["newinput"].focus()},focused:function(){this.$emit("focused")},blur:function(){this.$refs["newinput"]&&this.$refs["newinput"].blur()},blurifempty:function(){this.$refs["newinput"]&&this.$refs["newinput"].blurifempty()},change:function(){},setText:function(e){this.text=e,this.$refs["newinput"]&&this.$refs["newinput"].setText(e)},keyup:function(e){var t=e.target.value;""!==t?(this.$emit("inputClean",!0),this.text=t,this.anyUrlMeta=n["a"].getUrl(this.text),void 0!==this.anyUrlMeta?this.$emit("setMetaUrl",this.anyUrlMeta):this.$emit("inputClean",!1),this.chat&&this.core.mtrx.client.sendTyping(this.chat.roomId,!0,100)):this.$emit("inputClean",!1)},menuItemClick(e,t){this[e.click](t)},menuItemLoadedHandler:function(e){return this.menuIsVisible=e,this.menuIsVisible},uploadStart(e,t){},uploadError(e,t){this.$store.commit("icon",{icon:"error",message:t.text})},getImg(){return this.imgs=!0},uploadSizeError(e){e||this.$refs.dropdownMenu.hidePopup()},uploadUploaded(e,t){const i=["image/gif","image/jpeg","image/png","image/webp"];if(i.includes(t.file.type))return this.sendImage(t);this.sendFile(t)},imageWH(e){const t=new Image;var i={};return new Promise((r,s)=>{t.onload=function(){i.w=this.width,i.h=this.height,r(i)},t.onerror=function(e){s(e)},t.src=e.base64})},uploadUploadedAll(e,t){this.$store.state.loading=!1,this.$refs.dropdownMenu.hidePopup()},catchPermissonsError(e){if("permissions"==e||e.toString&&e.toString().indexOf("Permission")>-1)return this.microphoneDisabled=!0,void(window.cordova?this.$dialog.confirm(this.$i18n.t("micaccesscordova"),{okText:this.$i18n.t("button.ok")}):this.$dialog.confirm(this.$i18n.t("micaccessbrowser"),{okText:this.$i18n.t("button.ok")}));e.toString&&e.toString().indexOf("device not found")>-1?this.$dialog.confirm(this.$i18n.t("micdevicenotfound"),{okText:this.$i18n.t("button.ok")}):(this.$dialog.confirm(this.$i18n.t("micaccesscommonproblem"),{okText:this.$i18n.t("button.ok")}),console.error(e))},getFileIosCordova(e){return new Promise((t,i)=>{window.resolveLocalFileSystemURL(e,e=>{if(!e)return i("noentry");e.file(r=>{var s=new FileReader;s.onloadend=function(){var i=new Blob([new Uint8Array(this.result)],{type:r.type});e.remove(),t(i)},s.onerror=t=>{e.remove(),i(t)},s.readAsArrayBuffer(r)})},e=>{i(e)})})},initRecordingCordova(){this.prepareRecording=Object(ee["cancelable"])(this.core.media.permissions({audio:!0}).then(()=>(this.microphoneDisabled=!1,Promise.resolve())).catch(e=>(console.error(e),this.catchPermissonsError(e),Promise.reject(e)))),this.prepareRecording.then(()=>{this.microphoneDisabled=!1;var e="recording.mp3";n["a"].isios()&&(e="cdvfile://localhost/temporary/recording.m4a");var t=0;this.audioContext=this.core.getAudioContext();var i=this.cordovaMediaRecorder=new Media(e,()=>{if(this.recordTime=0,i.release(),this.cancelledCordovaMediaRecorder)this.cancelledCordovaMediaRecorder=!1;else{var t=null;t=this.getFileIosCordova(n["a"].isios()?e:window.cordova.file.externalDataDirectory+e).then(e=>Promise.resolve({data:e})),t.then(e=>(i.duration&&i.duration>0&&(e.duration=i.duration),this.createVoiceMessage(e,!0),Promise.resolve())).catch(e=>{this.clear(),console.error(e)}).finally(()=>{})}},e=>{console.error(e),this.isRecording=!1,this.clear()}),r=[];let s=this.$store.state.currentPlayingVoiceMessage;s&&s.pause(),this.interval=setInterval(()=>{n["a"].isios()?(r.push(1),r.length>50&&(r=_.last(r,50)),this.recordRmsData=_.clone(r)):this.cordovaMediaRecorder.getCurrentAmplitude(e=>{r.push(1e3*e),r.length>50&&(r=_.last(r,50)),this.recordRmsData=_.clone(r)},(function(e){console.log("E",e)})),t+=50,t%1e3===0&&(this.recordTime=t)},50),this.isRecording=!0,this.cancelOpacity=0,this.recordRmsData=[],this.recordTime=0,this.record=null,this.cordovaMediaRecorder.startRecord()}).catch(e=>{console.error(e)}).finally(()=>{this.prepareRecording=null})},initRecording(){if(!(this.prepareRecording||this.isRecording||this.cordovaMediaRecorder)){if(window.cordova)return this.initRecordingCordova();this.prepareRecording=Object(ee["cancelable"])(this.core.initMediaRecorder().then(e=>{if(this.microphoneDisabled=!1,this.prepareRecording)return Promise.resolve(e);e.stream.getTracks().forEach(e=>{e.stop()})}).catch(e=>(this.catchPermissonsError(e),Promise.reject(e)))),this.prepareRecording.then(e=>{this.mediaRecorder=e,this.audioContext=this.core.getAudioContext(),this.audioAnalyser=this.audioContext.createAnalyser();var t=this.audioContext.createMediaStreamSource(this.mediaRecorder.stream);t.connect(this.audioAnalyser),this.startRecording()}).catch(()=>{}).finally(()=>{this.prepareRecording=null})}},startRecording(){let e=this.$store.state.currentPlayingVoiceMessage;e&&e.pause(),this.$store.commit("SET_VOICERECORDING",!0),this.isRecording=!0,this.cancelOpacity=0,this.recordRmsData=[],this.recordTime=0,this.record=null,this.mediaRecorder.start();var t=0,i=[];this.interval=setInterval(()=>{var e=new Uint8Array(this.audioAnalyser.frequencyBinCount);this.audioAnalyser.getByteFrequencyData(e),i.push(this.generateRms(e)),i.length>50&&(i=_.last(i,50)),t+=50,this.recordRmsData=_.clone(i),t%1e3===0&&(this.recordTime=t)},50)},checkaudioForSend:function(e,t){e.duration<1?this.clear():t?this.sendVoiceMessage(e):this.record=e},getduration(e){return new Promise((t,i)=>{n["a"].readFile(e).then(e=>{try{this.audioContext.decodeAudioData(e,e=>{t(e.duration)})}catch(r){i(r)}}).catch(i)})},createVoiceMessage(e,t){var i=()=>{this.checkaudioForSend({file:e.data,id:n["a"].makeid(),duration:e.duration},t)};e.duration?i():this.getduration(e.data).then(t=>{e.duration=t,i()}).catch(e=>{console.error(e),this.clear()})},generateRms(e){return+Math.sqrt(e.reduce((e,t)=>e+t**2)/e.length).toPrecision(4)},stopRecording(e){let{cancel:t,sendnow:i}=e;if(console.log("STOP RECORDING",this.isRecording),this.$store.commit("SET_VOICERECORDING",!1),this.prepareRecording)return this.prepareRecording.cancel(),void(this.prepareRecording=null);this.isRecording=!1,this.interval&&(clearInterval(this.interval),this.interval=null),this.mediaRecorder&&(t||this.mediaRecorder.addEventListener("dataavailable",e=>{this.createVoiceMessage(e,i)}),this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(e=>{e.stop()}),this.mediaRecorder=null),this.cordovaMediaRecorder&&(this.cancelledCordovaMediaRecorder=!!t,this.cordovaMediaRecorder.stopRecord(),this.cordovaMediaRecorder=null)},sendVoiceMessage(e){var t=this;return Object(a["a"])((function*(){e||(e=t.record),e||t.clear(),t.recordRmsData=[];const i=yield t.core.convertAudioToBase64(e.file),r=n["a"].makeid(),s={type:"audio",id:r,base64:i};t.clear(),t.$f.pretry(()=>t.chat).then(()=>t.core.mtrx.sendAudio(t.chat,i,null,s,{relation:t.relationEvent})).catch(e=>(t.$emit("sentError",{id:r,error:e}),Promise.resolve()))}))()},clear(){this.record=null,this.recordRmsData=[],this.recordTime=0,this.interval&&(clearInterval(this.interval),this.interval=null),this.cordovaMediaRecorder&&(this.cordovaMediaRecorder=null),this.mediaRecorder&&(this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(e=>{e.stop()}),this.mediaRecorder=null)},setOpacity(e){this.cancelOpacity=e}}},ie=te;function re(e){var t=i("3136");t.__inject__&&t.__inject__(e)}var se=Object(g["a"])(ie,r,s,!1,re,"e8b463ac",null,!0);t["default"]=se.exports}}]); //# sourceMappingURL=matrix-element.6.min.js.map \ No newline at end of file diff --git a/chat/matrix-element.6.min.js.map b/chat/matrix-element.6.min.js.map index 14c1b5e676..55f484eee8 100644 --- a/chat/matrix-element.6.min.js.map +++ b/chat/matrix-element.6.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?6dbd","webpack:///./src/components/assets/recordProgress/index.scss?7174","webpack:///./src/components/chat/input/InputField/InputField.vue?f020","webpack:///./src/components/assets/upload/index.vue?4a8e","webpack:///./src/components/assets/recordProgress/index.scss?cee1","webpack:///./src/components/chat/input/index.sass?2730","webpack:///./src/components/chat/input/InputField/InputField.vue?fce9","webpack:///./src/components/assets/upload/index.vue?6d1f","webpack:///./src/components/assets/recordVoice/index.scss?ad6e","webpack:///./src/components/chat/input/index.sass?ea34","webpack:///./src/components/assets/recordVoice/index.scss?76f8","webpack:///./src/components/assets/upload/index.vue?fdd5","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?9ee5","webpack:///./src/components/chat/input/index.sass","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?90c5","webpack:///./src/components/assets/recordVoice/index.scss","webpack:///./src/components/assets/recordProgress/index.scss","webpack:///./src/components/chat/input/InputField/InputField.vue?1d64","webpack:///./src/components/chat/input/index.vue?56ea","webpack:///./src/components/chat/input/InputField/InputField.vue?d728","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?0090","webpack:///src/components/chat/input/picturePreview/picturePreview.vue","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?3bda","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue","webpack:///src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/chat/input/InputField/InputField.vue?3335","webpack:///./src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/assets/recordVoice/index.vue?97db","webpack:///./src/components/assets/recordVoice/index.js","webpack:///./src/components/assets/recordVoice","webpack:///./src/components/assets/recordVoice/index.vue","webpack:///./src/components/assets/recordProgress/index.vue?083f","webpack:///./src/components/assets/recordProgress/index.js","webpack:///./src/components/assets/recordProgress","webpack:///./src/components/assets/recordProgress/index.vue","webpack:///./src/components/assets/upload/index.vue?1a6d","webpack:///src/components/assets/upload/index.vue","webpack:///./src/components/assets/upload/index.vue?f5f6","webpack:///./src/components/assets/upload/index.vue","webpack:///./src/components/chat/input/index.js","webpack:///./src/components/chat/input","webpack:///./src/components/chat/input/index.vue"],"names":["content","__esModule","default","module","i","locals","exports","add","__inject__","shadowRoot","___CSS_LOADER_API_IMPORT___","push","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","tipusers","_l","user","key","id","class","selected","tipuserindex","on","$event","insertuser","_e","voiceEnable","isRecording","record","recordTime","recordRmsData","cancelOpacity","clear","ref","chat","roomId","sendinput","emitInputData","HideUploadPic","pasteImage","focused","tipBySearch","browsetip","selectcurrenttip","upload","extended","menuItems","scopedSlots","_u","fn","slotProps","item","onlyimage","multiple","extensions","images","files","uploadStart","data","uploadUploaded","result","uploadUploadedAll","error","uploadError","icon","_v","_s","title","proxy","menuItemClick","directives","name","rawName","value","expression","prepareRecording","microphoneDisabled","initRecording","stopRecording","setOpacity","e","sendVoiceMessage","_m","staticRenderFns","$t","domProps","text","blured","keydown","textchange","keyup","paste_image","mobile","emojiIndex","style","width","position","bottom","right","fontSize","fontFamily","exclude","insert_emoji","toggle_emoji_picker","send_text","base64","hide","props","is_opened","methods","injectStyles","context","style0","component","components","Picker","picturePreview","clickOutside","watch","immediately","handler","send","ready","display_emoji","content_height","pasted_data","block","resize","type","hidden_previews","computed","prepareemoji","window","setText","setTimeout","savetextinstorage","localStorage","send_empty_array","focus","blur","blurifempty","close_emoji_picker","textarea_resize","textarea_resize_reset","get_base64","reader","okText","cancelText","then","dialog","resize_image","catch","getsearchposition","start","middle","end","sposition","br","dg","getsearch","event","inserttip","f","storagekey","creared","mounted","hold","isHold","active","disabled","mousedown","mouseup","handleTouchStart","handleTouchEnd","recordEnd","Boolean","required","direction","mapState","state","beforeDestroy","document","removeEventListener","handleMove","$emit","cancel","console","log","Y","changedTouches","pageY","X","pageX","addEventListener","sendnow","clearStyle","$refs","toggle","transform","classList","remove","holder","deltaY","deltaX","length","contains","timer","opacity","Number","rmsData","Array","minute","Math","floor","sec","rmsDataLast","_","last","throttle","draw","graph","offsetWidth","re","canvas","ctx","getContext","count","l","c","max","clearRect","fillStyle","fillRect","_t","dropzone","each","maxsize","loading","maxSize","created","read","resolve","file","ha","next","err","errorText","check","checkSize","getExtension","checkExtension","handle","sendAnyFile","resizeIfNeed","handleImages","Object","u","String","relationEvent","InputField","contacts","preview","recordProgress","recordVoice","test","fileInfo","creating","userId","showuserselect","anyUrlMeta","joinedMembers","tipvalue","mediaRecorder","audioContext","audioAnalyser","interval","cancelledCordovaMediaRecorder","usersForKeysHash","close","$store","voiceMessagesEnabled","connect","contact","pkoindisabled","POCKETNETINSTANCE","supportimagegallery","click","$i18n","t","transaction","unshift","userlist","core","mtrx","chatUsersInfo","deep","uusers","map","split","ausers","matrixId","stateChat","$route","query","chatsMap","invited","filter","currentState","getMembers","m","v","membership","joined","arr","forEach","toLowerCase","indexOf","maintipuser","client","newchat","Promise","wait","$f","pretry","access","increase","showuserselected","action","resizeImage","ftype","Images","reject","cameraHandlerCustom","dropdownMenu","hidePopup","platform","ui","uploadImage","Base64","toFile","onSuccess","imgs","sendtransactionWrapper","menuIsVisible","users","j","getmatrixid","r","source","userinfo","store","commit","caption","userselected","sendtransaction","api","roomid","address","emitUrl","url","globalpreloader","usersInfo","info","_info","keys","kit","tetatetid","initialstate","encrypted","createRoom","room_alias_name","visibility","invite","initial_state","_chat","m_chat","getRoom","room_id","getStateEvents","setPowerLevel","greetings","errcode","joinRoom","baseUrl","replace","maySendMessage","textCutLimit","limit","trim","slice","replaceMentions","RegExp","textEvent","clearEventId","makeid","editEvent","body","msgtype","decryptKey","decrypted","sendEvent","dispatch","sendtext","relation","sendImage","meta","aborted","canencryptfilesize","s","pcrypto","canBeEncrypt","size","$dialog","confirm","sendFile","notenc","change","evt","target","getUrl","undefined","sendTyping","rowObject","menuItemLoadedHandler","message","getImg","uploadSizeError","validImageTypes","includes","imageWH","img","Image","imgInfo","onload","w","h","height","onerror","src","catchPermissonsError","toString","cordova","getFileIosCordova","path","resolveLocalFileSystemURL","entry","FileReader","onloadend","blob","Blob","Uint8Array","readAsArrayBuffer","initRecordingCordova","cancelable","media","permissions","audio","isios","getAudioContext","cordovaMediaRecorder","Media","release","fu","externalDataDirectory","duration","createVoiceMessage","finally","rmsdata","currentPlaying","currentPlayingVoiceMessage","pause","setInterval","clone","getCurrentAmplitude","amp","startRecord","initMediaRecorder","recorder","stream","getTracks","track","stop","createAnalyser","createMediaStreamSource","startRecording","dataArray","frequencyBinCount","getByteFrequencyData","generateRms","checkaudioForSend","getduration","readFile","arraybuffer","decodeAudioData","buffer","frequencies","sqrt","reduce","a","b","toPrecision","clearInterval","stopRecord","convertAudioToBase64","sendAudio"],"mappings":"oGAGA,IAAIA,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAwEL,QAC1FC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,qBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,uBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAwEL,QAC1FC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,wBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,oCCV3B,oH,kCCAA,oH,oCCAA,oH,oCCAA,qH,kCCAA,oH,uBCGA,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,uBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,uBCT3B,IAAIC,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,qPAAsP,KAE/QD,EAAOG,QAAUA,G,uBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,uLAAwL,KAEjND,EAAOG,QAAUA,G,qBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,09EAA29E,KAEp/ED,EAAOG,QAAUA,G,mCCNjB,oH,qBCCA,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,2xDAA8xD,KAEvzDD,EAAOG,QAAUA,G,qBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,i6CAAk6C,KAE37CD,EAAOG,QAAUA,G,qBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,4pDAA6pD,KAEtrDD,EAAOG,QAAUA,G,yCCNjB,IAAIM,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,aAAaC,MAAM,CAAC,GAAK,cAAc,CAAEP,EAAS,MAAEI,EAAG,MAAM,CAACE,YAAY,QAAQ,CAAEN,EAAQ,KAAEI,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAAEN,EAAIQ,SAAe,OAAEJ,EAAG,MAAM,CAACE,YAAY,YAAYN,EAAIS,GAAIT,EAAY,UAAE,SAASU,EAAKnB,GAAG,OAAOa,EAAG,MAAM,CAACO,IAAID,EAAKE,GAAGN,YAAY,oBAAoBO,MAAM,CAACC,SAAWd,EAAIe,cAAgBxB,GAAGyB,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAIkB,WAAWR,MAAS,CAACN,EAAG,UAAU,CAACG,MAAM,CAAC,QAAUG,EAAK,KAAO,OAAO,MAAK,GAAGV,EAAImB,KAAKf,EAAG,MAAM,CAACE,YAAY,UAAU,CAAEN,EAAIoB,cAAgBpB,EAAIqB,aAAerB,EAAIsB,QAASlB,EAAG,kBAAkB,CAACG,MAAM,CAAC,WAAaP,EAAIuB,WAAW,YAAcvB,EAAIqB,YAAY,QAAUrB,EAAIwB,cAAc,QAAUxB,EAAIyB,eAAeT,GAAG,CAAC,QAAUhB,EAAI0B,SAAStB,EAAG,aAAa,CAACuB,IAAI,WAAWpB,MAAM,CAAC,WAAa,YAAcP,EAAI4B,KAAKC,OAAO,SAAW7B,EAAIQ,UAAUQ,GAAG,CAAC,YAAchB,EAAI8B,UAAU,WAAa9B,EAAI+B,cAAc,YAAc/B,EAAIgC,cAAc,OAAShC,EAAIiC,WAAW,QAAUjC,EAAIkC,QAAQ,iBAAmBlC,EAAImC,YAAY,UAAYnC,EAAIoC,UAAU,iBAAmBpC,EAAIqC,oBAAqBrC,EAAIsC,QAAUtC,EAAI4B,KAAMxB,EAAG,MAAM,CAACE,YAAY,OAAOO,MAAM,CAAC0B,SAAUvC,EAAIoB,cAAc,CAAGpB,EAAIqB,aAAgBrB,EAAIsB,OAAo7CtB,EAAImB,KAAh7Cf,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,eAAe,CAACuB,IAAI,eAAepB,MAAM,CAAC,UAAYP,EAAIwC,UAAU,UAAY,GAAG,KAAO,eAAeC,YAAYzC,EAAI0C,GAAG,CAAC,CAAC/B,IAAI,UAAUgC,GAAG,SAASC,GAAW,MAAO,CAAGA,EAAUC,KAAKP,OAAgTlC,EAAG,SAAS,CAACG,MAAM,CAAC,UAAYqC,EAAUC,KAAKP,OAAOQ,UAAU,SAAWF,EAAUC,KAAKP,OAAOS,SAAS,WAAaH,EAAUC,KAAKP,OAAOU,WAAW,OAASJ,EAAUC,KAAKP,OAAOW,QAAQjC,GAAG,CAAC,MAAQ,SAAUkC,GAAS,OAAOlD,EAAImD,YAAYP,EAAUC,KAAMK,IAAU,SAAW,SAAUE,GAAQ,OAAOpD,EAAIqD,eAAeT,EAAUC,KAAMO,IAAS,YAAc,SAAUE,GAAU,OAAOtD,EAAIuD,kBAAkBX,EAAUC,KAAMS,IAAW,MAAQ,SAAUE,GAAS,OAAOxD,EAAIyD,YAAYb,EAAUC,KAAMW,KAAWf,YAAYzC,EAAI0C,GAAG,CAAC,CAAC/B,IAAI,UAAUgC,GAAG,WAAW,MAAO,CAACvC,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,MAAM,CAACE,YAAY,eAAe,CAAEsC,EAAUC,KAAS,KAAEzC,EAAG,IAAI,CAACS,MAAM+B,EAAUC,KAAKa,OAAO1D,EAAImB,OAAOf,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAI2D,GAAG,IAAI3D,EAAI4D,GAAGhB,EAAUC,KAAKgB,OAAO,WAAWC,OAAM,GAAM,CAACnD,IAAI,WAAWgC,GAAG,aAA6BmB,OAAM,IAAO,MAAK,KAAvpC1D,EAAG,MAAM,CAACE,YAAY,YAAYU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAI+D,cAAcnB,EAAUC,SAAS,CAACzC,EAAG,MAAM,CAACE,YAAY,eAAe,CAAEsC,EAAUC,KAAS,KAAEzC,EAAG,IAAI,CAACS,MAAM+B,EAAUC,KAAKa,OAAO1D,EAAImB,OAAOf,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAI2D,GAAG,IAAI3D,EAAI4D,GAAGhB,EAAUC,KAAKgB,OAAO,aAAo4B,MAAK,EAAM,eAAe,GAAa7D,EAAe,YAAE,CAACI,EAAG,MAAM,CAAC4D,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAQnE,EAAIqB,cAAgBrB,EAAIsB,OAAS8C,WAAW,6BAA6B9D,YAAY,cAAc,CAACF,EAAG,cAAc,CAACG,MAAM,CAAC,mBAAmBP,EAAIqE,iBAAgC,YAAcrE,EAAIqB,YAAY,SAAWrB,EAAIsE,oBAAoBtD,GAAG,CAAC,iBAAmBhB,EAAIuE,cAAc,gBAAkBvE,EAAIwE,cAAc,QAAUxE,EAAI0B,MAAM,UAAY1B,EAAIyE,eAAe,IAAIzE,EAAImB,MAAOnB,EAAIqB,aAAerB,EAAIsB,OAAQlB,EAAG,MAAM,CAACE,YAAY,aAAaU,GAAG,CAAC,MAAQ,SAAU0D,GAAI1E,EAAI2E,sBAAsB,CAAC3E,EAAI4E,GAAG,KAAK5E,EAAImB,MAAM,GAAGnB,EAAImB,MAAM,KAAKnB,EAAImB,OAAOf,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,kBAAkB,MACn4GyE,EAAkB,CAAC,WAAa,IAAI7E,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,IAAI,CAACE,YAAY,gC,oCCDpI,EAAS,WAAa,IAAIN,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,mBAAmB,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,WAAW,CAACuB,IAAI,WAAWrB,YAAY,aAAaC,MAAM,CAAC,GAAK,YAAY,KAAO,OAAO,IAAM,IAAI,WAAa,OAAO,YAAc,KAAK,YAAcP,EAAI8E,GAAG,wBAAwBC,SAAS,CAAC,MAAQ/E,EAAIgF,MAAMhE,GAAG,CAAC,MAAQhB,EAAIkC,QAAQ,KAAOlC,EAAIiF,OAAO,QAAUjF,EAAIkF,QAAQ,MAAQlF,EAAImF,WAAW,MAAQnF,EAAIoF,MAAM,MAAQpF,EAAIoF,MAAM,MAAQpF,EAAIqF,gBAAiBrF,EAAIsF,QAAUtF,EAAIuF,WAAYnF,EAAG,aAAa,CAACG,MAAM,CAAC,KAAO,OAAO,KAAO,WAAW,CAACH,EAAG,SAAS,CAAC4D,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAOnE,EAAiB,cAAEoE,WAAW,iBAAiB,CAACH,KAAK,gBAAgBC,QAAQ,kBAAkBC,MAAOnE,EAAsB,mBAAEoE,WAAW,uBAAuBoB,MAAM,CAAGC,MAAO,QAASC,SAAU,WAAYC,OAAQ,OAAQC,MAAO,QAASC,SAAU,QAASC,WAAY,YAAcvF,MAAM,CAAC,KAAOP,EAAIuF,WAAW,QAAUvF,EAAI+F,QAAQ,aAAc,EAAM,YAAa,EAAM,QAAS,EAAK,IAAM,YAAY/E,GAAG,CAAC,OAAShB,EAAIgG,iBAAiB,GAAGhG,EAAImB,MAAM,KAAOnB,EAAIsF,OAAkStF,EAAImB,KAA9Rf,EAAG,MAAM,CAACE,YAAY,yBAAyBU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAIiG,yBAAyB,CAAC7F,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,MAAM,CAACE,YAAY,UAAU,CAAEN,EAAiB,cAAEI,EAAG,IAAI,CAACE,YAAY,iBAAiBF,EAAG,IAAI,CAACE,YAAY,uBAAiCN,EAAQ,KAAEI,EAAG,MAAM,CAACE,YAAY,aAAaU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAIkG,UAAUjF,MAAW,CAACjB,EAAI4E,GAAG,KAAK5E,EAAImB,QAC5kD,EAAkB,CAAC,WAAa,IAAInB,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,IAAI,CAACE,YAAY,6B,yDCDhM,EAAS,WAAa,IAAIN,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAQF,EAAa,UAAEI,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,MAAM,CAACE,YAAY,kBAAkBC,MAAM,CAAC,IAAMP,EAAImG,OAAO,IAAM,qBAAqB/F,EAAG,IAAI,CAACE,YAAY,qBAAqBU,GAAG,CAAC,MAAQhB,EAAIoG,UAAUpG,EAAImB,MAChT,EAAkB,GCQP,GACf8C,sBACAoC,iBAEAjD,OACA,OACAkD,eAIAC,SACAH,OACA,qBCrBqY,I,YCGrY,SAASI,EAAcC,GAErB,IAAIC,EAAS,EAAQ,SACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAIE,EAAY,eACd,EACA,EACA,GACA,EACAH,EACA,WACA,MACC,GAGY,EAAAG,E,QC8Cf,IAAI,EAAS,IAAI,OAEF,OACf1C,kBACA2C,YACAC,mBACAC,kBAGA9C,YACA+C,4BAGAC,OACAhC,MACAiC,eACAC,sBAEA,GAEA,aACA,4BAIA,aACA,0BAGA,0BAKA9D,OACA,OACA+D,QAEAC,SACApC,QACAe,kBACAsB,iBACAC,kBACAC,eACAC,SAEAlF,QACAS,YACAC,kDACAC,QACAwE,QACAC,cAIAC,qBACApC,kBAIAqC,UACAtC,kBACA,+DAaAiB,SAEAsB,wBAEA,gBACA,2DAEA,CAEA,gBACAC,yCACA,oCAQAC,oBACA,YAEA,yBAEAC,gBACA,uBACA,gBAKA9F,mBACA,uBAGAiD,uBACA,8BAKA8C,6BACA,kBACAC,8CAGAC,mBACA,+BAGAC,QACA,gCAGAC,OACA,+BAGAC,cACA,WACA,aAGAC,sBACA,0BACA,wCACA,wBAKAC,kBAEA,WAGA,uCACA,uEACA,uBAJA,8BAUAC,wBACA,2DAEAxC,sBACA,wCAGAC,aAEA,8BAEA,sBACA,oCACA,yBACA,aACA,cAIA,0BAIAF,gBACA,oBAEA,0BAEAX,eAEA,oBAGAqD,cAGA,GAFA,uCAEA,wBAEA,+BACA,0BAEA,0CAEA,MAGA,oBACA,iBAEAC,aAEA,qBACA,0CACAC,aACAC,0BAGAC,KAAAC,IACA,sBACA,+BAIAJ,sBAQAK,kBACA,uCACA,4CAEA,8CAEA,yBAEAC,MAAAzF,gDACAyF,MAAAzF,+CAGA0F,qBAEA,2CAEA,OAAAC,cAAAC,SAAAC,WAEA,UACA,KACA,KAEA,mBAEAC,WAEA,GAEA,mBAEA,OAEA,wCACAC,KAEAC,KAIA,UACAF,UACAC,KAGAhK,UAEAA,0BAEA,KAEA,CAEAgK,KACAhK,QAEA,IACA,mCACA+J,QAEAC,KAGAhK,UAEAA,8BAfA+J,OAkBA,UAKAG,aAEA,gCAEA,SAEA,sCAFA,MAOAvE,WAEA,wCAEA,qCAEA,uCAEAwE,oBAEA,IAMA,iCAEA,qCAEA,+BAEAA,oBAEA,GAMA,gBACA,YACA,yBAEA,kBAGAA,oBAEA,QATA,GAaAtE,SAEA,cAGA,OAFAsE,oBAEA,EAGA,sDAEA,oBAEA,iCAEA,0BAGAzE,SAEA+C,gBACA,qCACA,MAIA2B,aAEA,oCAEA,cACA,uBAEA,8EAEA,wEAGA,qBACA,yBAGA,kCAEAC,gEAEA5B,gBACA,eACA,OAKA3B,OACAwD,kBACArJ,gBAKAsJ,YAIAC,UAEA,aACA,aAGA,oBAGA,wCAEA,iDACA,2CCpfiY,ICGjY,SAAS,EAActD,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIzG,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,wBAAwB,CAACF,EAAG,MAAM,CAACuB,IAAI,SAASrB,YAAY,sBAAsBO,MAAM,CAACmJ,KAAMhK,EAAIiK,SAAS,CAAC7J,EAAG,IAAI,CAACE,YAAY,WAAWO,MAAMb,EAAIiK,OAAS,UAAW,mBAAqBjK,EAAIiK,OAAmVjK,EAAImB,KAA/Uf,EAAG,MAAM,CAACuB,IAAI,SAASrB,YAAY,uCAAuCO,MAAM,CAACqJ,OAAQlK,EAAIqB,YAAa8I,SAAUnK,EAAImK,UAAUnJ,GAAG,CAAC,UAAYhB,EAAIoK,UAAU,QAAUpK,EAAIqK,QAAQ,WAAarK,EAAIsK,iBAAiB,SAAWtK,EAAIuK,eAAe,YAAcvK,EAAIuK,iBAAiB,CAACnK,EAAG,IAAI,CAACE,YAAY,6BAAuCN,EAAU,OAAEI,EAAG,MAAM,CAACuB,IAAI,OAAOrB,YAAY,sCAAsCU,GAAG,CAAC,MAAQhB,EAAIwK,YAAY,CAACpK,EAAG,IAAI,CAACE,YAAY,uBAAuBN,EAAImB,QACjzB,EAAkB,G,YCCP,GACd8C,KAAM,cACNoC,MAAO,CACNhF,YAAa,CACZqG,KAAM+C,QACNC,UAAU,GAEXrG,iBAAkB,CACjBqD,KAAM+C,SAEPN,SAAUM,SAEXrH,OACC,MAAO,CACN+F,MAAO,EACPc,QAAQ,EACRU,UAAW,OAGb/C,SAAU,IACNgD,eAAS,CACXtF,OAAQuF,GAASA,EAAMvF,UAGzByE,YAGAe,gBAECC,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAE3ChL,KAAKoB,aACRpB,KAAKiL,MAAM,kBAAmB,CAACC,QAAS,KAG1C5E,QAAS,CAER8D,QAAU,SAAS3F,GACdzE,KAAKqF,QACRrF,KAAKsK,eAAe7F,IAGtB0F,UAAY,SAAS1F,GAChBzE,KAAKqF,QACRrF,KAAKqK,iBAAiB5F,IAGxB4F,iBAAiB5F,GAKhB,GAHA0G,QAAQC,IAAI,IAAK3G,EAAGzE,KAAKgK,OAAQhK,KAAKoB,aAGlCpB,KAAKoB,aAKR,GAAGpB,KAAKgK,OAAQ,YAJhBhK,KAAKiL,MAAM,oBAOZjL,KAAKkJ,MAAQ,CACZmC,EAAG5G,EAAE6G,eAAiB7G,EAAE6G,eAAe,GAAGC,MAAQ9G,EAAE8G,MACpDC,EAAG/G,EAAE6G,eAAiB7G,EAAE6G,eAAe,GAAGG,MAAQhH,EAAEgH,OAGjDzL,KAAKqF,OAGRyF,SAASY,iBAAiB,YAAa1L,KAAKgL,YAF5CF,SAASY,iBAAiB,YAAa1L,KAAKgL,aAK9CV,eAAe7F,GACd0G,QAAQC,IAAI,IAAK3G,EAAGzE,KAAKgK,QAErBhK,KAAKgK,UAELhK,KAAKoB,aAAepB,KAAKoE,mBAC5BpE,KAAKiL,MAAM,kBAAmB,CAC7BU,SAAU,IAIZb,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAE/ChL,KAAK4L,eAINA,aAEK5L,KAAK6L,MAAMC,SACd9L,KAAK6L,MAAMC,OAAOvG,MAAMwG,UAAa,iBACrC/L,KAAK6L,MAAMC,OAAOE,UAAUC,OAAO,YAGhCjM,KAAK6L,MAAMK,QACdlM,KAAK6L,MAAMK,OAAOF,UAAUC,OAAO,WAIrCjB,WAAWvG,GAAG,MAIb,GAFA0G,QAAQC,IAAI,IAAK3G,EAAGzE,KAAKoB,cAErBpB,KAAKoB,YAAa,OAEtB,IAAI+K,EAASnM,KAAKkJ,MAAMmC,EAAI5G,EAAE8G,MAC1Ba,EAASpM,KAAKkJ,MAAMsC,EAAI/G,EAAEgH,MAE9B,OAAIhH,QAAJ,IAAIA,GAAJ,UAAIA,EAAG6G,sBAAP,OAAI,EAAmBe,SACtBF,EAASnM,KAAKkJ,MAAMmC,EAAI5G,EAAE6G,eAAe,GAAGC,MAC5Ca,EAASpM,KAAKkJ,MAAMsC,EAAI/G,EAAE6G,eAAe,GAAGG,OAI5CzL,KAAK0K,UADFyB,EAAS,GAAKC,EAAS,EACT,IAEA,IAIdD,EAAS,GAAwB,MAAnBnM,KAAK0K,WAElB1K,KAAK6L,MAAMK,OAAOF,UAAUM,SAAS,WACxCtM,KAAK6L,MAAMK,OAAOF,UAAUvM,IAAI,UAEjCO,KAAK6L,MAAMC,OAAOvG,MAAMwG,UAAa,gBAAeI,OAEhDA,EAAS,KACZnM,KAAK6L,MAAMC,OAAOvG,MAAMwG,UAAa,iBAErCjB,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAG/ChL,KAAKgK,QAAS,IAILoC,EAAS,GAAwB,MAAnBpM,KAAK0K,WAE7B1K,KAAK6L,MAAMC,OAAOvG,MAAMwG,UAAa,cAAaK,UAE9CpM,KAAK6L,MAAMK,OAAOF,UAAUM,SAAS,YACxCtM,KAAK6L,MAAMC,OAAOE,UAAUvM,IAAI,WAEjCO,KAAKiL,MAAM,aAAcmB,EAAS,GAAK,KAEnCA,EAAS,MACZpM,KAAK6L,MAAMC,OAAOvG,MAAMwG,UAAa,iBACrCjB,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAE/ChL,KAAKiL,MAAM,kBAAmB,CAAEC,QAAQ,IACxClL,KAAKiL,MAAM,aAKZjL,KAAK4L,cAIPrB,UAAU9F,GAIT,GAFAzE,KAAK4L,aAED5L,KAAKoB,aAAepB,KAAKgK,OAK5B,OAHAhK,KAAKiL,MAAM,kBAAmB,SAC9BjL,KAAKgK,QAAS,MC9KyN,ICG3O,SAAS,EAAcxD,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,gCCvBX,EAAS,WAAa,IAAIzG,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAAEN,EAAe,YAAEI,EAAG,MAAM,CAACE,YAAY,oBAAoB,CAACF,EAAG,MAAM,CAACE,YAAY,YAAYO,MAAM,CAAC,UAAab,EAAIqB,iBAAiBjB,EAAG,MAAM,CAACE,YAAY,MAAMU,GAAG,CAAC,MAAQhB,EAAI0B,QAAQ,CAACtB,EAAG,IAAI,CAACE,YAAY,mBAAmBF,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAI2D,GAAG3D,EAAI4D,GAAG5D,EAAIwM,UAAUpM,EAAG,MAAM,CAACuB,IAAI,QAAQrB,YAAY,SAAS,CAACF,EAAG,SAAS,CAACuB,IAAI,SAASpB,MAAM,CAAC,GAAK,SAAS,MAAQP,EAAIyF,MAAM,OAAS,UAAUrF,EAAG,MAAM,CAAC4D,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAOnE,EAAIqB,aAAerB,EAAIyM,QAASrI,WAAW,2BAA2BzC,IAAI,SAASrB,YAAY,UAAU,CAACF,EAAG,OAAO,CAACJ,EAAI2D,GAAG,+BAC5tB,EAAkB,GCDP,GACbM,KAAM,iBACNoC,MAAO,CACL9E,WAAY,CACVmG,KAAMgF,OACNhC,UAAU,GAEZiC,QAAS,CACPjF,KAAMkF,MACNlC,UAAU,GAEZrJ,YAAa,CACXqG,KAAM+C,SAERgC,QAAS,IAEXrJ,OACE,MAAO,CACLqC,MAAO,IAGXmC,SAAU,CACR4E,QACE,IAAIK,EAASC,KAAKC,MAAM9M,KAAKsB,WAAa,KACtCyL,EAAMF,KAAKC,MAAM9M,KAAKsB,WAAa,KAAQ,GAC/C,MAAQ,GAAEsL,EAASA,EAAS,IAAM,OAAQG,EAAM,GAAM,IAAMA,EAAMA,KAGpEC,cACE,OAAOC,EAAEC,KAAKlN,KAAK0M,QAAS,MAIhC3F,MAAQ,CACN2F,QAAUO,EAAEE,UAAS,WACnBnN,KAAKoN,SACJ,IAEHZ,QAAU,WACRxM,KAAK6L,MAAMX,OAAO3F,MAAMiH,QAAUxM,KAAKwM,UAI3C1C,UACE9J,KAAK6L,MAAMX,OAAO3F,MAAMiH,QAAU,EAClC,IAAIhH,EAAQxF,KAAK6L,MAAMwB,MAAMC,YAC7BtN,KAAKwF,MAAQA,EAAQA,EAAQ,IAE7BqC,OAAO6D,iBAAiB,SAAU1L,KAAKwH,SAEzCqD,gBACEhD,OAAOkD,oBAAoB,SAAU/K,KAAKwH,SAG5ClB,QAAS,CACPkB,SACE,IAAI+E,EAAQ,KAEZ,IAAIgB,EAAK,KACFhB,IACHA,EAAQxE,WAAW,KACjBwE,EAAQ,KACR,IAAI/G,EAAQxF,KAAK6L,MAAMwB,MAAMC,YAC7BtN,KAAKwF,MAAQA,EAAQA,EAAQ,KAC5B,MAIP+H,KAEFH,OAEE,IAAIpN,KAAK6L,MAAM2B,OAAQ,OAEvB,MAAMC,EAAMzN,KAAK6L,MAAM2B,OAAOE,WAAY,MAC1C,IACIC,EAAQ,GACRnI,EAAQ,EACZ,IAAIoI,EAAI5N,KAAKgN,YAAYX,OACrBwB,EAAIhB,KAAKiB,IAAIjB,KAAKC,MAAMc,EAAID,GAAQ,GAExCF,EAAIM,UAAU,EAAG,EAAG/N,KAAKwF,MAAO,IAEhC,IAAK,IAAIlG,EAAI,EAAGA,EAAIsO,EAAGtO,GAAQuO,EAC7BJ,EAAIO,UAAY,UAChBP,EAAIQ,SAAa,EAAJ3O,EAAQkG,EAAO,GAAKxF,KAAKgN,YAAY1N,GAAK,EAAGkG,EAAOxF,KAAKgN,YAAY1N,GAAK,EAAI,IAI/FmC,QACEzB,KAAKiL,MAAM,cC1F0N,ICG3O,SAAS,EAAczE,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIzG,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAACN,EAAImO,GAAG,WAAU,WAAW,MAAO,CAAC/N,EAAG,IAAI,CAACE,YAAY,qBAAoB,GAAGF,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,QAAQ,CAACG,MAAM,CAAC,KAAO,OAAO,SAAWP,EAAI+C,UAAU/B,GAAG,CAAC,OAAShB,EAAIsC,cAAetC,EAAY,SAAEI,EAAG,MAAM,CAACuB,IAAI,WAAWrB,YAAY,WAAWO,MAAM,CAACuN,SAAWpO,EAAIoO,WAAW,CAACpO,EAAImO,GAAG,YAAW,WAAW,MAAO,CAAC/N,EAAG,IAAI,CAACE,YAAY,gBAAgBN,EAAI2D,GAAG,IAAI3D,EAAI4D,GAAG5D,EAAI8E,GAAG,6BAA6B,UAAS,GAAG9E,EAAImB,QAC7oB,EAAkB,GCsDlBkN,G,UAAO,EAAQ,SAEf,EAAS,IAAI,OAEF,GACfpK,cACAD,cACAqC,OAEA+H,gBACArL,iBAEAD,kBAEAwL,SACAjP,WACAqI,aAGA1E,YACA0E,WACArI,gBAEA4D,QACAyE,YACArI,iBAMA+D,gBACA,OACAmL,aAIA3G,UACA4G,UACA,gCAIAC,eAGAlI,SAEAmI,iBACA,qBAEA,2BACA/F,wBAEAgG,GACAxI,uBACAyI,UAIAjG,sBAKArG,mBAAA,QACAoH,oBACAA,mBAEA,4HACA,KAEA,gBAEA,sBAEA,WAEA2E,uBAEA,oBAEA,KAUA,OARAQ,iBACArL,QACAoL,OACA5J,gCAGA8J,gBAKA,sBAEAxL,iBAEA,iBAEAwF,KAAA1F,IAEAyL,sBACAC,MAEA7F,MAAAvE,IAEAmK,iBACArL,QACAoL,OACA5J,2BAGA8J,mBAIAC,IAEA,gBACAF,4BAMAG,wBACA,qBACA,qFAGA,cACA,oCADA,GAKAC,kBACA,yBAIA,8BACA,UAJA,YAQAC,sBACA,6BAEAC,yBACA,wBACA,8BAEA,UAEAC,2BAEA,gCACA,oDAKAC,mBAEA,wFACA,qBAGA,oBAEAC,wBACA,yBAEAC,2BACA,uBAEA,qCAEA,+HAGA,oBACAtG,MAAAvE,GACA,mBAIA,2BAEA8K,yBAEA,gDACApM,WAEA,qBACA0F,KAAA1F,GAEA,iDACAA,WAEA,yBCjQ6W,ICG7W,SAAS,EAAcqD,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,qBCVA,IACdxC,KAAM,YACNoC,MAAO,CACNzE,KAAM6N,OACNC,EAAGC,OACHC,cAAeH,QAGhB7I,WAAY,CAAEiJ,aAAYC,sBAAUC,eAASC,iBAAgBC,cAAa3N,UAE1Ec,KAAM,WAEL,MAAO,CACNd,QAAQ,EACR4N,KAAM,GACN3B,SAAS,EACTvJ,KAAM,GACN4J,KAAM,GACNuB,SAAU,GACV/I,OAAO,EACPgJ,UAAU,EACVC,OAAQ,GACRC,eAAgB,KAChBC,WAAYZ,OACZa,cAAe,GACfC,SAAU,KACV1P,aAAc,EACdO,OAAQ,KACRE,cAAe,GACfH,aAAa,EAEbqP,cAAe,KACfC,aAAc,KACdC,cAAe,KAEfrP,WAAY,EACZsP,SAAU,KACVpP,cAAe,EACf6C,oBAAoB,EACpBD,kBAAkB,EAElByM,+BAA+B,IAMjC9J,MAAO,CACN+J,iBAAkB,CAEjB7J,QAAS,cAGV1G,SAAU,WAEJP,KAAKO,SAAS8L,OAGdrM,KAAKc,aAAed,KAAKO,SAAS8L,OAAS,IAC9CrM,KAAKc,aAAed,KAAKO,SAAS8L,OAAS,GAH5CrM,KAAKc,aAAe,IAWvB+J,gBACK7K,KAAK0Q,cACR1Q,KAAK0Q,aAAaK,SAGpBpJ,SAAU,CACTxG,cACC,OAAOnB,KAAKgR,OAAOpG,MAAMqG,sBAG1BC,QAAS,WACR,OAAOlR,KAAKgR,OAAOpG,MAAMuG,SAE1BC,cAAgB,WACf,OAAOpR,KAAKgR,OAAOpG,MAAMwG,eAE1B7O,UAAW,WACV,IAAIA,EAAY,GA6DhB,OA1DKvC,KAAK2P,gBAEL9H,OAAOwJ,mBAAqBxJ,OAAOwJ,kBAAkBhM,OAAOiM,sBAC/D/O,EAAU1C,KAAK,CACd0R,MAAO,sBACP3N,MAAO5D,KAAKwR,MAAMC,EAAE,2BACpBhO,KAAM,kBAKPlB,EAAU1C,KAAK,CACd0R,MAAO,gBACP3N,MAAO5D,KAAKwR,MAAMC,EAAE,2BACpBhO,KAAM,gBAENpB,OAAQ,CACPS,UAAU,EACVC,WAAY,CAAC,MAAO,OAAQ,MAAO,QACnCsL,QAAS,IACTrL,OAAQ,CACPwE,OAAQ,CACPC,KAAM,WASXlF,EAAU1C,KAAK,CACd0R,MAAO,cACP3N,MAAO5D,KAAKwR,MAAMC,EAAE,mBACpBhO,KAAM,qBAENpB,OAAQ,CACPS,UAAU,EACVC,WAAY,GACZsL,QAAS,GACTrL,OAAQ,CACPwE,OAAQ,CACPC,KAAM,YAQPzH,KAAK0R,cAAgB1R,KAAKoR,eAC7B7O,EAAUoP,QAAQ,CACjBJ,MAAO,yBACP3N,MAAO5D,KAAKwR,MAAMC,EAAE,oBACpBhO,KAAM,kBAIDlB,MAELoI,eAAS,CACX,UAGDiH,SAAU,WAGT,OAAK5R,KAAK2B,KAEH3B,KAAK6R,KAAKC,KAAKC,cAAc/R,KAAK2B,KAAKC,OAAQ,oBAF/B,IAMxB8P,YAAa,WACZ,OAAO/H,OAAEqI,KAAKnK,OAAQ,8CAGvBoK,OAAQ,WACP,OAAIjS,KAAKyP,EACDxC,EAAEiF,IAAIlS,KAAKyP,EAAE0C,MAAM,KAAO1C,GACzBA,GAIF,IAER2C,OAAQ,WACP,OAAIpS,KAAKyP,EACDxC,EAAEiF,IAAIlS,KAAKyP,EAAE0C,MAAM,KAAO1C,GACzBzP,KAAK6R,KAAKpR,KAAK4R,SAAS5C,IAI1B,IAER6C,UAAW,WACV,IAAI3R,EAAKX,KAAKuS,OAAOC,MAAM7R,GAC3B,OAAOX,KAAKgR,OAAOpG,MAAM6H,SAAS9R,IAEnC+R,QAAS,WAER,OAAK1S,KAAK2B,KAKHsL,EAAEiF,IAAIjF,EAAE0F,OAAO3S,KAAK2B,KAAKiR,aAAaC,cAAc,SAAUC,EAAGC,GACvE,MAAwB,WAAjBD,EAAEE,eACN,SAAUvD,GACb,OAAOA,EAAEW,UAPLpQ,KAAKyP,EAAUzP,KAAKoS,OACjB,IAUTa,OAAQ,WAEP,IAAKjT,KAAK2B,KAAM,MAAO,GAEV3B,KAAK2B,KAAKC,OAAvB,IAEIsR,EAAM,GASV,OANAlT,KAAK2B,KAAKiR,aAAaC,aAAaM,SAAQ,SAAU1S,GAC7B,SAApBA,EAAKuS,YACRE,EAAIrT,KAAKY,EAAK2P,WAIT8C,GAGR3S,SAAU,WAET,GAAsB,OAAlBP,KAAKwQ,SAAmB,MAAO,GACnC,GAAsB,KAAlBxQ,KAAKwQ,SAAiB,OAAOxQ,KAAK4R,SAEtC,IAAI1N,EAAQlE,KAAKwQ,SAAS4C,cAEtB3D,EAAIxC,EAAE0F,OAAO3S,KAAK4R,UAAU,SAAUnC,GACzC,OAA8C,GAAvCA,EAAEzL,KAAKoP,cAAcC,QAAQnP,IAAeuL,EAAEzL,KAAKoP,eAAiBlP,KAG5E,OAAOuL,GAIR6D,YAAa,WACZ,OAAItT,KAAKO,SAAS8L,OACVrM,KAAKO,SAASP,KAAKc,cAAgB,GAGpC,OAIT0N,YAMA1E,UACC9J,KAAKmH,OAAQ,GAGRnH,KAAK2B,MAAQ3B,KAAK6R,KAAKC,KAAKyB,QAChCvT,KAAKwT,UAAUxK,MAAMvE,GACbgP,QAAQ/E,YAMlBpI,QAAS,CACRoN,KAAM,WACL,OAAO1T,KAAK2T,GAAGC,OAAO,IACd5T,KAAK6R,KAAKC,KAAKyB,QAAUvT,KAAK6R,KAAKC,KAAK+B,SAIjD1R,UAAW,SAAU2R,GAEpBA,EAAW9T,KAAKc,eAAiBd,KAAKc,eAElCd,KAAKc,aAAed,KAAKO,SAAS8L,OAAS,IAC9CrM,KAAKc,aAAe,GAGjBd,KAAKc,aAAe,IACvBd,KAAKc,aAAed,KAAKO,SAAS8L,OAAS,IAK7CjK,iBAAkB,WACjBpC,KAAKiB,WAAWjB,KAAKO,SAASP,KAAKc,cAAgB,KAGpDG,WAAY,WAAqB,IAAXR,EAAW,uDAAJ,GAC5B,IAAIuD,EAAOvD,EAAKuD,MAAQ,GAExBhE,KAAK6L,MAAM,YAAYnC,UAAU1F,IAGlC9B,YAAa,SAAUgC,GACtBlE,KAAKwQ,SAAWtM,GAGjB6P,iBAAkB,SAAU5C,EAAS6C,GACpChU,KAAKgU,GAAQ7C,IAId8C,YAAa,SAAU/N,GAEtB,IAAIgO,EAAQhO,EAAOiM,MAAM,KAAK,GAAGA,MAAM,KAAK,GACxCnP,EAAS,IAAImR,OAEjB,OAAOnR,EAAOwE,OAAO,OAAOtB,EAAQ,KAAM,KAAMgO,EAAO,KAAMrL,KAAK3C,GAE1DuN,QAAQ/E,QAAQxI,IACrB8C,MAAMvE,GACDgP,QAAQW,OAAO3P,KAIxB4P,oBAAqB,WACpB,IAAIhR,EAAS,GAEbrD,KAAK6L,MAAMyI,aAAaC,YAExB1M,OAAOwJ,kBAAkBmD,SAASC,GAAGC,YAAY,CAChD5R,UAAU,EAEVkR,OAAQ,CAAC,EAAYtF,KAAY,IAAxB,OAAExI,GAAsB,EAGhC,OAAOlG,KAAKiU,YAAY/N,GAAQ2C,KAAK3C,GAE7ByD,OAAEgL,OAAOC,OAAO1O,GAAQ2C,KAAK8F,IACnC,IAAIxL,EAAO,CACV+C,SACAyI,QAGDtL,EAAOxD,KAAKsD,GAEZnD,KAAKoD,eAAe,KAAMD,GAE1BuL,OAGC1F,MAAMvE,IACR0G,QAAQ5H,MAAMkB,GACdiK,OAKFmG,UAAYC,IACX9U,KAAKsD,wBAKRyR,uBAAwB,WAEvB/U,KAAKgV,eAAgB,EAErB,IAAIC,EAAQhI,EAAE0F,OAAO1F,EAAEiF,IAAIlS,KAAKiT,OAASiC,GACjClV,KAAK2T,GAAG3B,KAAKhS,KAAM,sBAAwBA,KAAK2T,GAAGwB,YAAYD,KAAO,MACzEE,IAAM,MACV,OAAOA,GAAKA,EAAEC,QAAUD,EAAEzU,KAAF,UAAQX,KAAK6R,KAAKpR,KAAK6U,gBAAvB,aAAQ,EAAyB3U,MAG1D,IAAKsU,EAAM5I,OAEV,MAAO,eAGJ4I,EAAM5I,OAAS,EAElBrM,KAAK6R,KAAK0D,MAAMC,OAAO,WAAY,CAClCC,QAASzV,KAAKwR,MAAMC,EAAE,6BACtBhK,KAAM,iBACNtE,KAAM,CACL8R,MAAOA,EACPjB,OAAQ,kBACR0B,aAAe7H,IACd7N,KAAK+T,iBAAiBlG,EAAG,uBAU5B7N,KAAK2V,gBAAgBV,EAAM,IAI5BjV,KAAK6L,MAAMyI,aAAaC,aAIzBoB,gBAAiB,SAAUlV,GAC1B,IAAImV,EAAM5V,KAAK0R,YAIfkE,EAAI,CACHC,OAAQ7V,KAAK2B,KAAKC,OAClBkU,QAASrV,EAAK4U,OAAOS,WAWvBhU,cAAe,WACd9B,KAAKiL,MAAM,cACXjL,KAAKqC,QAAS,GAGfN,gBACC/B,KAAKqC,QAAS,GAGf0T,QAAS,SAAUC,GAClBhW,KAAKiL,MAAM,aAAc+K,IAG1BxC,UAEC,GAAIxT,KAAKyP,EAAG,CACXzP,KAAKgR,OAAOpG,MAAMqL,iBAAkB,EACpC,IAAI5D,EAAW,KAEX1Q,EAAO,KACPhB,EAAK,GAGT,OADAX,KAAKmQ,UAAW,EACTnQ,KAAK6R,KAAKpR,KAAKyV,UAAUlW,KAAKiS,QAAQpJ,KAAKsN,IAEjD,GAA0B,GAAtBnW,KAAKiS,OAAO5F,OAAa,CAE5B,IAAI+J,EAAQD,EAAK,GAEjB,IAAKC,IAAUA,EAAMC,MAAQD,EAAMC,KAAKhK,OAAS,GAGhD,OADArM,KAAKiL,MAAM,kBACJwI,QAAQW,OAAO,OAKxB,GAAIpU,KAAK6R,KAAKpR,KAAK6U,SAASe,KAAKhK,OAAS,GAEzC,OADArM,KAAKiL,MAAM,kBACJwI,QAAQW,OAAO,OAMvBzT,EAAKX,KAAK6R,KAAKC,KAAKwE,IAAIC,UAAUJ,EAAK,GAAInW,KAAK6R,KAAKpR,KAAK6U,UAE1DjD,EAAWrS,KAAK6R,KAAKpR,KAAK4R,SAAS8D,EAAK,GAAGxV,IAC9BX,KAAK6R,KAAKpR,KAAK4R,SAASrS,KAAK6R,KAAKpR,KAAK6U,SAAS3U,IAE7D,IAAI6V,EAAe,CAAC,CACnB,KAAQ,kBACR,UAAa,GACb,QAAW,CACVC,WAAW,KAIb,OAAOzW,KAAK6R,KAAKC,KAAKyB,OAAOmD,WAC5B,CACCC,gBAAiBhW,EACjBiW,WAAY,UACZC,OAAQ,CAACxE,GACTrO,KAAM,IAAMrD,EACZmW,cAAeN,MAKf3N,KAAKkO,IAEPpV,EAAOoV,EACP/W,KAAKgR,OAAOpG,MAAMqL,iBAAkB,EAEpC,IAAIe,EAAShX,KAAK6R,KAAKC,KAAKyB,OAAO0D,QAAQF,EAAMG,SAC7CzN,EAAQuN,EAAOpE,aAAauE,eAAe,uBAE/C,OAAOnX,KAAK6R,KAAKC,KAAKyB,OAAO6D,cAAczV,EAAKuV,QAAS7E,EAAU,IAAK5I,EAAM,IAAIT,MAAMvE,SAGtFoE,KAAKuM,IACPpV,KAAKmQ,UAAW,EAGZnQ,KAAKkR,SAAWlR,KAAKkR,SAAWvQ,GACnCX,KAAKqX,YAGNrX,KAAKgR,OAAOwE,OAAO,WAAW,GAEvB/B,QAAQ/E,YAEb1F,MAAMvE,IAERzE,KAAKmQ,UAAW,EAEhBnQ,KAAKgR,OAAOpG,MAAMqL,iBAAkB,EAEhCxR,GAAkB,iBAAbA,EAAE6S,QAEHtX,KAAK6R,KAAKC,KAAKyB,OAAOgE,SAAS,IAAM5W,EAAK,IAAMX,KAAK6R,KAAKC,KAAK0F,QAAQC,QAAQ,WAAY,KAAK5O,KAAK,QACzGG,MAAMvE,OAMHgP,QAAQW,OAAO3P,KAKvB,OAAOgP,QAAQW,OAAO,MAKxBsD,iBACC,OAAO1X,KAAK2B,MAAQ3B,KAAK2B,KAAK+V,kBAG/BL,YACCrX,KAAKkH,KAAK,MAAM2B,KAAKuM,GACb3B,QAAQ/E,QAAQ0G,KAIzBvT,UAAUkD,GAET/E,KAAKkH,KAAKnC,GAAM8D,KAAKuM,GAEb3B,QAAQ/E,QAAQ0G,KAMzBuC,aAAc,SAAU5S,EAAM6S,GAE7B,OADA7S,EAAOA,EAAK8S,OACR9S,EAAKsH,QAAUuL,EAAc7S,GAEjCA,EAAOA,EAAK+S,MAAM,EAAGF,GAEd7S,EAAK8S,OAAS,QAGtBE,gBAAgBhT,GAMf,OAJAkI,EAAEmB,KAAKpO,KAAK4R,UAAU,SAAUnR,GAC/BsE,EAAOA,EAAK0S,QAAQ,IAAIO,OAAO,IAAMvX,EAAKuD,KAAM,KAAM,IAAMvD,EAAKE,GAAK,IAAMF,EAAKuD,SAG3Ee,GAGRmC,KAAKnC,GAoBJ,OAlBK/E,KAAK2B,MACT3B,KAAKwT,UAAUxK,MAAMvE,OAUtBzE,KAAKiL,MAAM,WAGNjL,KAAK2P,eACT3P,KAAKmI,QAGCnI,KAAK2T,GAAGC,OAAO,IAEd5T,KAAK2B,OAAS3B,KAAKmQ,UAExBtH,KAAMuM,IAERpV,KAAKiL,MAAM,QAEXlG,EAAO/E,KAAK+X,gBAAgBhT,GAExB/E,KAAK2P,eAEuB,aAA3B3P,KAAK2P,cAAclI,MAAuBzH,KAAK2P,cAAclG,MAEzDzJ,KAAK6R,KAAKC,KAAKmG,UAAUjY,KAAK2B,KAAMoD,GAAM8D,KAAKuM,IAErDA,EAAE,gBAAkB,CACnB,SAAY,YACZ,SAAYpV,KAAK6R,KAAKC,KAAKoG,aAAalY,KAAK2P,cAAclG,QAAUE,OAAEwO,UAGxE,IAAIC,EAAYhD,EAShB,OAPApV,KAAK2P,cAAclG,MAAMA,MAAMvK,QAAQmZ,KAAOjD,EAAEiD,KAChDrY,KAAK2P,cAAclG,MAAMA,MAAMvK,QAAQqI,MAAQ6N,EAAE7N,MACjDvH,KAAK2P,cAAclG,MAAMA,MAAMvK,QAAQoZ,QAAUlD,EAAEkD,eAE5CtY,KAAK2P,cAAclG,MAAMA,MAAM8O,kBAC/BvY,KAAK2P,cAAclG,MAAMA,MAAM+O,UAE/BxY,KAAK6R,KAAKC,KAAKyB,OAAOkF,UAAUzY,KAAK2B,KAAKC,OAAQ,iBAAkBwW,KAEzEvP,KAAKuM,IAEPpV,KAAK6R,KAAK0D,MAAMmD,SAAS,gBAEzB1Y,KAAKiL,MAAM,sBAEXjL,KAAKiL,MAAM,SAEJwI,QAAQ/E,YACb1F,MAAMvE,IAER0G,QAAQ5H,MAAMkB,GACPgP,QAAQW,OAAO3P,KAOlBzE,KAAK6R,KAAKC,KAAK6G,SAAS3Y,KAAK2B,KAAMoD,EAAM,CAAE6T,SAAU5Y,KAAK2P,kBAE/D3G,MAAMvE,IAGRzE,KAAKiL,MAAM,mBAAoB,CAC9B1H,MAAOkB,OAOVzC,WAAWmB,GACVnD,KAAK6Y,UAAU,CAAE3S,OAAQ/C,KAG1B0V,UAAW,SAAU,GAAkB,IAAlB,OAAE3S,EAAF,KAAUyI,GAAQ,EAEtC,IAAIhO,EAAKgJ,OAAEwO,SAEPW,EAAO,CACVrR,KAAM,QACN9G,GAAIA,EACJuF,OAAQA,GAGTlG,KAAKiL,MAAM,cAAe6N,GAE1B9Y,KAAK2T,GAAGC,OAAO,IAEP5T,KAAK2B,MAEVkH,KAAK,IACHiQ,EAAKC,QACDtF,QAAQW,OAAO,WAEhBpU,KAAK6R,KAAKC,KAAK+G,UAAU7Y,KAAK2B,KAAMuE,EAAQ,KAAM4S,EAAM,CAAEF,SAAU5Y,KAAK2P,iBAE9E9G,KAAKuM,IAEPpV,KAAKiL,MAAM,WAAY,CACtBtK,GAAIA,IAGE8S,QAAQ/E,YAEb1F,MAAMvE,IAERzE,KAAKiL,MAAM,YAAa,CACvBtK,GAAIA,EACJ4C,MAAOkB,IAGDgP,QAAQ/E,aAQjBsK,mBAAoB,SAAUrK,GAE7B,IAAIsK,EAAI,SAER,OAAKjZ,KAAK2B,KAAKuX,QAAQC,gBAInBxK,EAAKyK,KAAOH,EAGRjZ,KAAKqZ,QAAQC,QACnB,8FAA+F,CAC/F3Q,OAAQ,MACRC,WAAY,eAGXC,KAAMC,GAEC2K,QAAQ/E,SAAQ,IAErB1F,MAAMvE,GACDgP,QAAQW,OAAO,WAjBjBX,QAAQ/E,SAAQ,IA0BzB6K,SAAU,SAAU,GAAU,IAAV,KAAE5K,GAAQ,EAE7B,IAAIhO,EAAKgJ,OAAEwO,SAEPW,EAAO,CACVrR,KAAM,OACN9G,GAAIA,EACJwV,KAAM,CACLnS,KAAM2K,EAAK3K,KACXoV,KAAMzK,EAAKyK,OAIbpZ,KAAKiL,MAAM,cAAe6N,GAE1B9Y,KAAK2T,GAAGC,OAAO,IAEP5T,KAAK2B,MAEVkH,KAAK,IAEA7I,KAAKgZ,mBAAmBrK,IAG7B9F,KAAM2Q,GAEDxZ,KAAK6R,KAAKC,KAAKyH,SAASvZ,KAAK2B,KAAMgN,EAAMmK,EAAM,CAAEF,SAAU5Y,KAAK2P,eAAiB6J,IAEtF3Q,KAAK,KAEP7I,KAAKiL,MAAM,WAAY,CACtBtK,GAAIA,IAGE8S,QAAQ/E,YAEb1F,MAAMvE,IAER0G,QAAQ5H,MAAMkB,GAEdzE,KAAKiL,MAAM,YAAa,CACvBtK,GAAIA,EACJ4C,MAAOkB,OAOV0D,MAAO,WACFnI,KAAK6L,MAAM,aACd7L,KAAK6L,MAAM,YAAY1D,SAGzBlG,QAAS,WACRjC,KAAKiL,MAAM,YAGZ7C,KAAM,WACDpI,KAAK6L,MAAM,aACd7L,KAAK6L,MAAM,YAAYzD,QAGzBC,YAAa,WACRrI,KAAK6L,MAAM,aACd7L,KAAK6L,MAAM,YAAYxD,eAGzBoR,OAAQ,aAGR3R,QAAS,SAAU/C,GAClB/E,KAAK+E,KAAOA,EAER/E,KAAK6L,MAAM,aACd7L,KAAK6L,MAAM,YAAY/D,QAAQ/C,IAGjCI,MAAO,SAAUuU,GAChB,IAAIxV,EAAQwV,EAAIC,OAAOzV,MAET,KAAVA,GAIHlE,KAAKiL,MAAM,cAAc,GAG1BjL,KAAK+E,KAAOb,EACZlE,KAAKsQ,WAAa3G,OAAEiQ,OAAO5Z,KAAK+E,WAGR8U,IAApB7Z,KAAKsQ,WACRtQ,KAAKiL,MAAM,aAAcjL,KAAKsQ,YAE9BtQ,KAAKiL,MAAM,cAAc,GAGtBjL,KAAK2B,MACR3B,KAAK6R,KAAKC,KAAKyB,OAAOuG,WAAW9Z,KAAK2B,KAAKC,QAAQ,EAAM,MAjBzD5B,KAAKiL,MAAM,cAAc,IAoB3BnH,cAAclB,EAAMmX,GACnB/Z,KAAK4C,EAAK2O,OAAOwI,IAGlBC,sBAAuB,SAAU9V,GAIhC,OAFAlE,KAAKgV,cAAgB9Q,EAEdlE,KAAKgV,eAGb9R,YAAYN,EAAMK,KAIlBO,YAAYZ,EAAMW,GACjBvD,KAAKgR,OAAOwE,OAAO,OAAQ,CAC1B/R,KAAM,QACNwW,QAAS1W,EAAMwB,QAGjBmV,SACC,OAAOla,KAAK8U,MAAO,GAEpBqF,gBAAgBjW,GACVA,GACJlE,KAAK6L,MAAMyI,aAAaC,aAG1BnR,eAAeR,EAAMO,GACpB,MAAMiX,EAAkB,CAAC,YAAa,aAAc,YAAa,cAGjE,GAAKA,EAAgBC,SAASlX,EAAKwL,KAAKlH,MAGvC,OAAOzH,KAAK6Y,UAAU1V,GAFtBnD,KAAKuZ,SAASpW,IAKhBmX,QAAQ3L,GACP,MAAM4L,EAAM,IAAIC,MAChB,IAAIC,EAAU,GAEd,OAAO,IAAIhH,QAAQ,CAAC/E,EAAS0F,KAE5BmG,EAAIG,OAAS,WACZD,EAAQE,EAAI3a,KAAKwF,MACjBiV,EAAQG,EAAI5a,KAAK6a,OACjBnM,EAAQ+L,IAGTF,EAAIO,QAAU,SAAUrW,GACvB2P,EAAO3P,IAGR8V,EAAIQ,IAAMpM,EAAKzI,UAIjB5C,kBAAkBV,EAAMS,GACvBrD,KAAKgR,OAAOpG,MAAM0D,SAAU,EAC5BtO,KAAK6L,MAAMyI,aAAaC,aAGzByG,qBAAqBlM,GAEpB,GAAW,eAAPA,GAAyBA,EAAImM,UAAYnM,EAAImM,WAAW5H,QAAQ,eAAiB,EAgBpF,OAfArT,KAAKqE,oBAAqB,OAEtBwD,OAAOqT,QACVlb,KAAKqZ,QAAQC,QACZtZ,KAAKwR,MAAMC,EAAE,oBAAqB,CAClC9I,OAAQ3I,KAAKwR,MAAMC,EAAE,eAItBzR,KAAKqZ,QAAQC,QACZtZ,KAAKwR,MAAMC,EAAE,oBAAqB,CAClC9I,OAAQ3I,KAAKwR,MAAMC,EAAE,gBAOnB3C,EAAImM,UAAYnM,EAAImM,WAAW5H,QAAQ,qBAAuB,EAClErT,KAAKqZ,QAAQC,QACZtZ,KAAKwR,MAAMC,EAAE,qBAAsB,CACnC9I,OAAQ3I,KAAKwR,MAAMC,EAAE,gBAMvBzR,KAAKqZ,QAAQC,QACZtZ,KAAKwR,MAAMC,EAAE,0BAA2B,CACxC9I,OAAQ3I,KAAKwR,MAAMC,EAAE,eAGtBtG,QAAQ5H,MAAMuL,KAGfqM,kBAAmBC,GAIlB,OAFAjQ,QAAQC,IAAI,OAAQgQ,GAEb,IAAI3H,QAAQ,CAAC/E,EAAS0F,KAC5BvM,OAAOwT,0BAA0BD,EAAOE,IAGvC,IAAIA,EACH,OAAOlH,EAAO,WAGfkH,EAAM3M,KAAMA,IACX,IAAIjG,EAAS,IAAI6S,WAEjBpQ,QAAQC,IAAI,OAAQuD,GAEpBjG,EAAO8S,UAAY,WAClB,IAAIC,EAAO,IAAIC,KAAK,CAAC,IAAIC,WAAW3b,KAAKqD,SAAU,CAACoE,KAAOkH,EAAKlH,OAEhE0D,QAAQC,IAAI,OAAQqQ,GAEpBH,EAAMrP,SAENyC,EAAQ+M,IAGT/S,EAAOoS,QAAWrW,IAEjB6W,EAAMrP,SAENmI,EAAO3P,IAGRiE,EAAOkT,kBAAkBjN,MAEvBlK,IACH2P,EAAO3P,QAMVoX,uBAEC7b,KAAKoE,iBAAmB0X,yBAAW9b,KAAK6R,KAAKkK,MAAMC,YAAY,CAAEC,OAAO,IAAQpT,KAAK,KACpF7I,KAAKqE,oBAAqB,EAEnBoP,QAAQ/E,YACb1F,MAAM8F,IAER3D,QAAQ5H,MAAMuL,GAEd9O,KAAKgb,qBAAqBlM,GAEnB2E,QAAQW,OAAOtF,MAIvB9O,KAAKoE,iBAAiByE,KAAK,KAE1BsC,QAAQC,IAAI,mBAEZpL,KAAKqE,oBAAqB,EAE1B,IAAI+W,EAAO,gBAERzR,OAAEuS,UAASd,EAAO,+CAErB,IAAIrO,EAAM,EAEV/M,KAAK0Q,aAAe1Q,KAAK6R,KAAKsK,kBAI9B,IAAIJ,EAAQ/b,KAAKoc,qBAAuB,IAAIC,MAAMjB,EAAM,KAQvD,GANAjQ,QAAQC,IAAI,iBAAkBpL,KAAK6Q,+BAEnC7Q,KAAKsB,WAAa,EAElBya,EAAMO,UAEFtc,KAAK6Q,8BAER7Q,KAAK6Q,+BAAgC,MAFtC,CAMA,IAAI0L,EAAK,KAIRA,EAAKvc,KAAKmb,kBAAkBxR,OAAEuS,QAAUd,EAAOvT,OAAOqT,QAAQvM,KAAK6N,sBAAwBpB,GAAMvS,KAAK4S,GAC9FhI,QAAQ/E,QAAQ,CACtBvL,KAAOsY,KAUVc,EAAG1T,KAAKuM,IAWPjK,QAAQC,IAAI,iBAAkB2Q,EAAMU,UAEhCV,EAAMU,UAAYV,EAAMU,SAAW,IACtCrH,EAAEqH,SAAWV,EAAMU,UAGpBzc,KAAK0c,mBAAmBtH,GAAG,GAEpB3B,QAAQ/E,YAEb1F,MAAMvE,IAERzE,KAAKyB,QAEL0J,QAAQ5H,MAAMkB,KACZkY,QAAQ,UAIRlY,IAEH0G,QAAQ5H,MAAMkB,GAEdzE,KAAKoB,aAAc,EACnBpB,KAAKyB,UAIFmb,EAAU,GAEd,IAAIC,EAAiB7c,KAAKgR,OAAOpG,MAAMkS,2BAEnCD,GACHA,EAAeE,QAIhB/c,KAAK4Q,SAAWoM,YAAY,KAGxBrT,OAAEuS,SACJU,EAAQ/c,KAAK,GAET+c,EAAQvQ,OAAS,KAAIuQ,EAAU3P,EAAEC,KAAK0P,EAAS,KAEnD5c,KAAKuB,cAAgB0L,EAAEgQ,MAAML,IAG7B5c,KAAKoc,qBAAqBc,oBAExBC,IAEAP,EAAQ/c,KAAW,IAANsd,GAETP,EAAQvQ,OAAS,KAAIuQ,EAAU3P,EAAEC,KAAK0P,EAAS,KAEnD5c,KAAKuB,cAAgB0L,EAAEgQ,MAAML,KAI9B,SAAUnY,GACT0G,QAAQC,IAAI,IAAK3G,MAQpBsI,GAAY,GAERA,EAAM,MAAS,IAAG/M,KAAKsB,WAAayL,IAEtC,IAEH/M,KAAKoB,aAAc,EACnBpB,KAAKwB,cAAgB,EACrBxB,KAAKuB,cAAgB,GACrBvB,KAAKsB,WAAa,EAClBtB,KAAKqB,OAAS,KAEdrB,KAAKoc,qBAAqBgB,gBAExBpU,MAAOvE,IACT0G,QAAQ5H,MAAMkB,KAGZkY,QAAQ,KACV3c,KAAKoE,iBAAmB,QAK1BE,gBAEC,KAAItE,KAAKoE,kBAAoBpE,KAAKoB,aAAepB,KAAKoc,sBAAtD,CAIA,GAFAjR,QAAQC,IAAI,kBAERvD,OAAOqT,QACV,OAAOlb,KAAK6b,uBAGb7b,KAAKoE,iBAAmB0X,yBAAW9b,KAAK6R,KAAKwL,oBAAoBxU,KAAMyU,IAItE,GAFAtd,KAAKqE,oBAAqB,EAEtBrE,KAAKoE,iBACR,OAAOqP,QAAQ/E,QAAQ4O,GAGvBA,EAASC,OAAOC,YAAYrK,QAASsK,IACpCA,EAAMC,WAIN1U,MAAM8F,IAER9O,KAAKgb,qBAAqBlM,GACnB2E,QAAQW,OAAOtF,MAKvB9O,KAAKoE,iBAAiByE,KAAMyU,IAG3Btd,KAAKyQ,cAAgB6M,EAErBtd,KAAK0Q,aAAe1Q,KAAK6R,KAAKsK,kBAC9Bnc,KAAK2Q,cAAgB3Q,KAAK0Q,aAAaiN,iBAIvC,IAAI5C,EAAM/a,KAAK0Q,aAAakN,wBAAwB5d,KAAKyQ,cAAc8M,QACvExC,EAAI7J,QAAQlR,KAAK2Q,eAEjB3Q,KAAK6d,mBAEH7U,MAAM,QAAW2T,QAAQ,KAC3B3c,KAAKoE,iBAAmB,SAM1ByZ,iBAEC,IAAIhB,EAAiB7c,KAAKgR,OAAOpG,MAAMkS,2BAEnCD,GACHA,EAAeE,QAGhB/c,KAAKgR,OAAOwE,OAAO,sBAAsB,GAEzCxV,KAAKoB,aAAc,EACnBpB,KAAKwB,cAAgB,EACrBxB,KAAKuB,cAAgB,GACrBvB,KAAKsB,WAAa,EAClBtB,KAAKqB,OAAS,KACdrB,KAAKyQ,cAAcvH,QAEnB,IAAI6D,EAAM,EACN6P,EAAU,GAGd5c,KAAK4Q,SAAWoM,YAAY,KAC3B,IAAIc,EAAY,IAAInC,WAAW3b,KAAK2Q,cAAcoN,mBAElD/d,KAAK2Q,cAAcqN,qBAAqBF,GAGxClB,EAAQ/c,KAAKG,KAAKie,YAAYH,IAE1BlB,EAAQvQ,OAAS,KAAIuQ,EAAU3P,EAAEC,KAAK0P,EAAS,KAEnD7P,GAAY,GAEZ/M,KAAKuB,cAAgB0L,EAAEgQ,MAAML,GAEzB7P,EAAM,MAAS,IAClB/M,KAAKsB,WAAayL,IAGjB,KAKJmR,kBAAmB,SAAU7c,EAAQsK,GAEhCtK,EAAOob,SAAW,EACrBzc,KAAKyB,QAGDkK,EACH3L,KAAK0E,iBAAiBrD,GAGtBrB,KAAKqB,OAASA,GAKjB8c,YAAYxP,GAEX,OAAO,IAAI8E,QAAQ,CAAC/E,EAAS0F,KAC5BzK,OAAEyU,SAASzP,GAAM9F,KAAKwV,IACrB,IACCre,KAAK0Q,aAAa4N,gBAAgBD,EAAcE,IAC/C7P,EAAQ6P,EAAO9B,YAEhB,MAAMhY,GACN2P,EAAO3P,MAGNuE,MAAMoL,MAOXsI,mBAAmBjT,EAAOkC,GACzBR,QAAQC,IAAI,QAAS3B,GAErB,IAAIoE,EAAI,KAIP7N,KAAKke,kBAAkB,CACtBvP,KAAMlF,EAAMtG,KACZxC,GAAIgJ,OAAEwO,SACNsE,SAAWhT,EAAMgT,UACf9Q,IAGDlC,EAAMgT,SAER5O,IAGA7N,KAAKme,YAAY1U,EAAMtG,MAAM0F,KAAK4T,IACjChT,EAAMgT,SAAWA,EAEjB5O,MACE7E,MAAOvE,IACT0G,QAAQ5H,MAAMkB,GAEdzE,KAAKyB,WAkCRwc,YAAYO,GACX,OAAQ3R,KAAK4R,KAAKD,EAAYE,OAAO,CAACC,EAAGC,IAAMD,EAAIC,GAAK,GAAKJ,EAAYnS,QAAQwS,YAAY,IAG9Fta,cAAc,GAAqB,IAArB,OAAE2G,EAAF,QAAUS,GAAW,EAOlC,GALAR,QAAQC,IAAI,iBAAkBpL,KAAKoB,aAGnCpB,KAAKgR,OAAOwE,OAAO,sBAAsB,GAErCxV,KAAKoE,iBAKR,OAHApE,KAAKoE,iBAAiB8G,cACtBlL,KAAKoE,iBAAmB,MAKzBpE,KAAKoB,aAAc,EAEfpB,KAAK4Q,WACRkO,cAAc9e,KAAK4Q,UACnB5Q,KAAK4Q,SAAW,MAIb5Q,KAAKyQ,gBAEJvF,GAKHlL,KAAKyQ,cAAc/E,iBAAiB,gBAAkBjC,IACrDzJ,KAAK0c,mBAAmBjT,EAAOkC,KAIjC3L,KAAKyQ,cAAciN,OAEnB1d,KAAKyQ,cAAc8M,OAAOC,YAAYrK,QAASsK,IAC9CA,EAAMC,SAGP1d,KAAKyQ,cAAgB,MAIlBzQ,KAAKoc,uBAGPpc,KAAK6Q,gCADF3F,EAOJlL,KAAKoc,qBAAqB2C,aAC1B/e,KAAKoc,qBAAuB,OAMxB1X,iBAAiBrD,GAAQ,8CAE1BA,IAAQA,EAAS,EAAKA,QAEtBA,GACH,EAAKI,QAGN,EAAKF,cAAgB,GAErB,MAAM2E,QAAe,EAAK2L,KAAKmN,qBAAqB3d,EAAOsN,MAErDhO,EAAKgJ,OAAEwO,SAEPW,EAAO,CACZrR,KAAM,QACN9G,GAAIA,EACJuF,OAAQA,GAGT,EAAKzE,QAEL,EAAKkS,GAAGC,OAAO,IACP,EAAKjS,MACVkH,KAAK,IACA,EAAKgJ,KAAKC,KAAKmN,UAAU,EAAKtd,KAAMuE,EAAQ,KAAM4S,EAAM,CAAEF,SAAU,EAAKjJ,iBAC9E3G,MAAMvE,IACR,EAAKwG,MAAM,YAAa,CACvBtK,GAAIA,EACJ4C,MAAOkB,IAEDgP,QAAQ/E,cA/Bc,IAqC/BjN,QACCzB,KAAKqB,OAAS,KACdrB,KAAKuB,cAAgB,GACrBvB,KAAKsB,WAAa,EAEdtB,KAAK4Q,WACRkO,cAAc9e,KAAK4Q,UACnB5Q,KAAK4Q,SAAW,MAGb5Q,KAAKoc,uBACRpc,KAAKoc,qBAAuB,MAGzBpc,KAAKyQ,gBAERzQ,KAAKyQ,cAAciN,OACnB1d,KAAKyQ,cAAc8M,OAAOC,YAAYrK,QAASsK,IAC9CA,EAAMC,SAEP1d,KAAKyQ,cAAgB,OAkBvBjM,WAAWgI,GACVxM,KAAKwB,cAAgBgL,KCj9CmN,MCG3O,SAAS,GAAchG,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,GAAY,eACd,GACA1G,EACA8E,GACA,EACA,GACA,WACA,MACC,GAGY,gB","file":"matrix-element.6.min.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a \r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./picturePreview.vue?vue&type=template&id=4b882d9f&scoped=true&\"\nimport script from \"./picturePreview.vue?vue&type=script&lang=js&\"\nexport * from \"./picturePreview.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./picturePreview.vue?vue&type=style&index=0&id=4b882d9f&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"4b882d9f\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./InputField.vue?vue&type=template&id=b9fd73f0&scoped=true&\"\nimport script from \"./InputField.vue?vue&type=script&lang=js&\"\nexport * from \"./InputField.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./InputField.vue?vue&type=style&index=0&id=b9fd73f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"b9fd73f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordButton_wrapper\"},[_c('div',{ref:\"holder\",staticClass:\"recordButton_holder\",class:{hold: _vm.isHold}},[_c('i',{staticClass:\"icon fas\",class:_vm.isHold ? 'fa-lock': 'fa-lock-open'})]),(!_vm.isHold)?_c('div',{ref:\"toggle\",staticClass:\"recordButton_micro recordButton_main\",class:{active: _vm.isRecording, disabled: _vm.disabled},on:{\"mousedown\":_vm.mousedown,\"mouseup\":_vm.mouseup,\"touchstart\":_vm.handleTouchStart,\"touchend\":_vm.handleTouchEnd,\"touchcancel\":_vm.handleTouchEnd}},[_c('i',{staticClass:\"icon fas fa-microphone\"})]):_vm._e(),(_vm.isHold)?_c('div',{ref:\"stop\",staticClass:\"recordButton_stop recordButton_main\",on:{\"click\":_vm.recordEnd}},[_c('i',{staticClass:\"icon fas fa-stop\"})]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n\tname: \"recordVoice\",\r\n\tprops: {\r\n\t\tisRecording: {\r\n\t\t\ttype: Boolean,\r\n\t\t\trequired: true\r\n\t\t},\r\n\t\tprepareRecording: {\r\n\t\t\ttype: Boolean\r\n\t\t},\r\n\t\tdisabled: Boolean,\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tstart: 0,\r\n\t\t\tisHold: false,\r\n\t\t\tdirection: null\r\n\t\t}\r\n\t},\r\n\tcomputed: {\r\n\t\t...mapState({\r\n\t\t\tmobile: state => state.mobile,\r\n\t\t})\r\n\t},\r\n\tmounted() {\r\n\t\r\n\t},\r\n\tbeforeDestroy() {\r\n\r\n\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\tif (this.isRecording) {\r\n\t\t\tthis.$emit('onRecordingStop', {cancel : true})\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\r\n\t\tmouseup : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchEnd(e)\r\n\t\t},\r\n\r\n\t\tmousedown : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchStart(e)\r\n\t\t},\r\n\t\t\r\n\t\thandleTouchStart(e) {\r\n\r\n\t\t\tconsole.log(\"E\", e, this.isHold, this.isRecording)\r\n\r\n\r\n\t\t\tif(!this.isRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStart')\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tif(this.isHold) return\r\n\t\t\t}\r\n\r\n\t\t\tthis.start = {\r\n\t\t\t\tY: e.changedTouches ? e.changedTouches[0].pageY : e.pageY,\r\n\t\t\t\tX: e.changedTouches ? e.changedTouches[0].pageX : e.pageX\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tdocument.addEventListener('mousemove', this.handleMove)\r\n\t\t\telse\r\n\t\t\t\tdocument.addEventListener('touchmove', this.handleMove)\r\n\r\n\t\t},\r\n\t\thandleTouchEnd(e) {\r\n\t\t\tconsole.log(\"E\", e, this.isHold)\r\n\r\n\t\t\tif (this.isHold) return\r\n\r\n\t\t\tif (this.isRecording || this.prepareRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStop', {\r\n\t\t\t\t\tsendnow : true\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t},\r\n\r\n\t\tclearStyle(){\r\n\r\n\t\t\tif (this.$refs.toggle){\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\tthis.$refs.toggle.classList.remove('outside')\r\n\t\t\t}\r\n\r\n\t\t\tif (this.$refs.holder){\r\n\t\t\t\tthis.$refs.holder.classList.remove('active')\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\thandleMove(e) {\r\n\r\n\t\t\tconsole.log(\"E\", e, this.isRecording)\r\n\r\n\t\t\tif(!this.isRecording) return\r\n\r\n\t\t\tlet deltaY = this.start.Y - e.pageY\r\n\t\t\tlet deltaX = this.start.X - e.pageX\r\n\r\n\t\t\tif (e?.changedTouches?.length) {\r\n\t\t\t\tdeltaY = this.start.Y - e.changedTouches[0].pageY\r\n\t\t\t\tdeltaX = this.start.X - e.changedTouches[0].pageX\r\n\t\t\t}\r\n\r\n\t\t\tif (deltaY > 5 && deltaX < 5) {\r\n\t\t\t\tthis.direction = 'Y'\r\n\t\t\t} else {\r\n\t\t\t\tthis.direction = 'X'\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (deltaY > 5 && this.direction === 'Y') {\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('active'))\r\n\t\t\t\t\tthis.$refs.holder.classList.add('active')\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,-${deltaY}px)`\r\n\r\n\t\t\t\tif (deltaY > 70) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\r\n\t\t\t\t\tthis.isHold = true\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t} else if (deltaX > 5 && this.direction === 'X') {\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(-${deltaX}px, 0)`\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('outside'))\r\n\t\t\t\t\tthis.$refs.toggle.classList.add('outside')\r\n\r\n\t\t\t\tthis.$emit('canceling', (deltaX - 5) / 130)\r\n\t\t\t\t\r\n\t\t\t\tif (deltaX > 130) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\t\t\t\t\tthis.$emit('onRecordingStop', { cancel: true })\r\n\t\t\t\t\tthis.$emit('onClear')\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.clearStyle()\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\trecordEnd(e) {\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t\tif (this.isRecording && this.isHold) {\r\n\r\n\t\t\t\tthis.$emit('onRecordingStop', {})\r\n\t\t\t\tthis.isHold = false\r\n\r\n\t\t\t\treturn\r\n\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t\r\n\t}\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=34d15f18&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=34d15f18&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"34d15f18\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordProgress\"},[(_vm.isRecording)?_c('div',{staticClass:\"indicatorWrapper\"},[_c('div',{staticClass:\"indicator\",class:{'recording': _vm.isRecording}})]):_c('div',{staticClass:\"del\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-trash\"})]),_c('div',{staticClass:\"timer\"},[_vm._v(_vm._s(_vm.timer))]),_c('div',{ref:\"graph\",staticClass:\"graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"id\":\"canvas\",\"width\":_vm.width,\"height\":\"20\"}})]),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isRecording && _vm.opacity),expression:\"isRecording && opacity\"}],ref:\"cancel\",staticClass:\"cancel\"},[_c('span',[_vm._v(\"Slide left to cancel\")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default {\r\n name: \"recordProgress\",\r\n props: {\r\n recordTime: {\r\n type: Number,\r\n required: true\r\n },\r\n rmsData: {\r\n type: Array,\r\n required: true\r\n },\r\n isRecording: {\r\n type: Boolean\r\n },\r\n opacity: {}\r\n },\r\n data() {\r\n return {\r\n width: 0,\r\n }\r\n },\r\n computed: {\r\n timer() {\r\n let minute = Math.floor(this.recordTime / 60000)\r\n let sec = Math.floor(this.recordTime / 1000) % 60\r\n return `${minute ? minute + ':' : '0:'}${(sec < 10) ? '0' + sec : sec}`\r\n },\r\n\r\n rmsDataLast(){\r\n return _.last(this.rmsData, 25)\r\n }\r\n },\r\n\r\n watch : {\r\n rmsData : _.throttle(function(){\r\n this.draw()\r\n }, 30),\r\n\r\n opacity : function(){\r\n this.$refs.cancel.style.opacity = this.opacity\r\n }\r\n },\r\n\r\n mounted() {\r\n this.$refs.cancel.style.opacity = 0\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n\r\n window.addEventListener(\"resize\", this.resize);\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.resize)\r\n },\r\n\r\n methods: {\r\n resize() {\r\n let timer = null\r\n\r\n var re = () => {\r\n if (!timer) {\r\n timer = setTimeout(() => {\r\n timer = null\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n }, 50)\r\n }\r\n }\r\n\r\n re()\r\n },\r\n draw() {\r\n\r\n if(!this.$refs.canvas) return\r\n\r\n const ctx = this.$refs.canvas.getContext(`2d`);\r\n let x = 0\r\n let count = 50\r\n let width = 2 //this.width / 200\r\n var l = this.rmsDataLast.length\r\n var c = Math.max(Math.floor(l / count), 1)\r\n\r\n ctx.clearRect(0, 0, this.width, 20);\r\n\r\n for (let i = 0; i < l; i = i + c) {\r\n ctx.fillStyle = '#00a4ff'\r\n ctx.fillRect(i * 2 * width, 10 - this.rmsDataLast[i] / 8, width, this.rmsDataLast[i] / 4 + 1)\r\n }\r\n\r\n },\r\n clear() {\r\n this.$emit('onClear')\r\n }\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3f87c0fa&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=3f87c0fa&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3f87c0fa\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"upload\"},[_c('div',{staticClass:\"uploadWrapper\"},[_c('div',{staticClass:\"contentWrapper\"},[_vm._t(\"content\",function(){return [_c('i',{staticClass:\"fas fa-plus\"})]})],2),_c('div',{staticClass:\"inputWrapper\"},[_c('input',{attrs:{\"type\":\"file\",\"multiple\":_vm.multiple},on:{\"change\":_vm.upload}})])]),(_vm.dropzone)?_c('div',{ref:\"dropzone\",staticClass:\"dropzone\",class:{dropzone : _vm.dropzone}},[_vm._t(\"dropzone\",function(){return [_c('i',{staticClass:\"fas fa-plus\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.dragAndDropAFile\"))+\" \")]})],2):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a28e80a8&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=a28e80a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a28e80a8\",\n null\n ,true\n)\n\nexport default component.exports","import f from \"@/application/functions\";\r\nimport InputField from './InputField/InputField.vue'\r\nimport recordVoice from '@/components/assets/recordVoice/index.vue';\r\nimport { mapState } from \"vuex\";\r\nimport Images from '@/application/utils/images.js'\r\n\r\nimport contacts from '@/components/contacts/list/index.vue'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport recordProgress from '@/components/assets/recordProgress/index.vue';\r\n\r\nimport upload from '@/components/assets/upload/index.vue';\r\n\r\nimport { cancelable } from 'cancelable-promise';\r\nexport default {\r\n\tname: 'chatInput',\r\n\tprops: {\r\n\t\tchat: Object,\r\n\t\tu: String,\r\n\t\trelationEvent: Object\r\n\t},\r\n\r\n\tcomponents: { InputField, contacts, preview, recordProgress, recordVoice, upload },\r\n\r\n\tdata: function () {\r\n\r\n\t\treturn {\r\n\t\t\tupload: true,\r\n\t\t\ttest: [],\r\n\t\t\tloading: false,\r\n\t\t\ttext: '',\r\n\t\t\tfile: {},\r\n\t\t\tfileInfo: {},\r\n\t\t\tready: false,\r\n\t\t\tcreating: false,\r\n\t\t\tuserId: '',\r\n\t\t\tshowuserselect: null,\r\n\t\t\tanyUrlMeta: String,\r\n\t\t\tjoinedMembers: [],\r\n\t\t\ttipvalue: null,\r\n\t\t\ttipuserindex: 0,\r\n\t\t\trecord: null,\r\n\t\t\trecordRmsData: [],\r\n\t\t\tisRecording: false,\r\n\r\n\t\t\tmediaRecorder: null,\r\n\t\t\taudioContext: null,\r\n\t\t\taudioAnalyser: null,\r\n\r\n\t\t\trecordTime: 0,\r\n\t\t\tinterval: null,\r\n\t\t\tcancelOpacity: 0,\r\n\t\t\tmicrophoneDisabled: false,\r\n\t\t\tprepareRecording: false,\r\n\r\n\t\t\tcancelledCordovaMediaRecorder: false\r\n\t\t}\r\n\r\n\t},\r\n\r\n\r\n\twatch: {\r\n\t\tusersForKeysHash: {\r\n\t\t\t//immediate: true,\r\n\t\t\thandler: function () {\r\n\t\t\t}\r\n\t\t},\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (!this.tipusers.length) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t} else {\r\n\t\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeDestroy() {\r\n\t\tif (this.audioContext)\r\n\t\t\tthis.audioContext.close()\r\n\t},\r\n\r\n\tcomputed: {\r\n\t\tvoiceEnable() {\r\n\t\t\treturn this.$store.state.voiceMessagesEnabled\r\n\t\t},\r\n\r\n\t\tconnect: function () {\r\n\t\t\treturn this.$store.state.contact\r\n\t\t},\r\n\t\tpkoindisabled : function(){\r\n\t\t\treturn this.$store.state.pkoindisabled\r\n\t\t},\r\n\t\tmenuItems: function () {\r\n\t\t\tvar menuItems = []\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\r\n\t\t\t\tif (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.mobile.supportimagegallery()) {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandlerCustom\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandler\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t\tupload: {\r\n\t\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\t\textensions: ['jpg', 'jpeg', 'png', 'webp'],\r\n\t\t\t\t\t\t\tmaxsize: 100,\r\n\t\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\tmenuItems.push({\r\n\t\t\t\t\tclick: \"fileHandler\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendFile\"),\r\n\t\t\t\t\ticon: \"fas fa-sticky-note\",\r\n\r\n\t\t\t\t\tupload: {\r\n\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\textensions: [],\r\n\t\t\t\t\t\tmaxsize: 25,\r\n\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.transaction && !this.pkoindisabled) {\r\n\t\t\t\tmenuItems.unshift({\r\n\t\t\t\t\tclick: \"sendtransactionWrapper\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendCoins\"),\r\n\t\t\t\t\ticon: \"fas fa-wallet\"\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn menuItems\r\n\t\t},\r\n\t\t...mapState([\r\n\t\t\t'chats'\r\n\t\t]),\r\n\r\n\t\tuserlist: function () {\r\n\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\treturn this.core.mtrx.chatUsersInfo(this.chat.roomId, 'anotherChatUsers')\r\n\r\n\t\t},\r\n\r\n\t\ttransaction: function () {\r\n\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.ui.wallet.send')\r\n\t\t},\r\n\r\n\t\tuusers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn u\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tausers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn this.core.user.matrixId(u)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tstateChat: function () {\r\n\t\t\tvar id = this.$route.query.id\r\n\t\t\treturn this.$store.state.chatsMap[id]\r\n\t\t},\r\n\t\tinvited: function () {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tif (this.u) return this.ausers\r\n\t\t\t\treturn []\r\n\t\t\t}\r\n\r\n\t\t\treturn _.map(_.filter(this.chat.currentState.getMembers(), function (m, v) {\r\n\t\t\t\treturn m.membership === 'invite'\r\n\t\t\t}), function (u) {\r\n\t\t\t\treturn u.userId\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tjoined: function () {\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\tlet roomId = this.chat.roomId\r\n\t\t\tlet self = this\r\n\t\t\tlet arr = []\r\n\t\t\tlet members = 0\r\n\r\n\t\t\tthis.chat.currentState.getMembers().forEach(function (user) {\r\n\t\t\t\tif (user.membership === 'join') {\r\n\t\t\t\t\tarr.push(user.userId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\treturn arr\r\n\t\t},\r\n\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (this.tipvalue === null) return []\r\n\t\t\tif (this.tipvalue === '') return this.userlist\r\n\r\n\t\t\tvar value = this.tipvalue.toLowerCase()\r\n\r\n\t\t\tvar u = _.filter(this.userlist, function (u) {\r\n\t\t\t\treturn u.name.toLowerCase().indexOf(value) == 0 && u.name.toLowerCase() != value\r\n\t\t\t})\r\n\r\n\t\t\treturn u\r\n\r\n\t\t},\r\n\r\n\t\tmaintipuser: function () {\r\n\t\t\tif (this.tipusers.length) {\r\n\t\t\t\treturn this.tipusers[this.tipuserindex || 0]\r\n\t\t\t}\r\n\r\n\t\t\treturn null\r\n\t\t},\r\n\t},\r\n\r\n\tcreated() {\r\n\r\n\t},\r\n\r\n\t///\r\n\r\n\tmounted() {\r\n\t\tthis.ready = true\r\n\r\n\r\n\t\tif (!this.chat && this.core.mtrx.client) {\r\n\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t},\r\n\r\n\tmethods: {\r\n\t\twait: function () {\r\n\t\t\treturn this.$f.pretry(() => {\r\n\t\t\t\treturn this.core.mtrx.client && this.core.mtrx.access\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tbrowsetip: function (increase) {\r\n\r\n\t\t\tincrease ? this.tipuserindex++ : this.tipuserindex--\r\n\r\n\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t}\r\n\r\n\t\t\tif (this.tipuserindex < 0) {\r\n\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tselectcurrenttip: function () {\r\n\t\t\tthis.insertuser(this.tipusers[this.tipuserindex || 0])\r\n\t\t},\r\n\r\n\t\tinsertuser: function (user = {}) {\r\n\t\t\tvar name = user.name || ''\r\n\r\n\t\t\tthis.$refs['newinput'].inserttip(name)\r\n\t\t},\r\n\r\n\t\ttipBySearch: function (value) {\r\n\t\t\tthis.tipvalue = value\r\n\t\t},\r\n\r\n\t\tshowuserselected: function (contact, action) {\r\n\t\t\tthis[action](contact)\r\n\t\t},\r\n\r\n\r\n\t\tresizeImage: function (base64) {\r\n\r\n\t\t\tvar ftype = base64.split(';')[0].split('/')[1];\r\n\t\t\tvar images = new Images()\r\n\r\n\t\t\treturn images.resize['fit'](base64, 1024, 1024, ftype, 0.95).then(base64 => {\r\n\r\n\t\t\t\treturn Promise.resolve(base64)\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.reject(e)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tcameraHandlerCustom: function () {\r\n\t\t\tvar result = []\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t\twindow.POCKETNETINSTANCE.platform.ui.uploadImage({\r\n\t\t\t\tmultiple: true,\r\n\r\n\t\t\t\taction: ({ base64 }, resolve) => {\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\treturn this.resizeImage(base64).then(base64 => {\r\n\r\n\t\t\t\t\t\treturn f.Base64.toFile(base64).then(file => {\r\n\t\t\t\t\t\t\tvar data = {\r\n\t\t\t\t\t\t\t\tbase64,\r\n\t\t\t\t\t\t\t\tfile\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tresult.push(data)\r\n\r\n\t\t\t\t\t\t\tthis.uploadUploaded(null, data)\r\n\r\n\t\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonSuccess: (imgs) => {\r\n\t\t\t\t\tthis.uploadUploadedAll()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendtransactionWrapper: function () {\r\n\r\n\t\t\tthis.menuIsVisible = false\r\n\r\n\t\t\tvar users = _.filter(_.map(this.joined, (j) => {\r\n\t\t\t\treturn this.$f.deep(this, '$store.state.users.' + this.$f.getmatrixid(j)) || null\r\n\t\t\t}), (r) => {\r\n\t\t\t\treturn r && r.source && r.id != this.core.user.userinfo?.id\r\n\t\t\t})\r\n\r\n\t\t\tif (!users.length) {\r\n\r\n\t\t\t\treturn 'users.length'\r\n\t\t\t}\r\n\r\n\t\t\tif (users.length > 1) {\r\n\r\n\t\t\t\tthis.core.store.commit('setmodal', {\r\n\t\t\t\t\tcaption: this.$i18n.t(\"caption.sendTransactionTo\"),\r\n\t\t\t\t\ttype: 'showuserselect',\r\n\t\t\t\t\tdata: {\r\n\t\t\t\t\t\tusers: users,\r\n\t\t\t\t\t\taction: 'sendtransaction',\r\n\t\t\t\t\t\tuserselected: (c) => {\r\n\t\t\t\t\t\t\tthis.showuserselected(c, 'sendtransaction')\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\t/*this.showuserselect = {\r\n\t\t\t\t users : users,\r\n\t\t\t\t action : 'sendtransaction'\r\n\t\t\t\t}*/\r\n\t\t\t} else {\r\n\t\t\t\tthis.sendtransaction(users[0])\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t},\r\n\r\n\t\tsendtransaction: function (user) {\r\n\t\t\tvar api = this.transaction\r\n\r\n\t\t\t//TODO get address and send transaction\r\n\r\n\t\t\tapi({\r\n\t\t\t\troomid: this.chat.roomId,\r\n\t\t\t\taddress: user.source.address\r\n\t\t\t})\r\n\r\n\t\t\t/*.then(({txid, from}) => {\r\n\t \r\n\t\t\t return this.core.mtrx.transaction(this.chat.roomId, txid)\r\n\t \r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\temitInputData: function () {\r\n\t\t\tthis.$emit('emptyInput')\r\n\t\t\tthis.upload = true\r\n\t\t},\r\n\r\n\t\tHideUploadPic() {\r\n\t\t\tthis.upload = false\r\n\t\t},\r\n\r\n\t\temitUrl: function (url) {\r\n\t\t\tthis.$emit('setMetaUrl', url)\r\n\t\t},\r\n\r\n\t\tnewchat() {\r\n\r\n\t\t\tif (this.u) {\r\n\t\t\t\tthis.$store.state.globalpreloader = true\r\n\t\t\t\tvar matrixId = null\r\n\t\t\t\tvar myMatrixId = null\r\n\t\t\t\tvar chat = null\r\n\t\t\t\tvar id = ''\r\n\r\n\t\t\t\tthis.creating = true\r\n\t\t\t\treturn this.core.user.usersInfo(this.uusers).then(info => {\r\n\r\n\t\t\t\t\tif (this.uusers.length == 1) {\r\n\r\n\t\t\t\t\t\tvar _info = info[0]\r\n\r\n\t\t\t\t\t\tif (!_info || !_info.keys || _info.keys.length < 12) {\r\n\r\n\t\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.core.user.userinfo.keys.length < 12) {\r\n\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t//return Promise.reject('ny3')\r\n\r\n\t\t\t\t\tid = this.core.mtrx.kit.tetatetid(info[0], this.core.user.userinfo)\r\n\r\n\t\t\t\t\tmatrixId = this.core.user.matrixId(info[0].id)\r\n\t\t\t\t\tmyMatrixId = this.core.user.matrixId(this.core.user.userinfo.id)\r\n\r\n\t\t\t\t\tvar initialstate = [{\r\n\t\t\t\t\t\t\"type\": \"m.set.encrypted\",\r\n\t\t\t\t\t\t\"state_key\": \"\",\r\n\t\t\t\t\t\t\"content\": {\r\n\t\t\t\t\t\t\tencrypted: true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}]\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.createRoom(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\troom_alias_name: id,\r\n\t\t\t\t\t\t\tvisibility: 'private',\r\n\t\t\t\t\t\t\tinvite: [matrixId],\r\n\t\t\t\t\t\t\tname: '#' + id,\r\n\t\t\t\t\t\t\tinitial_state: initialstate\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\r\n\t\t\t\t}).then(_chat => {\r\n\r\n\t\t\t\t\tchat = _chat\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tlet m_chat = this.core.mtrx.client.getRoom(_chat.room_id)\r\n\t\t\t\t\tlet event = m_chat.currentState.getStateEvents(\"m.room.power_levels\")\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.setPowerLevel(chat.room_id, matrixId, 100, event[0]).catch(e => {\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\r\n\t\t\t\t\tif (this.connect && this.connect == id) {\r\n\t\t\t\t\t\tthis.greetings()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.$store.commit('CONTACT', false)\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tif (e && e.errcode == 'M_ROOM_IN_USE') {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.client.joinRoom('#' + id + ':' + this.core.mtrx.baseUrl.replace(\"https://\", \"\")).then(() => {\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn Promise.reject('u')\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tmaySendMessage() {\r\n\t\t\treturn this.chat && this.chat.maySendMessage()\r\n\t\t},\r\n\r\n\t\tgreetings() {\r\n\t\t\tthis.send('👋').then(r => {\r\n\t\t\t\treturn Promise.resolve(r)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendinput(text) {\r\n\r\n\t\t\tthis.send(text).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\ttextCutLimit: function (text, limit) {\r\n\t\t\ttext = text.trim();\r\n\t\t\tif (text.length <= limit) return text;\r\n\r\n\t\t\ttext = text.slice(0, limit);\r\n\r\n\t\t\treturn text.trim() + \"...\";\r\n\t\t},\r\n\r\n\t\treplaceMentions(text) {\r\n\r\n\t\t\t_.each(this.userlist, function (user) {\r\n\t\t\t\ttext = text.replace(new RegExp('@' + user.name, 'g'), '@' + user.id + ':' + user.name)\r\n\t\t\t})\r\n\r\n\t\t\treturn text\r\n\t\t},\r\n\r\n\t\tsend(text) {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\t//return this.chat.pcrypto.getOrCreateCommonKey()\r\n\r\n\t\t\t//return this.chat.pcrypto.sendCommonKey()\r\n\r\n\t\t\t//return\r\n\r\n\t\t\tthis.$emit(\"sending\")\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\t\t\t\tthis.focus()\r\n\t\t\t}\r\n\r\n\t\t\treturn this.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat && !this.creating\r\n\r\n\t\t\t}).then((r) => {\r\n\r\n\t\t\t\tthis.$emit('sent')\r\n\r\n\t\t\t\ttext = this.replaceMentions(text)\r\n\r\n\t\t\t\tif (this.relationEvent) {\r\n\r\n\t\t\t\t\tif (this.relationEvent.type == 'm.replace' && this.relationEvent.event) {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.textEvent(this.chat, text).then(r => {\r\n\r\n\t\t\t\t\t\t\tr['m.relates_to'] = {\r\n\t\t\t\t\t\t\t\t\"rel_type\": \"m.replace\",\r\n\t\t\t\t\t\t\t\t\"event_id\": this.core.mtrx.clearEventId(this.relationEvent.event) || f.makeid(),\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar editEvent = r\r\n\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.body = r.body\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.block = r.block\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.msgtype = r.msgtype\r\n\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decryptKey\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decrypted\r\n\r\n\t\t\t\t\t\t\treturn this.core.mtrx.client.sendEvent(this.chat.roomId, 'm.room.message', editEvent)\r\n\r\n\t\t\t\t\t\t}).then(r => {\r\n\r\n\t\t\t\t\t\t\tthis.core.store.dispatch('FETCH_EVENTS')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('clearRelationEvent')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('force')\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\t\treturn Promise.reject(e)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.core.mtrx.sendtext(this.chat, text, { relation: this.relationEvent })\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\r\n\t\t\t\tthis.$emit('sentMessageError', {\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tpasteImage(data) {\r\n\t\t\tthis.sendImage({ base64: data })\r\n\t\t},\r\n\r\n\t\tsendImage: function ({ base64, file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"image\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\t\t\t//setTimeout(() => {\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\t\t\t\tif (meta.aborted)\r\n\t\t\t\t\treturn Promise.reject('aborted')\r\n\r\n\t\t\t\treturn this.core.mtrx.sendImage(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t})\r\n\t\t\t//}, 5000)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tcanencryptfilesize: function (file) {\r\n\r\n\t\t\tvar s = 10 * 1024 * 1024\r\n\r\n\t\t\tif (!this.chat.pcrypto.canBeEncrypt()) {\r\n\t\t\t\treturn Promise.resolve(false)\r\n\t\t\t}\r\n\r\n\t\t\tif (file.size > s) {\r\n\r\n\r\n\t\t\t\treturn this.$dialog.confirm(\r\n\t\t\t\t\t'Files larger than 10 megabytes are not encrypted. Do you want to send the file unencrypted?', {\r\n\t\t\t\t\tokText: 'Yes',\r\n\t\t\t\t\tcancelText: 'No, cancel'\r\n\t\t\t\t})\r\n\r\n\t\t\t\t\t.then((dialog) => {\r\n\r\n\t\t\t\t\t\treturn Promise.resolve(true)\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.reject('cancel')\r\n\t\t\t\t\t})\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve(false)\r\n\t\t},\r\n\r\n\t\tsendFile: function ({ file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"file\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tinfo: {\r\n\t\t\t\t\tname: file.name,\r\n\t\t\t\t\tsize: file.size\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\treturn this.canencryptfilesize(file)\r\n\r\n\r\n\t\t\t}).then((notenc) => {\r\n\r\n\t\t\t\treturn this.core.mtrx.sendFile(this.chat, file, meta, { relation: this.relationEvent }, notenc)\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].focus()\r\n\t\t},\r\n\r\n\t\tfocused: function () {\r\n\t\t\tthis.$emit('focused')\r\n\t\t},\r\n\r\n\t\tblur: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blur()\r\n\t\t},\r\n\r\n\t\tblurifempty: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blurifempty()\r\n\t\t},\r\n\r\n\t\tchange: function () {\r\n\t\t},\r\n\r\n\t\tsetText: function (text) {\r\n\t\t\tthis.text = text\r\n\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].setText(text)\r\n\t\t},\r\n\r\n\t\tkeyup: function (evt) {\r\n\t\t\tvar value = evt.target.value\r\n\r\n\t\t\tif (value === '') {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t\treturn\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', true)\r\n\t\t\t}\r\n\r\n\t\t\tthis.text = value\r\n\t\t\tthis.anyUrlMeta = f.getUrl(this.text)\r\n\r\n\r\n\t\t\tif (this.anyUrlMeta !== undefined) {\r\n\t\t\t\tthis.$emit('setMetaUrl', this.anyUrlMeta)\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t}\r\n\r\n\t\t\tif (this.chat)\r\n\t\t\t\tthis.core.mtrx.client.sendTyping(this.chat.roomId, true, 100)\r\n\t\t},\r\n\r\n\t\tmenuItemClick(item, rowObject) {\r\n\t\t\tthis[item.click](rowObject);\r\n\t\t},\r\n\r\n\t\tmenuItemLoadedHandler: function (value) {\r\n\r\n\t\t\tthis.menuIsVisible = value\r\n\r\n\t\t\treturn this.menuIsVisible\r\n\t\t},\r\n\r\n\t\tuploadStart(item, files) {\r\n\r\n\t\t},\r\n\r\n\t\tuploadError(item, error) {\r\n\t\t\tthis.$store.commit('icon', {\r\n\t\t\t\ticon: 'error',\r\n\t\t\t\tmessage: error.text\r\n\t\t\t})\r\n\t\t},\r\n\t\tgetImg() {\r\n\t\t\treturn this.imgs = true\r\n\t\t},\r\n\t\tuploadSizeError(value) {\r\n\t\t\tif (!value) {\r\n\t\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t\t}\r\n\t\t},\r\n\t\tuploadUploaded(item, data) {\r\n\t\t\tconst validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/webp'];\r\n\r\n\r\n\t\t\tif (!validImageTypes.includes(data.file.type)) {\r\n\t\t\t\tthis.sendFile(data)\r\n\t\t\t} else {\r\n\t\t\t\treturn this.sendImage(data)\r\n\t\t\t}\r\n\t\t},\r\n\t\timageWH(file) {\r\n\t\t\tconst img = new Image();\r\n\t\t\tvar imgInfo = {};\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\timg.onload = function () {\r\n\t\t\t\t\timgInfo.w = this.width\r\n\t\t\t\t\timgInfo.h = this.height\r\n\t\t\t\t\tresolve(imgInfo)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.onerror = function (e) {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.src = file.base64\r\n\t\t\t})\r\n\r\n\t\t},\r\n\t\tuploadUploadedAll(item, result) {\r\n\t\t\tthis.$store.state.loading = false\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t},\r\n\r\n\t\tcatchPermissonsError(err) {\r\n\r\n\t\t\tif (err == 'permissions' || (err.toString && err.toString().indexOf('Permission') > -1)) {\r\n\t\t\t\tthis.microphoneDisabled = true\r\n\r\n\t\t\t\tif (window.cordova) {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccesscordova'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccessbrowser'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif ((err.toString && err.toString().indexOf('device not found') > -1)) {\r\n\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\tthis.$i18n.t('micdevicenotfound'), {\r\n\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t})\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$dialog.confirm(\r\n\t\t\t\tthis.$i18n.t('micaccesscommonproblem'), {\r\n\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t})\r\n\r\n\t\t\tconsole.error(err)\r\n\t\t},\r\n\r\n\t\tgetFileIosCordova (path) {\r\n\r\n\t\t\tconsole.log('load', path)\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\twindow.resolveLocalFileSystemURL(path, (entry) => {\r\n\r\n\r\n\t\t\t\t\tif(!entry){\r\n\t\t\t\t\t\treturn reject('noentry')\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tentry.file((file) => {\r\n\t\t\t\t\t\tvar reader = new FileReader()\r\n\r\n\t\t\t\t\t\tconsole.log('file', file)\r\n\t\r\n\t\t\t\t\t\treader.onloadend = function() {\r\n\t\t\t\t\t\t\tvar blob = new Blob([new Uint8Array(this.result)], {type : file.type})\r\n\r\n\t\t\t\t\t\t\tconsole.log('blob', blob)\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\r\n\t\t\t\t\t\t\tresolve(blob)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treader.onerror = (e) => {\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file)\r\n\t\t\t\t\t})\r\n\t\t\t\t}, (e) => {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t\t\r\n\t\t},\r\n\r\n\t\tinitRecordingCordova() {\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.media.permissions({ audio: true }).then(() => {\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tconsole.error(err)\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\t\t\tthis.prepareRecording.then(() => {\r\n\r\n\t\t\t\tconsole.log(\"START RECORDING\")\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tvar path = 'recording.mp3'\r\n\r\n\t\t\t\tif(f.isios()) path = 'cdvfile://localhost/temporary/recording.m4a'\r\n\r\n\t\t\t\tvar sec = 0\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\r\n\t\t\t\t//var startedTime = (new Date()).getTime() / 1000\r\n\r\n\t\t\t\tvar media = this.cordovaMediaRecorder = new Media(path, () => {\r\n\r\n\t\t\t\t\tconsole.log(\"MEDIA PREPARED\", this.cancelledCordovaMediaRecorder)\r\n\r\n\t\t\t\t\tthis.recordTime = 0\r\n\r\n\t\t\t\t\tmedia.release()\r\n\r\n\t\t\t\t\tif (this.cancelledCordovaMediaRecorder) {\r\n\r\n\t\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar fu = null\r\n\r\n\t\t\t\t\t/*if(f.isios()){ */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfu = this.getFileIosCordova(f.isios() ? path : window.cordova.file.externalDataDirectory + path).then(blob => {\r\n\t\t\t\t\t\t\treturn Promise.resolve({\r\n\t\t\t\t\t\t\t\tdata : blob\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*}\r\n\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tfu = f.fetchLocal(path)\r\n\t\t\t\t\t}*/\r\n\r\n\t\t\t\t\tfu.then(r => {\r\n\t\t\t\t\t\t///temp\r\n\t\t\t\t\t\t/*if (f.isios())\r\n\t\t\t\t\t\t\tr.duration = (new Date()).getTime() / 1000 - startedTime\r\n\r\n\t\t\t\t\t\tconsole.log(\"R\", r)\r\n\r\n\t\t\t\t\t\t/*var e = {\r\n\t\t\t\t\t\t\tdata : r.data\r\n\t\t\t\t\t\t}*/\r\n\r\n\t\t\t\t\t\tconsole.log('media.duration', media.duration)\r\n\r\n\t\t\t\t\t\tif (media.duration && media.duration > 0){\r\n\t\t\t\t\t\t\tr.duration = media.duration\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.createVoiceMessage(r, true)\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t}).finally(() => {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}, (e) => {\r\n\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.isRecording = false\r\n\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\tvar rmsdata = []\r\n\r\n\t\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\t\tif (currentPlaying) {\r\n\t\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\t\t// get media amplitude\r\n\r\n\t\t\t\t\tif(f.isios()){\r\n\t\t\t\t\t\trmsdata.push(1)\r\n\r\n\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tthis.cordovaMediaRecorder.getCurrentAmplitude(\r\n\t\t\t\t\t\t\t// success callback\r\n\t\t\t\t\t\t\t(amp) => {\r\n\t\r\n\t\t\t\t\t\t\t\trmsdata.push(amp * 1000)\r\n\t\r\n\t\t\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\r\n\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tfunction (e) {\r\n\t\t\t\t\t\t\t\tconsole.log(\"E\", e)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\t\tif (sec % 1000 === 0) this.recordTime = sec\r\n\r\n\t\t\t\t}, 50);\r\n\r\n\t\t\t\tthis.isRecording = true\r\n\t\t\t\tthis.cancelOpacity = 0\r\n\t\t\t\tthis.recordRmsData = []\r\n\t\t\t\tthis.recordTime = 0\r\n\t\t\t\tthis.record = null\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.startRecord();\r\n\r\n\t\t\t}).catch((e) => { \r\n\t\t\t\tconsole.error(e)\r\n\r\n\r\n\t\t\t}).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tinitRecording() {\r\n\r\n\t\t\tif (this.prepareRecording || this.isRecording || this.cordovaMediaRecorder) return\r\n\r\n\t\t\tconsole.log(\"INIT RECORDING\")\r\n\r\n\t\t\tif (window.cordova) {\r\n\t\t\t\treturn this.initRecordingCordova()\r\n\t\t\t}\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.initMediaRecorder().then((recorder) => {\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tif (this.prepareRecording) {\r\n\t\t\t\t\treturn Promise.resolve(recorder)\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\t\ttrack.stop();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\r\n\t\t\tthis.prepareRecording.then((recorder) => {\r\n\r\n\r\n\t\t\t\tthis.mediaRecorder = recorder\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\t\t\t\tthis.audioAnalyser = this.audioContext.createAnalyser()\r\n\r\n\t\t\t\t//var audioDataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tvar src = this.audioContext.createMediaStreamSource(this.mediaRecorder.stream)\r\n\t\t\t\tsrc.connect(this.audioAnalyser)\r\n\r\n\t\t\t\tthis.startRecording()\r\n\r\n\t\t\t}).catch(() => { }).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tstartRecording() {\r\n\r\n\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\tif (currentPlaying) {\r\n\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t}\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', true)\r\n\r\n\t\t\tthis.isRecording = true\r\n\t\t\tthis.cancelOpacity = 0\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\t\t\tthis.record = null\r\n\t\t\tthis.mediaRecorder.start()\r\n\r\n\t\t\tvar sec = 0\r\n\t\t\tvar rmsdata = []\r\n\r\n\r\n\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\tvar dataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tthis.audioAnalyser.getByteFrequencyData(dataArray)\r\n\r\n\r\n\t\t\t\trmsdata.push(this.generateRms(dataArray))\r\n\r\n\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\r\n\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\r\n\t\t\t\tif (sec % 1000 === 0) {\r\n\t\t\t\t\tthis.recordTime = sec\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 50)\r\n\r\n\t\t},\r\n\r\n\r\n\t\tcheckaudioForSend: function (record, sendnow) {\r\n\r\n\t\t\tif (record.duration < 1) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (sendnow) {\r\n\t\t\t\t\tthis.sendVoiceMessage(record)\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.record = record\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetduration(file){\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\tf.readFile(file).then(arraybuffer => {\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\t\t\t\t\t\t\tresolve(buffer.duration)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}).catch(reject)\r\n\t\t\t})\r\n\r\n\t\t\t\r\n\r\n\t\t},\r\n\r\n\t\tcreateVoiceMessage(event, sendnow) {\r\n\t\t\tconsole.log('event', event)\r\n\r\n\t\t\tvar c = () => {\r\n\r\n\t\t\t\t//this.record = \r\n\r\n\t\t\t\tthis.checkaudioForSend({\r\n\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\tid: f.makeid(),\r\n\t\t\t\t\tduration : event.duration\r\n\t\t\t\t}, sendnow)\r\n\t\t\t}\r\n\r\n\t\t\tif(event.duration){\r\n\r\n\t\t\t\tc()\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.getduration(event.data).then(duration => {\r\n\t\t\t\t\tevent.duration = duration\r\n\r\n\t\t\t\t\tc()\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.clear()\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/*f.readFile(event.data).then(arraybuffer => {\r\n\r\n\t\t\t\tconsole.log('arraybuffer', arraybuffer)\r\n\r\n\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\r\n\t\t\t\t\tconsole.log('this.record', this.record)\r\n\t\t\t\t\tconsole.log('this.buffer', buffer)\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tthis.record = {\r\n\t\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\t\tid: f.makeid()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.record.duration = buffer.duration\r\n\r\n\t\t\t\t\tthis.checkaudioForSend(sendnow)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tconsole.error('e', e)\r\n\t\t\t\tthis.clear()\r\n\t\t\t\t//\r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\tgenerateRms(frequencies) {\r\n\t\t\treturn +Math.sqrt(frequencies.reduce((a, b) => a + b ** 2) / frequencies.length).toPrecision(4)\r\n\t\t},\r\n\r\n\t\tstopRecording({ cancel, sendnow }) {\r\n\r\n\t\t\tconsole.log(\"STOP RECORDING\", this.isRecording)\r\n\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', false)\r\n\r\n\t\t\tif (this.prepareRecording) {\r\n\r\n\t\t\t\tthis.prepareRecording.cancel()\r\n\t\t\t\tthis.prepareRecording = null\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tthis.isRecording = false\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\t//this.mediaRecorder.ondataavailable = () => { }\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.mediaRecorder.addEventListener('dataavailable', (event) => {\r\n\t\t\t\t\t\tthis.createVoiceMessage(event, sendnow)\r\n\t\t\t\t\t})//ondataavailable = (event) => this.createVoiceMessage(event, sendnow)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = true\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.stopRecord()\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tasync sendVoiceMessage(record) {\r\n\r\n\t\t\tif(!record) record = this.record\r\n\r\n\t\t\tif(!record) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\r\n\t\t\tthis.recordRmsData = []\r\n\r\n\t\t\tconst base64 = await this.core.convertAudioToBase64(record.file)\r\n\r\n\t\t\tconst id = f.makeid()\r\n\r\n\t\t\tconst meta = {\r\n\t\t\t\ttype: \"audio\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.clear()\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\t\t\t\treturn this.chat\r\n\t\t\t}).then(() => {\r\n\t\t\t\treturn this.core.mtrx.sendAudio(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tclear() {\r\n\t\t\tthis.record = null\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\t/*if (this.audioContext){\r\n\t\t\t\tthis.audioContext.close()\r\n\t\t\t}*/\r\n\t\t},\r\n\r\n\t\t/*async convertAudioToBase64(blob) {\r\n\t\t\tconst reader = new FileReader()\r\n\t\t\treader.readAsDataURL(blob)\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\treader.onloadend = () => {\r\n\t\t\t\t\tresolve(reader.result)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},*/\r\n\r\n\t\tsetOpacity(opacity) {\r\n\t\t\tthis.cancelOpacity = opacity\r\n\t\t}\r\n\r\n\t},\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e8b463ac&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e8b463ac&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e8b463ac\",\n null\n ,true\n)\n\nexport default component.exports"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?6dbd","webpack:///./src/components/assets/recordProgress/index.scss?7174","webpack:///./src/components/chat/input/InputField/InputField.vue?f020","webpack:///./src/components/assets/upload/index.vue?4a8e","webpack:///./src/components/assets/recordProgress/index.scss?cee1","webpack:///./src/components/chat/input/index.sass?2730","webpack:///./src/components/chat/input/InputField/InputField.vue?fce9","webpack:///./src/components/assets/upload/index.vue?6d1f","webpack:///./src/components/assets/recordVoice/index.scss?ad6e","webpack:///./src/components/chat/input/index.sass?ea34","webpack:///./src/components/assets/recordVoice/index.scss?76f8","webpack:///./src/components/assets/upload/index.vue?fdd5","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?9ee5","webpack:///./src/components/chat/input/index.sass","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?90c5","webpack:///./src/components/assets/recordVoice/index.scss","webpack:///./src/components/assets/recordProgress/index.scss","webpack:///./src/components/chat/input/InputField/InputField.vue?1d64","webpack:///./src/components/chat/input/index.vue?56ea","webpack:///./src/components/chat/input/InputField/InputField.vue?d728","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?0090","webpack:///src/components/chat/input/picturePreview/picturePreview.vue","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue?3bda","webpack:///./src/components/chat/input/picturePreview/picturePreview.vue","webpack:///src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/chat/input/InputField/InputField.vue?3335","webpack:///./src/components/chat/input/InputField/InputField.vue","webpack:///./src/components/assets/recordVoice/index.vue?97db","webpack:///./src/components/assets/recordVoice/index.js","webpack:///./src/components/assets/recordVoice","webpack:///./src/components/assets/recordVoice/index.vue","webpack:///./src/components/assets/recordProgress/index.vue?083f","webpack:///./src/components/assets/recordProgress/index.js","webpack:///./src/components/assets/recordProgress","webpack:///./src/components/assets/recordProgress/index.vue","webpack:///./src/components/assets/upload/index.vue?1a6d","webpack:///src/components/assets/upload/index.vue","webpack:///./src/components/assets/upload/index.vue?f5f6","webpack:///./src/components/assets/upload/index.vue","webpack:///./src/components/chat/input/index.js","webpack:///./src/components/chat/input","webpack:///./src/components/chat/input/index.vue"],"names":["content","__esModule","default","module","i","locals","exports","add","__inject__","shadowRoot","___CSS_LOADER_API_IMPORT___","push","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","tipusers","_l","user","key","id","class","selected","tipuserindex","on","$event","insertuser","_e","voiceEnable","isRecording","record","recordTime","recordRmsData","cancelOpacity","clear","ref","chat","roomId","sendinput","emitInputData","HideUploadPic","pasteImage","focused","tipBySearch","browsetip","selectcurrenttip","upload","extended","menuItems","scopedSlots","_u","fn","slotProps","item","onlyimage","multiple","extensions","images","files","uploadStart","data","uploadUploaded","result","uploadUploadedAll","error","uploadError","icon","_v","_s","title","proxy","menuItemClick","directives","name","rawName","value","expression","prepareRecording","microphoneDisabled","initRecording","stopRecording","setOpacity","e","sendVoiceMessage","_m","staticRenderFns","$t","domProps","text","blured","keydown","textchange","keyup","paste_image","mobile","emojiIndex","style","width","position","bottom","right","fontSize","fontFamily","exclude","insert_emoji","toggle_emoji_picker","send_text","base64","hide","props","is_opened","methods","injectStyles","context","style0","component","components","Picker","picturePreview","clickOutside","watch","immediately","handler","send","ready","display_emoji","content_height","pasted_data","block","resize","type","hidden_previews","computed","prepareemoji","window","setText","setTimeout","savetextinstorage","localStorage","send_empty_array","focus","blur","blurifempty","close_emoji_picker","textarea_resize","textarea_resize_reset","get_base64","reader","okText","cancelText","then","dialog","resize_image","catch","getsearchposition","start","middle","end","sposition","br","dg","getsearch","event","inserttip","f","storagekey","creared","mounted","hold","isHold","active","disabled","mousedown","mouseup","handleTouchStart","handleTouchEnd","recordEnd","Boolean","required","direction","mapState","state","beforeDestroy","document","removeEventListener","handleMove","$emit","cancel","Y","changedTouches","pageY","X","pageX","addEventListener","sendnow","clearStyle","$refs","toggle","transform","classList","remove","holder","deltaY","deltaX","length","contains","timer","opacity","Number","rmsData","Array","minute","Math","floor","sec","rmsDataLast","_","last","throttle","draw","graph","offsetWidth","re","canvas","ctx","getContext","count","l","c","max","clearRect","fillStyle","fillRect","_t","dropzone","each","maxsize","loading","maxSize","created","read","resolve","file","ha","next","err","errorText","check","checkSize","getExtension","checkExtension","handle","sendAnyFile","resizeIfNeed","handleImages","Object","u","String","relationEvent","InputField","contacts","preview","recordProgress","recordVoice","test","fileInfo","creating","userId","showuserselect","anyUrlMeta","joinedMembers","tipvalue","mediaRecorder","audioContext","audioAnalyser","interval","cancelledCordovaMediaRecorder","usersForKeysHash","close","$store","voiceMessagesEnabled","connect","contact","pkoindisabled","POCKETNETINSTANCE","supportimagegallery","click","$i18n","t","transaction","unshift","userlist","core","mtrx","chatUsersInfo","deep","uusers","map","split","ausers","matrixId","stateChat","$route","query","chatsMap","invited","filter","currentState","getMembers","m","v","membership","joined","arr","forEach","toLowerCase","indexOf","maintipuser","client","newchat","Promise","wait","$f","pretry","access","increase","showuserselected","action","resizeImage","ftype","Images","reject","cameraHandlerCustom","dropdownMenu","hidePopup","platform","ui","uploadImage","Base64","toFile","console","onSuccess","imgs","sendtransactionWrapper","menuIsVisible","users","j","getmatrixid","r","source","userinfo","store","commit","caption","userselected","sendtransaction","api","roomid","address","emitUrl","url","globalpreloader","usersInfo","info","_info","keys","kit","tetatetid","initialstate","encrypted","createRoom","room_alias_name","visibility","invite","initial_state","_chat","m_chat","getRoom","room_id","getStateEvents","setPowerLevel","greetings","errcode","joinRoom","baseUrl","replace","maySendMessage","textCutLimit","limit","trim","slice","replaceMentions","RegExp","textEvent","clearEventId","makeid","editEvent","body","msgtype","decryptKey","decrypted","sendEvent","dispatch","sendtext","relation","sendImage","meta","aborted","canencryptfilesize","s","pcrypto","canBeEncrypt","size","$dialog","confirm","sendFile","notenc","change","evt","target","getUrl","undefined","sendTyping","rowObject","menuItemLoadedHandler","message","getImg","uploadSizeError","validImageTypes","includes","imageWH","img","Image","imgInfo","onload","w","h","height","onerror","src","catchPermissonsError","toString","cordova","getFileIosCordova","path","resolveLocalFileSystemURL","entry","FileReader","onloadend","blob","Blob","Uint8Array","readAsArrayBuffer","initRecordingCordova","cancelable","media","permissions","audio","isios","getAudioContext","cordovaMediaRecorder","Media","release","fu","externalDataDirectory","duration","createVoiceMessage","finally","rmsdata","currentPlaying","currentPlayingVoiceMessage","pause","setInterval","clone","getCurrentAmplitude","amp","log","startRecord","initMediaRecorder","recorder","stream","getTracks","track","stop","createAnalyser","createMediaStreamSource","startRecording","dataArray","frequencyBinCount","getByteFrequencyData","generateRms","checkaudioForSend","getduration","readFile","arraybuffer","decodeAudioData","buffer","frequencies","sqrt","reduce","a","b","toPrecision","clearInterval","stopRecord","convertAudioToBase64","sendAudio"],"mappings":"oGAGA,IAAIA,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAwEL,QAC1FC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,qBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,uBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAwEL,QAC1FC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,wBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,oCCV3B,oH,kCCAA,oH,oCCAA,oH,oCCAA,qH,kCCAA,oH,uBCGA,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,uBCP3B,IAAIT,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QACvFC,EAAOG,QAAQE,WAAa,SAAUC,GACpCF,EAAI,WAAYP,EAASS,K,uBCT3B,IAAIC,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,qPAAsP,KAE/QD,EAAOG,QAAUA,G,uBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,uLAAwL,KAEjND,EAAOG,QAAUA,G,qBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,09EAA29E,KAEp/ED,EAAOG,QAAUA,G,mCCNjB,oH,qBCCA,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,2xDAA8xD,KAEvzDD,EAAOG,QAAUA,G,qBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,i6CAAk6C,KAE37CD,EAAOG,QAAUA,G,qBCLjB,IAAII,EAA8B,EAAQ,QAC1CJ,EAAUI,GAA4B,GAEtCJ,EAAQK,KAAK,CAACR,EAAOC,EAAI,4pDAA6pD,KAEtrDD,EAAOG,QAAUA,G,yCCNjB,IAAIM,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,aAAaC,MAAM,CAAC,GAAK,cAAc,CAAEP,EAAS,MAAEI,EAAG,MAAM,CAACE,YAAY,QAAQ,CAAEN,EAAQ,KAAEI,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAAEN,EAAIQ,SAAe,OAAEJ,EAAG,MAAM,CAACE,YAAY,YAAYN,EAAIS,GAAIT,EAAY,UAAE,SAASU,EAAKnB,GAAG,OAAOa,EAAG,MAAM,CAACO,IAAID,EAAKE,GAAGN,YAAY,oBAAoBO,MAAM,CAACC,SAAWd,EAAIe,cAAgBxB,GAAGyB,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAIkB,WAAWR,MAAS,CAACN,EAAG,UAAU,CAACG,MAAM,CAAC,QAAUG,EAAK,KAAO,OAAO,MAAK,GAAGV,EAAImB,KAAKf,EAAG,MAAM,CAACE,YAAY,UAAU,CAAEN,EAAIoB,cAAgBpB,EAAIqB,aAAerB,EAAIsB,QAASlB,EAAG,kBAAkB,CAACG,MAAM,CAAC,WAAaP,EAAIuB,WAAW,YAAcvB,EAAIqB,YAAY,QAAUrB,EAAIwB,cAAc,QAAUxB,EAAIyB,eAAeT,GAAG,CAAC,QAAUhB,EAAI0B,SAAStB,EAAG,aAAa,CAACuB,IAAI,WAAWpB,MAAM,CAAC,WAAa,YAAcP,EAAI4B,KAAKC,OAAO,SAAW7B,EAAIQ,UAAUQ,GAAG,CAAC,YAAchB,EAAI8B,UAAU,WAAa9B,EAAI+B,cAAc,YAAc/B,EAAIgC,cAAc,OAAShC,EAAIiC,WAAW,QAAUjC,EAAIkC,QAAQ,iBAAmBlC,EAAImC,YAAY,UAAYnC,EAAIoC,UAAU,iBAAmBpC,EAAIqC,oBAAqBrC,EAAIsC,QAAUtC,EAAI4B,KAAMxB,EAAG,MAAM,CAACE,YAAY,OAAOO,MAAM,CAAC0B,SAAUvC,EAAIoB,cAAc,CAAGpB,EAAIqB,aAAgBrB,EAAIsB,OAAo7CtB,EAAImB,KAAh7Cf,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,eAAe,CAACuB,IAAI,eAAepB,MAAM,CAAC,UAAYP,EAAIwC,UAAU,UAAY,GAAG,KAAO,eAAeC,YAAYzC,EAAI0C,GAAG,CAAC,CAAC/B,IAAI,UAAUgC,GAAG,SAASC,GAAW,MAAO,CAAGA,EAAUC,KAAKP,OAAgTlC,EAAG,SAAS,CAACG,MAAM,CAAC,UAAYqC,EAAUC,KAAKP,OAAOQ,UAAU,SAAWF,EAAUC,KAAKP,OAAOS,SAAS,WAAaH,EAAUC,KAAKP,OAAOU,WAAW,OAASJ,EAAUC,KAAKP,OAAOW,QAAQjC,GAAG,CAAC,MAAQ,SAAUkC,GAAS,OAAOlD,EAAImD,YAAYP,EAAUC,KAAMK,IAAU,SAAW,SAAUE,GAAQ,OAAOpD,EAAIqD,eAAeT,EAAUC,KAAMO,IAAS,YAAc,SAAUE,GAAU,OAAOtD,EAAIuD,kBAAkBX,EAAUC,KAAMS,IAAW,MAAQ,SAAUE,GAAS,OAAOxD,EAAIyD,YAAYb,EAAUC,KAAMW,KAAWf,YAAYzC,EAAI0C,GAAG,CAAC,CAAC/B,IAAI,UAAUgC,GAAG,WAAW,MAAO,CAACvC,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,MAAM,CAACE,YAAY,eAAe,CAAEsC,EAAUC,KAAS,KAAEzC,EAAG,IAAI,CAACS,MAAM+B,EAAUC,KAAKa,OAAO1D,EAAImB,OAAOf,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAI2D,GAAG,IAAI3D,EAAI4D,GAAGhB,EAAUC,KAAKgB,OAAO,WAAWC,OAAM,GAAM,CAACnD,IAAI,WAAWgC,GAAG,aAA6BmB,OAAM,IAAO,MAAK,KAAvpC1D,EAAG,MAAM,CAACE,YAAY,YAAYU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAI+D,cAAcnB,EAAUC,SAAS,CAACzC,EAAG,MAAM,CAACE,YAAY,eAAe,CAAEsC,EAAUC,KAAS,KAAEzC,EAAG,IAAI,CAACS,MAAM+B,EAAUC,KAAKa,OAAO1D,EAAImB,OAAOf,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAI2D,GAAG,IAAI3D,EAAI4D,GAAGhB,EAAUC,KAAKgB,OAAO,aAAo4B,MAAK,EAAM,eAAe,GAAa7D,EAAe,YAAE,CAACI,EAAG,MAAM,CAAC4D,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAQnE,EAAIqB,cAAgBrB,EAAIsB,OAAS8C,WAAW,6BAA6B9D,YAAY,cAAc,CAACF,EAAG,cAAc,CAACG,MAAM,CAAC,mBAAmBP,EAAIqE,iBAAgC,YAAcrE,EAAIqB,YAAY,SAAWrB,EAAIsE,oBAAoBtD,GAAG,CAAC,iBAAmBhB,EAAIuE,cAAc,gBAAkBvE,EAAIwE,cAAc,QAAUxE,EAAI0B,MAAM,UAAY1B,EAAIyE,eAAe,IAAIzE,EAAImB,MAAOnB,EAAIqB,aAAerB,EAAIsB,OAAQlB,EAAG,MAAM,CAACE,YAAY,aAAaU,GAAG,CAAC,MAAQ,SAAU0D,GAAI1E,EAAI2E,sBAAsB,CAAC3E,EAAI4E,GAAG,KAAK5E,EAAImB,MAAM,GAAGnB,EAAImB,MAAM,KAAKnB,EAAImB,OAAOf,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,kBAAkB,MACn4GyE,EAAkB,CAAC,WAAa,IAAI7E,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,IAAI,CAACE,YAAY,gC,oCCDpI,EAAS,WAAa,IAAIN,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,mBAAmB,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,YAAY,CAACF,EAAG,WAAW,CAACuB,IAAI,WAAWrB,YAAY,aAAaC,MAAM,CAAC,GAAK,YAAY,KAAO,OAAO,IAAM,IAAI,WAAa,OAAO,YAAc,KAAK,YAAcP,EAAI8E,GAAG,wBAAwBC,SAAS,CAAC,MAAQ/E,EAAIgF,MAAMhE,GAAG,CAAC,MAAQhB,EAAIkC,QAAQ,KAAOlC,EAAIiF,OAAO,QAAUjF,EAAIkF,QAAQ,MAAQlF,EAAImF,WAAW,MAAQnF,EAAIoF,MAAM,MAAQpF,EAAIoF,MAAM,MAAQpF,EAAIqF,gBAAiBrF,EAAIsF,QAAUtF,EAAIuF,WAAYnF,EAAG,aAAa,CAACG,MAAM,CAAC,KAAO,OAAO,KAAO,WAAW,CAACH,EAAG,SAAS,CAAC4D,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAOnE,EAAiB,cAAEoE,WAAW,iBAAiB,CAACH,KAAK,gBAAgBC,QAAQ,kBAAkBC,MAAOnE,EAAsB,mBAAEoE,WAAW,uBAAuBoB,MAAM,CAAGC,MAAO,QAASC,SAAU,WAAYC,OAAQ,OAAQC,MAAO,QAASC,SAAU,QAASC,WAAY,YAAcvF,MAAM,CAAC,KAAOP,EAAIuF,WAAW,QAAUvF,EAAI+F,QAAQ,aAAc,EAAM,YAAa,EAAM,QAAS,EAAK,IAAM,YAAY/E,GAAG,CAAC,OAAShB,EAAIgG,iBAAiB,GAAGhG,EAAImB,MAAM,KAAOnB,EAAIsF,OAAkStF,EAAImB,KAA9Rf,EAAG,MAAM,CAACE,YAAY,yBAAyBU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAIiG,yBAAyB,CAAC7F,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,MAAM,CAACE,YAAY,UAAU,CAAEN,EAAiB,cAAEI,EAAG,IAAI,CAACE,YAAY,iBAAiBF,EAAG,IAAI,CAACE,YAAY,uBAAiCN,EAAQ,KAAEI,EAAG,MAAM,CAACE,YAAY,aAAaU,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOjB,EAAIkG,UAAUjF,MAAW,CAACjB,EAAI4E,GAAG,KAAK5E,EAAImB,QAC5kD,EAAkB,CAAC,WAAa,IAAInB,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,cAAc,CAACF,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,IAAI,CAACE,YAAY,6B,yDCDhM,EAAS,WAAa,IAAIN,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAQF,EAAa,UAAEI,EAAG,MAAM,CAACE,YAAY,WAAW,CAACF,EAAG,MAAM,CAACE,YAAY,kBAAkBC,MAAM,CAAC,IAAMP,EAAImG,OAAO,IAAM,qBAAqB/F,EAAG,IAAI,CAACE,YAAY,qBAAqBU,GAAG,CAAC,MAAQhB,EAAIoG,UAAUpG,EAAImB,MAChT,EAAkB,GCQP,GACf8C,sBACAoC,iBAEAjD,OACA,OACAkD,eAIAC,SACAH,OACA,qBCrBqY,I,YCGrY,SAASI,EAAcC,GAErB,IAAIC,EAAS,EAAQ,SACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAIE,EAAY,eACd,EACA,EACA,GACA,EACAH,EACA,WACA,MACC,GAGY,EAAAG,E,QC8Cf,IAAI,EAAS,IAAI,OAEF,OACf1C,kBACA2C,YACAC,mBACAC,kBAGA9C,YACA+C,4BAGAC,OACAhC,MACAiC,eACAC,sBAEA,GAEA,aACA,4BAIA,aACA,0BAGA,0BAKA9D,OACA,OACA+D,QAEAC,SACApC,QACAe,kBACAsB,iBACAC,kBACAC,eACAC,SAEAlF,QACAS,YACAC,kDACAC,QACAwE,QACAC,cAIAC,qBACApC,kBAIAqC,UACAtC,kBACA,+DAaAiB,SAEAsB,wBAEA,gBACA,2DAEA,CAEA,gBACAC,yCACA,oCAQAC,oBACA,YAEA,yBAEAC,gBACA,uBACA,gBAKA9F,mBACA,uBAGAiD,uBACA,8BAKA8C,6BACA,kBACAC,8CAGAC,mBACA,+BAGAC,QACA,gCAGAC,OACA,+BAGAC,cACA,WACA,aAGAC,sBACA,0BACA,wCACA,wBAKAC,kBAEA,WAGA,uCACA,uEACA,uBAJA,8BAUAC,wBACA,2DAEAxC,sBACA,wCAGAC,aAEA,8BAEA,sBACA,oCACA,yBACA,aACA,cAIA,0BAIAF,gBACA,oBAEA,0BAEAX,eAEA,oBAGAqD,cAGA,GAFA,uCAEA,wBAEA,+BACA,0BAEA,0CAEA,MAGA,oBACA,iBAEAC,aAEA,qBACA,0CACAC,aACAC,0BAGAC,KAAAC,IACA,sBACA,+BAIAJ,sBAQAK,kBACA,uCACA,4CAEA,8CAEA,yBAEAC,MAAAzF,gDACAyF,MAAAzF,+CAGA0F,qBAEA,2CAEA,OAAAC,cAAAC,SAAAC,WAEA,UACA,KACA,KAEA,mBAEAC,WAEA,GAEA,mBAEA,OAEA,wCACAC,KAEAC,KAIA,UACAF,UACAC,KAGAhK,UAEAA,0BAEA,KAEA,CAEAgK,KACAhK,QAEA,IACA,mCACA+J,QAEAC,KAGAhK,UAEAA,8BAfA+J,OAkBA,UAKAG,aAEA,gCAEA,SAEA,sCAFA,MAOAvE,WAEA,wCAEA,qCAEA,uCAEAwE,oBAEA,IAMA,iCAEA,qCAEA,+BAEAA,oBAEA,GAMA,gBACA,YACA,yBAEA,kBAGAA,oBAEA,QATA,GAaAtE,SAEA,cAGA,OAFAsE,oBAEA,EAGA,sDAEA,oBAEA,iCAEA,0BAGAzE,SAEA+C,gBACA,qCACA,MAIA2B,aAEA,oCAEA,cACA,uBAEA,8EAEA,wEAGA,qBACA,yBAGA,kCAEAC,gEAEA5B,gBACA,eACA,OAKA3B,OACAwD,kBACArJ,gBAKAsJ,YAIAC,UAEA,aACA,aAGA,oBAGA,wCAEA,iDACA,2CCpfiY,ICGjY,SAAS,EAActD,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIzG,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,wBAAwB,CAACF,EAAG,MAAM,CAACuB,IAAI,SAASrB,YAAY,sBAAsBO,MAAM,CAACmJ,KAAMhK,EAAIiK,SAAS,CAAC7J,EAAG,IAAI,CAACE,YAAY,WAAWO,MAAMb,EAAIiK,OAAS,UAAW,mBAAqBjK,EAAIiK,OAAmVjK,EAAImB,KAA/Uf,EAAG,MAAM,CAACuB,IAAI,SAASrB,YAAY,uCAAuCO,MAAM,CAACqJ,OAAQlK,EAAIqB,YAAa8I,SAAUnK,EAAImK,UAAUnJ,GAAG,CAAC,UAAYhB,EAAIoK,UAAU,QAAUpK,EAAIqK,QAAQ,WAAarK,EAAIsK,iBAAiB,SAAWtK,EAAIuK,eAAe,YAAcvK,EAAIuK,iBAAiB,CAACnK,EAAG,IAAI,CAACE,YAAY,6BAAuCN,EAAU,OAAEI,EAAG,MAAM,CAACuB,IAAI,OAAOrB,YAAY,sCAAsCU,GAAG,CAAC,MAAQhB,EAAIwK,YAAY,CAACpK,EAAG,IAAI,CAACE,YAAY,uBAAuBN,EAAImB,QACjzB,EAAkB,G,YCCP,GACd8C,KAAM,cACNoC,MAAO,CACNhF,YAAa,CACZqG,KAAM+C,QACNC,UAAU,GAEXrG,iBAAkB,CACjBqD,KAAM+C,SAEPN,SAAUM,SAEXrH,OACC,MAAO,CACN+F,MAAO,EACPc,QAAQ,EACRU,UAAW,OAGb/C,SAAU,IACNgD,eAAS,CACXtF,OAAQuF,GAASA,EAAMvF,UAGzByE,YAGAe,gBAECC,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAE3ChL,KAAKoB,aACRpB,KAAKiL,MAAM,kBAAmB,CAACC,QAAS,KAG1C5E,QAAS,CAER8D,QAAU,SAAS3F,GACdzE,KAAKqF,QACRrF,KAAKsK,eAAe7F,IAGtB0F,UAAY,SAAS1F,GAChBzE,KAAKqF,QACRrF,KAAKqK,iBAAiB5F,IAGxB4F,iBAAiB5F,GAGhB,GAAIzE,KAAKoB,aAKR,GAAGpB,KAAKgK,OAAQ,YAJhBhK,KAAKiL,MAAM,oBAOZjL,KAAKkJ,MAAQ,CACZiC,EAAG1G,EAAE2G,eAAiB3G,EAAE2G,eAAe,GAAGC,MAAQ5G,EAAE4G,MACpDC,EAAG7G,EAAE2G,eAAiB3G,EAAE2G,eAAe,GAAGG,MAAQ9G,EAAE8G,OAGjDvL,KAAKqF,OAGRyF,SAASU,iBAAiB,YAAaxL,KAAKgL,YAF5CF,SAASU,iBAAiB,YAAaxL,KAAKgL,aAK9CV,eAAe7F,GAEVzE,KAAKgK,UAELhK,KAAKoB,aAAepB,KAAKoE,mBAC5BpE,KAAKiL,MAAM,kBAAmB,CAC7BQ,SAAU,IAIZX,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAE/ChL,KAAK0L,eAINA,aAEK1L,KAAK2L,MAAMC,SACd5L,KAAK2L,MAAMC,OAAOrG,MAAMsG,UAAa,iBACrC7L,KAAK2L,MAAMC,OAAOE,UAAUC,OAAO,YAGhC/L,KAAK2L,MAAMK,QACdhM,KAAK2L,MAAMK,OAAOF,UAAUC,OAAO,WAIrCf,WAAWvG,GAAG,MAEb,IAAIzE,KAAKoB,YAAa,OAEtB,IAAI6K,EAASjM,KAAKkJ,MAAMiC,EAAI1G,EAAE4G,MAC1Ba,EAASlM,KAAKkJ,MAAMoC,EAAI7G,EAAE8G,MAE9B,OAAI9G,QAAJ,IAAIA,GAAJ,UAAIA,EAAG2G,sBAAP,OAAI,EAAmBe,SACtBF,EAASjM,KAAKkJ,MAAMiC,EAAI1G,EAAE2G,eAAe,GAAGC,MAC5Ca,EAASlM,KAAKkJ,MAAMoC,EAAI7G,EAAE2G,eAAe,GAAGG,OAI5CvL,KAAK0K,UADFuB,EAAS,GAAKC,EAAS,EACT,IAEA,IAIdD,EAAS,GAAwB,MAAnBjM,KAAK0K,WAElB1K,KAAK2L,MAAMK,OAAOF,UAAUM,SAAS,WACxCpM,KAAK2L,MAAMK,OAAOF,UAAUrM,IAAI,UAEjCO,KAAK2L,MAAMC,OAAOrG,MAAMsG,UAAa,gBAAeI,OAEhDA,EAAS,KACZjM,KAAK2L,MAAMC,OAAOrG,MAAMsG,UAAa,iBAErCf,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAG/ChL,KAAKgK,QAAS,IAILkC,EAAS,GAAwB,MAAnBlM,KAAK0K,WAE7B1K,KAAK2L,MAAMC,OAAOrG,MAAMsG,UAAa,cAAaK,UAE9ClM,KAAK2L,MAAMK,OAAOF,UAAUM,SAAS,YACxCpM,KAAK2L,MAAMC,OAAOE,UAAUrM,IAAI,WAEjCO,KAAKiL,MAAM,aAAciB,EAAS,GAAK,KAEnCA,EAAS,MACZlM,KAAK2L,MAAMC,OAAOrG,MAAMsG,UAAa,iBACrCf,SAASC,oBAAoB,YAAa/K,KAAKgL,YAC/CF,SAASC,oBAAoB,YAAa/K,KAAKgL,YAE/ChL,KAAKiL,MAAM,kBAAmB,CAAEC,QAAQ,IACxClL,KAAKiL,MAAM,aAKZjL,KAAK0L,cAIPnB,UAAU9F,GAIT,GAFAzE,KAAK0L,aAED1L,KAAKoB,aAAepB,KAAKgK,OAK5B,OAHAhK,KAAKiL,MAAM,kBAAmB,SAC9BjL,KAAKgK,QAAS,MCzKyN,ICG3O,SAAS,EAAcxD,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,gCCvBX,EAAS,WAAa,IAAIzG,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAAEN,EAAe,YAAEI,EAAG,MAAM,CAACE,YAAY,oBAAoB,CAACF,EAAG,MAAM,CAACE,YAAY,YAAYO,MAAM,CAAC,UAAab,EAAIqB,iBAAiBjB,EAAG,MAAM,CAACE,YAAY,MAAMU,GAAG,CAAC,MAAQhB,EAAI0B,QAAQ,CAACtB,EAAG,IAAI,CAACE,YAAY,mBAAmBF,EAAG,MAAM,CAACE,YAAY,SAAS,CAACN,EAAI2D,GAAG3D,EAAI4D,GAAG5D,EAAIsM,UAAUlM,EAAG,MAAM,CAACuB,IAAI,QAAQrB,YAAY,SAAS,CAACF,EAAG,SAAS,CAACuB,IAAI,SAASpB,MAAM,CAAC,GAAK,SAAS,MAAQP,EAAIyF,MAAM,OAAS,UAAUrF,EAAG,MAAM,CAAC4D,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAOnE,EAAIqB,aAAerB,EAAIuM,QAASnI,WAAW,2BAA2BzC,IAAI,SAASrB,YAAY,UAAU,CAACF,EAAG,OAAO,CAACJ,EAAI2D,GAAG,+BAC5tB,EAAkB,GCDP,GACbM,KAAM,iBACNoC,MAAO,CACL9E,WAAY,CACVmG,KAAM8E,OACN9B,UAAU,GAEZ+B,QAAS,CACP/E,KAAMgF,MACNhC,UAAU,GAEZrJ,YAAa,CACXqG,KAAM+C,SAER8B,QAAS,IAEXnJ,OACE,MAAO,CACLqC,MAAO,IAGXmC,SAAU,CACR0E,QACE,IAAIK,EAASC,KAAKC,MAAM5M,KAAKsB,WAAa,KACtCuL,EAAMF,KAAKC,MAAM5M,KAAKsB,WAAa,KAAQ,GAC/C,MAAQ,GAAEoL,EAASA,EAAS,IAAM,OAAQG,EAAM,GAAM,IAAMA,EAAMA,KAGpEC,cACE,OAAOC,EAAEC,KAAKhN,KAAKwM,QAAS,MAIhCzF,MAAQ,CACNyF,QAAUO,EAAEE,UAAS,WACnBjN,KAAKkN,SACJ,IAEHZ,QAAU,WACRtM,KAAK2L,MAAMT,OAAO3F,MAAM+G,QAAUtM,KAAKsM,UAI3CxC,UACE9J,KAAK2L,MAAMT,OAAO3F,MAAM+G,QAAU,EAClC,IAAI9G,EAAQxF,KAAK2L,MAAMwB,MAAMC,YAC7BpN,KAAKwF,MAAQA,EAAQA,EAAQ,IAE7BqC,OAAO2D,iBAAiB,SAAUxL,KAAKwH,SAEzCqD,gBACEhD,OAAOkD,oBAAoB,SAAU/K,KAAKwH,SAG5ClB,QAAS,CACPkB,SACE,IAAI6E,EAAQ,KAEZ,IAAIgB,EAAK,KACFhB,IACHA,EAAQtE,WAAW,KACjBsE,EAAQ,KACR,IAAI7G,EAAQxF,KAAK2L,MAAMwB,MAAMC,YAC7BpN,KAAKwF,MAAQA,EAAQA,EAAQ,KAC5B,MAIP6H,KAEFH,OAEE,IAAIlN,KAAK2L,MAAM2B,OAAQ,OAEvB,MAAMC,EAAMvN,KAAK2L,MAAM2B,OAAOE,WAAY,MAC1C,IACIC,EAAQ,GACRjI,EAAQ,EACZ,IAAIkI,EAAI1N,KAAK8M,YAAYX,OACrBwB,EAAIhB,KAAKiB,IAAIjB,KAAKC,MAAMc,EAAID,GAAQ,GAExCF,EAAIM,UAAU,EAAG,EAAG7N,KAAKwF,MAAO,IAEhC,IAAK,IAAIlG,EAAI,EAAGA,EAAIoO,EAAGpO,GAAQqO,EAC7BJ,EAAIO,UAAY,UAChBP,EAAIQ,SAAa,EAAJzO,EAAQkG,EAAO,GAAKxF,KAAK8M,YAAYxN,GAAK,EAAGkG,EAAOxF,KAAK8M,YAAYxN,GAAK,EAAI,IAI/FmC,QACEzB,KAAKiL,MAAM,cC1F0N,ICG3O,SAAS,EAAczE,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,QCvBX,EAAS,WAAa,IAAIzG,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAACN,EAAIiO,GAAG,WAAU,WAAW,MAAO,CAAC7N,EAAG,IAAI,CAACE,YAAY,qBAAoB,GAAGF,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,QAAQ,CAACG,MAAM,CAAC,KAAO,OAAO,SAAWP,EAAI+C,UAAU/B,GAAG,CAAC,OAAShB,EAAIsC,cAAetC,EAAY,SAAEI,EAAG,MAAM,CAACuB,IAAI,WAAWrB,YAAY,WAAWO,MAAM,CAACqN,SAAWlO,EAAIkO,WAAW,CAAClO,EAAIiO,GAAG,YAAW,WAAW,MAAO,CAAC7N,EAAG,IAAI,CAACE,YAAY,gBAAgBN,EAAI2D,GAAG,IAAI3D,EAAI4D,GAAG5D,EAAI8E,GAAG,6BAA6B,UAAS,GAAG9E,EAAImB,QAC7oB,EAAkB,GCsDlBgN,G,UAAO,EAAQ,SAEf,EAAS,IAAI,OAEF,GACflK,cACAD,cACAqC,OAEA6H,gBACAnL,iBAEAD,kBAEAsL,SACA/O,WACAqI,aAGA1E,YACA0E,WACArI,gBAEA4D,QACAyE,YACArI,iBAMA+D,gBACA,OACAiL,aAIAzG,UACA0G,UACA,gCAIAC,eAGAhI,SAEAiI,iBACA,qBAEA,2BACA7F,wBAEA8F,GACAtI,uBACAuI,UAIA/F,sBAKArG,mBAAA,QACAoH,oBACAA,mBAEA,4HACA,KAEA,gBAEA,sBAEA,WAEAyE,uBAEA,oBAEA,KAUA,OARAQ,iBACAnL,QACAkL,OACA1J,gCAGA4J,gBAKA,sBAEAtL,iBAEA,iBAEAwF,KAAA1F,IAEAuL,sBACAC,MAEA3F,MAAAvE,IAEAiK,iBACAnL,QACAkL,OACA1J,2BAGA4J,mBAIAC,IAEA,gBACAF,4BAMAG,wBACA,qBACA,qFAGA,cACA,oCADA,GAKAC,kBACA,yBAIA,8BACA,UAJA,YAQAC,sBACA,6BAEAC,yBACA,wBACA,8BAEA,UAEAC,2BAEA,gCACA,oDAKAC,mBAEA,wFACA,qBAGA,oBAEAC,wBACA,yBAEAC,2BACA,uBAEA,qCAEA,+HAGA,oBACApG,MAAAvE,GACA,mBAIA,2BAEA4K,yBAEA,gDACAlM,WAEA,qBACA0F,KAAA1F,GAEA,iDACAA,WAEA,yBCjQ6W,ICG7W,SAAS,EAAcqD,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,EAAY,eACd,EACA,EACA,GACA,EACA,EACA,WACA,MACC,GAGY,I,qBCVA,IACdxC,KAAM,YACNoC,MAAO,CACNzE,KAAM2N,OACNC,EAAGC,OACHC,cAAeH,QAGhB3I,WAAY,CAAE+I,aAAYC,sBAAUC,eAASC,iBAAgBC,cAAazN,UAE1Ec,KAAM,WAEL,MAAO,CACNd,QAAQ,EACR0N,KAAM,GACN3B,SAAS,EACTrJ,KAAM,GACN0J,KAAM,GACNuB,SAAU,GACV7I,OAAO,EACP8I,UAAU,EACVC,OAAQ,GACRC,eAAgB,KAChBC,WAAYZ,OACZa,cAAe,GACfC,SAAU,KACVxP,aAAc,EACdO,OAAQ,KACRE,cAAe,GACfH,aAAa,EAEbmP,cAAe,KACfC,aAAc,KACdC,cAAe,KAEfnP,WAAY,EACZoP,SAAU,KACVlP,cAAe,EACf6C,oBAAoB,EACpBD,kBAAkB,EAElBuM,+BAA+B,IAMjC5J,MAAO,CACN6J,iBAAkB,CAEjB3J,QAAS,cAGV1G,SAAU,WAEJP,KAAKO,SAAS4L,OAGdnM,KAAKc,aAAed,KAAKO,SAAS4L,OAAS,IAC9CnM,KAAKc,aAAed,KAAKO,SAAS4L,OAAS,GAH5CnM,KAAKc,aAAe,IAWvB+J,gBACK7K,KAAKwQ,cACRxQ,KAAKwQ,aAAaK,SAGpBlJ,SAAU,CACTxG,cACC,OAAOnB,KAAK8Q,OAAOlG,MAAMmG,sBAG1BC,QAAS,WACR,OAAOhR,KAAK8Q,OAAOlG,MAAMqG,SAE1BC,cAAgB,WACf,OAAOlR,KAAK8Q,OAAOlG,MAAMsG,eAE1B3O,UAAW,WACV,IAAIA,EAAY,GA6DhB,OA1DKvC,KAAKyP,gBAEL5H,OAAOsJ,mBAAqBtJ,OAAOsJ,kBAAkB9L,OAAO+L,sBAC/D7O,EAAU1C,KAAK,CACdwR,MAAO,sBACPzN,MAAO5D,KAAKsR,MAAMC,EAAE,2BACpB9N,KAAM,kBAKPlB,EAAU1C,KAAK,CACdwR,MAAO,gBACPzN,MAAO5D,KAAKsR,MAAMC,EAAE,2BACpB9N,KAAM,gBAENpB,OAAQ,CACPS,UAAU,EACVC,WAAY,CAAC,MAAO,OAAQ,MAAO,QACnCoL,QAAS,IACTnL,OAAQ,CACPwE,OAAQ,CACPC,KAAM,WASXlF,EAAU1C,KAAK,CACdwR,MAAO,cACPzN,MAAO5D,KAAKsR,MAAMC,EAAE,mBACpB9N,KAAM,qBAENpB,OAAQ,CACPS,UAAU,EACVC,WAAY,GACZoL,QAAS,GACTnL,OAAQ,CACPwE,OAAQ,CACPC,KAAM,YAQPzH,KAAKwR,cAAgBxR,KAAKkR,eAC7B3O,EAAUkP,QAAQ,CACjBJ,MAAO,yBACPzN,MAAO5D,KAAKsR,MAAMC,EAAE,oBACpB9N,KAAM,kBAIDlB,MAELoI,eAAS,CACX,UAGD+G,SAAU,WAGT,OAAK1R,KAAK2B,KAEH3B,KAAK2R,KAAKC,KAAKC,cAAc7R,KAAK2B,KAAKC,OAAQ,oBAF/B,IAMxB4P,YAAa,WACZ,OAAO7H,OAAEmI,KAAKjK,OAAQ,8CAGvBkK,OAAQ,WACP,OAAI/R,KAAKuP,EACDxC,EAAEiF,IAAIhS,KAAKuP,EAAE0C,MAAM,KAAO1C,GACzBA,GAIF,IAER2C,OAAQ,WACP,OAAIlS,KAAKuP,EACDxC,EAAEiF,IAAIhS,KAAKuP,EAAE0C,MAAM,KAAO1C,GACzBvP,KAAK2R,KAAKlR,KAAK0R,SAAS5C,IAI1B,IAER6C,UAAW,WACV,IAAIzR,EAAKX,KAAKqS,OAAOC,MAAM3R,GAC3B,OAAOX,KAAK8Q,OAAOlG,MAAM2H,SAAS5R,IAEnC6R,QAAS,WAER,OAAKxS,KAAK2B,KAKHoL,EAAEiF,IAAIjF,EAAE0F,OAAOzS,KAAK2B,KAAK+Q,aAAaC,cAAc,SAAUC,EAAGC,GACvE,MAAwB,WAAjBD,EAAEE,eACN,SAAUvD,GACb,OAAOA,EAAEW,UAPLlQ,KAAKuP,EAAUvP,KAAKkS,OACjB,IAUTa,OAAQ,WAEP,IAAK/S,KAAK2B,KAAM,MAAO,GAEV3B,KAAK2B,KAAKC,OAAvB,IAEIoR,EAAM,GASV,OANAhT,KAAK2B,KAAK+Q,aAAaC,aAAaM,SAAQ,SAAUxS,GAC7B,SAApBA,EAAKqS,YACRE,EAAInT,KAAKY,EAAKyP,WAIT8C,GAGRzS,SAAU,WAET,GAAsB,OAAlBP,KAAKsQ,SAAmB,MAAO,GACnC,GAAsB,KAAlBtQ,KAAKsQ,SAAiB,OAAOtQ,KAAK0R,SAEtC,IAAIxN,EAAQlE,KAAKsQ,SAAS4C,cAEtB3D,EAAIxC,EAAE0F,OAAOzS,KAAK0R,UAAU,SAAUnC,GACzC,OAA8C,GAAvCA,EAAEvL,KAAKkP,cAAcC,QAAQjP,IAAeqL,EAAEvL,KAAKkP,eAAiBhP,KAG5E,OAAOqL,GAIR6D,YAAa,WACZ,OAAIpT,KAAKO,SAAS4L,OACVnM,KAAKO,SAASP,KAAKc,cAAgB,GAGpC,OAITwN,YAMAxE,UACC9J,KAAKmH,OAAQ,GAGRnH,KAAK2B,MAAQ3B,KAAK2R,KAAKC,KAAKyB,QAChCrT,KAAKsT,UAAUtK,MAAMvE,GACb8O,QAAQ/E,YAMlBlI,QAAS,CACRkN,KAAM,WACL,OAAOxT,KAAKyT,GAAGC,OAAO,IACd1T,KAAK2R,KAAKC,KAAKyB,QAAUrT,KAAK2R,KAAKC,KAAK+B,SAIjDxR,UAAW,SAAUyR,GAEpBA,EAAW5T,KAAKc,eAAiBd,KAAKc,eAElCd,KAAKc,aAAed,KAAKO,SAAS4L,OAAS,IAC9CnM,KAAKc,aAAe,GAGjBd,KAAKc,aAAe,IACvBd,KAAKc,aAAed,KAAKO,SAAS4L,OAAS,IAK7C/J,iBAAkB,WACjBpC,KAAKiB,WAAWjB,KAAKO,SAASP,KAAKc,cAAgB,KAGpDG,WAAY,WAAqB,IAAXR,EAAW,uDAAJ,GAC5B,IAAIuD,EAAOvD,EAAKuD,MAAQ,GAExBhE,KAAK2L,MAAM,YAAYjC,UAAU1F,IAGlC9B,YAAa,SAAUgC,GACtBlE,KAAKsQ,SAAWpM,GAGjB2P,iBAAkB,SAAU5C,EAAS6C,GACpC9T,KAAK8T,GAAQ7C,IAId8C,YAAa,SAAU7N,GAEtB,IAAI8N,EAAQ9N,EAAO+L,MAAM,KAAK,GAAGA,MAAM,KAAK,GACxCjP,EAAS,IAAIiR,OAEjB,OAAOjR,EAAOwE,OAAO,OAAOtB,EAAQ,KAAM,KAAM8N,EAAO,KAAMnL,KAAK3C,GAE1DqN,QAAQ/E,QAAQtI,IACrB8C,MAAMvE,GACD8O,QAAQW,OAAOzP,KAIxB0P,oBAAqB,WACpB,IAAI9Q,EAAS,GAEbrD,KAAK2L,MAAMyI,aAAaC,YAExBxM,OAAOsJ,kBAAkBmD,SAASC,GAAGC,YAAY,CAChD1R,UAAU,EAEVgR,OAAQ,CAAC,EAAYtF,KAAY,IAAxB,OAAEtI,GAAsB,EAGhC,OAAOlG,KAAK+T,YAAY7N,GAAQ2C,KAAK3C,GAE7ByD,OAAE8K,OAAOC,OAAOxO,GAAQ2C,KAAK4F,IACnC,IAAItL,EAAO,CACV+C,SACAuI,QAGDpL,EAAOxD,KAAKsD,GAEZnD,KAAKoD,eAAe,KAAMD,GAE1BqL,OAGCxF,MAAMvE,IACRkQ,QAAQpR,MAAMkB,GACd+J,OAKFoG,UAAYC,IACX7U,KAAKsD,wBAKRwR,uBAAwB,WAEvB9U,KAAK+U,eAAgB,EAErB,IAAIC,EAAQjI,EAAE0F,OAAO1F,EAAEiF,IAAIhS,KAAK+S,OAASkC,GACjCjV,KAAKyT,GAAG3B,KAAK9R,KAAM,sBAAwBA,KAAKyT,GAAGyB,YAAYD,KAAO,MACzEE,IAAM,MACV,OAAOA,GAAKA,EAAEC,QAAUD,EAAExU,KAAF,UAAQX,KAAK2R,KAAKlR,KAAK4U,gBAAvB,aAAQ,EAAyB1U,MAG1D,IAAKqU,EAAM7I,OAEV,MAAO,eAGJ6I,EAAM7I,OAAS,EAElBnM,KAAK2R,KAAK2D,MAAMC,OAAO,WAAY,CAClCC,QAASxV,KAAKsR,MAAMC,EAAE,6BACtB9J,KAAM,iBACNtE,KAAM,CACL6R,MAAOA,EACPlB,OAAQ,kBACR2B,aAAe9H,IACd3N,KAAK6T,iBAAiBlG,EAAG,uBAU5B3N,KAAK0V,gBAAgBV,EAAM,IAI5BhV,KAAK2L,MAAMyI,aAAaC,aAIzBqB,gBAAiB,SAAUjV,GAC1B,IAAIkV,EAAM3V,KAAKwR,YAIfmE,EAAI,CACHC,OAAQ5V,KAAK2B,KAAKC,OAClBiU,QAASpV,EAAK2U,OAAOS,WAWvB/T,cAAe,WACd9B,KAAKiL,MAAM,cACXjL,KAAKqC,QAAS,GAGfN,gBACC/B,KAAKqC,QAAS,GAGfyT,QAAS,SAAUC,GAClB/V,KAAKiL,MAAM,aAAc8K,IAG1BzC,UAEC,GAAItT,KAAKuP,EAAG,CACXvP,KAAK8Q,OAAOlG,MAAMoL,iBAAkB,EACpC,IAAI7D,EAAW,KAEXxQ,EAAO,KACPhB,EAAK,GAGT,OADAX,KAAKiQ,UAAW,EACTjQ,KAAK2R,KAAKlR,KAAKwV,UAAUjW,KAAK+R,QAAQlJ,KAAKqN,IAEjD,GAA0B,GAAtBlW,KAAK+R,OAAO5F,OAAa,CAE5B,IAAIgK,EAAQD,EAAK,GAEjB,IAAKC,IAAUA,EAAMC,MAAQD,EAAMC,KAAKjK,OAAS,GAGhD,OADAnM,KAAKiL,MAAM,kBACJsI,QAAQW,OAAO,OAKxB,GAAIlU,KAAK2R,KAAKlR,KAAK4U,SAASe,KAAKjK,OAAS,GAEzC,OADAnM,KAAKiL,MAAM,kBACJsI,QAAQW,OAAO,OAMvBvT,EAAKX,KAAK2R,KAAKC,KAAKyE,IAAIC,UAAUJ,EAAK,GAAIlW,KAAK2R,KAAKlR,KAAK4U,UAE1DlD,EAAWnS,KAAK2R,KAAKlR,KAAK0R,SAAS+D,EAAK,GAAGvV,IAC9BX,KAAK2R,KAAKlR,KAAK0R,SAASnS,KAAK2R,KAAKlR,KAAK4U,SAAS1U,IAE7D,IAAI4V,EAAe,CAAC,CACnB,KAAQ,kBACR,UAAa,GACb,QAAW,CACVC,WAAW,KAIb,OAAOxW,KAAK2R,KAAKC,KAAKyB,OAAOoD,WAC5B,CACCC,gBAAiB/V,EACjBgW,WAAY,UACZC,OAAQ,CAACzE,GACTnO,KAAM,IAAMrD,EACZkW,cAAeN,MAKf1N,KAAKiO,IAEPnV,EAAOmV,EACP9W,KAAK8Q,OAAOlG,MAAMoL,iBAAkB,EAEpC,IAAIe,EAAS/W,KAAK2R,KAAKC,KAAKyB,OAAO2D,QAAQF,EAAMG,SAC7CxN,EAAQsN,EAAOrE,aAAawE,eAAe,uBAE/C,OAAOlX,KAAK2R,KAAKC,KAAKyB,OAAO8D,cAAcxV,EAAKsV,QAAS9E,EAAU,IAAK1I,EAAM,IAAIT,MAAMvE,SAGtFoE,KAAKsM,IACPnV,KAAKiQ,UAAW,EAGZjQ,KAAKgR,SAAWhR,KAAKgR,SAAWrQ,GACnCX,KAAKoX,YAGNpX,KAAK8Q,OAAOyE,OAAO,WAAW,GAEvBhC,QAAQ/E,YAEbxF,MAAMvE,IAERzE,KAAKiQ,UAAW,EAEhBjQ,KAAK8Q,OAAOlG,MAAMoL,iBAAkB,EAEhCvR,GAAkB,iBAAbA,EAAE4S,QAEHrX,KAAK2R,KAAKC,KAAKyB,OAAOiE,SAAS,IAAM3W,EAAK,IAAMX,KAAK2R,KAAKC,KAAK2F,QAAQC,QAAQ,WAAY,KAAK3O,KAAK,QACzGG,MAAMvE,OAMH8O,QAAQW,OAAOzP,KAKvB,OAAO8O,QAAQW,OAAO,MAKxBuD,iBACC,OAAOzX,KAAK2B,MAAQ3B,KAAK2B,KAAK8V,kBAG/BL,YACCpX,KAAKkH,KAAK,MAAM2B,KAAKsM,GACb5B,QAAQ/E,QAAQ2G,KAIzBtT,UAAUkD,GAET/E,KAAKkH,KAAKnC,GAAM8D,KAAKsM,GAEb5B,QAAQ/E,QAAQ2G,KAMzBuC,aAAc,SAAU3S,EAAM4S,GAE7B,OADA5S,EAAOA,EAAK6S,OACR7S,EAAKoH,QAAUwL,EAAc5S,GAEjCA,EAAOA,EAAK8S,MAAM,EAAGF,GAEd5S,EAAK6S,OAAS,QAGtBE,gBAAgB/S,GAMf,OAJAgI,EAAEmB,KAAKlO,KAAK0R,UAAU,SAAUjR,GAC/BsE,EAAOA,EAAKyS,QAAQ,IAAIO,OAAO,IAAMtX,EAAKuD,KAAM,KAAM,IAAMvD,EAAKE,GAAK,IAAMF,EAAKuD,SAG3Ee,GAGRmC,KAAKnC,GAoBJ,OAlBK/E,KAAK2B,MACT3B,KAAKsT,UAAUtK,MAAMvE,OAUtBzE,KAAKiL,MAAM,WAGNjL,KAAKyP,eACTzP,KAAKmI,QAGCnI,KAAKyT,GAAGC,OAAO,IAEd1T,KAAK2B,OAAS3B,KAAKiQ,UAExBpH,KAAMsM,IAERnV,KAAKiL,MAAM,QAEXlG,EAAO/E,KAAK8X,gBAAgB/S,GAExB/E,KAAKyP,eAEuB,aAA3BzP,KAAKyP,cAAchI,MAAuBzH,KAAKyP,cAAchG,MAEzDzJ,KAAK2R,KAAKC,KAAKoG,UAAUhY,KAAK2B,KAAMoD,GAAM8D,KAAKsM,IAErDA,EAAE,gBAAkB,CACnB,SAAY,YACZ,SAAYnV,KAAK2R,KAAKC,KAAKqG,aAAajY,KAAKyP,cAAchG,QAAUE,OAAEuO,UAGxE,IAAIC,EAAYhD,EAShB,OAPAnV,KAAKyP,cAAchG,MAAMA,MAAMvK,QAAQkZ,KAAOjD,EAAEiD,KAChDpY,KAAKyP,cAAchG,MAAMA,MAAMvK,QAAQqI,MAAQ4N,EAAE5N,MACjDvH,KAAKyP,cAAchG,MAAMA,MAAMvK,QAAQmZ,QAAUlD,EAAEkD,eAE5CrY,KAAKyP,cAAchG,MAAMA,MAAM6O,kBAC/BtY,KAAKyP,cAAchG,MAAMA,MAAM8O,UAE/BvY,KAAK2R,KAAKC,KAAKyB,OAAOmF,UAAUxY,KAAK2B,KAAKC,OAAQ,iBAAkBuW,KAEzEtP,KAAKsM,IAEPnV,KAAK2R,KAAK2D,MAAMmD,SAAS,gBAEzBzY,KAAKiL,MAAM,sBAEXjL,KAAKiL,MAAM,SAEJsI,QAAQ/E,YACbxF,MAAMvE,IAERkQ,QAAQpR,MAAMkB,GACP8O,QAAQW,OAAOzP,KAOlBzE,KAAK2R,KAAKC,KAAK8G,SAAS1Y,KAAK2B,KAAMoD,EAAM,CAAE4T,SAAU3Y,KAAKyP,kBAE/DzG,MAAMvE,IAGRzE,KAAKiL,MAAM,mBAAoB,CAC9B1H,MAAOkB,OAOVzC,WAAWmB,GACVnD,KAAK4Y,UAAU,CAAE1S,OAAQ/C,KAG1ByV,UAAW,SAAU,GAAkB,IAAlB,OAAE1S,EAAF,KAAUuI,GAAQ,EAEtC,IAAI9N,EAAKgJ,OAAEuO,SAEPW,EAAO,CACVpR,KAAM,QACN9G,GAAIA,EACJuF,OAAQA,GAGTlG,KAAKiL,MAAM,cAAe4N,GAE1B7Y,KAAKyT,GAAGC,OAAO,IAEP1T,KAAK2B,MAEVkH,KAAK,IACHgQ,EAAKC,QACDvF,QAAQW,OAAO,WAEhBlU,KAAK2R,KAAKC,KAAKgH,UAAU5Y,KAAK2B,KAAMuE,EAAQ,KAAM2S,EAAM,CAAEF,SAAU3Y,KAAKyP,iBAE9E5G,KAAKsM,IAEPnV,KAAKiL,MAAM,WAAY,CACtBtK,GAAIA,IAGE4S,QAAQ/E,YAEbxF,MAAMvE,IAERzE,KAAKiL,MAAM,YAAa,CACvBtK,GAAIA,EACJ4C,MAAOkB,IAGD8O,QAAQ/E,aAQjBuK,mBAAoB,SAAUtK,GAE7B,IAAIuK,EAAI,SAER,OAAKhZ,KAAK2B,KAAKsX,QAAQC,gBAInBzK,EAAK0K,KAAOH,EAGRhZ,KAAKoZ,QAAQC,QACnB,8FAA+F,CAC/F1Q,OAAQ,MACRC,WAAY,eAGXC,KAAMC,GAECyK,QAAQ/E,SAAQ,IAErBxF,MAAMvE,GACD8O,QAAQW,OAAO,WAjBjBX,QAAQ/E,SAAQ,IA0BzB8K,SAAU,SAAU,GAAU,IAAV,KAAE7K,GAAQ,EAE7B,IAAI9N,EAAKgJ,OAAEuO,SAEPW,EAAO,CACVpR,KAAM,OACN9G,GAAIA,EACJuV,KAAM,CACLlS,KAAMyK,EAAKzK,KACXmV,KAAM1K,EAAK0K,OAIbnZ,KAAKiL,MAAM,cAAe4N,GAE1B7Y,KAAKyT,GAAGC,OAAO,IAEP1T,KAAK2B,MAEVkH,KAAK,IAEA7I,KAAK+Y,mBAAmBtK,IAG7B5F,KAAM0Q,GAEDvZ,KAAK2R,KAAKC,KAAK0H,SAAStZ,KAAK2B,KAAM8M,EAAMoK,EAAM,CAAEF,SAAU3Y,KAAKyP,eAAiB8J,IAEtF1Q,KAAK,KAEP7I,KAAKiL,MAAM,WAAY,CACtBtK,GAAIA,IAGE4S,QAAQ/E,YAEbxF,MAAMvE,IAERkQ,QAAQpR,MAAMkB,GAEdzE,KAAKiL,MAAM,YAAa,CACvBtK,GAAIA,EACJ4C,MAAOkB,OAOV0D,MAAO,WACFnI,KAAK2L,MAAM,aACd3L,KAAK2L,MAAM,YAAYxD,SAGzBlG,QAAS,WACRjC,KAAKiL,MAAM,YAGZ7C,KAAM,WACDpI,KAAK2L,MAAM,aACd3L,KAAK2L,MAAM,YAAYvD,QAGzBC,YAAa,WACRrI,KAAK2L,MAAM,aACd3L,KAAK2L,MAAM,YAAYtD,eAGzBmR,OAAQ,aAGR1R,QAAS,SAAU/C,GAClB/E,KAAK+E,KAAOA,EAER/E,KAAK2L,MAAM,aACd3L,KAAK2L,MAAM,YAAY7D,QAAQ/C,IAGjCI,MAAO,SAAUsU,GAChB,IAAIvV,EAAQuV,EAAIC,OAAOxV,MAET,KAAVA,GAIHlE,KAAKiL,MAAM,cAAc,GAG1BjL,KAAK+E,KAAOb,EACZlE,KAAKoQ,WAAazG,OAAEgQ,OAAO3Z,KAAK+E,WAGR6U,IAApB5Z,KAAKoQ,WACRpQ,KAAKiL,MAAM,aAAcjL,KAAKoQ,YAE9BpQ,KAAKiL,MAAM,cAAc,GAGtBjL,KAAK2B,MACR3B,KAAK2R,KAAKC,KAAKyB,OAAOwG,WAAW7Z,KAAK2B,KAAKC,QAAQ,EAAM,MAjBzD5B,KAAKiL,MAAM,cAAc,IAoB3BnH,cAAclB,EAAMkX,GACnB9Z,KAAK4C,EAAKyO,OAAOyI,IAGlBC,sBAAuB,SAAU7V,GAIhC,OAFAlE,KAAK+U,cAAgB7Q,EAEdlE,KAAK+U,eAGb7R,YAAYN,EAAMK,KAIlBO,YAAYZ,EAAMW,GACjBvD,KAAK8Q,OAAOyE,OAAO,OAAQ,CAC1B9R,KAAM,QACNuW,QAASzW,EAAMwB,QAGjBkV,SACC,OAAOja,KAAK6U,MAAO,GAEpBqF,gBAAgBhW,GACVA,GACJlE,KAAK2L,MAAMyI,aAAaC,aAG1BjR,eAAeR,EAAMO,GACpB,MAAMgX,EAAkB,CAAC,YAAa,aAAc,YAAa,cAGjE,GAAKA,EAAgBC,SAASjX,EAAKsL,KAAKhH,MAGvC,OAAOzH,KAAK4Y,UAAUzV,GAFtBnD,KAAKsZ,SAASnW,IAKhBkX,QAAQ5L,GACP,MAAM6L,EAAM,IAAIC,MAChB,IAAIC,EAAU,GAEd,OAAO,IAAIjH,QAAQ,CAAC/E,EAAS0F,KAE5BoG,EAAIG,OAAS,WACZD,EAAQE,EAAI1a,KAAKwF,MACjBgV,EAAQG,EAAI3a,KAAK4a,OACjBpM,EAAQgM,IAGTF,EAAIO,QAAU,SAAUpW,GACvByP,EAAOzP,IAGR6V,EAAIQ,IAAMrM,EAAKvI,UAIjB5C,kBAAkBV,EAAMS,GACvBrD,KAAK8Q,OAAOlG,MAAMwD,SAAU,EAC5BpO,KAAK2L,MAAMyI,aAAaC,aAGzB0G,qBAAqBnM,GAEpB,GAAW,eAAPA,GAAyBA,EAAIoM,UAAYpM,EAAIoM,WAAW7H,QAAQ,eAAiB,EAgBpF,OAfAnT,KAAKqE,oBAAqB,OAEtBwD,OAAOoT,QACVjb,KAAKoZ,QAAQC,QACZrZ,KAAKsR,MAAMC,EAAE,oBAAqB,CAClC5I,OAAQ3I,KAAKsR,MAAMC,EAAE,eAItBvR,KAAKoZ,QAAQC,QACZrZ,KAAKsR,MAAMC,EAAE,oBAAqB,CAClC5I,OAAQ3I,KAAKsR,MAAMC,EAAE,gBAOnB3C,EAAIoM,UAAYpM,EAAIoM,WAAW7H,QAAQ,qBAAuB,EAClEnT,KAAKoZ,QAAQC,QACZrZ,KAAKsR,MAAMC,EAAE,qBAAsB,CACnC5I,OAAQ3I,KAAKsR,MAAMC,EAAE,gBAMvBvR,KAAKoZ,QAAQC,QACZrZ,KAAKsR,MAAMC,EAAE,0BAA2B,CACxC5I,OAAQ3I,KAAKsR,MAAMC,EAAE,eAGtBoD,QAAQpR,MAAMqL,KAGfsM,kBAAmBC,GAElB,OAAO,IAAI5H,QAAQ,CAAC/E,EAAS0F,KAC5BrM,OAAOuT,0BAA0BD,EAAOE,IAGvC,IAAIA,EACH,OAAOnH,EAAO,WAGfmH,EAAM5M,KAAMA,IACX,IAAI/F,EAAS,IAAI4S,WAEjB5S,EAAO6S,UAAY,WAClB,IAAIC,EAAO,IAAIC,KAAK,CAAC,IAAIC,WAAW1b,KAAKqD,SAAU,CAACoE,KAAOgH,EAAKhH,OAEhE4T,EAAMtP,SAENyC,EAAQgN,IAGT9S,EAAOmS,QAAWpW,IAEjB4W,EAAMtP,SAENmI,EAAOzP,IAGRiE,EAAOiT,kBAAkBlN,MAEvBhK,IACHyP,EAAOzP,QAMVmX,uBAEC5b,KAAKoE,iBAAmByX,yBAAW7b,KAAK2R,KAAKmK,MAAMC,YAAY,CAAEC,OAAO,IAAQnT,KAAK,KACpF7I,KAAKqE,oBAAqB,EAEnBkP,QAAQ/E,YACbxF,MAAM4F,IAER+F,QAAQpR,MAAMqL,GAEd5O,KAAK+a,qBAAqBnM,GAEnB2E,QAAQW,OAAOtF,MAIvB5O,KAAKoE,iBAAiByE,KAAK,KAE1B7I,KAAKqE,oBAAqB,EAE1B,IAAI8W,EAAO,gBAERxR,OAAEsS,UAASd,EAAO,+CAErB,IAAItO,EAAM,EAEV7M,KAAKwQ,aAAexQ,KAAK2R,KAAKuK,kBAI9B,IAAIJ,EAAQ9b,KAAKmc,qBAAuB,IAAIC,MAAMjB,EAAM,KAMvD,GAJAnb,KAAKsB,WAAa,EAElBwa,EAAMO,UAEFrc,KAAK2Q,8BAER3Q,KAAK2Q,+BAAgC,MAFtC,CAMA,IAAI2L,EAAK,KAIRA,EAAKtc,KAAKkb,kBAAkBvR,OAAEsS,QAAUd,EAAOtT,OAAOoT,QAAQxM,KAAK8N,sBAAwBpB,GAAMtS,KAAK2S,GAC9FjI,QAAQ/E,QAAQ,CACtBrL,KAAOqY,KAUVc,EAAGzT,KAAKsM,IAYH2G,EAAMU,UAAYV,EAAMU,SAAW,IACtCrH,EAAEqH,SAAWV,EAAMU,UAGpBxc,KAAKyc,mBAAmBtH,GAAG,GAEpB5B,QAAQ/E,YAEbxF,MAAMvE,IAERzE,KAAKyB,QAELkT,QAAQpR,MAAMkB,KACZiY,QAAQ,UAIRjY,IAEHkQ,QAAQpR,MAAMkB,GAEdzE,KAAKoB,aAAc,EACnBpB,KAAKyB,UAIFkb,EAAU,GAEd,IAAIC,EAAiB5c,KAAK8Q,OAAOlG,MAAMiS,2BAEnCD,GACHA,EAAeE,QAIhB9c,KAAK0Q,SAAWqM,YAAY,KAGxBpT,OAAEsS,SACJU,EAAQ9c,KAAK,GAET8c,EAAQxQ,OAAS,KAAIwQ,EAAU5P,EAAEC,KAAK2P,EAAS,KAEnD3c,KAAKuB,cAAgBwL,EAAEiQ,MAAML,IAG7B3c,KAAKmc,qBAAqBc,oBAExBC,IAEAP,EAAQ9c,KAAW,IAANqd,GAETP,EAAQxQ,OAAS,KAAIwQ,EAAU5P,EAAEC,KAAK2P,EAAS,KAEnD3c,KAAKuB,cAAgBwL,EAAEiQ,MAAML,KAI9B,SAAUlY,GACTkQ,QAAQwI,IAAI,IAAK1Y,MAQpBoI,GAAY,GAERA,EAAM,MAAS,IAAG7M,KAAKsB,WAAauL,IAEtC,IAEH7M,KAAKoB,aAAc,EACnBpB,KAAKwB,cAAgB,EACrBxB,KAAKuB,cAAgB,GACrBvB,KAAKsB,WAAa,EAClBtB,KAAKqB,OAAS,KAEdrB,KAAKmc,qBAAqBiB,gBAExBpU,MAAOvE,IACTkQ,QAAQpR,MAAMkB,KAGZiY,QAAQ,KACV1c,KAAKoE,iBAAmB,QAK1BE,gBAEC,KAAItE,KAAKoE,kBAAoBpE,KAAKoB,aAAepB,KAAKmc,sBAAtD,CAEA,GAAItU,OAAOoT,QACV,OAAOjb,KAAK4b,uBAGb5b,KAAKoE,iBAAmByX,yBAAW7b,KAAK2R,KAAK0L,oBAAoBxU,KAAMyU,IAItE,GAFAtd,KAAKqE,oBAAqB,EAEtBrE,KAAKoE,iBACR,OAAOmP,QAAQ/E,QAAQ8O,GAGvBA,EAASC,OAAOC,YAAYvK,QAASwK,IACpCA,EAAMC,WAIN1U,MAAM4F,IAER5O,KAAK+a,qBAAqBnM,GACnB2E,QAAQW,OAAOtF,MAKvB5O,KAAKoE,iBAAiByE,KAAMyU,IAG3Btd,KAAKuQ,cAAgB+M,EAErBtd,KAAKwQ,aAAexQ,KAAK2R,KAAKuK,kBAC9Blc,KAAKyQ,cAAgBzQ,KAAKwQ,aAAamN,iBAIvC,IAAI7C,EAAM9a,KAAKwQ,aAAaoN,wBAAwB5d,KAAKuQ,cAAcgN,QACvEzC,EAAI9J,QAAQhR,KAAKyQ,eAEjBzQ,KAAK6d,mBAEH7U,MAAM,QAAW0T,QAAQ,KAC3B1c,KAAKoE,iBAAmB,SAM1ByZ,iBAEC,IAAIjB,EAAiB5c,KAAK8Q,OAAOlG,MAAMiS,2BAEnCD,GACHA,EAAeE,QAGhB9c,KAAK8Q,OAAOyE,OAAO,sBAAsB,GAEzCvV,KAAKoB,aAAc,EACnBpB,KAAKwB,cAAgB,EACrBxB,KAAKuB,cAAgB,GACrBvB,KAAKsB,WAAa,EAClBtB,KAAKqB,OAAS,KACdrB,KAAKuQ,cAAcrH,QAEnB,IAAI2D,EAAM,EACN8P,EAAU,GAGd3c,KAAK0Q,SAAWqM,YAAY,KAC3B,IAAIe,EAAY,IAAIpC,WAAW1b,KAAKyQ,cAAcsN,mBAElD/d,KAAKyQ,cAAcuN,qBAAqBF,GAGxCnB,EAAQ9c,KAAKG,KAAKie,YAAYH,IAE1BnB,EAAQxQ,OAAS,KAAIwQ,EAAU5P,EAAEC,KAAK2P,EAAS,KAEnD9P,GAAY,GAEZ7M,KAAKuB,cAAgBwL,EAAEiQ,MAAML,GAEzB9P,EAAM,MAAS,IAClB7M,KAAKsB,WAAauL,IAGjB,KAKJqR,kBAAmB,SAAU7c,EAAQoK,GAEhCpK,EAAOmb,SAAW,EACrBxc,KAAKyB,QAGDgK,EACHzL,KAAK0E,iBAAiBrD,GAGtBrB,KAAKqB,OAASA,GAKjB8c,YAAY1P,GAEX,OAAO,IAAI8E,QAAQ,CAAC/E,EAAS0F,KAC5BvK,OAAEyU,SAAS3P,GAAM5F,KAAKwV,IACrB,IACCre,KAAKwQ,aAAa8N,gBAAgBD,EAAcE,IAC/C/P,EAAQ+P,EAAO/B,YAEhB,MAAM/X,GACNyP,EAAOzP,MAGNuE,MAAMkL,MAOXuI,mBAAmBhT,EAAOgC,GACzB,IAAIkC,EAAI,KAIP3N,KAAKke,kBAAkB,CACtBzP,KAAMhF,EAAMtG,KACZxC,GAAIgJ,OAAEuO,SACNsE,SAAW/S,EAAM+S,UACf/Q,IAGDhC,EAAM+S,SAER7O,IAGA3N,KAAKme,YAAY1U,EAAMtG,MAAM0F,KAAK2T,IACjC/S,EAAM+S,SAAWA,EAEjB7O,MACE3E,MAAOvE,IACTkQ,QAAQpR,MAAMkB,GAEdzE,KAAKyB,WAkCRwc,YAAYO,GACX,OAAQ7R,KAAK8R,KAAKD,EAAYE,OAAO,CAACC,EAAGC,IAAMD,EAAIC,GAAK,GAAKJ,EAAYrS,QAAQ0S,YAAY,IAG9Fta,cAAc,GAAqB,IAArB,OAAE2G,EAAF,QAAUO,GAAW,EAOlC,GALAkJ,QAAQwI,IAAI,iBAAkBnd,KAAKoB,aAGnCpB,KAAK8Q,OAAOyE,OAAO,sBAAsB,GAErCvV,KAAKoE,iBAKR,OAHApE,KAAKoE,iBAAiB8G,cACtBlL,KAAKoE,iBAAmB,MAKzBpE,KAAKoB,aAAc,EAEfpB,KAAK0Q,WACRoO,cAAc9e,KAAK0Q,UACnB1Q,KAAK0Q,SAAW,MAIb1Q,KAAKuQ,gBAEJrF,GAKHlL,KAAKuQ,cAAc/E,iBAAiB,gBAAkB/B,IACrDzJ,KAAKyc,mBAAmBhT,EAAOgC,KAIjCzL,KAAKuQ,cAAcmN,OAEnB1d,KAAKuQ,cAAcgN,OAAOC,YAAYvK,QAASwK,IAC9CA,EAAMC,SAGP1d,KAAKuQ,cAAgB,MAIlBvQ,KAAKmc,uBAGPnc,KAAK2Q,gCADFzF,EAOJlL,KAAKmc,qBAAqB4C,aAC1B/e,KAAKmc,qBAAuB,OAMxBzX,iBAAiBrD,GAAQ,8CAE1BA,IAAQA,EAAS,EAAKA,QAEtBA,GACH,EAAKI,QAGN,EAAKF,cAAgB,GAErB,MAAM2E,QAAe,EAAKyL,KAAKqN,qBAAqB3d,EAAOoN,MAErD9N,EAAKgJ,OAAEuO,SAEPW,EAAO,CACZpR,KAAM,QACN9G,GAAIA,EACJuF,OAAQA,GAGT,EAAKzE,QAEL,EAAKgS,GAAGC,OAAO,IACP,EAAK/R,MACVkH,KAAK,IACA,EAAK8I,KAAKC,KAAKqN,UAAU,EAAKtd,KAAMuE,EAAQ,KAAM2S,EAAM,CAAEF,SAAU,EAAKlJ,iBAC9EzG,MAAMvE,IACR,EAAKwG,MAAM,YAAa,CACvBtK,GAAIA,EACJ4C,MAAOkB,IAED8O,QAAQ/E,cA/Bc,IAqC/B/M,QACCzB,KAAKqB,OAAS,KACdrB,KAAKuB,cAAgB,GACrBvB,KAAKsB,WAAa,EAEdtB,KAAK0Q,WACRoO,cAAc9e,KAAK0Q,UACnB1Q,KAAK0Q,SAAW,MAGb1Q,KAAKmc,uBACRnc,KAAKmc,qBAAuB,MAGzBnc,KAAKuQ,gBAERvQ,KAAKuQ,cAAcmN,OACnB1d,KAAKuQ,cAAcgN,OAAOC,YAAYvK,QAASwK,IAC9CA,EAAMC,SAEP1d,KAAKuQ,cAAgB,OAkBvB/L,WAAW8H,GACVtM,KAAKwB,cAAgB8K,KCl8CmN,MCG3O,SAAS,GAAc9F,GAErB,IAAIC,EAAS,EAAQ,QACnBA,EAAO/G,YAAY+G,EAAO/G,WAAW8G,GAMzC,IAAI,GAAY,eACd,GACA1G,EACA8E,GACA,EACA,GACA,WACA,MACC,GAGY,gB","file":"matrix-element.6.min.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a \r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./picturePreview.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./picturePreview.vue?vue&type=template&id=4b882d9f&scoped=true&\"\nimport script from \"./picturePreview.vue?vue&type=script&lang=js&\"\nexport * from \"./picturePreview.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./picturePreview.vue?vue&type=style&index=0&id=4b882d9f&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"4b882d9f\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InputField.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./InputField.vue?vue&type=template&id=b9fd73f0&scoped=true&\"\nimport script from \"./InputField.vue?vue&type=script&lang=js&\"\nexport * from \"./InputField.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./InputField.vue?vue&type=style&index=0&id=b9fd73f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"b9fd73f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordButton_wrapper\"},[_c('div',{ref:\"holder\",staticClass:\"recordButton_holder\",class:{hold: _vm.isHold}},[_c('i',{staticClass:\"icon fas\",class:_vm.isHold ? 'fa-lock': 'fa-lock-open'})]),(!_vm.isHold)?_c('div',{ref:\"toggle\",staticClass:\"recordButton_micro recordButton_main\",class:{active: _vm.isRecording, disabled: _vm.disabled},on:{\"mousedown\":_vm.mousedown,\"mouseup\":_vm.mouseup,\"touchstart\":_vm.handleTouchStart,\"touchend\":_vm.handleTouchEnd,\"touchcancel\":_vm.handleTouchEnd}},[_c('i',{staticClass:\"icon fas fa-microphone\"})]):_vm._e(),(_vm.isHold)?_c('div',{ref:\"stop\",staticClass:\"recordButton_stop recordButton_main\",on:{\"click\":_vm.recordEnd}},[_c('i',{staticClass:\"icon fas fa-stop\"})]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n\tname: \"recordVoice\",\r\n\tprops: {\r\n\t\tisRecording: {\r\n\t\t\ttype: Boolean,\r\n\t\t\trequired: true\r\n\t\t},\r\n\t\tprepareRecording: {\r\n\t\t\ttype: Boolean\r\n\t\t},\r\n\t\tdisabled: Boolean,\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tstart: 0,\r\n\t\t\tisHold: false,\r\n\t\t\tdirection: null\r\n\t\t}\r\n\t},\r\n\tcomputed: {\r\n\t\t...mapState({\r\n\t\t\tmobile: state => state.mobile,\r\n\t\t})\r\n\t},\r\n\tmounted() {\r\n\t\r\n\t},\r\n\tbeforeDestroy() {\r\n\r\n\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\tif (this.isRecording) {\r\n\t\t\tthis.$emit('onRecordingStop', {cancel : true})\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\r\n\t\tmouseup : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchEnd(e)\r\n\t\t},\r\n\r\n\t\tmousedown : function(e){\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tthis.handleTouchStart(e)\r\n\t\t},\r\n\t\t\r\n\t\thandleTouchStart(e) {\r\n\r\n\r\n\t\t\tif(!this.isRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStart')\r\n\t\t\t}\r\n\r\n\t\t\telse{\r\n\t\t\t\tif(this.isHold) return\r\n\t\t\t}\r\n\r\n\t\t\tthis.start = {\r\n\t\t\t\tY: e.changedTouches ? e.changedTouches[0].pageY : e.pageY,\r\n\t\t\t\tX: e.changedTouches ? e.changedTouches[0].pageX : e.pageX\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.mobile)\r\n\t\t\t\tdocument.addEventListener('mousemove', this.handleMove)\r\n\t\t\telse\r\n\t\t\t\tdocument.addEventListener('touchmove', this.handleMove)\r\n\r\n\t\t},\r\n\t\thandleTouchEnd(e) {\r\n\r\n\t\t\tif (this.isHold) return\r\n\r\n\t\t\tif (this.isRecording || this.prepareRecording) {\r\n\t\t\t\tthis.$emit('onRecordingStop', {\r\n\t\t\t\t\tsendnow : true\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t},\r\n\r\n\t\tclearStyle(){\r\n\r\n\t\t\tif (this.$refs.toggle){\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\tthis.$refs.toggle.classList.remove('outside')\r\n\t\t\t}\r\n\r\n\t\t\tif (this.$refs.holder){\r\n\t\t\t\tthis.$refs.holder.classList.remove('active')\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\thandleMove(e) {\r\n\r\n\t\t\tif(!this.isRecording) return\r\n\r\n\t\t\tlet deltaY = this.start.Y - e.pageY\r\n\t\t\tlet deltaX = this.start.X - e.pageX\r\n\r\n\t\t\tif (e?.changedTouches?.length) {\r\n\t\t\t\tdeltaY = this.start.Y - e.changedTouches[0].pageY\r\n\t\t\t\tdeltaX = this.start.X - e.changedTouches[0].pageX\r\n\t\t\t}\r\n\r\n\t\t\tif (deltaY > 5 && deltaX < 5) {\r\n\t\t\t\tthis.direction = 'Y'\r\n\t\t\t} else {\r\n\t\t\t\tthis.direction = 'X'\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (deltaY > 5 && this.direction === 'Y') {\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('active'))\r\n\t\t\t\t\tthis.$refs.holder.classList.add('active')\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,-${deltaY}px)`\r\n\r\n\t\t\t\tif (deltaY > 70) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\r\n\t\t\t\t\tthis.isHold = true\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t} else if (deltaX > 5 && this.direction === 'X') {\r\n\r\n\t\t\t\tthis.$refs.toggle.style.transform = `translate(-${deltaX}px, 0)`\r\n\r\n\t\t\t\tif(!this.$refs.holder.classList.contains('outside'))\r\n\t\t\t\t\tthis.$refs.toggle.classList.add('outside')\r\n\r\n\t\t\t\tthis.$emit('canceling', (deltaX - 5) / 130)\r\n\t\t\t\t\r\n\t\t\t\tif (deltaX > 130) {\r\n\t\t\t\t\tthis.$refs.toggle.style.transform = `translate(0,0)`\r\n\t\t\t\t\tdocument.removeEventListener('mousemove', this.handleMove)\r\n\t\t\t\t\tdocument.removeEventListener('touchmove', this.handleMove)\r\n\t\t\t\t\t//document.removeEventListener('mouseup', this.handleTouchEnd)\r\n\t\t\t\t\tthis.$emit('onRecordingStop', { cancel: true })\r\n\t\t\t\t\tthis.$emit('onClear')\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.clearStyle()\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\trecordEnd(e) {\r\n\r\n\t\t\tthis.clearStyle()\r\n\r\n\t\t\tif (this.isRecording && this.isHold) {\r\n\r\n\t\t\t\tthis.$emit('onRecordingStop', {})\r\n\t\t\t\tthis.isHold = false\r\n\r\n\t\t\t\treturn\r\n\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t\r\n\t}\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=34d15f18&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=34d15f18&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"34d15f18\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"recordProgress\"},[(_vm.isRecording)?_c('div',{staticClass:\"indicatorWrapper\"},[_c('div',{staticClass:\"indicator\",class:{'recording': _vm.isRecording}})]):_c('div',{staticClass:\"del\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-trash\"})]),_c('div',{staticClass:\"timer\"},[_vm._v(_vm._s(_vm.timer))]),_c('div',{ref:\"graph\",staticClass:\"graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"id\":\"canvas\",\"width\":_vm.width,\"height\":\"20\"}})]),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isRecording && _vm.opacity),expression:\"isRecording && opacity\"}],ref:\"cancel\",staticClass:\"cancel\"},[_c('span',[_vm._v(\"Slide left to cancel\")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default {\r\n name: \"recordProgress\",\r\n props: {\r\n recordTime: {\r\n type: Number,\r\n required: true\r\n },\r\n rmsData: {\r\n type: Array,\r\n required: true\r\n },\r\n isRecording: {\r\n type: Boolean\r\n },\r\n opacity: {}\r\n },\r\n data() {\r\n return {\r\n width: 0,\r\n }\r\n },\r\n computed: {\r\n timer() {\r\n let minute = Math.floor(this.recordTime / 60000)\r\n let sec = Math.floor(this.recordTime / 1000) % 60\r\n return `${minute ? minute + ':' : '0:'}${(sec < 10) ? '0' + sec : sec}`\r\n },\r\n\r\n rmsDataLast(){\r\n return _.last(this.rmsData, 25)\r\n }\r\n },\r\n\r\n watch : {\r\n rmsData : _.throttle(function(){\r\n this.draw()\r\n }, 30),\r\n\r\n opacity : function(){\r\n this.$refs.cancel.style.opacity = this.opacity\r\n }\r\n },\r\n\r\n mounted() {\r\n this.$refs.cancel.style.opacity = 0\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n\r\n window.addEventListener(\"resize\", this.resize);\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.resize)\r\n },\r\n\r\n methods: {\r\n resize() {\r\n let timer = null\r\n\r\n var re = () => {\r\n if (!timer) {\r\n timer = setTimeout(() => {\r\n timer = null\r\n let width = this.$refs.graph.offsetWidth\r\n this.width = width - width % 100\r\n }, 50)\r\n }\r\n }\r\n\r\n re()\r\n },\r\n draw() {\r\n\r\n if(!this.$refs.canvas) return\r\n\r\n const ctx = this.$refs.canvas.getContext(`2d`);\r\n let x = 0\r\n let count = 50\r\n let width = 2 //this.width / 200\r\n var l = this.rmsDataLast.length\r\n var c = Math.max(Math.floor(l / count), 1)\r\n\r\n ctx.clearRect(0, 0, this.width, 20);\r\n\r\n for (let i = 0; i < l; i = i + c) {\r\n ctx.fillStyle = '#00a4ff'\r\n ctx.fillRect(i * 2 * width, 10 - this.rmsDataLast[i] / 8, width, this.rmsDataLast[i] / 4 + 1)\r\n }\r\n\r\n },\r\n clear() {\r\n this.$emit('onClear')\r\n }\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3f87c0fa&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.scss?vue&type=style&index=0&id=3f87c0fa&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3f87c0fa\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"upload\"},[_c('div',{staticClass:\"uploadWrapper\"},[_c('div',{staticClass:\"contentWrapper\"},[_vm._t(\"content\",function(){return [_c('i',{staticClass:\"fas fa-plus\"})]})],2),_c('div',{staticClass:\"inputWrapper\"},[_c('input',{attrs:{\"type\":\"file\",\"multiple\":_vm.multiple},on:{\"change\":_vm.upload}})])]),(_vm.dropzone)?_c('div',{ref:\"dropzone\",staticClass:\"dropzone\",class:{dropzone : _vm.dropzone}},[_vm._t(\"dropzone\",function(){return [_c('i',{staticClass:\"fas fa-plus\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.dragAndDropAFile\"))+\" \")]})],2):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a28e80a8&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=a28e80a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a28e80a8\",\n null\n ,true\n)\n\nexport default component.exports","import f from \"@/application/functions\";\r\nimport InputField from './InputField/InputField.vue'\r\nimport recordVoice from '@/components/assets/recordVoice/index.vue';\r\nimport { mapState } from \"vuex\";\r\nimport Images from '@/application/utils/images.js'\r\n\r\nimport contacts from '@/components/contacts/list/index.vue'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport recordProgress from '@/components/assets/recordProgress/index.vue';\r\n\r\nimport upload from '@/components/assets/upload/index.vue';\r\n\r\nimport { cancelable } from 'cancelable-promise';\r\nexport default {\r\n\tname: 'chatInput',\r\n\tprops: {\r\n\t\tchat: Object,\r\n\t\tu: String,\r\n\t\trelationEvent: Object\r\n\t},\r\n\r\n\tcomponents: { InputField, contacts, preview, recordProgress, recordVoice, upload },\r\n\r\n\tdata: function () {\r\n\r\n\t\treturn {\r\n\t\t\tupload: true,\r\n\t\t\ttest: [],\r\n\t\t\tloading: false,\r\n\t\t\ttext: '',\r\n\t\t\tfile: {},\r\n\t\t\tfileInfo: {},\r\n\t\t\tready: false,\r\n\t\t\tcreating: false,\r\n\t\t\tuserId: '',\r\n\t\t\tshowuserselect: null,\r\n\t\t\tanyUrlMeta: String,\r\n\t\t\tjoinedMembers: [],\r\n\t\t\ttipvalue: null,\r\n\t\t\ttipuserindex: 0,\r\n\t\t\trecord: null,\r\n\t\t\trecordRmsData: [],\r\n\t\t\tisRecording: false,\r\n\r\n\t\t\tmediaRecorder: null,\r\n\t\t\taudioContext: null,\r\n\t\t\taudioAnalyser: null,\r\n\r\n\t\t\trecordTime: 0,\r\n\t\t\tinterval: null,\r\n\t\t\tcancelOpacity: 0,\r\n\t\t\tmicrophoneDisabled: false,\r\n\t\t\tprepareRecording: false,\r\n\r\n\t\t\tcancelledCordovaMediaRecorder: false\r\n\t\t}\r\n\r\n\t},\r\n\r\n\r\n\twatch: {\r\n\t\tusersForKeysHash: {\r\n\t\t\t//immediate: true,\r\n\t\t\thandler: function () {\r\n\t\t\t}\r\n\t\t},\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (!this.tipusers.length) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t} else {\r\n\t\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t},\r\n\r\n\tbeforeDestroy() {\r\n\t\tif (this.audioContext)\r\n\t\t\tthis.audioContext.close()\r\n\t},\r\n\r\n\tcomputed: {\r\n\t\tvoiceEnable() {\r\n\t\t\treturn this.$store.state.voiceMessagesEnabled\r\n\t\t},\r\n\r\n\t\tconnect: function () {\r\n\t\t\treturn this.$store.state.contact\r\n\t\t},\r\n\t\tpkoindisabled : function(){\r\n\t\t\treturn this.$store.state.pkoindisabled\r\n\t\t},\r\n\t\tmenuItems: function () {\r\n\t\t\tvar menuItems = []\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\r\n\t\t\t\tif (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.mobile.supportimagegallery()) {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandlerCustom\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tmenuItems.push({\r\n\t\t\t\t\t\tclick: \"cameraHandler\",\r\n\t\t\t\t\t\ttitle: this.$i18n.t(\"button.takePhotoOrVideo\"),\r\n\t\t\t\t\t\ticon: \"fas fa-camera\",\r\n\r\n\t\t\t\t\t\tupload: {\r\n\t\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\t\textensions: ['jpg', 'jpeg', 'png', 'webp'],\r\n\t\t\t\t\t\t\tmaxsize: 100,\r\n\t\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\tmenuItems.push({\r\n\t\t\t\t\tclick: \"fileHandler\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendFile\"),\r\n\t\t\t\t\ticon: \"fas fa-sticky-note\",\r\n\r\n\t\t\t\t\tupload: {\r\n\t\t\t\t\t\tmultiple: true,\r\n\t\t\t\t\t\textensions: [],\r\n\t\t\t\t\t\tmaxsize: 25,\r\n\t\t\t\t\t\timages: {\r\n\t\t\t\t\t\t\tresize: {\r\n\t\t\t\t\t\t\t\ttype: 'fit'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.transaction && !this.pkoindisabled) {\r\n\t\t\t\tmenuItems.unshift({\r\n\t\t\t\t\tclick: \"sendtransactionWrapper\",\r\n\t\t\t\t\ttitle: this.$i18n.t(\"button.sendCoins\"),\r\n\t\t\t\t\ticon: \"fas fa-wallet\"\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn menuItems\r\n\t\t},\r\n\t\t...mapState([\r\n\t\t\t'chats'\r\n\t\t]),\r\n\r\n\t\tuserlist: function () {\r\n\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\treturn this.core.mtrx.chatUsersInfo(this.chat.roomId, 'anotherChatUsers')\r\n\r\n\t\t},\r\n\r\n\t\ttransaction: function () {\r\n\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.ui.wallet.send')\r\n\t\t},\r\n\r\n\t\tuusers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn u\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tausers: function () {\r\n\t\t\tif (this.u) {\r\n\t\t\t\treturn _.map(this.u.split(','), (u) => {\r\n\t\t\t\t\treturn this.core.user.matrixId(u)\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn []\r\n\t\t},\r\n\t\tstateChat: function () {\r\n\t\t\tvar id = this.$route.query.id\r\n\t\t\treturn this.$store.state.chatsMap[id]\r\n\t\t},\r\n\t\tinvited: function () {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tif (this.u) return this.ausers\r\n\t\t\t\treturn []\r\n\t\t\t}\r\n\r\n\t\t\treturn _.map(_.filter(this.chat.currentState.getMembers(), function (m, v) {\r\n\t\t\t\treturn m.membership === 'invite'\r\n\t\t\t}), function (u) {\r\n\t\t\t\treturn u.userId\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tjoined: function () {\r\n\r\n\t\t\tif (!this.chat) return []\r\n\r\n\t\t\tlet roomId = this.chat.roomId\r\n\t\t\tlet self = this\r\n\t\t\tlet arr = []\r\n\t\t\tlet members = 0\r\n\r\n\t\t\tthis.chat.currentState.getMembers().forEach(function (user) {\r\n\t\t\t\tif (user.membership === 'join') {\r\n\t\t\t\t\tarr.push(user.userId)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\treturn arr\r\n\t\t},\r\n\r\n\t\ttipusers: function () {\r\n\r\n\t\t\tif (this.tipvalue === null) return []\r\n\t\t\tif (this.tipvalue === '') return this.userlist\r\n\r\n\t\t\tvar value = this.tipvalue.toLowerCase()\r\n\r\n\t\t\tvar u = _.filter(this.userlist, function (u) {\r\n\t\t\t\treturn u.name.toLowerCase().indexOf(value) == 0 && u.name.toLowerCase() != value\r\n\t\t\t})\r\n\r\n\t\t\treturn u\r\n\r\n\t\t},\r\n\r\n\t\tmaintipuser: function () {\r\n\t\t\tif (this.tipusers.length) {\r\n\t\t\t\treturn this.tipusers[this.tipuserindex || 0]\r\n\t\t\t}\r\n\r\n\t\t\treturn null\r\n\t\t},\r\n\t},\r\n\r\n\tcreated() {\r\n\r\n\t},\r\n\r\n\t///\r\n\r\n\tmounted() {\r\n\t\tthis.ready = true\r\n\r\n\r\n\t\tif (!this.chat && this.core.mtrx.client) {\r\n\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t},\r\n\r\n\tmethods: {\r\n\t\twait: function () {\r\n\t\t\treturn this.$f.pretry(() => {\r\n\t\t\t\treturn this.core.mtrx.client && this.core.mtrx.access\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tbrowsetip: function (increase) {\r\n\r\n\t\t\tincrease ? this.tipuserindex++ : this.tipuserindex--\r\n\r\n\t\t\tif (this.tipuserindex > this.tipusers.length - 1) {\r\n\t\t\t\tthis.tipuserindex = 0\r\n\t\t\t}\r\n\r\n\t\t\tif (this.tipuserindex < 0) {\r\n\t\t\t\tthis.tipuserindex = this.tipusers.length - 1\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tselectcurrenttip: function () {\r\n\t\t\tthis.insertuser(this.tipusers[this.tipuserindex || 0])\r\n\t\t},\r\n\r\n\t\tinsertuser: function (user = {}) {\r\n\t\t\tvar name = user.name || ''\r\n\r\n\t\t\tthis.$refs['newinput'].inserttip(name)\r\n\t\t},\r\n\r\n\t\ttipBySearch: function (value) {\r\n\t\t\tthis.tipvalue = value\r\n\t\t},\r\n\r\n\t\tshowuserselected: function (contact, action) {\r\n\t\t\tthis[action](contact)\r\n\t\t},\r\n\r\n\r\n\t\tresizeImage: function (base64) {\r\n\r\n\t\t\tvar ftype = base64.split(';')[0].split('/')[1];\r\n\t\t\tvar images = new Images()\r\n\r\n\t\t\treturn images.resize['fit'](base64, 1024, 1024, ftype, 0.95).then(base64 => {\r\n\r\n\t\t\t\treturn Promise.resolve(base64)\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.reject(e)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tcameraHandlerCustom: function () {\r\n\t\t\tvar result = []\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t\twindow.POCKETNETINSTANCE.platform.ui.uploadImage({\r\n\t\t\t\tmultiple: true,\r\n\r\n\t\t\t\taction: ({ base64 }, resolve) => {\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\treturn this.resizeImage(base64).then(base64 => {\r\n\r\n\t\t\t\t\t\treturn f.Base64.toFile(base64).then(file => {\r\n\t\t\t\t\t\t\tvar data = {\r\n\t\t\t\t\t\t\t\tbase64,\r\n\t\t\t\t\t\t\t\tfile\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tresult.push(data)\r\n\r\n\t\t\t\t\t\t\tthis.uploadUploaded(null, data)\r\n\r\n\t\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\tresolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonSuccess: (imgs) => {\r\n\t\t\t\t\tthis.uploadUploadedAll()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendtransactionWrapper: function () {\r\n\r\n\t\t\tthis.menuIsVisible = false\r\n\r\n\t\t\tvar users = _.filter(_.map(this.joined, (j) => {\r\n\t\t\t\treturn this.$f.deep(this, '$store.state.users.' + this.$f.getmatrixid(j)) || null\r\n\t\t\t}), (r) => {\r\n\t\t\t\treturn r && r.source && r.id != this.core.user.userinfo?.id\r\n\t\t\t})\r\n\r\n\t\t\tif (!users.length) {\r\n\r\n\t\t\t\treturn 'users.length'\r\n\t\t\t}\r\n\r\n\t\t\tif (users.length > 1) {\r\n\r\n\t\t\t\tthis.core.store.commit('setmodal', {\r\n\t\t\t\t\tcaption: this.$i18n.t(\"caption.sendTransactionTo\"),\r\n\t\t\t\t\ttype: 'showuserselect',\r\n\t\t\t\t\tdata: {\r\n\t\t\t\t\t\tusers: users,\r\n\t\t\t\t\t\taction: 'sendtransaction',\r\n\t\t\t\t\t\tuserselected: (c) => {\r\n\t\t\t\t\t\t\tthis.showuserselected(c, 'sendtransaction')\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\r\n\t\t\t\t/*this.showuserselect = {\r\n\t\t\t\t users : users,\r\n\t\t\t\t action : 'sendtransaction'\r\n\t\t\t\t}*/\r\n\t\t\t} else {\r\n\t\t\t\tthis.sendtransaction(users[0])\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\r\n\t\t},\r\n\r\n\t\tsendtransaction: function (user) {\r\n\t\t\tvar api = this.transaction\r\n\r\n\t\t\t//TODO get address and send transaction\r\n\r\n\t\t\tapi({\r\n\t\t\t\troomid: this.chat.roomId,\r\n\t\t\t\taddress: user.source.address\r\n\t\t\t})\r\n\r\n\t\t\t/*.then(({txid, from}) => {\r\n\t \r\n\t\t\t return this.core.mtrx.transaction(this.chat.roomId, txid)\r\n\t \r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\temitInputData: function () {\r\n\t\t\tthis.$emit('emptyInput')\r\n\t\t\tthis.upload = true\r\n\t\t},\r\n\r\n\t\tHideUploadPic() {\r\n\t\t\tthis.upload = false\r\n\t\t},\r\n\r\n\t\temitUrl: function (url) {\r\n\t\t\tthis.$emit('setMetaUrl', url)\r\n\t\t},\r\n\r\n\t\tnewchat() {\r\n\r\n\t\t\tif (this.u) {\r\n\t\t\t\tthis.$store.state.globalpreloader = true\r\n\t\t\t\tvar matrixId = null\r\n\t\t\t\tvar myMatrixId = null\r\n\t\t\t\tvar chat = null\r\n\t\t\t\tvar id = ''\r\n\r\n\t\t\t\tthis.creating = true\r\n\t\t\t\treturn this.core.user.usersInfo(this.uusers).then(info => {\r\n\r\n\t\t\t\t\tif (this.uusers.length == 1) {\r\n\r\n\t\t\t\t\t\tvar _info = info[0]\r\n\r\n\t\t\t\t\t\tif (!_info || !_info.keys || _info.keys.length < 12) {\r\n\r\n\t\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.core.user.userinfo.keys.length < 12) {\r\n\t\t\t\t\t\tthis.$emit('cantchatcrypto')\r\n\t\t\t\t\t\treturn Promise.reject('ny2')\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t//return Promise.reject('ny3')\r\n\r\n\t\t\t\t\tid = this.core.mtrx.kit.tetatetid(info[0], this.core.user.userinfo)\r\n\r\n\t\t\t\t\tmatrixId = this.core.user.matrixId(info[0].id)\r\n\t\t\t\t\tmyMatrixId = this.core.user.matrixId(this.core.user.userinfo.id)\r\n\r\n\t\t\t\t\tvar initialstate = [{\r\n\t\t\t\t\t\t\"type\": \"m.set.encrypted\",\r\n\t\t\t\t\t\t\"state_key\": \"\",\r\n\t\t\t\t\t\t\"content\": {\r\n\t\t\t\t\t\t\tencrypted: true\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}]\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.createRoom(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\troom_alias_name: id,\r\n\t\t\t\t\t\t\tvisibility: 'private',\r\n\t\t\t\t\t\t\tinvite: [matrixId],\r\n\t\t\t\t\t\t\tname: '#' + id,\r\n\t\t\t\t\t\t\tinitial_state: initialstate\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\r\n\t\t\t\t}).then(_chat => {\r\n\r\n\t\t\t\t\tchat = _chat\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tlet m_chat = this.core.mtrx.client.getRoom(_chat.room_id)\r\n\t\t\t\t\tlet event = m_chat.currentState.getStateEvents(\"m.room.power_levels\")\r\n\r\n\t\t\t\t\treturn this.core.mtrx.client.setPowerLevel(chat.room_id, matrixId, 100, event[0]).catch(e => {\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\r\n\t\t\t\t\tif (this.connect && this.connect == id) {\r\n\t\t\t\t\t\tthis.greetings()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.$store.commit('CONTACT', false)\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\tthis.creating = false\r\n\r\n\t\t\t\t\tthis.$store.state.globalpreloader = false\r\n\r\n\t\t\t\t\tif (e && e.errcode == 'M_ROOM_IN_USE') {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.client.joinRoom('#' + id + ':' + this.core.mtrx.baseUrl.replace(\"https://\", \"\")).then(() => {\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\treturn Promise.reject('u')\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tmaySendMessage() {\r\n\t\t\treturn this.chat && this.chat.maySendMessage()\r\n\t\t},\r\n\r\n\t\tgreetings() {\r\n\t\t\tthis.send('👋').then(r => {\r\n\t\t\t\treturn Promise.resolve(r)\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tsendinput(text) {\r\n\r\n\t\t\tthis.send(text).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\ttextCutLimit: function (text, limit) {\r\n\t\t\ttext = text.trim();\r\n\t\t\tif (text.length <= limit) return text;\r\n\r\n\t\t\ttext = text.slice(0, limit);\r\n\r\n\t\t\treturn text.trim() + \"...\";\r\n\t\t},\r\n\r\n\t\treplaceMentions(text) {\r\n\r\n\t\t\t_.each(this.userlist, function (user) {\r\n\t\t\t\ttext = text.replace(new RegExp('@' + user.name, 'g'), '@' + user.id + ':' + user.name)\r\n\t\t\t})\r\n\r\n\t\t\treturn text\r\n\t\t},\r\n\r\n\t\tsend(text) {\r\n\r\n\t\t\tif (!this.chat) {\r\n\t\t\t\tthis.newchat().catch(e => {\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\t//return this.chat.pcrypto.getOrCreateCommonKey()\r\n\r\n\t\t\t//return this.chat.pcrypto.sendCommonKey()\r\n\r\n\t\t\t//return\r\n\r\n\t\t\tthis.$emit(\"sending\")\r\n\r\n\r\n\t\t\tif (!this.relationEvent) {\r\n\t\t\t\tthis.focus()\r\n\t\t\t}\r\n\r\n\t\t\treturn this.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat && !this.creating\r\n\r\n\t\t\t}).then((r) => {\r\n\r\n\t\t\t\tthis.$emit('sent')\r\n\r\n\t\t\t\ttext = this.replaceMentions(text)\r\n\r\n\t\t\t\tif (this.relationEvent) {\r\n\r\n\t\t\t\t\tif (this.relationEvent.type == 'm.replace' && this.relationEvent.event) {\r\n\r\n\t\t\t\t\t\treturn this.core.mtrx.textEvent(this.chat, text).then(r => {\r\n\r\n\t\t\t\t\t\t\tr['m.relates_to'] = {\r\n\t\t\t\t\t\t\t\t\"rel_type\": \"m.replace\",\r\n\t\t\t\t\t\t\t\t\"event_id\": this.core.mtrx.clearEventId(this.relationEvent.event) || f.makeid(),\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tvar editEvent = r\r\n\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.body = r.body\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.block = r.block\r\n\t\t\t\t\t\t\tthis.relationEvent.event.event.content.msgtype = r.msgtype\r\n\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decryptKey\r\n\t\t\t\t\t\t\tdelete this.relationEvent.event.event.decrypted\r\n\r\n\t\t\t\t\t\t\treturn this.core.mtrx.client.sendEvent(this.chat.roomId, 'm.room.message', editEvent)\r\n\r\n\t\t\t\t\t\t}).then(r => {\r\n\r\n\t\t\t\t\t\t\tthis.core.store.dispatch('FETCH_EVENTS')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('clearRelationEvent')\r\n\r\n\t\t\t\t\t\t\tthis.$emit('force')\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t\t\treturn Promise.reject(e)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.core.mtrx.sendtext(this.chat, text, { relation: this.relationEvent })\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\r\n\t\t\t\tthis.$emit('sentMessageError', {\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tpasteImage(data) {\r\n\t\t\tthis.sendImage({ base64: data })\r\n\t\t},\r\n\r\n\t\tsendImage: function ({ base64, file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"image\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\t\t\t//setTimeout(() => {\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\t\t\t\tif (meta.aborted)\r\n\t\t\t\t\treturn Promise.reject('aborted')\r\n\r\n\t\t\t\treturn this.core.mtrx.sendImage(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t})\r\n\t\t\t//}, 5000)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tcanencryptfilesize: function (file) {\r\n\r\n\t\t\tvar s = 10 * 1024 * 1024\r\n\r\n\t\t\tif (!this.chat.pcrypto.canBeEncrypt()) {\r\n\t\t\t\treturn Promise.resolve(false)\r\n\t\t\t}\r\n\r\n\t\t\tif (file.size > s) {\r\n\r\n\r\n\t\t\t\treturn this.$dialog.confirm(\r\n\t\t\t\t\t'Files larger than 10 megabytes are not encrypted. Do you want to send the file unencrypted?', {\r\n\t\t\t\t\tokText: 'Yes',\r\n\t\t\t\t\tcancelText: 'No, cancel'\r\n\t\t\t\t})\r\n\r\n\t\t\t\t\t.then((dialog) => {\r\n\r\n\t\t\t\t\t\treturn Promise.resolve(true)\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.reject('cancel')\r\n\t\t\t\t\t})\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve(false)\r\n\t\t},\r\n\r\n\t\tsendFile: function ({ file }) {\r\n\r\n\t\t\tvar id = f.makeid()\r\n\r\n\t\t\tvar meta = {\r\n\t\t\t\ttype: \"file\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tinfo: {\r\n\t\t\t\t\tname: file.name,\r\n\t\t\t\t\tsize: file.size\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.$emit(\"sendingData\", meta)\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\r\n\t\t\t\treturn this.chat\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\treturn this.canencryptfilesize(file)\r\n\r\n\r\n\t\t\t}).then((notenc) => {\r\n\r\n\t\t\t\treturn this.core.mtrx.sendFile(this.chat, file, meta, { relation: this.relationEvent }, notenc)\r\n\r\n\t\t\t}).then(() => {\r\n\r\n\t\t\t\tthis.$emit(\"sentData\", {\r\n\t\t\t\t\tid: id\r\n\t\t\t\t})\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\r\n\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].focus()\r\n\t\t},\r\n\r\n\t\tfocused: function () {\r\n\t\t\tthis.$emit('focused')\r\n\t\t},\r\n\r\n\t\tblur: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blur()\r\n\t\t},\r\n\r\n\t\tblurifempty: function () {\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].blurifempty()\r\n\t\t},\r\n\r\n\t\tchange: function () {\r\n\t\t},\r\n\r\n\t\tsetText: function (text) {\r\n\t\t\tthis.text = text\r\n\r\n\t\t\tif (this.$refs['newinput'])\r\n\t\t\t\tthis.$refs['newinput'].setText(text)\r\n\t\t},\r\n\r\n\t\tkeyup: function (evt) {\r\n\t\t\tvar value = evt.target.value\r\n\r\n\t\t\tif (value === '') {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t\treturn\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', true)\r\n\t\t\t}\r\n\r\n\t\t\tthis.text = value\r\n\t\t\tthis.anyUrlMeta = f.getUrl(this.text)\r\n\r\n\r\n\t\t\tif (this.anyUrlMeta !== undefined) {\r\n\t\t\t\tthis.$emit('setMetaUrl', this.anyUrlMeta)\r\n\t\t\t} else {\r\n\t\t\t\tthis.$emit('inputClean', false)\r\n\t\t\t}\r\n\r\n\t\t\tif (this.chat)\r\n\t\t\t\tthis.core.mtrx.client.sendTyping(this.chat.roomId, true, 100)\r\n\t\t},\r\n\r\n\t\tmenuItemClick(item, rowObject) {\r\n\t\t\tthis[item.click](rowObject);\r\n\t\t},\r\n\r\n\t\tmenuItemLoadedHandler: function (value) {\r\n\r\n\t\t\tthis.menuIsVisible = value\r\n\r\n\t\t\treturn this.menuIsVisible\r\n\t\t},\r\n\r\n\t\tuploadStart(item, files) {\r\n\r\n\t\t},\r\n\r\n\t\tuploadError(item, error) {\r\n\t\t\tthis.$store.commit('icon', {\r\n\t\t\t\ticon: 'error',\r\n\t\t\t\tmessage: error.text\r\n\t\t\t})\r\n\t\t},\r\n\t\tgetImg() {\r\n\t\t\treturn this.imgs = true\r\n\t\t},\r\n\t\tuploadSizeError(value) {\r\n\t\t\tif (!value) {\r\n\t\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t\t}\r\n\t\t},\r\n\t\tuploadUploaded(item, data) {\r\n\t\t\tconst validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/webp'];\r\n\r\n\r\n\t\t\tif (!validImageTypes.includes(data.file.type)) {\r\n\t\t\t\tthis.sendFile(data)\r\n\t\t\t} else {\r\n\t\t\t\treturn this.sendImage(data)\r\n\t\t\t}\r\n\t\t},\r\n\t\timageWH(file) {\r\n\t\t\tconst img = new Image();\r\n\t\t\tvar imgInfo = {};\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\timg.onload = function () {\r\n\t\t\t\t\timgInfo.w = this.width\r\n\t\t\t\t\timgInfo.h = this.height\r\n\t\t\t\t\tresolve(imgInfo)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.onerror = function (e) {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t}\r\n\r\n\t\t\t\timg.src = file.base64\r\n\t\t\t})\r\n\r\n\t\t},\r\n\t\tuploadUploadedAll(item, result) {\r\n\t\t\tthis.$store.state.loading = false\r\n\t\t\tthis.$refs.dropdownMenu.hidePopup();\r\n\t\t},\r\n\r\n\t\tcatchPermissonsError(err) {\r\n\r\n\t\t\tif (err == 'permissions' || (err.toString && err.toString().indexOf('Permission') > -1)) {\r\n\t\t\t\tthis.microphoneDisabled = true\r\n\r\n\t\t\t\tif (window.cordova) {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccesscordova'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\t\tthis.$i18n.t('micaccessbrowser'), {\r\n\t\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif ((err.toString && err.toString().indexOf('device not found') > -1)) {\r\n\t\t\t\tthis.$dialog.confirm(\r\n\t\t\t\t\tthis.$i18n.t('micdevicenotfound'), {\r\n\t\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t\t})\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\r\n\t\t\tthis.$dialog.confirm(\r\n\t\t\t\tthis.$i18n.t('micaccesscommonproblem'), {\r\n\t\t\t\tokText: this.$i18n.t(\"button.ok\"),\r\n\t\t\t})\r\n\r\n\t\t\tconsole.error(err)\r\n\t\t},\r\n\r\n\t\tgetFileIosCordova (path) {\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\twindow.resolveLocalFileSystemURL(path, (entry) => {\r\n\r\n\r\n\t\t\t\t\tif(!entry){\r\n\t\t\t\t\t\treturn reject('noentry')\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tentry.file((file) => {\r\n\t\t\t\t\t\tvar reader = new FileReader()\r\n\t\r\n\t\t\t\t\t\treader.onloadend = function() {\r\n\t\t\t\t\t\t\tvar blob = new Blob([new Uint8Array(this.result)], {type : file.type})\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\r\n\t\t\t\t\t\t\tresolve(blob)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treader.onerror = (e) => {\r\n\r\n\t\t\t\t\t\t\tentry.remove()\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file)\r\n\t\t\t\t\t})\r\n\t\t\t\t}, (e) => {\r\n\t\t\t\t\treject(e)\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t\t\r\n\t\t},\r\n\r\n\t\tinitRecordingCordova() {\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.media.permissions({ audio: true }).then(() => {\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tconsole.error(err)\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\t\t\tthis.prepareRecording.then(() => {\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tvar path = 'recording.mp3'\r\n\r\n\t\t\t\tif(f.isios()) path = 'cdvfile://localhost/temporary/recording.m4a'\r\n\r\n\t\t\t\tvar sec = 0\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\r\n\t\t\t\t//var startedTime = (new Date()).getTime() / 1000\r\n\r\n\t\t\t\tvar media = this.cordovaMediaRecorder = new Media(path, () => {\r\n\r\n\t\t\t\t\tthis.recordTime = 0\r\n\r\n\t\t\t\t\tmedia.release()\r\n\r\n\t\t\t\t\tif (this.cancelledCordovaMediaRecorder) {\r\n\r\n\t\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar fu = null\r\n\r\n\t\t\t\t\t/*if(f.isios()){ */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfu = this.getFileIosCordova(f.isios() ? path : window.cordova.file.externalDataDirectory + path).then(blob => {\r\n\t\t\t\t\t\t\treturn Promise.resolve({\r\n\t\t\t\t\t\t\t\tdata : blob\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*}\r\n\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tfu = f.fetchLocal(path)\r\n\t\t\t\t\t}*/\r\n\r\n\t\t\t\t\tfu.then(r => {\r\n\t\t\t\t\t\t///temp\r\n\t\t\t\t\t\t/*if (f.isios())\r\n\t\t\t\t\t\t\tr.duration = (new Date()).getTime() / 1000 - startedTime\r\n\r\n\t\t\t\t\t\tconsole.log(\"R\", r)\r\n\r\n\t\t\t\t\t\t/*var e = {\r\n\t\t\t\t\t\t\tdata : r.data\r\n\t\t\t\t\t\t}*/\r\n\r\n\r\n\t\t\t\t\t\tif (media.duration && media.duration > 0){\r\n\t\t\t\t\t\t\tr.duration = media.duration\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.createVoiceMessage(r, true)\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t\t\tconsole.error(e)\r\n\t\t\t\t\t}).finally(() => {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}, (e) => {\r\n\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.isRecording = false\r\n\t\t\t\t\tthis.clear()\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\tvar rmsdata = []\r\n\r\n\t\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\t\tif (currentPlaying) {\r\n\t\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\t\t// get media amplitude\r\n\r\n\t\t\t\t\tif(f.isios()){\r\n\t\t\t\t\t\trmsdata.push(1)\r\n\r\n\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tthis.cordovaMediaRecorder.getCurrentAmplitude(\r\n\t\t\t\t\t\t\t// success callback\r\n\t\t\t\t\t\t\t(amp) => {\r\n\t\r\n\t\t\t\t\t\t\t\trmsdata.push(amp * 1000)\r\n\t\r\n\t\t\t\t\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\t\r\n\t\t\t\t\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\t\r\n\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tfunction (e) {\r\n\t\t\t\t\t\t\t\tconsole.log(\"E\", e)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\r\n\r\n\t\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\t\tif (sec % 1000 === 0) this.recordTime = sec\r\n\r\n\t\t\t\t}, 50);\r\n\r\n\t\t\t\tthis.isRecording = true\r\n\t\t\t\tthis.cancelOpacity = 0\r\n\t\t\t\tthis.recordRmsData = []\r\n\t\t\t\tthis.recordTime = 0\r\n\t\t\t\tthis.record = null\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.startRecord();\r\n\r\n\t\t\t}).catch((e) => { \r\n\t\t\t\tconsole.error(e)\r\n\r\n\r\n\t\t\t}).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tinitRecording() {\r\n\r\n\t\t\tif (this.prepareRecording || this.isRecording || this.cordovaMediaRecorder) return\r\n\r\n\t\t\tif (window.cordova) {\r\n\t\t\t\treturn this.initRecordingCordova()\r\n\t\t\t}\r\n\r\n\t\t\tthis.prepareRecording = cancelable(this.core.initMediaRecorder().then((recorder) => {\r\n\r\n\t\t\t\tthis.microphoneDisabled = false\r\n\r\n\t\t\t\tif (this.prepareRecording) {\r\n\t\t\t\t\treturn Promise.resolve(recorder)\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\trecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\t\ttrack.stop();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t}).catch(err => {\r\n\r\n\t\t\t\tthis.catchPermissonsError(err)\r\n\t\t\t\treturn Promise.reject(err)\r\n\r\n\t\t\t}))\r\n\r\n\r\n\t\t\tthis.prepareRecording.then((recorder) => {\r\n\r\n\r\n\t\t\t\tthis.mediaRecorder = recorder\r\n\r\n\t\t\t\tthis.audioContext = this.core.getAudioContext()\r\n\t\t\t\tthis.audioAnalyser = this.audioContext.createAnalyser()\r\n\r\n\t\t\t\t//var audioDataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tvar src = this.audioContext.createMediaStreamSource(this.mediaRecorder.stream)\r\n\t\t\t\tsrc.connect(this.audioAnalyser)\r\n\r\n\t\t\t\tthis.startRecording()\r\n\r\n\t\t\t}).catch(() => { }).finally(() => {\r\n\t\t\t\tthis.prepareRecording = null\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tstartRecording() {\r\n\r\n\t\t\tlet currentPlaying = this.$store.state.currentPlayingVoiceMessage\r\n\r\n\t\t\tif (currentPlaying) {\r\n\t\t\t\tcurrentPlaying.pause()\r\n\t\t\t}\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', true)\r\n\r\n\t\t\tthis.isRecording = true\r\n\t\t\tthis.cancelOpacity = 0\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\t\t\tthis.record = null\r\n\t\t\tthis.mediaRecorder.start()\r\n\r\n\t\t\tvar sec = 0\r\n\t\t\tvar rmsdata = []\r\n\r\n\r\n\t\t\tthis.interval = setInterval(() => {\r\n\t\t\t\tvar dataArray = new Uint8Array(this.audioAnalyser.frequencyBinCount)\r\n\r\n\t\t\t\tthis.audioAnalyser.getByteFrequencyData(dataArray)\r\n\r\n\r\n\t\t\t\trmsdata.push(this.generateRms(dataArray))\r\n\r\n\t\t\t\tif (rmsdata.length > 50) rmsdata = _.last(rmsdata, 50)\r\n\r\n\t\t\t\tsec = sec + 50\r\n\r\n\t\t\t\tthis.recordRmsData = _.clone(rmsdata)\r\n\r\n\t\t\t\tif (sec % 1000 === 0) {\r\n\t\t\t\t\tthis.recordTime = sec\r\n\t\t\t\t}\r\n\r\n\t\t\t}, 50)\r\n\r\n\t\t},\r\n\r\n\r\n\t\tcheckaudioForSend: function (record, sendnow) {\r\n\r\n\t\t\tif (record.duration < 1) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (sendnow) {\r\n\t\t\t\t\tthis.sendVoiceMessage(record)\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tthis.record = record\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetduration(file){\r\n\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\tf.readFile(file).then(arraybuffer => {\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\t\t\t\t\t\t\tresolve(buffer.duration)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\treject(e)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}).catch(reject)\r\n\t\t\t})\r\n\r\n\t\t\t\r\n\r\n\t\t},\r\n\r\n\t\tcreateVoiceMessage(event, sendnow) {\r\n\t\t\tvar c = () => {\r\n\r\n\t\t\t\t//this.record = \r\n\r\n\t\t\t\tthis.checkaudioForSend({\r\n\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\tid: f.makeid(),\r\n\t\t\t\t\tduration : event.duration\r\n\t\t\t\t}, sendnow)\r\n\t\t\t}\r\n\r\n\t\t\tif(event.duration){\r\n\r\n\t\t\t\tc()\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tthis.getduration(event.data).then(duration => {\r\n\t\t\t\t\tevent.duration = duration\r\n\r\n\t\t\t\t\tc()\r\n\t\t\t\t}).catch((e) => {\r\n\t\t\t\t\tconsole.error(e)\r\n\r\n\t\t\t\t\tthis.clear()\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/*f.readFile(event.data).then(arraybuffer => {\r\n\r\n\t\t\t\tconsole.log('arraybuffer', arraybuffer)\r\n\r\n\t\t\t\tthis.audioContext.decodeAudioData(arraybuffer, (buffer) => {\r\n\r\n\t\t\t\t\tconsole.log('this.record', this.record)\r\n\t\t\t\t\tconsole.log('this.buffer', buffer)\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tthis.record = {\r\n\t\t\t\t\t\tfile: event.data,\r\n\t\t\t\t\t\tid: f.makeid()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.record.duration = buffer.duration\r\n\r\n\t\t\t\t\tthis.checkaudioForSend(sendnow)\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tconsole.error('e', e)\r\n\t\t\t\tthis.clear()\r\n\t\t\t\t//\r\n\t\t\t})*/\r\n\r\n\t\t},\r\n\r\n\t\tgenerateRms(frequencies) {\r\n\t\t\treturn +Math.sqrt(frequencies.reduce((a, b) => a + b ** 2) / frequencies.length).toPrecision(4)\r\n\t\t},\r\n\r\n\t\tstopRecording({ cancel, sendnow }) {\r\n\r\n\t\t\tconsole.log(\"STOP RECORDING\", this.isRecording)\r\n\r\n\r\n\t\t\tthis.$store.commit('SET_VOICERECORDING', false)\r\n\r\n\t\t\tif (this.prepareRecording) {\r\n\r\n\t\t\t\tthis.prepareRecording.cancel()\r\n\t\t\t\tthis.prepareRecording = null\r\n\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tthis.isRecording = false\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\t//this.mediaRecorder.ondataavailable = () => { }\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.mediaRecorder.addEventListener('dataavailable', (event) => {\r\n\t\t\t\t\t\tthis.createVoiceMessage(event, sendnow)\r\n\t\t\t\t\t})//ondataavailable = (event) => this.createVoiceMessage(event, sendnow)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\r\n\t\t\t\tif (cancel) {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = true\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.cancelledCordovaMediaRecorder = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.cordovaMediaRecorder.stopRecord()\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tasync sendVoiceMessage(record) {\r\n\r\n\t\t\tif(!record) record = this.record\r\n\r\n\t\t\tif(!record) {\r\n\t\t\t\tthis.clear()\r\n\t\t\t}\r\n\r\n\t\t\tthis.recordRmsData = []\r\n\r\n\t\t\tconst base64 = await this.core.convertAudioToBase64(record.file)\r\n\r\n\t\t\tconst id = f.makeid()\r\n\r\n\t\t\tconst meta = {\r\n\t\t\t\ttype: \"audio\",\r\n\t\t\t\tid: id,\r\n\t\t\t\tbase64: base64,\r\n\t\t\t}\r\n\r\n\t\t\tthis.clear()\r\n\r\n\t\t\tthis.$f.pretry(() => {\r\n\t\t\t\treturn this.chat\r\n\t\t\t}).then(() => {\r\n\t\t\t\treturn this.core.mtrx.sendAudio(this.chat, base64, null, meta, { relation: this.relationEvent })\r\n\t\t\t}).catch(e => {\r\n\t\t\t\tthis.$emit('sentError', {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\terror: e\r\n\t\t\t\t})\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\r\n\t\t},\r\n\r\n\t\tclear() {\r\n\t\t\tthis.record = null\r\n\t\t\tthis.recordRmsData = []\r\n\t\t\tthis.recordTime = 0\r\n\r\n\t\t\tif (this.interval) {\r\n\t\t\t\tclearInterval(this.interval)\r\n\t\t\t\tthis.interval = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.cordovaMediaRecorder) {\r\n\t\t\t\tthis.cordovaMediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\tif (this.mediaRecorder) {\r\n\r\n\t\t\t\tthis.mediaRecorder.stop()\r\n\t\t\t\tthis.mediaRecorder.stream.getTracks().forEach((track) => {\r\n\t\t\t\t\ttrack.stop();\r\n\t\t\t\t});\r\n\t\t\t\tthis.mediaRecorder = null\r\n\t\t\t}\r\n\r\n\t\t\t/*if (this.audioContext){\r\n\t\t\t\tthis.audioContext.close()\r\n\t\t\t}*/\r\n\t\t},\r\n\r\n\t\t/*async convertAudioToBase64(blob) {\r\n\t\t\tconst reader = new FileReader()\r\n\t\t\treader.readAsDataURL(blob)\r\n\t\t\treturn new Promise(resolve => {\r\n\t\t\t\treader.onloadend = () => {\r\n\t\t\t\t\tresolve(reader.result)\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},*/\r\n\r\n\t\tsetOpacity(opacity) {\r\n\t\t\tthis.cancelOpacity = opacity\r\n\t\t}\r\n\r\n\t},\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e8b463ac&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e8b463ac&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e8b463ac\",\n null\n ,true\n)\n\nexport default component.exports"],"sourceRoot":""} \ No newline at end of file diff --git a/chat/matrix-element.js b/chat/matrix-element.js index 870ca21de2..d3fe3179a2 100644 --- a/chat/matrix-element.js +++ b/chat/matrix-element.js @@ -9984,20 +9984,6 @@ module.exports.__inject__ = function (shadowRoot) { add("08f900d1", content, shadowRoot) }; -/***/ }), - -/***/ "2931": -/***/ (function(module, exports, __webpack_require__) { - -// Imports -var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb"); -exports = ___CSS_LOADER_API_IMPORT___(false); -// Module -exports.push([module.i, ".deletedMessage[data-v-659136c0]{font-size:.8em;text-align:center;opacity:.6}.event[data-v-659136c0]{opacity:0;transition:.3s}.event.readyToRender[data-v-659136c0]{opacity:1}.event .loading[data-v-659136c0]{width:100%;height:100%;text-align:center}.event .deletedMessage[data-v-659136c0],.event .loading[data-v-659136c0]{position:relative;left:0;top:0;padding:.5em}", ""]); -// Exports -module.exports = exports; - - /***/ }), /***/ "2a7f": @@ -36510,7 +36496,6 @@ class mtrxkit_MTRXKIT { chatIsPublic(chat) { var join_rules = chat.currentState.getStateEvents("m.room.join_rules"); - console.log('join_rules', join_rules); return _.find(join_rules, v => { return functions["a" /* default */].deep(v, 'event.content.join_rule') == 'public'; }) ? true : false; @@ -39333,8 +39318,6 @@ const sdk = __webpack_require__("0a00"); var mtrx_axios = __webpack_require__("bc3a"); -console.log("sdk", sdk); - class mtrx_MTRX { constructor(core, p) { Object(defineProperty["a" /* default */])(this, "fastsync", function () { @@ -40004,7 +39987,6 @@ class mtrx_MTRX { info.from = from; return new Promise(resolve => { if (chat.pcrypto.canBeEncrypt()) { - console.log("??????????"); return chat.pcrypto.encryptFile(file).then(r => { info.secrets = r.secrets; return resolve(r.file); @@ -40017,7 +39999,6 @@ class mtrx_MTRX { if (promise.abort) meta.abort = promise.abort; return promise; }).then(audio => { - console.log(audio, info); if (meta.aborted) return Promise.reject('aborted'); return this.client.sendAudioMessage(chat.roomId, audio, info, 'Audio'); }); @@ -40076,8 +40057,6 @@ class mtrx_MTRX { var _this7 = this; return Object(asyncToGenerator["a" /* default */])(function* () { - console.log('getAudioUnencrypt'); - if (event.event.content.audioData) { return Promise.resolve(event.event.content.audioData); } @@ -44186,6 +44165,18 @@ module.exports.__inject__ = function (shadowRoot) { add("7b306284", content, shadowRoot) }; +/***/ }), + +/***/ "60b9": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_72e46191_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8056"); +/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_72e46191_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_72e46191_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_72e46191_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_72e46191_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + + /***/ }), /***/ "6129": @@ -44653,12 +44644,12 @@ function exists(indexedDB, dbName) { // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"056ad8cc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/events/event/index.vue?vue&type=template&id=659136c0&scoped=true& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"056ad8cc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/events/event/index.vue?vue&type=template&id=72e46191&scoped=true& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.event.localRedactionEvent() && !_vm.event.getRedactionEvent() && !_vm.removed)?_c('div',{ref:"msgElement",staticClass:"event",class:{readyToRender: _vm.readyToRender, my: _vm.my}},[(_vm.type === 'member' && !_vm.preview)?_c('member',{attrs:{"chat":_vm.chat,"event":_vm.event,"userinfo":_vm.userinfo,"readed":_vm.readed,"preview":_vm.preview || false},on:{"readyToRender":_vm.setReadyToRender}}):_vm._e(),(_vm.type === 'message' || _vm.preview)?_c('message',{attrs:{"chat":_vm.chat,"event":_vm.event,"prevevent":_vm.prevevent,"origin":_vm.event,"decryptEvent":_vm.decryptEvent,"decryptedInfo":_vm.decryptedInfo,"encryptedData":_vm.encryptedData,"imgEvent":_vm.galleryData,"userinfo":_vm.userinfo,"readed":_vm.readed,"preview":_vm.preview || false,"withImage":_vm.withImage || false,"clientWidth":_vm.clientWidth,"encrypted":_vm.encrypted,"subtype":_vm.subtype,"error":_vm.error,"reference":_vm.reference,"downloaded":_vm.downloaded,"last":_vm.last,"showmyicontrue":_vm.showmyicontrue,"fromreference":_vm.fromreference,"multiSelect":_vm.multiSelect,"selectedMessages":_vm.selectedMessages,"audioBuffer":_vm.audioBuffer,"isRemoveSelectedMessages":_vm.isRemoveSelectedMessages},on:{"openGalleryImg":_vm.openImage,"readyToRender":_vm.setReadyToRender,"remove":_vm.removeEvent,"download":_vm.downloadFile,"decryptagain":_vm.decryptAgain,"showMultiSelect":function($event){return _vm.$emit('showMultiSelect')},"selectMessage":_vm.selectMessage,"removeMessage":_vm.removeMessage,"messagesIsDeleted":_vm.messagesIsDeleted,"editing":_vm.editing,"reply":_vm.reply,"share":_vm.share,"menuIsVisible":_vm.menuIsVisibleHandler}}):_vm._e(),(_vm.type === 'common')?_c('common',{attrs:{"event":_vm.event,"userinfo":_vm.userinfo,"readed":_vm.readed,"preview":_vm.preview || false}}):_vm._e(),(_vm.downloading)?_c('div',{staticClass:"loading"},[_c('linepreloader')],1):_vm._e()],1):_c('div',{staticClass:"deletedMessage"},[_c('i',{staticClass:"fas fa-eraser"}),_vm._v(" "+_vm._s(_vm.$t("caption.messageDeleted"))+" ")])} var staticRenderFns = [] -// CONCATENATED MODULE: ./src/components/events/event/index.vue?vue&type=template&id=659136c0&scoped=true& +// CONCATENATED MODULE: ./src/components/events/event/index.vue?vue&type=template&id=72e46191&scoped=true& // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js var asyncToGenerator = __webpack_require__("1da1"); @@ -46728,10 +46719,7 @@ var message_component = Object(componentNormalizer["a" /* default */])( var _this = this; return Object(asyncToGenerator["a" /* default */])(function* () { - console.log("decryptAudiodecryptAudiodecryptAudiodecryptAudio"); - _this.core.mtrx.getAudio(_this.chat, _this.event).then(url => { - console.log("HE"); _this.decryptedInfo = url; }).catch(e => { _this.event.event.decryptKey = _this.decryptKey = { @@ -46768,8 +46756,6 @@ var message_component = Object(componentNormalizer["a" /* default */])( var _this4 = this; return Object(asyncToGenerator["a" /* default */])(function* () { - console.log('this.event', _this4.event); - if (_this4.event.event.decrypted) { _this4.decryptEvent = _this4.event.event.decrypted; return Promise.resolve(); @@ -46827,7 +46813,7 @@ var message_component = Object(componentNormalizer["a" /* default */])( function event_injectStyles (context) { - var style0 = __webpack_require__("72a7") + var style0 = __webpack_require__("60b9") if (style0.__inject__) style0.__inject__(context) } @@ -46840,7 +46826,7 @@ var event_component = Object(componentNormalizer["a" /* default */])( staticRenderFns, false, event_injectStyles, - "659136c0", + "72e46191", null ,true ) @@ -55163,18 +55149,6 @@ function b64_enc (data) { //UMD FOOTER END -/***/ }), - -/***/ "72a7": -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_659136c0_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("de24"); -/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_659136c0_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_659136c0_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_659136c0_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_10_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_10_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_659136c0_scoped_true_lang_sass___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); - - /***/ }), /***/ "72aa": @@ -55347,6 +55321,20 @@ module.exports = exports; module.exports = JSON.parse("{\"caption\":{\"create\":\"Создать\",\"addPublicChatName\":\"Имя Публичной комнаты\",\"addGroupNamePlaceHolder\":\"Имя Чата\",\"createPublicChat\":\"Создать публичный чат\",\"chatTopic\":\"Топик изменён\",\"publicRoomTitle\":\"Публичная комната\",\"asModerator\":\"права модерации\",\"marked\":\"Передал\",\"unmarked\":\"Снял\",\"removeBan\":\"Снять Бан\",\"cancelModeration\":\"Снять модерцию\",\"uploadFiles\":\"Загрузить файлы\",\"header\":\"Заголовок\",\"dragAndDropAFile\":\"Перетятите файл в эту область\",\"chatInvite\":\"Вы приглашены в чат с\",\"cantJoion\":\"Вы не можете присоединиться к чату с\",\"chatInviteDecline\":\"Вы можете присоединиться к чату или отклонить приглашение\",\"creatorLeft\":\"Так как создатель чата покинул его\",\"encrypted\":\"Зашифровано \",\"noImages\":\"В чате пока нет изображений\",\"noFiles\":\"В чате пока нет файлов\",\"inviteUser\":\"Пригласить пользователя\",\"invite\":\"Пригласить\",\"add\":\"Добавить\",\"mute\":\"Отключить звук\",\"unmute\":\"Включить звук\",\"leave\":\"Покинуть\",\"Info\":\"Информация\",\"new\":\"Новый\",\"typing\":\"печатает\",\"accNotFound\":\"Ваш аккаунт находится в процессе регистрации, пожалуйста, подождите...\",\"emptyList\":\"Список пуст\",\"welcome\":\"Добро пожаловать в чат!\",\"startNewChat\":\"Начать новый чат\",\"chats\":\"Чаты\",\"shareWith\":\"Поделиться с\",\"newChat\":\"Новый чат\",\"moveToChat\":\"Перейти в чат\",\"queryNoResults\":\"Нет результатов по запросу\",\"needMoreCharacters\":\"Введите больше символов для поиска\",\"createGroup\":\"Создать группу\",\"unabletoDecrypt\":\"* Невозможно расшифровать\",\"messageDeleted\":\"Сообщение удалено\",\"sentImage\":\"отправлено изображение\",\"sentVoiceMessage\":\"отправлено голосовое сообщение\",\"invitationToChat\":\"Приглашение в чат\",\"invitationToRoom\":\"Приглашение в комнату\",\"leftChat\":\"покинул чат\",\"joined\":\"присоединился\",\"chatRenamed\":\"Чат переименован в \",\"recentComment\":\"Последний комментарий:\",\"share\":\"Поделиться\",\"followers\":\"Подписались\",\"reputation\":\"Репутация\",\"unsubscribe\":\"Отписаться\",\"following\":\"Подписан\",\"theme\":\"Тема:\",\"contacts\":\"Контакты\",\"phoneContacts\":\"Телефонные контакты\",\"chooseInviteMedia\":\"Пожалуйста, выберите, способ приглашения\",\"admin\":\"Админ\",\"moderator\":\"Модератор\",\"videocall\":\"Видеозвонок\",\"call\":\"Звонок\",\"leaveAndDelete\":\"Покинуть и удалить чат\",\"donate\":\"Донат\",\"makeModerator\":\"Сделать модератором\",\"ban\":\"Бан\",\"kick\":\"Исключить\",\"members\":\"Участники\",\"media\":\"Медиа\",\"files\":\"Файлы\",\"contactsList\":\"Список контактов\",\"send\":\"Отправить\",\"pageCaption\":\"Заголовок страницы\",\"caption\":\"Заголовок\",\"text\":\"текст\",\"placeholder\":\"плейсхолдер\",\"sendTransactionTo\":\"Послать транзакрию\",\"toBePaidByReceiver\":\"Оплата получателем\",\"toBePaidBySender\":\"Оплата отправителем\",\"source\":\"Источник\",\"amount\":\"Количество\",\"receiver\":\"Получатель\",\"message\":\"Сообщение\",\"includeFeesInAmount\":\"Включить комиссию в сумму\",\"transactionFees\":\"Комиссия за транзакцию\",\"totalAmount\":\"Итого\",\"balanceTooLow\":\"Баланс слишком низкий\",\"transactionError\":\"Ошибка: нельзя совершить транзакцию\",\"calculateFees\":\"Подсчитать комиссию\",\"startChatWith\":\"Начать чат с\",\"searchResult\":\"Результат поиска\",\"joinedInTheChat\":\"вошел в чат\",\"invited\":\"приглашен \",\"hasInvited\":\"приглашен \",\"inTheChat\":\" в чат\",\"banned\":\"забанен\",\"andRoom\":\"и комната\",\"inRoom\":\"в комнате\",\"left\":\"покинул\",\"theChat\":\" чат \",\"made\":\"сделал \",\"aModerator\":\" модератором\",\"editedChatNameTo \":\"изменил имя чата на \",\"somebody\":\"Кто-то\",\"sent\":\"отправлено\",\"PKOINto\":\" PKOIN для \",\"response\":\"Ответ\",\"edited\":\"Отредактировано\",\"settings\":\"Настройки\",\"unauthorized\":\"Неавторизован\",\"search\":\"Поиск\",\"replyOnMessage\":\"Ответить на сообщение\",\"editMessage\":\"Редактировать сообщение\",\"inviteFriend\":\"Пригласить друзей\",\"emptyContactList\":\"Ваша книга контактов пуста\",\"joinApp\":\"Присоединяйтесь ко мне в защищенном чате.\",\"hasInvitedToJoin\":\"Это зашифрованный чат, который не привязывается к номеру телефона.\",\"messagefrom\":\"Пересланное сообщение от\",\"usernotgen\":\"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.\",\"younotgen\":\"Please wait a minute, Your encryption keys are being generated...\",\"messageRead\":\"Сообщение прочитано\",\"open\":\"Открыть\",\"You\":\"Вы\",\"chatsearchingempty\":\"Чатов по данному фильтру не найдено\",\"sendmessage\":\"Отправить сообщение\"},\"input\":{\"patientEmailPlaceholder\":\"Электронная почта\",\"refillNamePlaceholder\":\"Заполнить имя еще раз\"},\"message\":{},\"button\":{\"starChatButton\":\"Начать чат\",\"decline\":\"Отклонить\",\"join\":\"Присоединиться\",\"ok\":\"Ок\",\"copy\":\"Скопировать\",\"forward\":\"Переслать\",\"delete\":\"Удалить\",\"save\":\"Сохранить\",\"reply\":\"Ответить\",\"share\":\"Переслать\",\"download\":\"Загрузить\",\"downloaded\":\"Загружено\",\"goToPocketnetProfile\":\"Перейти в профиль\",\"sendFile\":\"Отправить файл\",\"takePhotoOrVideo\":\"Отправить фотографию\",\"sendCoins\":\"Отправить коины\",\"edit\":\"Редактировать\",\"select\":\"Выбрать\",\"block\":\"Заблокировать\",\"unblock\":\"Разблокировать\",\"blockUser\":\"Заблокировать пользователя\",\"Complain\":\"Пожаловаться\"},\"type\":{\"publicgroup\":\"Создать публичную группу\",\"privategroup\":\"Создать приватную группу\",\"one\":\"Чат один на один\"},\"typelabel\":{\"publicgroup\":\"Создание публичной группы\",\"privategroup\":\"Создание приватной группы\",\"one\":\"Создание чата один на один\"},\"yes\":\"Да\",\"cancel\":\"Отменить\",\"teamMessages\":{\"1-title\":\"Добро пожаловать в приватный чат Bastyon!\",\"1-list1\":\"Личный мессенджер, который НЕ связан с вашим номером телефона\",\"1-list2\":\"Конечное шифрование каждого разговора 1 на 1 по умолчанию\",\"1-list3\":\"Все изображения, отправленные или полученные через чат, хранятся в зашифрованном виде\",\"1-list4\":\"История сообщений сохраняется только в течение 7 дней\",\"2-title\":\"Огромное объявление! Приложение Pocketnet теперь называется Bastyon!\",\"2-message1\":\"Домен будет перенесен на Bastyon.com. Недавно мы выпустили следующие крупные обновления:\",\"2-list1\":\"Частный зашифрованный мессенджер, не связанный с вашим номером телефона\",\"2-list2\":\"Возможность пожертвовать PKOIN блогерам\",\"2-list3\":\"Видео и прямая трансляция\",\"2-message2\":\"Пригласите своих друзей сейчас и станьте частью большого будущего децентрализованного интернета!\",\"2-button\":\"Пригласите друзей\"},\"sendingerror\":\"Возникла ошибка при отправке сообщения\",\"details\":\"Подробнее\",\"settings_pin\":\"Закрепить окно чата\",\"checked\":\"Да\",\"unchecked\":\"Нет\",\"settings_read\":\"Отправлять отчёты о прочтении\",\"messagewasburn\":\"Данное сообщение осталось только лишь в памяти вашего устройства\",\"messagewillburn\":\"Сообщение скоро будет удалено\",\"micaccessbrowser\":\"Доступ к микрофону запрещен настройками браузера, пожалуйста проверьте настройки.\",\"micaccesscommonproblem\":\"Извините, по какой-то причине запись голосовых сообщений невозможна на устройстве.\",\"micaccesscordova\":\"Доступ к микрофону запрещен настройками устройства, пожалуйста разрешите доступ к микрофону в настройках устройства.\",\"micdevicenotfound\":\"Устройство для записи звука не найдено\"}"); +/***/ }), + +/***/ "7747": +/***/ (function(module, exports, __webpack_require__) { + +// Imports +var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb"); +exports = ___CSS_LOADER_API_IMPORT___(false); +// Module +exports.push([module.i, ".deletedMessage[data-v-72e46191]{font-size:.8em;text-align:center;opacity:.6}.event[data-v-72e46191]{opacity:0;transition:.3s}.event.readyToRender[data-v-72e46191]{opacity:1}.event .loading[data-v-72e46191]{width:100%;height:100%;text-align:center}.event .deletedMessage[data-v-72e46191],.event .loading[data-v-72e46191]{position:relative;left:0;top:0;padding:.5em}", ""]); +// Exports +module.exports = exports; + + /***/ }), /***/ "7769": @@ -56579,6 +56567,24 @@ exports.push([module.i, ".eventMember[data-v-54a240c2]{display:flex;align-items: module.exports = exports; +/***/ }), + +/***/ "8056": +/***/ (function(module, exports, __webpack_require__) { + +// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./time.vue?vue&type=template&id=9218004e&scoped=true&\"\nimport script from \"./time.vue?vue&type=script&lang=js&\"\nexport * from \"./time.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./time.vue?vue&type=style&index=0&id=9218004e&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"9218004e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapState} from 'vuex';\r\nimport chatName from '@/components/chats/assets/name.vue'\r\nimport chatTime from '@/components/chats/assets/time.vue'\r\nimport chatIcon from '@/components/chats/assets/icon.vue'\r\n\r\n\r\nexport default {\r\n name: 'preview',\r\n props: {\r\n chat: Object,\r\n dummy: Boolean,\r\n },\r\n\r\n components: {\r\n chatName,\r\n chatTime,\r\n chatIcon,\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n roomMuted: false,\r\n ready: false,\r\n lastEvent: {},\r\n userStatusRoom: String,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n m_chat: {\r\n immediate: true,\r\n handler: function () {\r\n\r\n this.ready = false\r\n\r\n if (this.m_chat && !_.isEmpty(this.m_chat)) {\r\n\r\n this.core.mtrx.kit.prepareChat(this.m_chat).then(r => {\r\n this.ready = true\r\n })\r\n }\r\n \r\n }\r\n }\r\n\r\n },\r\n\r\n\r\n mounted : function(){\r\n\r\n \r\n },\r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n blockedCheck: function () {\r\n var users = this.core.mtrx.anotherChatUsers(this.m_chat.roomId)\r\n\r\n if (users.length == 1) {\r\n return this.core.mtrx.blockeduser(users[0].userId)\r\n }\r\n\r\n },\r\n m_chat: function () {\r\n\r\n if (!this.core.mtrx.client || !this.chat) return null\r\n\r\n let pushRules = this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId)\r\n\r\n if (pushRules !== null) {\r\n this.roomMuted = true\r\n }\r\n\r\n if (this.chat.roomId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(this.chat.roomId)\r\n\r\n return m_chat || null\r\n }\r\n\r\n },\r\n chatevents: function () {\r\n return (this.events[this.chat.roomId] || {}).timeline || []\r\n },\r\n\r\n key: function () {\r\n if (this.event) return this.event.event_id\r\n\r\n return 'key'\r\n },\r\n\r\n unknowngroupusers : function(){\r\n return this.core.mtrx.kit.unknowngroupusers(this.chat)\r\n },\r\n\r\n matrixevent : function(){\r\n var e = this.event\r\n\r\n if (e){\r\n return e.get()\r\n }\r\n },\r\n\r\n event: function () {\r\n\r\n if (this.chat && this.chat.roomId) {\r\n\r\n var members = this.m_chat.currentState.getMembers()\r\n\r\n var events = _.filter(this.chatevents, (e) => {\r\n \r\n if (members.length <= 2 &&\r\n (e.event.type === 'm.room.power_levels' || (\r\n e.event.type === 'm.room.member' && e.event.content.membership !== 'invite'\r\n ))\r\n\r\n ) {\r\n return false\r\n }\r\n if (e.event.type === 'm.room.redaction') {\r\n return false\r\n }\r\n\r\n return !(e.event.content['m.relates_to'] && e.event.content['m.relates_to'][\"rel_type\"] === 'm.replace');\r\n\r\n })\r\n\r\n events = _.sortBy(events, function (e) {\r\n return e.event.origin_server_ts\r\n })\r\n\r\n if (events.length) {\r\n return events[events.length - 1]\r\n }\r\n\r\n }\r\n\r\n },\r\n\r\n ...mapState([\r\n 'minimized',\r\n 'active',\r\n 'events'\r\n ]),\r\n }),\r\n\r\n methods: {},\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=33d22462&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"33d22462\",\n null\n ,true\n)\n\nexport default component.exports","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"topheader\"},on:{\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"topheader \"},[_c('div',{staticClass:\"work\"},[_c('div',{staticClass:\"headerLine\"},[_c('div',{staticClass:\"leftIcon icon\",on:{\"mouseenter\":_vm.mouseenter}},[_vm._t(\"left\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"leftaddIcon iconsmall\"},[_vm._t(\"leftadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"infoPart\",on:{\"mouseenter\":_vm.mouseenter}},[_c('div',[_vm._t(\"info\",function(){return [_vm._v(\"   \")]})],2)]),_c('div',{staticClass:\"rightaddIcons iconsmall\"},[_vm._t(\"rightadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"rightIcons icon\"},[_vm._t(\"right\",function(){return [_vm._v(\"   \")]})],2)]),_vm._t(\"additional\")],2)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'topheader',\r\n props: { },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : function() {\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n mouseenter : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'header'})\r\n },\r\n\r\n mouseleave : function(){\r\n if (this.$store.state.autohide)\r\n this.$store.commit('active', false)\r\n\r\n this.$store.commit('blockactive', {value : false, item : 'header'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=52afd868&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=52afd868&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"52afd868\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {};\r\nexports.default = void 0;\r\n\r\nvar matrixcs = _interopRequireWildcard(require(\"./matrix\"));\r\n\r\nObject.keys(matrixcs).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === matrixcs[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return matrixcs[key];\r\n }\r\n });\r\n});\r\n\r\nvar _browserRequest = _interopRequireDefault(require(\"browser-request\"));\r\n\r\nvar _qs = _interopRequireDefault(require(\"qs\"));\r\n\r\n/*\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nmatrixcs.request(function (opts, fn) {\r\n // We manually fix the query string for browser-request because\r\n // it doesn't correctly handle cases like ?via=one&via=two. Instead\r\n // we mimic `request`'s query string interface to make it all work\r\n // as expected.\r\n // browser-request will happily take the constructed string as the\r\n // query string without trying to modify it further.\r\n opts.qs = _qs.default.stringify(opts.qs || {}, opts.qsStringifyOptions);\r\n return (0, _browserRequest.default)(opts, fn);\r\n}); // just *accessing* indexedDB throws an exception in firefox with\r\n// indexeddb disabled.\r\n\r\nlet indexedDB;\r\n\r\ntry {\r\n indexedDB = global.indexedDB;\r\n} catch (e) {} // if our browser (appears to) support indexeddb, use an indexeddb crypto store.\r\n\r\n\r\nif (indexedDB) {\r\n matrixcs.setCryptoStoreFactory(function () {\r\n return new matrixcs.IndexedDBCryptoStore(indexedDB, \"matrix-js-sdk:crypto\");\r\n });\r\n} // We export 3 things to make browserify happy as well as downstream projects.\r\n// It's awkward, but required.\r\n\r\n\r\nvar _default = matrixcs; // keep export for browserify package deps\r\n\r\nexports.default = _default;\r\nglobal.matrixcs = matrixcs;","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=332740e2&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=332740e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"332740e2\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.getDesktopCapturerSources = getDesktopCapturerSources;\r\nexports.setAudioOutput = setAudioOutput;\r\nexports.setAudioInput = setAudioInput;\r\nexports.setVideoInput = setVideoInput;\r\nexports.createNewMatrixCall = createNewMatrixCall;\r\nexports.MatrixCall = exports.CallError = exports.CallErrorCode = exports.CallEvent = exports.CallParty = exports.CallDirection = exports.CallType = exports.CallState = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _event = require(\"../@types/event\");\r\n\r\nvar _randomstring = require(\"../randomstring\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link createNewMatrixCall} for the public API.\r\n * @module webrtc/call\r\n */\r\nlet CallState;\r\nexports.CallState = CallState;\r\n\r\n(function (CallState) {\r\n CallState[\"Fledgling\"] = \"fledgling\";\r\n CallState[\"InviteSent\"] = \"invite_sent\";\r\n CallState[\"WaitLocalMedia\"] = \"wait_local_media\";\r\n CallState[\"CreateOffer\"] = \"create_offer\";\r\n CallState[\"CreateAnswer\"] = \"create_answer\";\r\n CallState[\"Connecting\"] = \"connecting\";\r\n CallState[\"Connected\"] = \"connected\";\r\n CallState[\"Ringing\"] = \"ringing\";\r\n CallState[\"Ended\"] = \"ended\";\r\n})(CallState || (exports.CallState = CallState = {}));\r\n\r\nlet CallType;\r\nexports.CallType = CallType;\r\n\r\n(function (CallType) {\r\n CallType[\"Voice\"] = \"voice\";\r\n CallType[\"Video\"] = \"video\";\r\n})(CallType || (exports.CallType = CallType = {}));\r\n\r\nlet CallDirection;\r\nexports.CallDirection = CallDirection;\r\n\r\n(function (CallDirection) {\r\n CallDirection[\"Inbound\"] = \"inbound\";\r\n CallDirection[\"Outbound\"] = \"outbound\";\r\n})(CallDirection || (exports.CallDirection = CallDirection = {}));\r\n\r\nlet CallParty;\r\nexports.CallParty = CallParty;\r\n\r\n(function (CallParty) {\r\n CallParty[\"Local\"] = \"local\";\r\n CallParty[\"Remote\"] = \"remote\";\r\n})(CallParty || (exports.CallParty = CallParty = {}));\r\n\r\nlet CallEvent;\r\nexports.CallEvent = CallEvent;\r\n\r\n(function (CallEvent) {\r\n CallEvent[\"Hangup\"] = \"hangup\";\r\n CallEvent[\"State\"] = \"state\";\r\n CallEvent[\"Error\"] = \"error\";\r\n CallEvent[\"Replaced\"] = \"replaced\";\r\n CallEvent[\"LocalHoldUnhold\"] = \"local_hold_unhold\";\r\n CallEvent[\"RemoteHoldUnhold\"] = \"remote_hold_unhold\";\r\n CallEvent[\"HoldUnhold\"] = \"hold_unhold\";\r\n})(CallEvent || (exports.CallEvent = CallEvent = {}));\r\n\r\nlet CallErrorCode;\r\nexports.CallErrorCode = CallErrorCode;\r\n\r\n(function (CallErrorCode) {\r\n CallErrorCode[\"UserHangup\"] = \"user_hangup\";\r\n CallErrorCode[\"LocalOfferFailed\"] = \"local_offer_failed\";\r\n CallErrorCode[\"NoUserMedia\"] = \"no_user_media\";\r\n CallErrorCode[\"UnknownDevices\"] = \"unknown_devices\";\r\n CallErrorCode[\"SendInvite\"] = \"send_invite\";\r\n CallErrorCode[\"CreateAnswer\"] = \"create_answer\";\r\n CallErrorCode[\"SendAnswer\"] = \"send_answer\";\r\n CallErrorCode[\"SetRemoteDescription\"] = \"set_remote_description\";\r\n CallErrorCode[\"SetLocalDescription\"] = \"set_local_description\";\r\n CallErrorCode[\"AnsweredElsewhere\"] = \"answered_elsewhere\";\r\n CallErrorCode[\"IceFailed\"] = \"ice_failed\";\r\n CallErrorCode[\"InviteTimeout\"] = \"invite_timeout\";\r\n CallErrorCode[\"Replaced\"] = \"replaced\";\r\n CallErrorCode[\"SignallingFailed\"] = \"signalling_timeout\";\r\n})(CallErrorCode || (exports.CallErrorCode = CallErrorCode = {}));\r\n\r\nvar ConstraintsType;\r\n/**\r\n * The version field that we set in m.call.* events\r\n */\r\n\r\n(function (ConstraintsType) {\r\n ConstraintsType[\"Audio\"] = \"audio\";\r\n ConstraintsType[\"Video\"] = \"video\";\r\n})(ConstraintsType || (ConstraintsType = {}));\r\n\r\nconst VOIP_PROTO_VERSION = 1;\r\n/** The fallback ICE server to use for STUN or TURN protocols. */\r\n\r\nconst FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';\r\n/** The length of time a call can be ringing for. */\r\n\r\nconst CALL_TIMEOUT_MS = 60000;\r\n/** Retrieves sources from desktopCapturer */\r\n\r\nfunction getDesktopCapturerSources() {\r\n const options = {\r\n thumbnailSize: {\r\n height: 176,\r\n width: 312\r\n },\r\n types: [\"screen\", \"window\"]\r\n };\r\n return window.electron.getDesktopCapturerSources(options);\r\n}\r\n\r\nclass CallError extends Error {\r\n constructor(code, msg, err) {\r\n // Stil ldon't think there's any way to have proper nested errors\r\n super(msg + \": \" + err);\r\n (0, _defineProperty2.default)(this, \"code\", void 0);\r\n this.code = code;\r\n }\r\n\r\n}\r\n\r\nexports.CallError = CallError;\r\n\r\nfunction genCallID() {\r\n return Date.now().toString() + (0, _randomstring.randomString)(16);\r\n}\r\n/**\r\n * Construct a new Matrix Call.\r\n * @constructor\r\n * @param {Object} opts Config options.\r\n * @param {string} opts.roomId The room ID for this call.\r\n * @param {Object} opts.webRtc The WebRTC globals from the browser.\r\n * @param {boolean} opts.forceTURN whether relay through TURN should be forced.\r\n * @param {Object} opts.URL The URL global.\r\n * @param {Array} opts.turnServers Optional. A list of TURN servers.\r\n * @param {MatrixClient} opts.client The Matrix Client instance to send events to.\r\n */\r\n\r\n\r\nclass MatrixCall extends _events.EventEmitter {\r\n // Fix when client is TSified\r\n // XXX: I don't know why this is called 'config'.\r\n // The party ID of the other side: undefined if we haven't chosen a partner\r\n // yet, null if we have but they didn't send a party ID.\r\n // in the browser it's 'number'\r\n // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold\r\n // This flag represents whether we want the other party to be on hold\r\n // and this one we set when we're transitioning out of the hold state because we\r\n // can't tell the difference between that and the other party holding us\r\n // the stats for the call at the point it ended. We can't get these after we\r\n // tear the call down, so we just grab a snapshot before we stop the call.\r\n // The typescript definitions have this type as 'any' :(\r\n // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example\r\n // If candidates arrive before we've picked an opponent (which, in particular,\r\n // will happen if the opponent sends candidates eagerly before the user answers\r\n // the call) we buffer them up here so we can then add the ones from the party we pick\r\n constructor(opts) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"roomId\", void 0);\r\n (0, _defineProperty2.default)(this, \"type\", void 0);\r\n (0, _defineProperty2.default)(this, \"callId\", void 0);\r\n (0, _defineProperty2.default)(this, \"state\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupParty\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupReason\", void 0);\r\n (0, _defineProperty2.default)(this, \"direction\", void 0);\r\n (0, _defineProperty2.default)(this, \"ourPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"client\", void 0);\r\n (0, _defineProperty2.default)(this, \"forceTURN\", void 0);\r\n (0, _defineProperty2.default)(this, \"turnServers\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendQueue\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendTries\", void 0);\r\n (0, _defineProperty2.default)(this, \"sentEndOfCandidates\", void 0);\r\n (0, _defineProperty2.default)(this, \"peerConn\", void 0);\r\n (0, _defineProperty2.default)(this, \"localVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteAudioElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"screenSharingStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"localAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteOrAnswerSent\", void 0);\r\n (0, _defineProperty2.default)(this, \"waitForLocalAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"config\", void 0);\r\n (0, _defineProperty2.default)(this, \"successor\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentMember\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentVersion\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentCaps\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteTimeout\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteOnHold\", void 0);\r\n (0, _defineProperty2.default)(this, \"unholdingRemote\", void 0);\r\n (0, _defineProperty2.default)(this, \"micMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"vidMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"callStatsAtEnd\", void 0);\r\n (0, _defineProperty2.default)(this, \"makingOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"ignoreOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteCandidateBuffer\", new Map());\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForInvite\", async stream => {\r\n if (this.successor) {\r\n this.successor.gotUserMediaForAnswer(stream);\r\n return;\r\n }\r\n\r\n if (this.callHasEnded()) {\r\n this.stopAllMedia();\r\n return;\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n this.setState(CallState.CreateOffer);\r\n\r\n _logger.logger.debug(\"gotUserMediaForInvite -> \" + this.type);\r\n\r\n const videoEl = this.getLocalVideoElement();\r\n\r\n if (videoEl && this.type === CallType.Video) {\r\n videoEl.autoplay = true;\r\n\r\n if (this.screenSharingStream) {\r\n _logger.logger.debug(\"Setting screen sharing stream to the local video element\");\r\n\r\n videoEl.srcObject = this.screenSharingStream;\r\n } else {\r\n videoEl.srcObject = stream;\r\n }\r\n\r\n videoEl.muted = true;\r\n\r\n try {\r\n await videoEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n } // why do we enable audio (and only audio) tracks here? -- matthew\r\n\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const audioTrack of stream.getAudioTracks()) {\r\n _logger.logger.info(\"Adding audio track with id \" + audioTrack.id);\r\n\r\n this.peerConn.addTrack(audioTrack, stream);\r\n }\r\n\r\n for (const videoTrack of (this.screenSharingStream || stream).getVideoTracks()) {\r\n _logger.logger.info(\"Adding video track with id \" + videoTrack.id);\r\n\r\n this.peerConn.addTrack(videoTrack, stream);\r\n } // Now we wait for the negotiationneeded event\r\n\r\n });\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForAnswer\", async stream => {\r\n if (this.callHasEnded()) {\r\n return;\r\n }\r\n\r\n const localVidEl = this.getLocalVideoElement();\r\n\r\n if (localVidEl && this.type === CallType.Video) {\r\n localVidEl.autoplay = true;\r\n localVidEl.srcObject = stream;\r\n localVidEl.muted = true;\r\n\r\n try {\r\n await localVidEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const track of stream.getTracks()) {\r\n this.peerConn.addTrack(track, stream);\r\n }\r\n\r\n this.setState(CallState.CreateAnswer);\r\n let myAnswer;\r\n\r\n try {\r\n myAnswer = await this.peerConn.createAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Failed to create answer: \", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.CreateAnswer, true);\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(myAnswer);\r\n this.setState(CallState.Connecting); // Allow a short time for initial candidates to be gathered\r\n\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n this.sendAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalIceCandidate\", event => {\r\n if (event.candidate) {\r\n _logger.logger.debug(\"Call \" + this.callId + \" got local ICE \" + event.candidate.sdpMid + \" candidate: \" + event.candidate.candidate);\r\n\r\n if (this.callHasEnded()) return; // As with the offer, note we need to make a copy of this object, not\r\n // pass the original: that broke in Chrome ~m43.\r\n\r\n if (event.candidate.candidate !== '' || !this.sentEndOfCandidates) {\r\n this.queueCandidate(event.candidate);\r\n if (event.candidate.candidate === '') this.sentEndOfCandidates = true;\r\n }\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceGatheringStateChange\", event => {\r\n _logger.logger.debug(\"ice gathering state changed to \" + this.peerConn.iceGatheringState);\r\n\r\n if (this.peerConn.iceGatheringState === 'complete' && !this.sentEndOfCandidates) {\r\n // If we didn't get an empty-string candidate to signal the end of candidates,\r\n // create one ourselves now gathering has finished.\r\n // We cast because the interface lists all the properties as required but we\r\n // only want to send 'candidate'\r\n // XXX: We probably want to send either sdpMid or sdpMLineIndex, as it's not strictly\r\n // correct to have a candidate that lacks both of these. We'd have to figure out what\r\n // previous candidates had been sent with and copy them.\r\n const c = {\r\n candidate: ''\r\n };\r\n this.queueCandidate(c);\r\n this.sentEndOfCandidates = true;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalOffer\", async description => {\r\n _logger.logger.debug(\"Created offer: \", description);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(\"Ignoring newly created offer on call ID \" + this.callId + \" because the call has ended\");\r\n\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(description);\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n\r\n if (this.peerConn.iceGatheringState === 'gathering') {\r\n // Allow a short time for initial candidates to be gathered\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n }\r\n\r\n if (this.callHasEnded()) return;\r\n const eventType = this.state === CallState.CreateOffer ? _event.EventType.CallInvite : _event.EventType.CallNegotiate;\r\n const content = {\r\n lifetime: CALL_TIMEOUT_MS\r\n }; // clunky because TypeScript can't folow the types through if we use an expression as the key\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n content.offer = this.peerConn.localDescription;\r\n } else {\r\n content.description = this.peerConn.localDescription;\r\n }\r\n\r\n if (this.client._supportsCallTransfer) {\r\n content.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // Get rid of any candidates waiting to be sent: they'll be included in the local\r\n // description we just got and will send in the offer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(eventType, content);\r\n } catch (error) {\r\n _logger.logger.error(\"Failed to send invite\", error);\r\n\r\n if (error.event) this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SignallingFailed;\r\n let message = \"Signalling failed\";\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n code = CallErrorCode.SendInvite;\r\n message = \"Failed to send invite\";\r\n }\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.terminate(CallParty.Local, code, false); // no need to carry on & send the candidate queue, but we also\r\n // don't want to rethrow the error\r\n\r\n return;\r\n }\r\n\r\n this.sendCandidateQueue();\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n this.inviteOrAnswerSent = true;\r\n this.setState(CallState.InviteSent);\r\n this.inviteTimeout = setTimeout(() => {\r\n this.inviteTimeout = null;\r\n\r\n if (this.state === CallState.InviteSent) {\r\n this.hangup(CallErrorCode.InviteTimeout, false);\r\n }\r\n }, CALL_TIMEOUT_MS);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"getLocalOfferFailed\", err => {\r\n _logger.logger.error(\"Failed to get local offer\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.LocalOfferFailed, \"Failed to get local offer!\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.LocalOfferFailed, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"getUserMediaFailed\", err => {\r\n if (this.successor) {\r\n this.successor.getUserMediaFailed(err);\r\n return;\r\n }\r\n\r\n _logger.logger.warn(\"Failed to get user media - ending call\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Couldn't start capturing media! Is your microphone set up and \" + \"does this app have permission?\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceConnectionStateChanged\", () => {\r\n if (this.callHasEnded()) {\r\n return; // because ICE can still complete as we're ending the call\r\n }\r\n\r\n _logger.logger.debug(\"Call ID \" + this.callId + \": ICE connection state changed to: \" + this.peerConn.iceConnectionState); // ideally we'd consider the call to be connected when we get media but\r\n // chrome doesn't implement any of the 'onstarted' events yet\r\n\r\n\r\n if (this.peerConn.iceConnectionState == 'connected') {\r\n this.setState(CallState.Connected);\r\n } else if (this.peerConn.iceConnectionState == 'failed') {\r\n this.hangup(CallErrorCode.IceFailed, false);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onSignallingStateChanged\", () => {\r\n _logger.logger.debug(\"call \" + this.callId + \": Signalling state changed to: \" + this.peerConn.signalingState);\r\n });\r\n (0, _defineProperty2.default)(this, \"onTrack\", ev => {\r\n if (ev.streams.length === 0) {\r\n _logger.logger.warn(`Streamless ${ev.track.kind} found: ignoring.`);\r\n\r\n return;\r\n } // If we already have a stream, check this track is from the same one\r\n\r\n\r\n if (this.remoteStream && ev.streams[0].id !== this.remoteStream.id) {\r\n _logger.logger.warn(`Ignoring new stream ID ${ev.streams[0].id}: we already have stream ID ${this.remoteStream.id}`);\r\n\r\n return;\r\n }\r\n\r\n if (!this.remoteStream) {\r\n _logger.logger.info(\"Got remote stream with id \" + ev.streams[0].id);\r\n } // Note that we check by ID above and always set the remote stream: Chrome appears\r\n // to make new stream objects when tranciever directionality is changed and the 'active'\r\n // status of streams change\r\n\r\n\r\n this.remoteStream = ev.streams[0];\r\n\r\n _logger.logger.debug(`Track id ${ev.track.id} of kind ${ev.track.kind} added`);\r\n\r\n if (ev.track.kind === 'video') {\r\n if (this.remoteVideoElement) {\r\n this.playRemoteVideo();\r\n }\r\n } else {\r\n if (this.remoteAudioElement) this.playRemoteAudio();\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onNegotiationNeeded\", async () => {\r\n _logger.logger.info(\"Negotation is needed!\");\r\n\r\n if (this.state !== CallState.CreateOffer && this.opponentVersion === 0) {\r\n _logger.logger.info(\"Opponent does not support renegotiation: ignoring negotiationneeded event\");\r\n\r\n return;\r\n }\r\n\r\n this.makingOffer = true;\r\n\r\n try {\r\n const myOffer = await this.peerConn.createOffer();\r\n await this.gotLocalOffer(myOffer);\r\n } catch (e) {\r\n this.getLocalOfferFailed(e);\r\n return;\r\n } finally {\r\n this.makingOffer = false;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onHangupReceived\", msg => {\r\n _logger.logger.debug(\"Hangup received for call ID \" + this.callId); // party ID must match (our chosen partner hanging up the call) or be undefined (we haven't chosen\r\n // a partner yet but we're treating the hangup as a reject as per VoIP v0)\r\n\r\n\r\n if (this.partyIdMatches(msg) || this.state === CallState.Ringing) {\r\n // default reason is user_hangup\r\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.info(`Ignoring message from party ID ${msg.party_id}: our partner is ${this.opponentPartyId}`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onRejectReceived\", msg => {\r\n _logger.logger.debug(\"Reject received for call ID \" + this.callId); // No need to check party_id for reject because if we'd received either\r\n // an answer or reject, we wouldn't be in state InviteSent\r\n\r\n\r\n const shouldTerminate = // reject events also end the call if it's ringing: it's another of\r\n // our devices rejecting the call.\r\n [CallState.InviteSent, CallState.Ringing].includes(this.state) || // also if we're in the init state and it's an inbound call, since\r\n // this means we just haven't entered the ringing state yet\r\n this.state === CallState.Fledgling && this.direction === CallDirection.Inbound;\r\n\r\n if (shouldTerminate) {\r\n this.terminate(CallParty.Remote, CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.debug(`Call is in state: ${this.state}: ignoring reject`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onAnsweredElsewhere\", msg => {\r\n _logger.logger.debug(\"Call ID \" + this.callId + \" answered elsewhere\");\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n });\r\n this.roomId = opts.roomId;\r\n this.client = opts.client;\r\n this.type = null;\r\n this.forceTURN = opts.forceTURN;\r\n this.ourPartyId = this.client.deviceId; // Array of Objects with urls, username, credential keys\r\n\r\n this.turnServers = opts.turnServers || [];\r\n\r\n if (this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed()) {\r\n this.turnServers.push({\r\n urls: [FALLBACK_ICE_SERVER]\r\n });\r\n }\r\n\r\n for (const server of this.turnServers) {\r\n utils.checkObjectHasKeys(server, [\"urls\"]);\r\n }\r\n\r\n this.callId = genCallID();\r\n this.state = CallState.Fledgling; // A queue for candidates waiting to go out.\r\n // We try to amalgamate candidates into a single candidate message where\r\n // possible\r\n\r\n this.candidateSendQueue = [];\r\n this.candidateSendTries = 0;\r\n this.sentEndOfCandidates = false;\r\n this.inviteOrAnswerSent = false;\r\n this.makingOffer = false;\r\n this.remoteOnHold = false;\r\n this.unholdingRemote = false;\r\n this.micMuted = false;\r\n this.vidMuted = false;\r\n }\r\n /**\r\n * Place a voice call to this room.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVoiceCall() {\r\n _logger.logger.debug(\"placeVoiceCall\");\r\n\r\n this.checkForErrorListener();\r\n const constraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.type = CallType.Voice;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a video call to this room.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVideoCall(remoteVideoElement, localVideoElement) {\r\n _logger.logger.debug(\"placeVideoCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n const constraints = getUserMediaContraints(ConstraintsType.Video);\r\n this.type = CallType.Video;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a screen-sharing call to this room. This includes audio.\r\n * This method is EXPERIMENTAL and subject to change without warning. It\r\n * only works in Google Chrome and Firefox >= 44.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeScreenSharingCall(remoteVideoElement, localVideoElement, selectDesktopCapturerSource) {\r\n _logger.logger.debug(\"placeScreenSharingCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n\r\n try {\r\n var _window$electron;\r\n\r\n const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);\r\n\r\n if (!screenshareConstraints) {\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n return;\r\n }\r\n\r\n if ((_window$electron = window.electron) !== null && _window$electron !== void 0 && _window$electron.getDesktopCapturerSources) {\r\n // We are using Electron\r\n _logger.logger.debug(\"Getting screen stream using getUserMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getUserMedia(screenshareConstraints);\r\n } else {\r\n // We are not using Electron\r\n _logger.logger.debug(\"Getting screen stream using getDisplayMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getDisplayMedia(screenshareConstraints);\r\n }\r\n\r\n _logger.logger.debug(\"Got screen stream, requesting audio stream...\");\r\n\r\n const audioConstraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.placeCallWithConstraints(audioConstraints);\r\n } catch (err) {\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n }\r\n\r\n this.type = CallType.Video;\r\n }\r\n\r\n getOpponentMember() {\r\n return this.opponentMember;\r\n }\r\n\r\n opponentCanBeTransferred() {\r\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.transferee\"]);\r\n }\r\n /**\r\n * Retrieve the local <video> DOM element.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getLocalVideoElement() {\r\n return this.localVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <video> DOM element\r\n * used for playing back video capable streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteVideoElement() {\r\n return this.remoteVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <audio> DOM element\r\n * used for playing back audio only streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteAudioElement() {\r\n return this.remoteAudioElement;\r\n }\r\n /**\r\n * Set the local <video> DOM element. If this call is active,\r\n * video will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setLocalVideoElement(element) {\r\n this.localVideoElement = element;\r\n\r\n if (element && this.localAVStream && this.type === CallType.Video) {\r\n element.autoplay = true;\r\n element.srcObject = this.localAVStream;\r\n element.muted = true;\r\n\r\n try {\r\n await element.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n }\r\n /**\r\n * Set the remote <video> DOM element. If this call is active,\r\n * the first received video-capable stream will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n setRemoteVideoElement(element) {\r\n if (element === this.remoteVideoElement) return;\r\n element.autoplay = true; // if we already have an audio element set, use that instead and mute the audio\r\n // on this video element.\r\n\r\n if (this.remoteAudioElement) element.muted = true;\r\n this.remoteVideoElement = element;\r\n\r\n if (this.remoteStream) {\r\n this.playRemoteVideo();\r\n }\r\n }\r\n /**\r\n * Set the remote <audio> DOM element. If this call is active,\r\n * the first received audio-only stream will be rendered to it immediately.\r\n * The audio will *not* be rendered from the remoteVideoElement.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setRemoteAudioElement(element) {\r\n if (element === this.remoteAudioElement) return;\r\n this.remoteAudioElement = element;\r\n if (this.remoteStream) this.playRemoteAudio();\r\n } // The typescript definitions have this type as 'any' :(\r\n\r\n\r\n async getCurrentCallStats() {\r\n if (this.callHasEnded()) {\r\n return this.callStatsAtEnd;\r\n }\r\n\r\n return this.collectCallStats();\r\n }\r\n\r\n async collectCallStats() {\r\n // This happens when the call fails before it starts.\r\n // For example when we fail to get capture sources\r\n if (!this.peerConn) return;\r\n const statsReport = await this.peerConn.getStats();\r\n const stats = [];\r\n\r\n for (const item of statsReport) {\r\n stats.push(item[1]);\r\n }\r\n\r\n return stats;\r\n }\r\n /**\r\n * Configure this call from an invite event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.invite event\r\n */\r\n\r\n\r\n async initWithInvite(event) {\r\n const invite = event.getContent();\r\n this.direction = CallDirection.Inbound; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n }\r\n\r\n this.peerConn = this.createPeerConnection(); // we must set the party ID before await-ing on anything: the call event\r\n // handler will start giving us more call events (eg. candidates) so if\r\n // we haven't set the party ID, we'll ignore them.\r\n\r\n this.chooseOpponent(event);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(invite.offer);\r\n await this.addBufferedIceCandidates();\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // According to previous comments in this file, firefox at some point did not\r\n // add streams until media started ariving on them. Testing latest firefox\r\n // (81 at time of writing), this is no longer a problem, so let's do it the correct way.\r\n\r\n\r\n if (!this.remoteStream || this.remoteStream.getTracks().length === 0) {\r\n _logger.logger.error(\"No remote stream or no tracks after setting remote description!\");\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n }\r\n\r\n this.type = this.remoteStream.getTracks().some(t => t.kind === 'video') ? CallType.Video : CallType.Voice;\r\n this.setState(CallState.Ringing);\r\n\r\n if (event.getLocalAge()) {\r\n setTimeout(() => {\r\n if (this.state == CallState.Ringing) {\r\n _logger.logger.debug(\"Call invite has expired. Hanging up.\");\r\n\r\n this.hangupParty = CallParty.Remote; // effectively\r\n\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn.signalingState != 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n this.emit(CallEvent.Hangup);\r\n }\r\n }, invite.lifetime - event.getLocalAge());\r\n }\r\n }\r\n /**\r\n * Configure this call from a hangup or reject event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.hangup event\r\n */\r\n\r\n\r\n initWithHangup(event) {\r\n // perverse as it may seem, sometimes we want to instantiate a call with a\r\n // hangup message (because when getting the state of the room on load, events\r\n // come in reverse order and we want to remember that a call has been hung up)\r\n this.setState(CallState.Ended);\r\n }\r\n /**\r\n * Answer a call.\r\n */\r\n\r\n\r\n async answer() {\r\n if (this.inviteOrAnswerSent) {\r\n return;\r\n }\r\n\r\n _logger.logger.debug(`Answering call ${this.callId} of type ${this.type}`);\r\n\r\n if (!this.localAVStream && !this.waitForLocalAVStream) {\r\n const constraints = getUserMediaContraints(this.type == CallType.Video ? ConstraintsType.Video : ConstraintsType.Audio);\r\n\r\n _logger.logger.log(\"Getting user media with constraints\", constraints);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.waitForLocalAVStream = true;\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.waitForLocalAVStream = false;\r\n this.gotUserMediaForAnswer(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n } else if (this.localAVStream) {\r\n this.gotUserMediaForAnswer(this.localAVStream);\r\n } else if (this.waitForLocalAVStream) {\r\n this.setState(CallState.WaitLocalMedia);\r\n }\r\n }\r\n /**\r\n * Replace this call with a new call, e.g. for glare resolution. Used by\r\n * MatrixClient.\r\n * @param {MatrixCall} newCall The new call.\r\n */\r\n\r\n\r\n replacedBy(newCall) {\r\n _logger.logger.debug(this.callId + \" being replaced by \" + newCall.callId);\r\n\r\n if (this.state === CallState.WaitLocalMedia) {\r\n _logger.logger.debug(\"Telling new call to wait for local media\");\r\n\r\n newCall.waitForLocalAVStream = true;\r\n } else if (this.state === CallState.CreateOffer) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n } else if (this.state === CallState.InviteSent) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n }\r\n\r\n newCall.localVideoElement = this.localVideoElement;\r\n newCall.remoteVideoElement = this.remoteVideoElement;\r\n newCall.remoteAudioElement = this.remoteAudioElement;\r\n this.successor = newCall;\r\n this.emit(CallEvent.Replaced, newCall);\r\n this.hangup(CallErrorCode.Replaced, true);\r\n }\r\n /**\r\n * Hangup a call.\r\n * @param {string} reason The reason why the call is being hung up.\r\n * @param {boolean} suppressEvent True to suppress emitting an event.\r\n */\r\n\r\n\r\n hangup(reason, suppressEvent) {\r\n if (this.callHasEnded()) return;\r\n\r\n _logger.logger.debug(\"Ending call \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, reason, !suppressEvent); // We don't want to send hangup here if we didn't even get to sending an invite\r\n\r\n if (this.state === CallState.WaitLocalMedia) return;\r\n const content = {}; // Continue to send no reason for user hangups temporarily, until\r\n // clients understand the user_hangup reason (voip v1)\r\n\r\n if (reason !== CallErrorCode.UserHangup) content['reason'] = reason;\r\n this.sendVoipEvent(_event.EventType.CallHangup, {});\r\n }\r\n /**\r\n * Reject a call\r\n * This used to be done by calling hangup, but is a separate method and protocol\r\n * event as of MSC2746.\r\n */\r\n\r\n\r\n reject() {\r\n if (this.state !== CallState.Ringing) {\r\n throw Error(\"Call must be in 'ringing' state to reject!\");\r\n }\r\n\r\n if (this.opponentVersion < 1) {\r\n _logger.logger.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`);\r\n\r\n this.hangup(CallErrorCode.UserHangup, true);\r\n return;\r\n }\r\n\r\n _logger.logger.debug(\"Rejecting call: \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.UserHangup, true);\r\n this.sendVoipEvent(_event.EventType.CallReject, {});\r\n }\r\n /**\r\n * Set whether our outbound video should be muted or not.\r\n * @param {boolean} muted True to mute the outbound video.\r\n */\r\n\r\n\r\n setLocalVideoMuted(muted) {\r\n this.vidMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if local video is muted.\r\n *\r\n * If there are multiple video tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no video tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the local preview video is muted, else false\r\n * (including if the call is not set up yet).\r\n */\r\n\r\n\r\n isLocalVideoMuted() {\r\n return this.vidMuted;\r\n }\r\n /**\r\n * Set whether the microphone should be muted or not.\r\n * @param {boolean} muted True to mute the mic.\r\n */\r\n\r\n\r\n setMicrophoneMuted(muted) {\r\n this.micMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if the microphone is muted.\r\n *\r\n * If there are multiple audio tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no audio tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the mic is muted, else false (including if the call\r\n * is not set up yet).\r\n */\r\n\r\n\r\n isMicrophoneMuted() {\r\n return this.micMuted;\r\n }\r\n /**\r\n * @returns true if we have put the party on the other side of the call on hold\r\n * (that is, we are signalling to them that we are not listening)\r\n */\r\n\r\n\r\n isRemoteOnHold() {\r\n return this.remoteOnHold;\r\n }\r\n\r\n setRemoteOnHold(onHold) {\r\n if (this.isRemoteOnHold() === onHold) return;\r\n this.remoteOnHold = onHold;\r\n if (!onHold) this.unholdingRemote = true;\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n // We set 'inactive' rather than 'sendonly' because we're not planning on\r\n // playing music etc. to the other side.\r\n tranceiver.direction = onHold ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n this.updateMuteStatus();\r\n\r\n if (!onHold) {\r\n this.playRemoteAudio();\r\n }\r\n\r\n this.emit(CallEvent.RemoteHoldUnhold, this.remoteOnHold);\r\n }\r\n /**\r\n * Indicates whether we are 'on hold' to the remote party (ie. if true,\r\n * they cannot hear us). Note that this will return true when we put the\r\n * remote on hold too due to the way hold is implemented (since we don't\r\n * wish to play hold music when we put a call on hold, we use 'inactive'\r\n * rather than 'sendonly')\r\n * @returns true if the other party has put us on hold\r\n */\r\n\r\n\r\n isLocalOnHold() {\r\n if (this.state !== CallState.Connected) return false;\r\n if (this.unholdingRemote) return false;\r\n let callOnHold = true; // We consider a call to be on hold only if *all* the tracks are on hold\r\n // (is this the right thing to do?)\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n const trackOnHold = ['inactive', 'recvonly'].includes(tranceiver.currentDirection);\r\n if (!trackOnHold) callOnHold = false;\r\n }\r\n\r\n return callOnHold;\r\n }\r\n /**\r\n * Sends a DTMF digit to the other party\r\n * @param digit The digit (nb. string - '#' and '*' are dtmf too)\r\n */\r\n\r\n\r\n sendDtmfDigit(digit) {\r\n for (const sender of this.peerConn.getSenders()) {\r\n if (sender.track.kind === 'audio' && sender.dtmf) {\r\n sender.dtmf.insertDTMF(digit);\r\n return;\r\n }\r\n }\r\n\r\n throw new Error(\"Unable to find a track to send DTMF on\");\r\n }\r\n\r\n updateMuteStatus() {\r\n if (!this.localAVStream) {\r\n return;\r\n }\r\n\r\n const micShouldBeMuted = this.micMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getAudioTracks(), !micShouldBeMuted);\r\n const vidShouldBeMuted = this.vidMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getVideoTracks(), !vidShouldBeMuted);\r\n\r\n if (this.remoteOnHold) {\r\n if (this.remoteAudioElement && this.remoteAudioElement.srcObject === this.remoteStream) {\r\n this.remoteAudioElement.muted = true;\r\n } else if (this.remoteVideoElement && this.remoteVideoElement.srcObject === this.remoteStream) {\r\n this.remoteVideoElement.muted = true;\r\n }\r\n } else {\r\n this.playRemoteAudio();\r\n }\r\n }\r\n /**\r\n * Internal\r\n * @param {Object} stream\r\n */\r\n\r\n\r\n async sendAnswer() {\r\n const answerContent = {\r\n answer: {\r\n sdp: this.peerConn.localDescription.sdp,\r\n // type is now deprecated as of Matrix VoIP v1, but\r\n // required to still be sent for backwards compat\r\n type: this.peerConn.localDescription.type\r\n }\r\n };\r\n\r\n if (this.client._supportsCallTransfer) {\r\n answerContent.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // We have just taken the local description from the peerconnection which will\r\n // contain all the local candidates added so far, so we can discard any candidates\r\n // we had queued up because they'll be in the answer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallAnswer, answerContent); // If this isn't the first time we've tried to send the answer,\r\n // we may have candidates queued up, so send them now.\r\n\r\n this.inviteOrAnswerSent = true;\r\n } catch (error) {\r\n // We've failed to answer: back to the ringing state\r\n this.setState(CallState.Ringing);\r\n this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SendAnswer;\r\n let message = \"Failed to send answer\";\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n throw error;\r\n } // error handler re-throws so this won't happen on error, but\r\n // we don't want the same error handling on the candidate queue\r\n\r\n\r\n this.sendCandidateQueue();\r\n }\r\n\r\n async onRemoteIceCandidatesReceived(ev) {\r\n if (this.callHasEnded()) {\r\n //debuglog(\"Ignoring remote ICE candidate because call has ended\");\r\n return;\r\n }\r\n\r\n const cands = ev.getContent().candidates;\r\n\r\n if (!cands) {\r\n _logger.logger.info(\"Ignoring candidates event with no candidates!\");\r\n\r\n return;\r\n }\r\n\r\n const fromPartyId = ev.getContent().version === 0 ? null : ev.getContent().party_id || null;\r\n\r\n if (this.opponentPartyId === undefined) {\r\n // we haven't picked an opponent yet so save the candidates\r\n _logger.logger.info(`Bufferring ${cands.length} candidates until we pick an opponent`);\r\n\r\n const bufferedCands = this.remoteCandidateBuffer.get(fromPartyId) || [];\r\n bufferedCands.push(...cands);\r\n this.remoteCandidateBuffer.set(fromPartyId, bufferedCands);\r\n return;\r\n }\r\n\r\n if (!this.partyIdMatches(ev.getContent())) {\r\n _logger.logger.info(`Ignoring candidates from party ID ${ev.getContent().party_id}: ` + `we have chosen party ID ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n await this.addIceCandidates(cands);\r\n }\r\n /**\r\n * Used by MatrixClient.\r\n * @param {Object} msg\r\n */\r\n\r\n\r\n async onAnswerReceived(event) {\r\n _logger.logger.debug(`Got answer for call ID ${this.callId} from party ID ${event.getContent().party_id}`);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);\r\n\r\n return;\r\n }\r\n\r\n if (this.opponentPartyId !== undefined) {\r\n _logger.logger.info(`Ignoring answer from party ID ${event.getContent().party_id}: ` + `we already have an answer/reject from ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n this.chooseOpponent(event);\r\n await this.addBufferedIceCandidates();\r\n this.setState(CallState.Connecting);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(event.getContent().answer);\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // If the answer we selected has a party_id, send a select_answer event\r\n // We do this after setting the remote description since otherwise we'd block\r\n // call setup on it\r\n\r\n\r\n if (this.opponentPartyId !== null) {\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallSelectAnswer, {\r\n selected_party_id: this.opponentPartyId\r\n });\r\n } catch (err) {\r\n // This isn't fatal, and will just mean that if another party has raced to answer\r\n // the call, they won't know they got rejected, so we carry on & don't retry.\r\n _logger.logger.warn(\"Failed to send select_answer event\", err);\r\n }\r\n }\r\n }\r\n\r\n async onSelectAnswerReceived(event) {\r\n if (this.direction !== CallDirection.Inbound) {\r\n _logger.logger.warn(\"Got select_answer for an outbound call: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n const selectedPartyId = event.getContent().selected_party_id;\r\n\r\n if (selectedPartyId === undefined || selectedPartyId === null) {\r\n _logger.logger.warn(\"Got nonsensical select_answer with null/undefined selected_party_id: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n if (selectedPartyId !== this.ourPartyId) {\r\n _logger.logger.info(`Got select_answer for party ID ${selectedPartyId}: we are party ID ${this.ourPartyId}.`); // The other party has picked somebody else's answer\r\n\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n }\r\n }\r\n\r\n async onNegotiateReceived(event) {\r\n const description = event.getContent().description;\r\n\r\n if (!description || !description.sdp || !description.type) {\r\n _logger.logger.info(\"Ignoring invalid m.call.negotiate event\");\r\n\r\n return;\r\n } // Politeness always follows the direction of the call: in a glare situation,\r\n // we pick either the inbound or outbound call, so one side will always be\r\n // inbound and one outbound\r\n\r\n\r\n const polite = this.direction === CallDirection.Inbound; // Here we follow the perfect negotiation logic from\r\n // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation\r\n\r\n const offerCollision = description.type === 'offer' && (this.makingOffer || this.peerConn.signalingState != 'stable');\r\n this.ignoreOffer = !polite && offerCollision;\r\n\r\n if (this.ignoreOffer) {\r\n _logger.logger.info(\"Ignoring colliding negotiate event because we're impolite\");\r\n\r\n return;\r\n }\r\n\r\n const prevLocalOnHold = this.isLocalOnHold();\r\n\r\n if (description.type === 'answer') {\r\n // whenever we get an answer back, clear the flag we set whilst trying to un-hold\r\n // the other party: the state of the channels now reflects reality\r\n this.unholdingRemote = false;\r\n }\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(description);\r\n\r\n if (description.type === 'offer') {\r\n // First we sent the direction of the tranciever to what we'd like it to be,\r\n // irresepective of whether the other side has us on hold - so just whether we\r\n // want the call to be on hold or not. This is necessary because in a few lines,\r\n // we'll adjust the direction and unless we do this too, we'll never come off hold.\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = this.isRemoteOnHold() ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n const localDescription = await this.peerConn.createAnswer();\r\n await this.peerConn.setLocalDescription(localDescription); // Now we've got our answer, set the direction to the outcome of the negotiation.\r\n // We need to do this otherwise Firefox will notice that the direction is not the\r\n // currentDirection and try to negotiate itself off hold again.\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = tranceiver.currentDirection;\r\n }\r\n\r\n this.sendVoipEvent(_event.EventType.CallNegotiate, {\r\n description: this.peerConn.localDescription\r\n });\r\n }\r\n } catch (err) {\r\n _logger.logger.warn(\"Failed to complete negotiation\", err);\r\n }\r\n\r\n const newLocalOnHold = this.isLocalOnHold();\r\n\r\n if (prevLocalOnHold !== newLocalOnHold) {\r\n this.emit(CallEvent.LocalHoldUnhold, newLocalOnHold); // also this one for backwards compat\r\n\r\n this.emit(CallEvent.HoldUnhold, newLocalOnHold);\r\n }\r\n }\r\n\r\n callHasEnded() {\r\n // This exists as workaround to typescript trying to be clever and erroring\r\n // when putting if (this.state === CallState.Ended) return; twice in the same\r\n // function, even though that function is async.\r\n return this.state === CallState.Ended;\r\n }\r\n\r\n async playRemoteAudio() {\r\n if (this.remoteVideoElement) this.remoteVideoElement.muted = true;\r\n this.remoteAudioElement.muted = false;\r\n this.remoteAudioElement.srcObject = this.remoteStream; // if audioOutput is non-default:\r\n\r\n try {\r\n if (audioOutput) {\r\n // This seems quite unreliable in Chrome, although I haven't yet managed to make a jsfiddle where\r\n // it fails.\r\n // It seems reliable if you set the sink ID after setting the srcObject and then set the sink ID\r\n // back to the default after the call is over\r\n _logger.logger.info(\"Setting audio sink to \" + audioOutput + \", was \" + this.remoteAudioElement.sinkId);\r\n\r\n await this.remoteAudioElement.setSinkId(audioOutput);\r\n }\r\n } catch (e) {\r\n _logger.logger.warn(\"Couldn't set requested audio output device: using default\", e);\r\n }\r\n\r\n try {\r\n await this.remoteAudioElement.play();\r\n } catch (e) {\r\n _logger.logger.error(\"Failed to play remote audio element\", e);\r\n }\r\n }\r\n\r\n async playRemoteVideo() {\r\n // A note on calling methods on media elements:\r\n // We used to have queues per media element to serialise all calls on those elements.\r\n // The reason given for this was that load() and play() were racing. However, we now\r\n // never call load() explicitly so this seems unnecessary. However, serialising every\r\n // operation was causing bugs where video would not resume because some play command\r\n // had got stuck and all media operations were queued up behind it. If necessary, we\r\n // should serialise the ones that need to be serialised but then be able to interrupt\r\n // them with another load() which will cancel the pending one, but since we don't call\r\n // load() explicitly, it shouldn't be a problem.\r\n this.remoteVideoElement.srcObject = this.remoteStream;\r\n\r\n _logger.logger.info(\"playing remote video. stream active? \" + this.remoteStream.active);\r\n\r\n try {\r\n await this.remoteVideoElement.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play remote video element\", e);\r\n }\r\n }\r\n\r\n setState(state) {\r\n const oldState = this.state;\r\n this.state = state;\r\n this.emit(CallEvent.State, state, oldState);\r\n }\r\n /**\r\n * Internal\r\n * @param {string} eventType\r\n * @param {Object} content\r\n * @return {Promise}\r\n */\r\n\r\n\r\n sendVoipEvent(eventType, content) {\r\n return this.client.sendEvent(this.roomId, eventType, Object.assign({}, content, {\r\n version: VOIP_PROTO_VERSION,\r\n call_id: this.callId,\r\n party_id: this.ourPartyId\r\n }));\r\n }\r\n\r\n queueCandidate(content) {\r\n // Sends candidates with are sent in a special way because we try to amalgamate\r\n // them into one message\r\n this.candidateSendQueue.push(content); // Don't send the ICE candidates yet if the call is in the ringing state: this\r\n // means we tried to pick (ie. started generating candidates) and then failed to\r\n // send the answer and went back to the ringing state. Queue up the candidates\r\n // to send if we sucessfully send the answer.\r\n // Equally don't send if we haven't yet sent the answer because we can send the\r\n // first batch of candidates along with the answer\r\n\r\n if (this.state === CallState.Ringing || !this.inviteOrAnswerSent) return; // MSC2746 reccomends these values (can be quite long when calling because the\r\n // callee will need a while to answer the call)\r\n\r\n const delay = this.direction === CallDirection.Inbound ? 500 : 2000;\r\n\r\n if (this.candidateSendTries === 0) {\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delay);\r\n }\r\n }\r\n /*\r\n * Transfers this call to another user\r\n */\r\n\r\n\r\n async transfer(targetUserId) {\r\n // Fetch the target user's global profile info: their room avatar / displayname\r\n // could be different in whatever room we shae with them.\r\n const profileInfo = await this.client.getProfileInfo(targetUserId);\r\n const replacementId = genCallID();\r\n const body = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: targetUserId,\r\n display_name: profileInfo.display_name,\r\n avatar_url: profileInfo.avatar_url\r\n },\r\n create_call: replacementId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, body);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n /*\r\n * Transfers this call to the target call, effectively 'joining' the\r\n * two calls (so the remote parties on each call are connected together).\r\n */\r\n\r\n\r\n async transferToCall(transferTargetCall) {\r\n const targetProfileInfo = await this.client.getProfileInfo(transferTargetCall.getOpponentMember().userId);\r\n const transfereeProfileInfo = await this.client.getProfileInfo(this.getOpponentMember().userId);\r\n const newCallId = genCallID();\r\n const bodyToTransferTarget = {\r\n // the replacements on each side have their own ID, and it's distinct from the\r\n // ID of the new call (but we can use the same function to generate it)\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: this.getOpponentMember().userId,\r\n display_name: transfereeProfileInfo.display_name,\r\n avatar_url: transfereeProfileInfo.avatar_url\r\n },\r\n await_call: newCallId\r\n };\r\n await transferTargetCall.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferTarget);\r\n const bodyToTransferee = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: transferTargetCall.getOpponentMember().userId,\r\n display_name: targetProfileInfo.display_name,\r\n avatar_url: targetProfileInfo.avatar_url\r\n },\r\n create_call: newCallId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferee);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n await transferTargetCall.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n\r\n async terminate(hangupParty, hangupReason, shouldEmit) {\r\n if (this.callHasEnded()) return;\r\n this.callStatsAtEnd = await this.collectCallStats();\r\n\r\n if (this.inviteTimeout) {\r\n clearTimeout(this.inviteTimeout);\r\n this.inviteTimeout = null;\r\n }\r\n\r\n const remoteVid = this.getRemoteVideoElement();\r\n const remoteAud = this.getRemoteAudioElement();\r\n const localVid = this.getLocalVideoElement();\r\n\r\n if (remoteVid) {\r\n remoteVid.pause();\r\n remoteVid.srcObject = null;\r\n }\r\n\r\n if (remoteAud) {\r\n remoteAud.pause();\r\n remoteAud.srcObject = null;\r\n\r\n try {\r\n // As per comment in playRemoteAudio, setting the sink ID back to the default\r\n // once the call is over makes setSinkId work reliably.\r\n await this.remoteAudioElement.setSinkId('');\r\n } catch (e) {\r\n _logger.logger.warn(\"Failed to set sink ID back to default\");\r\n }\r\n }\r\n\r\n if (localVid) {\r\n localVid.pause();\r\n localVid.srcObject = null;\r\n }\r\n\r\n this.hangupParty = hangupParty;\r\n this.hangupReason = hangupReason;\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn && this.peerConn.signalingState !== 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n if (shouldEmit) {\r\n this.emit(CallEvent.Hangup, this);\r\n }\r\n }\r\n\r\n stopAllMedia() {\r\n _logger.logger.debug(`stopAllMedia (stream=${this.localAVStream})`);\r\n\r\n if (this.localAVStream) {\r\n for (const track of this.localAVStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.screenSharingStream) {\r\n for (const track of this.screenSharingStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.remoteStream) {\r\n for (const track of this.remoteStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n }\r\n\r\n checkForErrorListener() {\r\n if (this.listeners(\"error\").length === 0) {\r\n throw new Error(\"You MUST attach an error listener using call.on('error', function() {})\");\r\n }\r\n }\r\n\r\n async sendCandidateQueue() {\r\n if (this.candidateSendQueue.length === 0) {\r\n return;\r\n }\r\n\r\n const cands = this.candidateSendQueue;\r\n this.candidateSendQueue = [];\r\n ++this.candidateSendTries;\r\n const content = {\r\n candidates: cands\r\n };\r\n\r\n _logger.logger.debug(\"Attempting to send \" + cands.length + \" candidates\");\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallCandidates, content);\r\n } catch (error) {\r\n // don't retry this event: we'll send another one later as we might\r\n // have more candidates by then.\r\n if (error.event) this.client.cancelPendingEvent(error.event); // put all the candidates we failed to send back in the queue\r\n\r\n this.candidateSendQueue.push(...cands);\r\n\r\n if (this.candidateSendTries > 5) {\r\n _logger.logger.debug(\"Failed to send candidates on attempt \" + this.candidateSendTries + \". Giving up on this call.\", error);\r\n\r\n const code = CallErrorCode.SignallingFailed;\r\n const message = \"Signalling failed\";\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.hangup(code, false);\r\n return;\r\n }\r\n\r\n const delayMs = 500 * Math.pow(2, this.candidateSendTries);\r\n ++this.candidateSendTries;\r\n\r\n _logger.logger.debug(\"Failed to send candidates. Retrying in \" + delayMs + \"ms\", error);\r\n\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delayMs);\r\n }\r\n }\r\n\r\n async placeCallWithConstraints(constraints) {\r\n _logger.logger.log(\"Getting user media with constraints\", constraints); // XXX Find a better way to do this\r\n\r\n\r\n this.client._callEventHandler.calls.set(this.callId, this);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.direction = CallDirection.Outbound;\r\n this.config = constraints; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n } // create the peer connection now so it can be gathering candidates while we get user\r\n // media (assuming a candidate pool size is configured)\r\n\r\n\r\n this.peerConn = this.createPeerConnection();\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.gotUserMediaForInvite(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n }\r\n\r\n createPeerConnection() {\r\n const pc = new window.RTCPeerConnection({\r\n iceTransportPolicy: this.forceTURN ? 'relay' : undefined,\r\n iceServers: this.turnServers,\r\n iceCandidatePoolSize: this.client._iceCandidatePoolSize\r\n }); // 'connectionstatechange' would be better, but firefox doesn't implement that.\r\n\r\n pc.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChanged);\r\n pc.addEventListener('signalingstatechange', this.onSignallingStateChanged);\r\n pc.addEventListener('icecandidate', this.gotLocalIceCandidate);\r\n pc.addEventListener('icegatheringstatechange', this.onIceGatheringStateChange);\r\n pc.addEventListener('track', this.onTrack);\r\n pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);\r\n return pc;\r\n }\r\n\r\n partyIdMatches(msg) {\r\n // They must either match or both be absent (in which case opponentPartyId will be null)\r\n // Also we ignore party IDs on the invite/offer if the version is 0, so we must do the same\r\n // here and use null if the version is 0 (woe betide any opponent sending messages in the\r\n // same call with different versions)\r\n const msgPartyId = msg.version === 0 ? null : msg.party_id || null;\r\n return msgPartyId === this.opponentPartyId;\r\n } // Commits to an opponent for the call\r\n // ev: An invite or answer event\r\n\r\n\r\n chooseOpponent(ev) {\r\n // I choo-choo-choose you\r\n const msg = ev.getContent();\r\n\r\n _logger.logger.debug(`Choosing party ID ${msg.party_id} for call ID ${this.callId}`);\r\n\r\n this.opponentVersion = msg.version;\r\n\r\n if (this.opponentVersion === 0) {\r\n // set to null to indicate that we've chosen an opponent, but because\r\n // they're v0 they have no party ID (even if they sent one, we're ignoring it)\r\n this.opponentPartyId = null;\r\n } else {\r\n // set to their party ID, or if they're naughty and didn't send one despite\r\n // not being v0, set it to null to indicate we picked an opponent with no\r\n // party ID\r\n this.opponentPartyId = msg.party_id || null;\r\n }\r\n\r\n this.opponentCaps = msg.capabilities || {};\r\n this.opponentMember = ev.sender;\r\n }\r\n\r\n async addBufferedIceCandidates() {\r\n const bufferedCands = this.remoteCandidateBuffer.get(this.opponentPartyId);\r\n\r\n if (bufferedCands) {\r\n _logger.logger.info(`Adding ${bufferedCands.length} buffered candidates for opponent ${this.opponentPartyId}`);\r\n\r\n await this.addIceCandidates(bufferedCands);\r\n }\r\n\r\n this.remoteCandidateBuffer = null;\r\n }\r\n\r\n async addIceCandidates(cands) {\r\n for (const cand of cands) {\r\n if ((cand.sdpMid === null || cand.sdpMid === undefined) && (cand.sdpMLineIndex === null || cand.sdpMLineIndex === undefined)) {\r\n _logger.logger.debug(\"Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex\");\r\n\r\n continue;\r\n }\r\n\r\n _logger.logger.debug(\"Call \" + this.callId + \" got remote ICE \" + cand.sdpMid + \" candidate: \" + cand.candidate);\r\n\r\n try {\r\n await this.peerConn.addIceCandidate(cand);\r\n } catch (err) {\r\n if (!this.ignoreOffer) {\r\n _logger.logger.info(\"Failed to add remote ICE candidate\", err);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.MatrixCall = MatrixCall;\r\n\r\nfunction setTracksEnabled(tracks, enabled) {\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].enabled = enabled;\r\n }\r\n}\r\n\r\nfunction getUserMediaContraints(type) {\r\n const isWebkit = !!navigator.webkitGetUserMedia;\r\n\r\n switch (type) {\r\n case ConstraintsType.Audio:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: false\r\n };\r\n }\r\n\r\n case ConstraintsType.Video:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: {\r\n deviceId: videoInput ? {\r\n ideal: videoInput\r\n } : undefined,\r\n\r\n /* We want 640x360. Chrome will give it only if we ask exactly,\r\n FF refuses entirely if we ask exactly, so have to ask for ideal\r\n instead\r\n XXX: Is this still true?\r\n */\r\n width: isWebkit ? {\r\n exact: 640\r\n } : {\r\n ideal: 640\r\n },\r\n height: isWebkit ? {\r\n exact: 360\r\n } : {\r\n ideal: 360\r\n }\r\n }\r\n };\r\n }\r\n }\r\n}\r\n\r\nasync function getScreenshareContraints(selectDesktopCapturerSource) {\r\n var _window$electron2;\r\n\r\n if ((_window$electron2 = window.electron) !== null && _window$electron2 !== void 0 && _window$electron2.getDesktopCapturerSources && selectDesktopCapturerSource) {\r\n // We have access to getDesktopCapturerSources()\r\n _logger.logger.debug(\"Electron getDesktopCapturerSources() is available...\");\r\n\r\n const selectedSource = await selectDesktopCapturerSource();\r\n if (!selectedSource) return null;\r\n return {\r\n audio: false,\r\n video: {\r\n mandatory: {\r\n chromeMediaSource: \"desktop\",\r\n chromeMediaSourceId: selectedSource.id\r\n }\r\n }\r\n };\r\n } else {\r\n // We do not have access to the Electron desktop capturer,\r\n // therefore we can assume we are on the web\r\n _logger.logger.debug(\"Electron desktopCapturer is not available...\");\r\n\r\n return {\r\n audio: false,\r\n video: true\r\n };\r\n }\r\n}\r\n\r\nlet audioOutput;\r\nlet audioInput;\r\nlet videoInput;\r\n/**\r\n * Set an audio output device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\nfunction setAudioOutput(deviceId) {\r\n audioOutput = deviceId;\r\n}\r\n/**\r\n * Set an audio input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setAudioInput(deviceId) {\r\n audioInput = deviceId;\r\n}\r\n/**\r\n * Set a video input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setVideoInput(deviceId) {\r\n videoInput = deviceId;\r\n}\r\n/**\r\n * Create a new Matrix call for the browser.\r\n * @param {MatrixClient} client The client instance to use.\r\n * @param {string} roomId The room the call is in.\r\n * @param {Object?} options DEPRECATED optional options map.\r\n * @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be\r\n * forced. This option is deprecated - use opts.forceTURN when creating the matrix client\r\n * since it's only possible to set this option on outbound calls.\r\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\r\n */\r\n\r\n\r\nfunction createNewMatrixCall(client, roomId, options) {\r\n // typeof prevents Node from erroring on an undefined reference\r\n if (typeof window === 'undefined' || typeof document === 'undefined') {\r\n // NB. We don't log here as apps try to create a call object as a test for\r\n // whether calls are supported, so we shouldn't fill the logs up.\r\n return null;\r\n } // Firefox throws on so little as accessing the RTCPeerConnection when operating in\r\n // a secure mode. There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616\r\n // though the concern is that the browser throwing a SecurityError will brick the\r\n // client creation process.\r\n\r\n\r\n try {\r\n const supported = Boolean(window.RTCPeerConnection || window.RTCSessionDescription || window.RTCIceCandidate || navigator.mediaDevices);\r\n\r\n if (!supported) {\r\n _logger.logger.error(\"WebRTC is not supported in this browser / environment\");\r\n\r\n return null;\r\n }\r\n } catch (e) {\r\n _logger.logger.error(\"Exception thrown when trying to access WebRTC\", e);\r\n\r\n return null;\r\n }\r\n\r\n const optionsForceTURN = options ? options.forceTURN : false;\r\n const opts = {\r\n client: client,\r\n roomId: roomId,\r\n turnServers: client.getTurnServers(),\r\n // call level options\r\n forceTURN: client._forceTURN || optionsForceTURN\r\n };\r\n const call = new MatrixCall(opts);\r\n client.reEmitter.reEmit(call, Object.values(CallEvent));\r\n return call;\r\n}","\r\nvar createHash = null\r\n\r\nvar f = {}\r\n\r\nf.sha224 = function(text){\r\n\r\n if(!createHash){\r\n createHash = require('create-hash')\r\n }\r\n\r\n var hash = createHash('sha224')\r\n hash.update(text)\r\n return hash.digest()\r\n\r\n}\r\n\r\n\r\nf.language = function () {\r\n\r\n var language;\r\n if (window.navigator.languages) {\r\n language = window.navigator.languages[0];\r\n } else {\r\n language = window.navigator.userLanguage || window.navigator.language;\r\n }\r\n\r\n return language\r\n}\r\nf.deep = function (obj, key) {\r\n var _key = _.isArray(key) ? key : key.split(\".\");\r\n\r\n var tkey = _key[0];\r\n\r\n if (typeof obj == 'undefined' || !obj) return undefined;\r\n\r\n if (typeof obj[tkey] != 'undefined') {\r\n _key.splice(0, 1);\r\n\r\n if (_key.length === 0) {\r\n return obj[tkey];\r\n }\r\n else {\r\n return f.deep(obj[tkey], _key)\r\n }\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n\r\nvar renderFrameEqualizer = function (canvas, ctx, analyser, stop, colornumbers, offset) {\r\n\r\n\r\n\r\n if (!colornumbers) {\r\n colornumbers = {\r\n r: 25,\r\n g: 250,\r\n b: 50\r\n }\r\n }\r\n\r\n if (!offset) {\r\n offset = {\r\n x: 25,\r\n offset: [0, 0]\r\n }\r\n }\r\n\r\n var WIDTH = canvas.width;\r\n var HEIGHT = canvas.height;\r\n\r\n var bufferLength = analyser.frequencyBinCount;\r\n var dataArray = new Uint8Array(bufferLength);\r\n\r\n var barWidth = (WIDTH / bufferLength) / 2.5;\r\n var barHeight;\r\n\r\n var x = offset.x // offset[0] -15;\r\n\r\n analyser.getByteFrequencyData(dataArray);\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n for (var i = 0; i < bufferLength; i++) {\r\n\r\n barHeight = dataArray[i];\r\n\r\n var r = barHeight + (colornumbers.r * (i / bufferLength));\r\n var g = colornumbers.g * (i / bufferLength);\r\n var b = colornumbers.b;\r\n\r\n var opacity = - Math.abs(i - bufferLength / 2) / bufferLength + 1 / 2\r\n\r\n\r\n if (i > offset.offset[0] && i < bufferLength - offset.offset[1]) {\r\n ctx.fillStyle = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + opacity * 2 + \")\";\r\n ctx.fillRect(x, HEIGHT / 2 - (barHeight * opacity), barWidth, barHeight * opacity * 2);\r\n }\r\n\r\n\r\n x += barWidth + 1;\r\n }\r\n\r\n requestAnimationFrame(function () {\r\n if (stop()) {\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n return\r\n }\r\n\r\n renderFrameEqualizer(canvas, ctx, analyser, stop, colornumbers, offset)\r\n });\r\n\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nf.permutations = function (array, k) {\r\n\r\n k || (k = 1)\r\n\r\n var m = [];\r\n var combinations = [];\r\n var indices = [];\r\n var len = array.length;\r\n function run(level) {\r\n for (var i = 0; i < len; i++) {\r\n if (!indices[i]) {\r\n indices[i] = true;\r\n combinations[level] = array[i];\r\n if (level < k - 1) {\r\n run(level + 1, i + 1);\r\n } else {\r\n m.push(([]).concat(combinations));\r\n }\r\n indices[i] = false;\r\n }\r\n }\r\n }\r\n run(0);\r\n return m;\r\n}\r\n\r\nvar copytext = function (text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // IE specific code path to prevent textarea being shown while dialog is visible.\r\n return clipboardData.setData(\"Text\", text);\r\n\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in MS Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return false;\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\r\nvar makeid = function (valid) {\r\n\r\n function s4() {\r\n return Math.floor((1 + Math.random()) * 0x10000)\r\n .toString(16)\r\n .substring(1);\r\n }\r\n\r\n if (!valid) {\r\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\r\n s4() + '-' + s4() + s4() + s4();\r\n }\r\n\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\r\n for (var i = 0; i < 16; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n return text;\r\n}\r\n// roomalias\r\n\r\nvar flball = function (str) {\r\n\r\n //return flbb(str)\r\n\r\n if (!str || !str.split) return str\r\n\r\n var exception = [\"2ndEdison, 3dCarbon\", \"A-Pmcs\"];\r\n var lower = [\"TO\", \"K\", \"X\", \"10X\", \"THE\", \"AN\", \"AND\", \"OR\", \"AT\", \"BUT\", \"BY\", \"FOR\", \"IN\", \"OF\", \"OFF\", \"ON\", \"OUT\", \"PER\", \"UP\", \"VIA\", \"AS\", \"FOR\"];\r\n var upper = [\"2MCBL\", \"USA\", \"TONS\", \"BHCC\", \"LLC\", \"LTD\", \"1BWK\", \"AGMA\", \"VIII\", \"XIII\", \"BHCC\"];\r\n var capital = [\"LAS\", \"LAW\", \"SON\", \"DEE\", \"ST\", \"PET\", \"BIG\", \"WAY\", \"AIR\", \"ALL\", \"TOP\", \"JOY\", \"CO\", \"INC\", \"INC.\", \"AVE\", \"PAY\", \"ST.\", \"FOX\", \"CAR\", \"TAX\", \"DAY\", \"MAN\", \"CO.\", \"NEW\"];\r\n var capitalReg = new RegExp(capital.join('|'));\r\n var upperReg = new RegExp(upper.join('|'));\r\n\r\n\r\n var nameArr = str.split(' ').map(function (word) {\r\n if (exception.some(function (w) { return w.toUpperCase() === word })) {\r\n\r\n return exception.find(function (w) { return w.toUpperCase() === word });\r\n }\r\n\r\n if (\r\n lower.some(function (w) {\r\n if (w === word) {\r\n return true;\r\n };\r\n var wArr = w.split(' ');\r\n for (var i = 0; i < wArr.length; i++) {\r\n if (/[0-9]/.test(wArr[i]) && /ST|ND|RD|TH|K/.test(wArr[i + 1] + wArr[i + 2])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n })\r\n ) {\r\n return word.toLowerCase();\r\n }\r\n\r\n if (capitalReg.test(word)) {\r\n return word[0] + word.slice(1).toLowerCase();\r\n }\r\n if (word.replace(/\\(|\\)/g, '').length <= 3 || upperReg.test(word)) {\r\n return word;\r\n }\r\n var wordCap = word.toLowerCase().replace(/[A-Za-z]/, function (l) { return l.toUpperCase() });\r\n var wordArr = [];\r\n wordArr.push(wordCap[0]);\r\n for (var i = 0; i < wordCap.length; i++) {\r\n if (wordCap[i + 1] && (/\\.|\\/|[0-9]|\\&|\\-|\\s/.test(wordCap[i]) || (wordCap[i - 1] + wordCap[i]).toLowerCase() === 'mc')) {\r\n wordArr.push(wordCap[i + 1].toUpperCase());\r\n } else if (wordCap[i + 1]) {\r\n wordArr.push(wordCap[i + 1])\r\n }\r\n };\r\n return wordArr.join('')\r\n })\r\n\r\n return flb(nameArr.join(' '))\r\n}\r\n\r\nvar flb = function (str) {\r\n return str[0].toUpperCase() + str.substr(1);\r\n}\r\n\r\nvar flbs = function (str) {\r\n\r\n return str[0].toUpperCase() + str.substr(1).toLowerCase();\r\n}\r\n\r\nvar flbb = function (str) {\r\n\r\n var s = str.split(' ');\r\n\r\n return _.map(s, function (s) {\r\n return flbs(s);\r\n }).join(' ')\r\n\r\n}\r\nvar group = function (array, _function) {\r\n var group = {};\r\n\r\n _.each(array, function (el, i) {\r\n\r\n var index = _function(el, i);\r\n\r\n if (!index) return;\r\n\r\n if (!group[index])\r\n group[index] = [];\r\n\r\n group[index].push(el);\r\n\r\n })\r\n\r\n return group;\r\n}\r\n\r\nvar _scrollTop = function (scrollTop, el, time) {\r\n\r\n if (!el) el = $(\"body,html\");\r\n\r\n if (!time) time = 200;\r\n\r\n el.animate({ scrollTop: scrollTop }, time);\r\n}\r\n\r\nvar _scrollTo = function (to, el, time) {\r\n\r\n if (!to) to = $(this);\r\n\r\n var ofssetObj = to.offset();\r\n\r\n var offset = (to.height() - $(window).height()) / 2;\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTop = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.offset();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTopP = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.position();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar stringEq = function (s1, s2) {\r\n\r\n if (!s1) s1 = ''\r\n if (!s2) s2 = ''\r\n\r\n var bw = function (s) {\r\n return s.split(/[ \\t\\v\\r\\n\\f,.]+/)\r\n }\r\n\r\n var hash = function (s) {\r\n\r\n var ps = bw(s).join(' ')\r\n\r\n return ps.toLowerCase().replace(/[^a-zа-я0-9&]*/g, '');\r\n }\r\n\r\n\r\n\r\n var makeTr = function (w) {\r\n var trs = {};\r\n\r\n var takeC = function (index) {\r\n var c;\r\n\r\n if (index < 0 || index >= w.length) c = \"_\";\r\n\r\n else c = w[index];\r\n\r\n return c;\r\n }\r\n\r\n for (var i = -1; i <= w.length; i++) {\r\n\r\n var tr = \"\";\r\n\r\n for (var j = i - 1; j <= i + 1; j++) {\r\n tr = tr + takeC(j);\r\n }\r\n\r\n\r\n trs[tr] = 1;\r\n }\r\n\r\n return trs;\r\n }\r\n\r\n\r\n var t1 = makeTr(hash(s1)),\r\n t2 = makeTr(hash(s2));\r\n\r\n\r\n var c = 0,\r\n m = Math.max(_.toArray(t1).length, _.toArray(t2).length)\r\n\r\n _.each(t1, function (t, index) {\r\n\r\n if (t2[index]) c++;\r\n\r\n })\r\n\r\n return c / m;\r\n\r\n\r\n}\r\n\r\nvar pretry = function (_function, time, totaltime) {\r\n\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n retry(_function, resolve, time, totaltime)\r\n\r\n })\r\n}\r\n\r\nvar retry = function (_function, clbk, time, totaltime) {\r\n\r\n if (_function()){\r\n\r\n \r\n\r\n if (clbk) clbk();\r\n\r\n return\r\n }\r\n\r\n if (!time) time = 20;\r\n\r\n var totalTimeCounter = 0\r\n\r\n var interval = setInterval(function () {\r\n\r\n if (_function() || (totaltime && totaltime <= totalTimeCounter)) {\r\n\r\n\r\n clearInterval(interval);\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n totalTimeCounter += time\r\n\r\n }, time);\r\n}\r\n\r\nvar md5 = function (d) {\r\n var result = M(V(Y(X(d), 8 * d.length))); return result.toLowerCase()\r\n}; function M(d) { for (var _, m = \"0123456789ABCDEF\", f = \"\", r = 0; r < d.length; r++)_ = d.charCodeAt(r), f += m.charAt(_ >>> 4 & 15) + m.charAt(15 & _); return f } function X(d) { for (var _ = Array(d.length >> 2), m = 0; m < _.length; m++)_[m] = 0; for (m = 0; m < 8 * d.length; m += 8)_[m >> 5] |= (255 & d.charCodeAt(m / 8)) << m % 32; return _ } function V(d) { for (var _ = \"\", m = 0; m < 32 * d.length; m += 8)_ += String.fromCharCode(d[m >> 5] >>> m % 32 & 255); return _ } function Y(d, _) { d[_ >> 5] |= 128 << _ % 32, d[14 + (_ + 64 >>> 9 << 4)] = _; for (var m = 1732584193, f = -271733879, r = -1732584194, i = 271733878, n = 0; n < d.length; n += 16) { var h = m, t = f, g = r, e = i; f = md5_ii(f = md5_ii(f = md5_ii(f = md5_ii(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_ff(f = md5_ff(f = md5_ff(f = md5_ff(f, r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = safe_add(m, h), f = safe_add(f, t), r = safe_add(r, g), i = safe_add(i, e) } return Array(m, f, r, i) } function md5_cmn(d, _, m, f, r, i) { return safe_add(bit_rol(safe_add(safe_add(_, d), safe_add(f, i)), r), m) } function md5_ff(d, _, m, f, r, i, n) { return md5_cmn(_ & m | ~_ & f, d, _, r, i, n) } function md5_gg(d, _, m, f, r, i, n) { return md5_cmn(_ & f | m & ~f, d, _, r, i, n) } function md5_hh(d, _, m, f, r, i, n) { return md5_cmn(_ ^ m ^ f, d, _, r, i, n) } function md5_ii(d, _, m, f, r, i, n) { return md5_cmn(m ^ (_ | ~f), d, _, r, i, n) } function safe_add(d, _) { var m = (65535 & d) + (65535 & _); return (d >> 16) + (_ >> 16) + (m >> 16) << 16 | 65535 & m } function bit_rol(d, _) { return d << _ | d >>> 32 - _ }\r\n\r\nvar retryLazy = function (_function, clbk, time) {\r\n if (!time) time = 200;\r\n\r\n var f = function () {\r\n _function(function (result) {\r\n\r\n if (result) {\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n else {\r\n setTimeout(f, time)\r\n }\r\n\r\n })\r\n }\r\n\r\n f();\r\n}\r\n\r\nvar isAndroid = function () {\r\n var ua = navigator.userAgent.toLowerCase();\r\n var isAndroid = ua.indexOf(\"android\") > -1;\r\n\r\n if (isAndroid) {\r\n return true\r\n }\r\n}\r\n\r\nvar isMobile = function () {\r\n return $('html').hasClass('mobile');\r\n}\r\n\r\nvar isTablet = function () {\r\n return $('html').hasClass('mobile') || $('html').hasClass('tablet');\r\n}\r\n\r\nvar slowMade = function (_function, timer, time) {\r\n\r\n if (!time) time = 20\r\n\r\n if (timer)\r\n clearTimeout(timer);\r\n\r\n timer = setTimeout(_function, time);\r\n\r\n return timer;\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nvar trim = function (s) {\r\n return rtrim(ltrim(s));\r\n}\r\n\r\nvar ltrim = function (s) {\r\n return (s || \"\").replace(/^\\s+/, '');\r\n}\r\n\r\nvar rtrim = function (s) {\r\n return (s || \"\").replace(/\\s+$/, '');\r\n}\r\n\r\nvar ltrimrn = function (s) {\r\n return (s || \"\").replace(/^[\\r\\n\\t ]+/, '');\r\n}\r\n\r\nvar rtrimrn = function (s) {\r\n return (s || \"\").replace(/[\\r\\n\\t ]+$/, '');\r\n}\r\n\r\nvar trimrn = function (s) {\r\n return rtrimrn(ltrimrn(s));\r\n}\r\n\r\nvar hexEncode = function (text) {\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 0; i < text.length; i++) {\r\n ch = text.charCodeAt(i);\r\n if (ch > 0xFF) ch -= 0x350;\r\n ch = ch.toString(16);\r\n while (ch.length < 2) ch = \"0\" + ch;\r\n result += ch;\r\n }\r\n return result;\r\n}\r\n\r\nvar stringify = function(e){\r\n\r\n if(!e) return null\r\n\r\n if(e.toString) {\r\n\r\n var s = e.toString()\r\n\r\n if (s != '[object Object]')\r\n return s\r\n }\r\n\r\n if(_.isObject(e)) return JSON.stringify(e)\r\n\r\n return e\r\n}\r\n\r\nvar hexstorage = {}\r\n\r\n\r\nvar hexDecode = function (hex) {\r\n\r\n if (hexstorage[hex]) return hexstorage[hex]\r\n\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 2; i <= hex.length; i += 2) {\r\n ch = parseInt(hex.substring(i - 2, i), 16);\r\n if (ch >= 128) ch += 0x350;\r\n ch = String.fromCharCode(\"0x\" + ch.toString(16));\r\n result += ch;\r\n }\r\n\r\n hexstorage[hex] = result\r\n\r\n return result;\r\n}\r\nvar imgDimensions = function (data) {\r\n let img = new Image()\r\n img.src = data.base64\r\n data.width = img.width\r\n data.height = img.height\r\n return data\r\n}\r\n\r\nvar knsites = ['bastyon.com', 'pocketnet.app', 'zoom.us', 'youtube', 'facebook', 'instagram', 'vk.com', 'twitter', 'pinterest', 'vimeo', 'ask.fm', 'change.org', 'wikipedia', 'livejournal', 'linkedin', 'myspace', 'reddit', 'tumblr', 'ok.ru', 'flickr', 'google', 'yandex', 'yahoo', 'bing', 'gmail', 'mail']\r\n\r\nvar knsite = function (url) {\r\n return _.find(knsites, function (u) {\r\n return url.indexOf(u) > -1\r\n })\r\n}\r\n\r\nvar getUrl = function (data) {\r\n\r\n /*if(!linkify){\r\n linkify = require('linkifyjs');\r\n linkify.registerCustomProtocol('pocketnet')\r\n linkify.registerCustomProtocol('bastyon')\r\n }*/\r\n\r\n var links = linkify.find(data)\r\n\r\n if (links.length) {\r\n return links[0].href\r\n }\r\n}\r\nvar getTxt = function (data) {\r\n return data.replace(/\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/g, '')\r\n}\r\nvar getmatrixid = function (str) {\r\n return str.split(\":\")[0].replace(\"@\", '')\r\n}\r\nvar getMatrixIdFull = function (id, domain) {\r\n id || (id = '')\r\n\r\n if (id.indexOf(\"@\") == 0) return id\r\n return '@' + id + ':' + domain\r\n}\r\nvar ObjDiff = function (x, y) {\r\n var target = {};\r\n var diffProps = Object.keys(x).filter(function (i) {\r\n return x[i] !== y[i];\r\n\r\n }).map(function (j) {\r\n var obj = {};\r\n obj[j] = x[j];\r\n target = Object.assign(target, obj)\r\n });\r\n return target;\r\n}\r\nvar filterByUserId = function (arr, data) {\r\n var a = arr.map(function (e) {\r\n return e.id;\r\n });\r\n var d = data.map(function (e) {\r\n return e.id;\r\n });\r\n\r\n var x = [];\r\n a.forEach(function (e) {\r\n x.push(data[d.indexOf(e)]);\r\n });\r\n\r\n return x;\r\n}\r\nvar formatBytes = function (bytes, decimals = 2) {\r\n if (bytes === 0) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\r\n}\r\n\r\nvar poketnetUrlParser = function (url) {\r\n var newURL = new URL(url)\r\n return {\r\n post: newURL.searchParams.get('s'),\r\n user: newURL.pathname.replace('/', ''),\r\n }\r\n}\r\n\r\n// Takes a url and returns another one that fits into iframe\r\nvar videoUrlParser = function (url) {\r\n var youtube_host = ['www.youtube.com', 'youtube.com', 'youtu.be']\r\n var vimeo_host = ['www.vimeo.com', 'vimeo.com']\r\n var peertube_host = ['peer.tube', 'peertube.social']\r\n\r\n var newURL = new URL(url)\r\n\r\n if (youtube_host.indexOf(newURL.hostname) > -1) return `https://www.youtube.com/embed/${newURL.searchParams.get('v')}`\r\n if (vimeo_host.indexOf(newURL.hostname) > -1) return `https://player.vimeo.com/video${newURL.pathname}`\r\n if (peertube_host.indexOf(newURL.hostname) > -1) return `https://pocketnetpeertube1.nohost.me/${newURL.pathname.replace('watch', 'embed')}`\r\n}\r\n\r\n// Cuts string if its length longer than 'lenght'\r\nvar textFormatter = function (text, length) {\r\n return text.slice(0, length) + `...`\r\n}\r\n\r\n// takes a text and returns it without url in it\r\nvar urlSeparator = function (text) {\r\n var url = getUrl(text)\r\n return text.replace(url, \"\")\r\n}\r\n\r\n// takes a timestamp and turns it into a string like `Dec 25, 2000 at 2:15 PM`\r\nvar dateParser = function (data) {\r\n var parsedDate = new Date(data * 1000)\r\n\r\n var year = parsedDate.getFullYear()\r\n var month = parsedDate.getMonth()\r\n var day = parsedDate.getDate()\r\n\r\n var meridian = parsedDate.getHours() > 13 ? `PM` : `AM`\r\n var hour = parsedDate.getHours() > 13 ? parsedDate.getHours() - 12 : parsedDate.getHours()\r\n var minutes = parsedDate.getMinutes() < 10 ? `0${parsedDate.getMinutes()}` : parsedDate.getMinutes()\r\n\r\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\r\n\r\n return `${months[month]} ${day}, ${year} at ${hour}:${minutes} ${meridian}`\r\n}\r\n\r\n// calculates rating and returns star icons\r\nvar setRating = function (total_score, votes) {\r\n\r\n var average_score = total_score / votes\r\n\r\n var full_star = ``\r\n var half_star = ``\r\n var emply_star = ``\r\n\r\n var rating = [``, ``, ``, ``, ``]\r\n\r\n if (total_score === 0) {\r\n return rating.map(item => item = emply_star)\r\n }\r\n\r\n return rating.map(item => {\r\n if (average_score >= 1) {\r\n average_score--\r\n return item = full_star\r\n }\r\n if (average_score < 1 && average_score >= 0.5) {\r\n average_score--\r\n return item = half_star\r\n }\r\n if (average_score < 0.5) {\r\n average_score--\r\n return item = emply_star\r\n }\r\n })\r\n}\r\n\r\n// Indicates whether an object is on at least 80% within viewport or not\r\nvar isVisible = function (element) {\r\n var topY = element.getBoundingClientRect().top\r\n var bottomY = element.getBoundingClientRect().bottom\r\n var window_height = document.documentElement.clientHeight\r\n var elem_height = bottomY - topY\r\n\r\n var isVisibleOnTop = bottomY >= elem_height * 0.8\r\n var isVisibleOnbottom = bottomY <= window_height + elem_height * 0.2\r\n\r\n if (isVisibleOnTop && isVisibleOnbottom) return true\r\n else return false\r\n}\r\nvar _arrayBufferToBase64 = function (buffer) {\r\n var binary = '';\r\n var bytes = new Uint8Array(buffer);\r\n var len = bytes.byteLength;\r\n for (var i = 0; i < len; i++) {\r\n binary += String.fromCharCode(bytes[i]);\r\n }\r\n return window.btoa(binary);\r\n}\r\n\r\nvar _base64ToArrayBuffer = function (base64) {\r\n var binary_string = window.atob(base64);\r\n var len = binary_string.length;\r\n var bytes = new Uint8Array(len);\r\n for (var i = 0; i < len; i++) {\r\n bytes[i] = binary_string.charCodeAt(i);\r\n }\r\n return bytes.buffer;\r\n}\r\n\r\nvar Base64 = {\r\n // private property\r\n _keyStr: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\r\n\r\n // public method for encoding\r\n encode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = Base64._utf8_encode(input);\r\n\r\n while (i < input.length) {\r\n\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output +\r\n Base64._keyStr.charAt(enc1) + Base64._keyStr.charAt(enc2) +\r\n Base64._keyStr.charAt(enc3) + Base64._keyStr.charAt(enc4);\r\n\r\n }\r\n\r\n return output;\r\n },\r\n\r\n // public method for decoding\r\n decode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3;\r\n var enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\r\n\r\n while (i < input.length) {\r\n\r\n enc1 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc2 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc3 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc4 = Base64._keyStr.indexOf(input.charAt(i++));\r\n\r\n chr1 = (enc1 << 2) | (enc2 >> 4);\r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\r\n chr3 = ((enc3 & 3) << 6) | enc4;\r\n\r\n output = output + String.fromCharCode(chr1);\r\n\r\n if (enc3 != 64) {\r\n output = output + String.fromCharCode(chr2);\r\n }\r\n if (enc4 != 64) {\r\n output = output + String.fromCharCode(chr3);\r\n }\r\n\r\n }\r\n\r\n output = Base64._utf8_decode(output);\r\n\r\n return output;\r\n\r\n },\r\n\r\n // private method for UTF-8 encoding\r\n _utf8_encode: function (string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < string.length; n++) {\r\n\r\n var c = string.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n\r\n }\r\n\r\n return utftext;\r\n },\r\n\r\n // private method for UTF-8 decoding\r\n _utf8_decode: function (utftext) {\r\n var string = \"\";\r\n var i = 0;\r\n var c = 0, c1 = 0, c2 = 0;\r\n\r\n while (i < utftext.length) {\r\n\r\n c = utftext.charCodeAt(i);\r\n\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n }\r\n else if ((c > 191) && (c < 224)) {\r\n c2 = utftext.charCodeAt(i + 1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n }\r\n else {\r\n c2 = utftext.charCodeAt(i + 1);\r\n c3 = utftext.charCodeAt(i + 2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n\r\n }\r\n return string;\r\n },\r\n\r\n fromFile: file => new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n\r\n reader.readAsDataURL(file);\r\n reader.onloadend = () => resolve(reader.result);\r\n reader.onerror = error => reject(error);\r\n }),\r\n\r\n toFileFetch: function (base64) {\r\n return fetch(base64).then(res => {\r\n return res.blob()\r\n }).then(blob => {\r\n return new (window.wFile || window.File)([blob], \"File name\", { type: \"image/png\" })\r\n })\r\n },\r\n\r\n toFile: function (base64) {\r\n\r\n try {\r\n var arr = base64.split(','),\r\n mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]),\r\n n = bstr.length,\r\n u8arr = new Uint8Array(n);\r\n\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n var file = new (window.wFile || window.File)([u8arr], \"Filename\", { type: mime });\r\n\r\n return Promise.resolve(file)\r\n }\r\n catch (e) {\r\n return Promise.reject(e)\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nf.copyArrayBuffer = function(src){\r\n var dst = new ArrayBuffer(src.byteLength);\r\n new Uint8Array(dst).set(new Uint8Array(src));\r\n return dst;\r\n}\r\n\r\nf.readFile = function (file) {\r\n\r\n let reader = new FileReader();\r\n\r\n reader.readAsArrayBuffer(file);\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n reader.onload = function () {\r\n resolve(reader.result);\r\n };\r\n\r\n reader.onerror = function () {\r\n reject(reader.error);\r\n };\r\n })\r\n}\r\n\r\nf.fetchLocal = function (url) {\r\n\r\n\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest\r\n\r\n xhr.onload = function () {\r\n\r\n var type = xhr.getResponseHeader('content-type')\r\n\r\n\r\n resolve({\r\n data: new Blob([xhr.response], { type: type, name: 'file' })\r\n })\r\n\r\n // resolve()\r\n }\r\n\r\n xhr.onerror = function (e) {\r\n console.error(e, url)\r\n reject(new TypeError('Local request failed'))\r\n }\r\n\r\n xhr.open('GET', url)\r\n xhr.responseType = \"arraybuffer\";\r\n xhr.send(null)\r\n })\r\n};\r\n\r\n\r\n\r\nf.saveFileCordova = function(file, name, clbk, todownloads){\r\n\r\n var storageLocation = \"\";\r\n\r\n switch (device.platform) {\r\n case \"Android\":\r\n storageLocation = 'file:///storage/emulated/0/'; //LocalFileSystem.PERSISTENT\r\n break;\r\n case \"iOS\":\r\n storageLocation = cordova.file.cacheDirectory;\r\n break;\r\n }\r\n\r\n\r\n var onsuccess = function (fileSystem) {\r\n\r\n fileSystem.getDirectory('Download', { exclusive: false }, function (directory) {\r\n\r\n directory.getFile(name, { create: true, exclusive: false }, function (entry) {\r\n // After you save the file, you can access it with this URL\r\n var myFileUrl = entry.toURL();\r\n\r\n\r\n entry.createWriter(function (writer) {\r\n\r\n writer.onwriteend = function (evt) {\r\n //sitemessage(\"File \" + name + \" successfully downloaded\");\r\n\r\n if (window.galleryRefresh){\r\n\r\n window.galleryRefresh.refresh(myFileUrl, function (msg) {\r\n\r\n }, function (err) {\r\n\r\n\r\n })\r\n\r\n }\r\n\r\n if (clbk)\r\n clbk({\r\n name,\r\n url : myFileUrl\r\n })\r\n };\r\n\r\n writer.onerror = function (e) {\r\n\r\n if (clbk)\r\n clbk(null, e)\r\n\r\n };\r\n\r\n // Write to the file\r\n writer.seek(0);\r\n\r\n writer.write(file);\r\n\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file writer, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n\r\n })\r\n }\r\n\r\n var onerror = function (evt) {\r\n if(clbk) clbk(null, evt)\r\n }\r\n \r\n if(todownloads){\r\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){\r\n\r\n\r\n onsuccess(fileSystem.root)\r\n }, onerror)\r\n }\r\n else{\r\n window.resolveLocalFileSystemURL(storageLocation, onsuccess, onerror)\r\n }\r\n\r\n}\r\n\r\nfunction iOS() {\r\n return [\r\n 'iPad Simulator',\r\n 'iPhone Simulator',\r\n 'iPod Simulator',\r\n 'iPad',\r\n 'iPhone',\r\n 'iPod'\r\n ].includes(navigator.platform)\r\n // iPad on iOS 13 detection\r\n || (navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document)\r\n}\r\n\r\nf.isios = function () {\r\n return (window.cordova && window.device && deep(window, 'device.platform') == 'iOS') || iOS()\r\n}\r\n\r\nf.now = function (date) {\r\n var now = date || (new Date);\r\n var UTCseconds = (now.getTime() + now.getTimezoneOffset() * 60 * 1000);\r\n var d = new Date(UTCseconds);\r\n d.toString();\r\n\r\n return d\r\n}\r\n\r\nf.date = {\r\n addseconds: function (now, seconds) {\r\n if (!now) now = new Date\r\n\r\n var ntime = now.getTime() + seconds * 1000\r\n var d = new Date(ntime);\r\n\r\n return d\r\n }\r\n}\r\n\r\nf.getservers = function(arr, mult, address) {\r\n\r\n if(!arr.length) return []\r\n\r\n mult || (mult = 1)\r\n\r\n if(mult > arr.length) mult = arr.length\r\n\r\n var mutations = f.permutations(arr, mult);\r\n\r\n var index = f.helpers.base58.decode(address) % mutations.length;\r\n\r\n return mutations[index]\r\n}\r\n\r\nf.helpers = {\r\n base58: {\r\n ALPHABET: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',\r\n ALPHABET_MAP: {},\r\n i: 0,\r\n\r\n encode(buffer) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var carry, digits, j;\r\n if (buffer.length === 0) {\r\n return '';\r\n }\r\n i = void 0;\r\n j = void 0;\r\n digits = [0];\r\n i = 0;\r\n while (i < buffer.length) {\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] <<= 8;\r\n j++;\r\n }\r\n digits[0] += buffer[i];\r\n carry = 0;\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] += carry;\r\n carry = (digits[j] / 58) | 0;\r\n digits[j] %= 58;\r\n ++j;\r\n }\r\n while (carry) {\r\n digits.push(carry % 58);\r\n carry = (carry / 58) | 0;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (buffer[i] === 0 && i < buffer.length - 1) {\r\n digits.push(0);\r\n i++;\r\n }\r\n return digits\r\n .reverse()\r\n .map(function (digit) {\r\n return ALPHABET[digit];\r\n })\r\n .join('');\r\n },\r\n\r\n decode(string) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var bytes, c, carry, j;\r\n if (string.length === 0) {\r\n return new (\r\n typeof Uint8Array !== 'undefined' && Uint8Array !== null\r\n ? Uint8Array\r\n : Buffer\r\n )(0);\r\n }\r\n i = void 0;\r\n j = void 0;\r\n bytes = [0];\r\n i = 0;\r\n while (i < string.length) {\r\n c = string[i];\r\n if (!(c in ALPHABET_MAP)) {\r\n throw (\r\n \"Base58.decode received unacceptable input. Character '\" +\r\n c +\r\n \"' is not in the Base58 alphabet.\"\r\n );\r\n }\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] *= 58;\r\n j++;\r\n }\r\n bytes[0] += ALPHABET_MAP[c];\r\n carry = 0;\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] += carry;\r\n carry = bytes[j] >> 8;\r\n bytes[j] &= 0xff;\r\n ++j;\r\n }\r\n while (carry) {\r\n bytes.push(carry & 0xff);\r\n carry >>= 8;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (string[i] === '1' && i < string.length - 1) {\r\n bytes.push(0);\r\n i++;\r\n }\r\n\r\n const outputArray = new Uint8Array(bytes.reverse());\r\n\r\n let buffer = Buffer.from(outputArray);\r\n return buffer.readUIntBE(0, outputArray.length);\r\n },\r\n },\r\n};\r\n\r\nf.getCaretPosition = function(ctrl){\r\n // IE < 9 Support \r\n if (document.selection) {\r\n ctrl.focus();\r\n var range = document.selection.createRange();\r\n var rangelen = range.text.length;\r\n range.moveStart('character', -ctrl.value.length);\r\n var start = range.text.length - rangelen;\r\n return {\r\n 'start': start,\r\n 'end': start + rangelen\r\n };\r\n } // IE >=9 and other browsers\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\r\n return {\r\n 'start': ctrl.selectionStart,\r\n 'end': ctrl.selectionEnd\r\n };\r\n } else {\r\n return {\r\n 'start': 0,\r\n 'end': 0\r\n };\r\n }\r\n}\r\n\r\nf.setCaretPosition = function(ctrl, start, end) {\r\n // IE >= 9 and other browsers\r\n if (ctrl.setSelectionRange) {\r\n ctrl.focus();\r\n ctrl.setSelectionRange(start, end);\r\n }\r\n // IE < 9 \r\n else if (ctrl.createTextRange) {\r\n var range = ctrl.createTextRange();\r\n range.collapse(true);\r\n range.moveEnd('character', end);\r\n range.moveStart('character', start);\r\n range.select();\r\n }\r\n}\r\n\r\nf.ObjDiff = ObjDiff\r\nf._arrayBufferToBase64 = _arrayBufferToBase64\r\nf._base64ToArrayBuffer = _base64ToArrayBuffer\r\nf.Base64 = Base64\r\nf.getmatrixid = getmatrixid\r\nf.getMatrixIdFull = getMatrixIdFull\r\nf.formatBytes = formatBytes\r\nf.filterByUserId = filterByUserId\r\nf.trim = trim\r\nf.isAndroid = isAndroid\r\nf.isMobile = isMobile\r\nf.isTablet = isTablet\r\nf.rand = rand\r\nf.group = group\r\nf.flball = flball\r\nf.flb = flb\r\nf.flbs = flbs\r\nf.flbb = flbb\r\nf.makeid = makeid\r\nf.scrollTo = _scrollTo\r\nf.stringEq = stringEq\r\nf.pretry = pretry\r\nf.retry = retry\r\nf.retryLazy = retryLazy\r\nf.slowMade = slowMade\r\nf.renderFrameEqualizer = renderFrameEqualizer\r\nf.hexEncode = hexEncode\r\nf.hexDecode = hexDecode\r\nf.imgDimensions = imgDimensions\r\nf.getUrl = getUrl\r\nf.getTxt = getTxt\r\nf.poketnetUrlParser = poketnetUrlParser\r\nf.textFormatter = textFormatter\r\nf.urlSeparator = urlSeparator\r\nf.dateParser = dateParser\r\nf.setRating = setRating\r\nf.videoUrlParser = videoUrlParser\r\nf.isVisible = isVisible\r\nf.copytext = copytext\r\nf.md5 = md5\r\nf.knsite = knsite\r\nf.stringify = stringify\r\nexport default f","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","import listToStyles from './listToStyles'\n\nexport default function addStylesToShadowDOM (parentId, list, shadowRoot) {\n var styles = listToStyles(parentId, list)\n addStyles(styles, shadowRoot)\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nfunction addStyles (styles /* Array */, shadowRoot) {\n const injectedStyles =\n shadowRoot._injectedStyles ||\n (shadowRoot._injectedStyles = {})\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i]\n var style = injectedStyles[item.id]\n if (!style) {\n for (var j = 0; j < item.parts.length; j++) {\n addStyle(item.parts[j], shadowRoot)\n }\n injectedStyles[item.id] = true\n }\n }\n}\n\nfunction createStyleElement (shadowRoot) {\n var styleElement = document.createElement('style')\n styleElement.type = 'text/css'\n shadowRoot.appendChild(styleElement)\n return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */, shadowRoot) {\n var styleElement = createStyleElement(shadowRoot)\n var css = obj.css\n var media = obj.media\n var sourceMap = obj.sourceMap\n\n if (media) {\n styleElement.setAttribute('media', media)\n }\n\n if (sourceMap) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n }\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild)\n }\n styleElement.appendChild(document.createTextNode(css))\n }\n}\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.AutoDiscovery = void 0;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _url = require(\"url\");\r\n\r\n/*\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/** @module auto-discovery */\r\n// Dev note: Auto discovery is part of the spec.\r\n// See: https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery\r\n\r\n/**\r\n * Description for what an automatically discovered client configuration\r\n * would look like. Although this is a class, it is recommended that it\r\n * be treated as an interface definition rather than as a class.\r\n *\r\n * Additional properties than those defined here may be present, and\r\n * should follow the Java package naming convention.\r\n */\r\nclass DiscoveredClientConfig {\r\n // eslint-disable-line no-unused-vars\r\n // Dev note: this is basically a copy/paste of the .well-known response\r\n // object as defined in the spec. It does have additional information,\r\n // however. Overall, this exists to serve as a place for documentation\r\n // and not functionality.\r\n // See https://matrix.org/docs/spec/client_server/r0.4.0.html#get-well-known-matrix-client\r\n constructor() {\r\n /**\r\n * The homeserver configuration the client should use. This will\r\n * always be present on the object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n this[\"m.homeserver\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey. Additionally,\r\n * if this is not AutoDiscovery.SUCCESS then the client should\r\n * assume the other properties in the client config (such as\r\n * the identity server configuration) are not valid.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * If the state is AutoDiscovery.FAIL_ERROR or .FAIL_PROMPT\r\n * then this will contain a human-readable (English) message\r\n * for what went wrong. If the state is none of those previously\r\n * mentioned, this will be falsey.\r\n */\r\n error: \"Something went wrong\",\r\n\r\n /**\r\n * The base URL clients should use to talk to the homeserver,\r\n * particularly for the login process. May be falsey if the\r\n * state is not AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://matrix.org\"\r\n };\r\n /**\r\n * The identity server configuration the client should use. This\r\n * will always be present on teh object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n\r\n this[\"m.identity_server\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * The base URL clients should use for interacting with the\r\n * identity server. May be falsey if the state is not\r\n * AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://vector.im\"\r\n };\r\n }\r\n\r\n}\r\n/**\r\n * Utilities for automatically discovery resources, such as homeservers\r\n * for users to log in to.\r\n */\r\n\r\n\r\nclass AutoDiscovery {\r\n // Dev note: the constants defined here are related to but not\r\n // exactly the same as those in the spec. This is to hopefully\r\n // translate the meaning of the states in the spec, but also\r\n // support our own if needed.\r\n static get ERROR_INVALID() {\r\n return \"Invalid homeserver discovery response\";\r\n }\r\n\r\n static get ERROR_GENERIC_FAILURE() {\r\n return \"Failed to get autodiscovery configuration from server\";\r\n }\r\n\r\n static get ERROR_INVALID_HS_BASE_URL() {\r\n return \"Invalid base_url for m.homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_HOMESERVER() {\r\n return \"Homeserver URL does not appear to be a valid Matrix homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_IS_BASE_URL() {\r\n return \"Invalid base_url for m.identity_server\";\r\n }\r\n\r\n static get ERROR_INVALID_IDENTITY_SERVER() {\r\n return \"Identity server URL does not appear to be a valid identity server\";\r\n }\r\n\r\n static get ERROR_INVALID_IS() {\r\n return \"Invalid identity server discovery response\";\r\n }\r\n\r\n static get ERROR_MISSING_WELLKNOWN() {\r\n return \"No .well-known JSON file found\";\r\n }\r\n\r\n static get ERROR_INVALID_JSON() {\r\n return \"Invalid JSON\";\r\n }\r\n\r\n static get ALL_ERRORS() {\r\n return [AutoDiscovery.ERROR_INVALID, AutoDiscovery.ERROR_GENERIC_FAILURE, AutoDiscovery.ERROR_INVALID_HS_BASE_URL, AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IS_BASE_URL, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, AutoDiscovery.ERROR_INVALID_IS, AutoDiscovery.ERROR_MISSING_WELLKNOWN, AutoDiscovery.ERROR_INVALID_JSON];\r\n }\r\n /**\r\n * The auto discovery failed. The client is expected to communicate\r\n * the error to the user and refuse logging in.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_ERROR() {\r\n return \"FAIL_ERROR\";\r\n }\r\n /**\r\n * The auto discovery failed, however the client may still recover\r\n * from the problem. The client is recommended to that the same\r\n * action it would for PROMPT while also warning the user about\r\n * what went wrong. The client may also treat this the same as\r\n * a FAIL_ERROR state.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_PROMPT() {\r\n return \"FAIL_PROMPT\";\r\n }\r\n /**\r\n * The auto discovery didn't fail but did not find anything of\r\n * interest. The client is expected to prompt the user for more\r\n * information, or fail if it prefers.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get PROMPT() {\r\n return \"PROMPT\";\r\n }\r\n /**\r\n * The auto discovery was successful.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get SUCCESS() {\r\n return \"SUCCESS\";\r\n }\r\n /**\r\n * Validates and verifies client configuration information for purposes\r\n * of logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be included, and will be transparently brought into the\r\n * response object unaltered.\r\n * @param {string} wellknown The configuration object itself, as returned\r\n * by the .well-known auto-discovery endpoint.\r\n * @return {Promise} Resolves to the verified\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when verification fails.\r\n */\r\n\r\n\r\n static async fromDiscoveryConfig(wellknown) {\r\n // Step 1 is to get the config, which is provided to us here.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n };\r\n\r\n if (!wellknown || !wellknown[\"m.homeserver\"]) {\r\n _logger.logger.error(\"No m.homeserver key in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n return Promise.resolve(clientConfig);\r\n }\r\n\r\n if (!wellknown[\"m.homeserver\"][\"base_url\"]) {\r\n _logger.logger.error(\"No m.homeserver base_url in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Make sure the homeserver URL is valid *looking*. We'll make\r\n // sure it points to a homeserver in Step 3.\r\n\r\n\r\n const hsUrl = this._sanitizeWellKnownUrl(wellknown[\"m.homeserver\"][\"base_url\"]);\r\n\r\n if (!hsUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.homeserver\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 3: Make sure the homeserver URL points to a homeserver.\r\n\r\n\r\n const hsVersions = await this._fetchWellKnownObject(`${hsUrl}/_matrix/client/versions`);\r\n\r\n if (!hsVersions || !hsVersions.raw[\"versions\"]) {\r\n _logger.logger.error(\"Invalid /versions response\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER; // Supply the base_url to the caller because they may be ignoring liveliness\r\n // errors, like this one.\r\n\r\n clientConfig[\"m.homeserver\"].base_url = hsUrl;\r\n return Promise.resolve(clientConfig);\r\n } // Step 4: Now that the homeserver looks valid, update our client config.\r\n\r\n\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: hsUrl\r\n }; // Step 5: Try to pull out the identity server configuration\r\n\r\n let isUrl = \"\";\r\n\r\n if (wellknown[\"m.identity_server\"]) {\r\n // We prepare a failing identity server response to save lines later\r\n // in this branch.\r\n const failingClientConfig = {\r\n \"m.homeserver\": clientConfig[\"m.homeserver\"],\r\n \"m.identity_server\": {\r\n state: AutoDiscovery.FAIL_PROMPT,\r\n error: AutoDiscovery.ERROR_INVALID_IS,\r\n base_url: null\r\n }\r\n }; // Step 5a: Make sure the URL is valid *looking*. We'll make sure it\r\n // points to an identity server in Step 5b.\r\n\r\n isUrl = this._sanitizeWellKnownUrl(wellknown[\"m.identity_server\"][\"base_url\"]);\r\n\r\n if (!isUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.identity_server\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IS_BASE_URL;\r\n return Promise.resolve(failingClientConfig);\r\n } // Step 5b: Verify there is an identity server listening on the provided\r\n // URL.\r\n\r\n\r\n const isResponse = await this._fetchWellKnownObject(`${isUrl}/_matrix/identity/api/v1`);\r\n\r\n if (!isResponse || !isResponse.raw || isResponse.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"Invalid /api/v1 response\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER; // Supply the base_url to the caller because they may be ignoring\r\n // liveliness errors, like this one.\r\n\r\n failingClientConfig[\"m.identity_server\"].base_url = isUrl;\r\n return Promise.resolve(failingClientConfig);\r\n }\r\n } // Step 6: Now that the identity server is valid, or never existed,\r\n // populate the IS section.\r\n\r\n\r\n if (isUrl && isUrl.length > 0) {\r\n clientConfig[\"m.identity_server\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: isUrl\r\n };\r\n } // Step 7: Copy any other keys directly into the clientConfig. This is for\r\n // things like custom configuration of services.\r\n\r\n\r\n Object.keys(wellknown).map(k => {\r\n if (k === \"m.homeserver\" || k === \"m.identity_server\") {\r\n // Only copy selected parts of the config to avoid overwriting\r\n // properties computed by the validation logic above.\r\n const notProps = [\"error\", \"state\", \"base_url\"];\r\n\r\n for (const prop of Object.keys(wellknown[k])) {\r\n if (notProps.includes(prop)) continue;\r\n clientConfig[k][prop] = wellknown[k][prop];\r\n }\r\n } else {\r\n // Just copy the whole thing over otherwise\r\n clientConfig[k] = wellknown[k];\r\n }\r\n }); // Step 8: Give the config to the caller (finally)\r\n\r\n return Promise.resolve(clientConfig);\r\n }\r\n /**\r\n * Attempts to automatically discover client configuration information\r\n * prior to logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be discovered, and will be transparently included in the\r\n * response object unaltered.\r\n * @param {string} domain The homeserver domain to perform discovery\r\n * on. For example, \"matrix.org\".\r\n * @return {Promise} Resolves to the discovered\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when discovery fails.\r\n */\r\n\r\n\r\n static async findClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n } // We use a .well-known lookup for all cases. According to the spec, we\r\n // can do other discovery mechanisms if we want such as custom lookups\r\n // however we won't bother with that here (mostly because the spec only\r\n // supports .well-known right now).\r\n //\r\n // By using .well-known, we need to ensure we at least pull out a URL\r\n // for the homeserver. We don't really need an identity server configuration\r\n // but will return one anyways (with state PROMPT) to make development\r\n // easier for clients. If we can't get a homeserver URL, all bets are\r\n // off on the rest of the config and we'll assume it is invalid too.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n\r\n\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n }; // Step 1: Actually request the .well-known JSON file and make sure it\r\n // at least has a homeserver definition.\r\n\r\n const wellknown = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n\r\n if (!wellknown || wellknown.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"No response or error when parsing .well-known\");\r\n\r\n if (wellknown.reason) _logger.logger.error(wellknown.reason);\r\n\r\n if (wellknown.action === \"IGNORE\") {\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n };\r\n } else {\r\n // this can only ever be FAIL_PROMPT at this point.\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n }\r\n\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Validate and parse the config\r\n\r\n\r\n return AutoDiscovery.fromDiscoveryConfig(wellknown.raw);\r\n }\r\n /**\r\n * Gets the raw discovery client configuration for the given domain name.\r\n * Should only be used if there's no validation to be done on the resulting\r\n * object, otherwise use findClientConfig().\r\n * @param {string} domain The domain to get the client config for.\r\n * @returns {Promise} Resolves to the domain's client config. Can\r\n * be an empty object.\r\n */\r\n\r\n\r\n static async getRawClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n }\r\n\r\n const response = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n if (!response) return {};\r\n return response.raw || {};\r\n }\r\n /**\r\n * Sanitizes a given URL to ensure it is either an HTTP or HTTP URL and\r\n * is suitable for the requirements laid out by .well-known auto discovery.\r\n * If valid, the URL will also be stripped of any trailing slashes.\r\n * @param {string} url The potentially invalid URL to sanitize.\r\n * @return {string|boolean} The sanitized URL or a falsey value if the URL is invalid.\r\n * @private\r\n */\r\n\r\n\r\n static _sanitizeWellKnownUrl(url) {\r\n if (!url) return false;\r\n\r\n try {\r\n // We have to try and parse the URL using the NodeJS URL\r\n // library if we're on NodeJS and use the browser's URL\r\n // library when we're in a browser. To accomplish this, we\r\n // try the NodeJS version first and fall back to the browser.\r\n let parsed = null;\r\n\r\n try {\r\n if (_url.URL) parsed = new _url.URL(url);else parsed = new URL(url);\r\n } catch (e) {\r\n parsed = new URL(url);\r\n }\r\n\r\n if (!parsed || !parsed.hostname) return false;\r\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return false;\r\n const port = parsed.port ? `:${parsed.port}` : \"\";\r\n const path = parsed.pathname ? parsed.pathname : \"\";\r\n let saferUrl = `${parsed.protocol}//${parsed.hostname}${port}${path}`;\r\n\r\n if (saferUrl.endsWith(\"/\")) {\r\n saferUrl = saferUrl.substring(0, saferUrl.length - 1);\r\n }\r\n\r\n return saferUrl;\r\n } catch (e) {\r\n _logger.logger.error(e);\r\n\r\n return false;\r\n }\r\n }\r\n /**\r\n * Fetches a JSON object from a given URL, as expected by all .well-known\r\n * related lookups. If the server gives a 404 then the `action` will be\r\n * IGNORE. If the server returns something that isn't JSON, the `action`\r\n * will be FAIL_PROMPT. For any other failure the `action` will be FAIL_PROMPT.\r\n *\r\n * The returned object will be a result of the call in object form with\r\n * the following properties:\r\n * raw: The JSON object returned by the server.\r\n * action: One of SUCCESS, IGNORE, or FAIL_PROMPT.\r\n * reason: Relatively human readable description of what went wrong.\r\n * error: The actual Error, if one exists.\r\n * @param {string} url The URL to fetch a JSON object from.\r\n * @return {Promise} Resolves to the returned state.\r\n * @private\r\n */\r\n\r\n\r\n static async _fetchWellKnownObject(url) {\r\n return new Promise(function (resolve, reject) {\r\n const request = require(\"./matrix\").getRequest();\r\n\r\n if (!request) throw new Error(\"No request library available\");\r\n request({\r\n method: \"GET\",\r\n uri: url,\r\n timeout: 5000\r\n }, (err, response, body) => {\r\n if (err || response && (response.statusCode < 200 || response.statusCode >= 300)) {\r\n let action = \"FAIL_PROMPT\";\r\n let reason = (err ? err.message : null) || \"General failure\";\r\n\r\n if (response && response.statusCode === 404) {\r\n action = \"IGNORE\";\r\n reason = AutoDiscovery.ERROR_MISSING_WELLKNOWN;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: action,\r\n reason: reason,\r\n error: err\r\n });\r\n return;\r\n }\r\n\r\n try {\r\n resolve({\r\n raw: JSON.parse(body),\r\n action: \"SUCCESS\"\r\n });\r\n } catch (e) {\r\n let reason = AutoDiscovery.ERROR_INVALID;\r\n\r\n if (e.name === \"SyntaxError\") {\r\n reason = AutoDiscovery.ERROR_INVALID_JSON;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: \"FAIL_PROMPT\",\r\n reason: reason,\r\n error: e\r\n });\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.AutoDiscovery = AutoDiscovery;","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"label[data-v-6b3704ba]{display:inline}.likelink[data-v-6b3704ba]{text-decoration:underline;cursor:pointer}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.setNow = setNow;\r\nexports.setTimeout = setTimeout;\r\nexports.clearTimeout = clearTimeout;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* A re-implementation of the javascript callback functions (setTimeout,\r\n * clearTimeout; setInterval and clearInterval are not yet implemented) which\r\n * try to improve handling of large clock jumps (as seen when\r\n * suspending/resuming the system).\r\n *\r\n * In particular, if a timeout would have fired while the system was suspended,\r\n * it will instead fire as soon as possible after resume.\r\n */\r\n// we schedule a callback at least this often, to check if we've missed out on\r\n// some wall-clock time due to being suspended.\r\nconst TIMER_CHECK_PERIOD_MS = 1000; // counter, for making up ids to return from setTimeout\r\n\r\nlet _count = 0; // the key for our callback with the real global.setTimeout\r\n\r\nlet _realCallbackKey; // a sorted list of the callbacks to be run.\r\n// each is an object with keys [runAt, func, params, key].\r\n\r\n\r\nconst _callbackList = []; // var debuglog = logger.log.bind(logger);\r\n\r\nconst debuglog = function () {};\r\n/**\r\n * Replace the function used by this module to get the current time.\r\n *\r\n * Intended for use by the unit tests.\r\n *\r\n * @param {function} [f] function which should return a millisecond counter\r\n *\r\n * @internal\r\n */\r\n\r\n\r\nfunction setNow(f) {\r\n _now = f || Date.now;\r\n}\r\n\r\nlet _now = Date.now;\r\n/**\r\n * reimplementation of window.setTimeout, which will call the callback if\r\n * the wallclock time goes past the deadline.\r\n *\r\n * @param {function} func callback to be called after a delay\r\n * @param {Number} delayMs number of milliseconds to delay by\r\n *\r\n * @return {Number} an identifier for this callback, which may be passed into\r\n * clearTimeout later.\r\n */\r\n\r\nfunction setTimeout(func, delayMs) {\r\n delayMs = delayMs || 0;\r\n\r\n if (delayMs < 0) {\r\n delayMs = 0;\r\n }\r\n\r\n const params = Array.prototype.slice.call(arguments, 2);\r\n const runAt = _now() + delayMs;\r\n const key = _count++;\r\n debuglog(\"setTimeout: scheduling cb\", key, \"at\", runAt, \"(delay\", delayMs, \")\");\r\n const data = {\r\n runAt: runAt,\r\n func: func,\r\n params: params,\r\n key: key\r\n }; // figure out where it goes in the list\r\n\r\n const idx = binarySearch(_callbackList, function (el) {\r\n return el.runAt - runAt;\r\n });\r\n\r\n _callbackList.splice(idx, 0, data);\r\n\r\n _scheduleRealCallback();\r\n\r\n return key;\r\n}\r\n/**\r\n * reimplementation of window.clearTimeout, which mirrors setTimeout\r\n *\r\n * @param {Number} key result from an earlier setTimeout call\r\n */\r\n\r\n\r\nfunction clearTimeout(key) {\r\n if (_callbackList.length === 0) {\r\n return;\r\n } // remove the element from the list\r\n\r\n\r\n let i;\r\n\r\n for (i = 0; i < _callbackList.length; i++) {\r\n const cb = _callbackList[i];\r\n\r\n if (cb.key == key) {\r\n _callbackList.splice(i, 1);\r\n\r\n break;\r\n }\r\n } // iff it was the first one in the list, reschedule our callback.\r\n\r\n\r\n if (i === 0) {\r\n _scheduleRealCallback();\r\n }\r\n} // use the real global.setTimeout to schedule a callback to _runCallbacks.\r\n\r\n\r\nfunction _scheduleRealCallback() {\r\n if (_realCallbackKey) {\r\n global.clearTimeout(_realCallbackKey);\r\n }\r\n\r\n const first = _callbackList[0];\r\n\r\n if (!first) {\r\n debuglog(\"_scheduleRealCallback: no more callbacks, not rescheduling\");\r\n return;\r\n }\r\n\r\n const now = _now();\r\n\r\n const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);\r\n debuglog(\"_scheduleRealCallback: now:\", now, \"delay:\", delayMs);\r\n _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);\r\n}\r\n\r\nfunction _runCallbacks() {\r\n let cb;\r\n\r\n const now = _now();\r\n\r\n debuglog(\"_runCallbacks: now:\", now); // get the list of things to call\r\n\r\n const callbacksToRun = [];\r\n\r\n while (true) {\r\n const first = _callbackList[0];\r\n\r\n if (!first || first.runAt > now) {\r\n break;\r\n }\r\n\r\n cb = _callbackList.shift();\r\n debuglog(\"_runCallbacks: popping\", cb.key);\r\n callbacksToRun.push(cb);\r\n } // reschedule the real callback before running our functions, to\r\n // keep the codepaths the same whether or not our functions\r\n // register their own setTimeouts.\r\n\r\n\r\n _scheduleRealCallback();\r\n\r\n for (let i = 0; i < callbacksToRun.length; i++) {\r\n cb = callbacksToRun[i];\r\n\r\n try {\r\n cb.func.apply(global, cb.params);\r\n } catch (e) {\r\n _logger.logger.error(\"Uncaught exception in callback function\", e.stack || e);\r\n }\r\n }\r\n}\r\n/* search in a sorted array.\r\n *\r\n * returns the index of the last element for which func returns\r\n * greater than zero, or array.length if no such element exists.\r\n */\r\n\r\n\r\nfunction binarySearch(array, func) {\r\n // min is inclusive, max exclusive.\r\n let min = 0;\r\n let max = array.length;\r\n\r\n while (min < max) {\r\n const mid = min + max >> 1;\r\n const res = func(array[mid]);\r\n\r\n if (res > 0) {\r\n // the element at 'mid' is too big; set it as the new max.\r\n max = mid;\r\n } else {\r\n // the element at 'mid' is too small. 'min' is inclusive, so +1.\r\n min = mid + 1;\r\n }\r\n } // presumably, min==max now.\r\n\r\n\r\n return min;\r\n}","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {\r\n request: true,\r\n getRequest: true,\r\n wrapRequest: true,\r\n setCryptoStoreFactory: true,\r\n createClient: true,\r\n ContentHelpers: true,\r\n createNewMatrixCall: true,\r\n setMatrixCallAudioOutput: true,\r\n setMatrixCallAudioInput: true,\r\n setMatrixCallVideoInput: true\r\n};\r\nexports.request = request;\r\nexports.getRequest = getRequest;\r\nexports.wrapRequest = wrapRequest;\r\nexports.setCryptoStoreFactory = setCryptoStoreFactory;\r\nexports.createClient = createClient;\r\nObject.defineProperty(exports, \"createNewMatrixCall\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.createNewMatrixCall;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioOutput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioOutput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioInput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallVideoInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setVideoInput;\r\n }\r\n});\r\nexports.ContentHelpers = void 0;\r\n\r\nvar _memoryCryptoStore = require(\"./crypto/store/memory-crypto-store\");\r\n\r\nObject.keys(_memoryCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memoryCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memoryCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _memory = require(\"./store/memory\");\r\n\r\nObject.keys(_memory).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memory[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memory[key];\r\n }\r\n });\r\n});\r\n\r\nvar _scheduler = require(\"./scheduler\");\r\n\r\nObject.keys(_scheduler).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _scheduler[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _scheduler[key];\r\n }\r\n });\r\n});\r\n\r\nvar _client = require(\"./client\");\r\n\r\nObject.keys(_client).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _client[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _client[key];\r\n }\r\n });\r\n});\r\n\r\nvar _httpApi = require(\"./http-api\");\r\n\r\nObject.keys(_httpApi).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _httpApi[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _httpApi[key];\r\n }\r\n });\r\n});\r\n\r\nvar _autodiscovery = require(\"./autodiscovery\");\r\n\r\nObject.keys(_autodiscovery).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _autodiscovery[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _autodiscovery[key];\r\n }\r\n });\r\n});\r\n\r\nvar _syncAccumulator = require(\"./sync-accumulator\");\r\n\r\nObject.keys(_syncAccumulator).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _syncAccumulator[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _syncAccumulator[key];\r\n }\r\n });\r\n});\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\nObject.keys(_errors).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _errors[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _errors[key];\r\n }\r\n });\r\n});\r\n\r\nvar _event = require(\"./models/event\");\r\n\r\nObject.keys(_event).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _event[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _event[key];\r\n }\r\n });\r\n});\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nObject.keys(_room).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _room[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _room[key];\r\n }\r\n });\r\n});\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nObject.keys(_group).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _group[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _group[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nObject.keys(_eventTimeline).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimeline[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimeline[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimelineSet = require(\"./models/event-timeline-set\");\r\n\r\nObject.keys(_eventTimelineSet).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimelineSet[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimelineSet[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomMember = require(\"./models/room-member\");\r\n\r\nObject.keys(_roomMember).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomMember[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomMember[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomState = require(\"./models/room-state\");\r\n\r\nObject.keys(_roomState).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomState[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomState[key];\r\n }\r\n });\r\n});\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nObject.keys(_user).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _user[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _user[key];\r\n }\r\n });\r\n});\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nObject.keys(_filter).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _filter[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _filter[key];\r\n }\r\n });\r\n});\r\n\r\nvar _timelineWindow = require(\"./timeline-window\");\r\n\r\nObject.keys(_timelineWindow).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _timelineWindow[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _timelineWindow[key];\r\n }\r\n });\r\n});\r\n\r\nvar _interactiveAuth = require(\"./interactive-auth\");\r\n\r\nObject.keys(_interactiveAuth).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _interactiveAuth[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _interactiveAuth[key];\r\n }\r\n });\r\n});\r\n\r\nvar _serviceTypes = require(\"./service-types\");\r\n\r\nObject.keys(_serviceTypes).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _serviceTypes[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _serviceTypes[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddb = require(\"./store/indexeddb\");\r\n\r\nObject.keys(_indexeddb).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddb[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddb[key];\r\n }\r\n });\r\n});\r\n\r\nvar _webstorage = require(\"./store/session/webstorage\");\r\n\r\nObject.keys(_webstorage).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _webstorage[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _webstorage[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddbCryptoStore = require(\"./crypto/store/indexeddb-crypto-store\");\r\n\r\nObject.keys(_indexeddbCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddbCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddbCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _contentRepo = require(\"./content-repo\");\r\n\r\nObject.keys(_contentRepo).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _contentRepo[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _contentRepo[key];\r\n }\r\n });\r\n});\r\n\r\nvar _ContentHelpers = _interopRequireWildcard(require(\"./content-helpers\"));\r\n\r\nexports.ContentHelpers = _ContentHelpers;\r\n\r\nvar _call = require(\"./webrtc/call\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n// expose the underlying request object so different environments can use\r\n// different request libs (e.g. request or browser-request)\r\nlet requestInstance;\r\n/**\r\n * The function used to perform HTTP requests. Only use this if you want to\r\n * use a different HTTP library, e.g. Angular's $http. This should\r\n * be set prior to calling {@link createClient}.\r\n * @param {requestFunction} r The request function to use.\r\n */\r\n\r\nfunction request(r) {\r\n requestInstance = r;\r\n}\r\n/**\r\n * Return the currently-set request function.\r\n * @return {requestFunction} The current request function.\r\n */\r\n\r\n\r\nfunction getRequest() {\r\n return requestInstance;\r\n}\r\n/**\r\n * Apply wrapping code around the request function. The wrapper function is\r\n * installed as the new request handler, and when invoked it is passed the\r\n * previous value, along with the options and callback arguments.\r\n * @param {requestWrapperFunction} wrapper The wrapping function.\r\n */\r\n\r\n\r\nfunction wrapRequest(wrapper) {\r\n const origRequest = requestInstance;\r\n\r\n requestInstance = function (options, callback) {\r\n return wrapper(origRequest, options, callback);\r\n };\r\n}\r\n\r\nlet cryptoStoreFactory = () => new _memoryCryptoStore.MemoryCryptoStore();\r\n/**\r\n * Configure a different factory to be used for creating crypto stores\r\n *\r\n * @param {Function} fac a function which will return a new\r\n * {@link module:crypto.store.base~CryptoStore}.\r\n */\r\n\r\n\r\nfunction setCryptoStoreFactory(fac) {\r\n cryptoStoreFactory = fac;\r\n}\r\n\r\n/**\r\n * Construct a Matrix Client. Similar to {@link module:client.MatrixClient}\r\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\r\n * @param {(Object|string)} opts The configuration options for this client. If\r\n * this is a string, it is assumed to be the base URL. These configuration\r\n * options will be passed directly to {@link module:client.MatrixClient}.\r\n * @param {Object} opts.store If not set, defaults to\r\n * {@link module:store/memory.MemoryStore}.\r\n * @param {Object} opts.scheduler If not set, defaults to\r\n * {@link module:scheduler~MatrixScheduler}.\r\n * @param {requestFunction} opts.request If not set, defaults to the function\r\n * supplied to {@link request} which defaults to the request module from NPM.\r\n *\r\n * @param {module:crypto.store.base~CryptoStore=} opts.cryptoStore\r\n * crypto store implementation. Calls the factory supplied to\r\n * {@link setCryptoStoreFactory} if unspecified; or if no factory has been\r\n * specified, uses a default implementation (indexeddb in the browser,\r\n * in-memory otherwise).\r\n *\r\n * @return {MatrixClient} A new matrix client.\r\n * @see {@link module:client.MatrixClient} for the full list of options for\r\n * opts.\r\n */\r\nfunction createClient(opts) {\r\n if (typeof opts === \"string\") {\r\n opts = {\r\n \"baseUrl\": opts\r\n };\r\n }\r\n\r\n opts.request = opts.request || requestInstance;\r\n opts.store = opts.store || new _memory.MemoryStore({\r\n localStorage: global.localStorage\r\n });\r\n opts.scheduler = opts.scheduler || new _scheduler.MatrixScheduler();\r\n opts.cryptoStore = opts.cryptoStore || cryptoStoreFactory();\r\n return new _client.MatrixClient(opts);\r\n}\r\n/**\r\n * The request function interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will attempt to call this function in order to\r\n * perform an HTTP request.\r\n * @callback requestFunction\r\n * @param {Object} opts The options for this HTTP request.\r\n * @param {string} opts.uri The complete URI.\r\n * @param {string} opts.method The HTTP method.\r\n * @param {Object} opts.qs The query parameters to append to the URI.\r\n * @param {Object} opts.body The JSON-serializable object.\r\n * @param {boolean} opts.json True if this is a JSON request.\r\n * @param {Object} opts._matrix_opts The underlying options set for\r\n * {@link MatrixHttpApi}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * A wrapper for the request function interface.\r\n * @callback requestWrapperFunction\r\n * @param {requestFunction} origRequest The underlying request function being\r\n * wrapped\r\n * @param {Object} opts The options for this HTTP request, given in the same\r\n * form as {@link requestFunction}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * The request callback interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will implement a callback which meets this\r\n * interface in order to handle the HTTP response.\r\n * @callback requestCallback\r\n * @param {Error} err The error if one occurred, else falsey.\r\n * @param {Object} response The HTTP response which consists of\r\n * {statusCode: {Number}, headers: {Object}}\r\n * @param {Object} body The parsed HTTP response body.\r\n */","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.encodeParams = encodeParams;\r\nexports.encodeUri = encodeUri;\r\nexports.map = map;\r\nexports.filter = filter;\r\nexports.keys = keys;\r\nexports.values = values;\r\nexports.forEach = forEach;\r\nexports.findElement = findElement;\r\nexports.removeElement = removeElement;\r\nexports.isFunction = isFunction;\r\nexports.isArray = isArray;\r\nexports.checkObjectHasKeys = checkObjectHasKeys;\r\nexports.checkObjectHasNoAdditionalKeys = checkObjectHasNoAdditionalKeys;\r\nexports.deepCopy = deepCopy;\r\nexports.deepCompare = deepCompare;\r\nexports.extend = extend;\r\nexports.runPolyfills = runPolyfills;\r\nexports.inherits = inherits;\r\nexports.polyfillSuper = polyfillSuper;\r\nexports.isNumber = isNumber;\r\nexports.removeHiddenChars = removeHiddenChars;\r\nexports.escapeRegExp = escapeRegExp;\r\nexports.globToRegexp = globToRegexp;\r\nexports.ensureNoTrailingSlash = ensureNoTrailingSlash;\r\nexports.sleep = sleep;\r\nexports.isNullOrUndefined = isNullOrUndefined;\r\nexports.defer = defer;\r\nexports.promiseMapSeries = promiseMapSeries;\r\nexports.promiseTry = promiseTry;\r\nexports.chunkPromises = chunkPromises;\r\nexports.setCrypto = setCrypto;\r\nexports.getCrypto = getCrypto;\r\n\r\nvar _unhomoglyph = _interopRequireDefault(require(\"unhomoglyph\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module.\r\n * @module utils\r\n */\r\n\r\n/**\r\n * Encode a dictionary of query parameters.\r\n * @param {Object} params A dict of key/values to encode e.g.\r\n * {\"foo\": \"bar\", \"baz\": \"taz\"}\r\n * @return {string} The encoded string e.g. foo=bar&baz=taz\r\n */\r\nfunction encodeParams(params) {\r\n let qs = \"\";\r\n\r\n for (const key in params) {\r\n if (!params.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n qs += \"&\" + encodeURIComponent(key) + \"=\" + encodeURIComponent(params[key]);\r\n }\r\n\r\n return qs.substring(1);\r\n}\r\n/**\r\n * Encodes a URI according to a set of template variables. Variables will be\r\n * passed through encodeURIComponent.\r\n * @param {string} pathTemplate The path with template variables e.g. '/foo/$bar'.\r\n * @param {Object} variables The key/value pairs to replace the template\r\n * variables with. E.g. { \"$bar\": \"baz\" }.\r\n * @return {string} The result of replacing all template variables e.g. '/foo/baz'.\r\n */\r\n\r\n\r\nfunction encodeUri(pathTemplate, variables) {\r\n for (const key in variables) {\r\n if (!variables.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n pathTemplate = pathTemplate.replace(key, encodeURIComponent(variables[key]));\r\n }\r\n\r\n return pathTemplate;\r\n}\r\n/**\r\n * Applies a map function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array with the signature fn(element){...}\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction map(array, fn) {\r\n const results = new Array(array.length);\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n results[i] = fn(array[i]);\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Applies a filter function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array. It should return true to keep the element. The function signature\r\n * looks like fn(element, index, array){...}.\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction filter(array, fn) {\r\n const results = [];\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n results.push(array[i]);\r\n }\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Get the keys for an object. Same as Object.keys().\r\n * @param {Object} obj The object to get the keys for.\r\n * @return {string[]} The keys of the object.\r\n */\r\n\r\n\r\nfunction keys(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(key);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Get the values for an object.\r\n * @param {Object} obj The object to get the values for.\r\n * @return {Array<*>} The values of the object.\r\n */\r\n\r\n\r\nfunction values(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(obj[key]);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Invoke a function for each item in the array.\r\n * @param {Array} array The array.\r\n * @param {Function} fn The function to invoke for each element. Has the\r\n * function signature fn(element, index).\r\n */\r\n\r\n\r\nfunction forEach(array, fn) {\r\n for (let i = 0; i < array.length; i++) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * The findElement() method returns a value in the array, if an element in the array\r\n * satisfies (returns true) the provided testing function. Otherwise undefined\r\n * is returned.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array)\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {*} The first value in the array which returns true for\r\n * the given function.\r\n */\r\n\r\n\r\nfunction findElement(array, fn, reverse) {\r\n let i;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * The removeElement() method removes the first element in the array that\r\n * satisfies (returns true) the provided testing function.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array). Return true to\r\n * remove this element and break.\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {boolean} True if an element was removed.\r\n */\r\n\r\n\r\nfunction removeElement(array, fn, reverse) {\r\n let i;\r\n let removed;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n/**\r\n * Checks if the given thing is a function.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is a function.\r\n */\r\n\r\n\r\nfunction isFunction(value) {\r\n return Object.prototype.toString.call(value) === \"[object Function]\";\r\n}\r\n/**\r\n * Checks if the given thing is an array.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is an array.\r\n */\r\n\r\n\r\nfunction isArray(value) {\r\n return Array.isArray ? Array.isArray(value) : Boolean(value && value.constructor === Array);\r\n}\r\n/**\r\n * Checks that the given object has the specified keys.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} keys The list of keys that 'obj' must have.\r\n * @throws If the object is missing keys.\r\n */\r\n// note using 'keys' here would shadow the 'keys' function defined above\r\n\r\n\r\nfunction checkObjectHasKeys(obj, keys_) {\r\n for (let i = 0; i < keys_.length; i++) {\r\n if (!obj.hasOwnProperty(keys_[i])) {\r\n throw new Error(\"Missing required key: \" + keys_[i]);\r\n }\r\n }\r\n}\r\n/**\r\n * Checks that the given object has no extra keys other than the specified ones.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} allowedKeys The list of allowed key names.\r\n * @throws If there are extra keys.\r\n */\r\n\r\n\r\nfunction checkObjectHasNoAdditionalKeys(obj, allowedKeys) {\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n if (allowedKeys.indexOf(key) === -1) {\r\n throw new Error(\"Unknown key: \" + key);\r\n }\r\n }\r\n}\r\n/**\r\n * Deep copy the given object. The object MUST NOT have circular references and\r\n * MUST NOT have functions.\r\n * @param {Object} obj The object to deep copy.\r\n * @return {Object} A copy of the object without any references to the original.\r\n */\r\n\r\n\r\nfunction deepCopy(obj) {\r\n return JSON.parse(JSON.stringify(obj));\r\n}\r\n/**\r\n * Compare two objects for equality. The objects MUST NOT have circular references.\r\n *\r\n * @param {Object} x The first object to compare.\r\n * @param {Object} y The second object to compare.\r\n *\r\n * @return {boolean} true if the two objects are equal\r\n */\r\n\r\n\r\nfunction deepCompare(x, y) {\r\n // Inspired by\r\n // http://stackoverflow.com/questions/1068834/object-comparison-in-javascript#1144249\r\n // Compare primitives and functions.\r\n // Also check if both arguments link to the same object.\r\n if (x === y) {\r\n return true;\r\n }\r\n\r\n if (typeof x !== typeof y) {\r\n return false;\r\n } // special-case NaN (since NaN !== NaN)\r\n\r\n\r\n if (typeof x === 'number' && isNaN(x) && isNaN(y)) {\r\n return true;\r\n } // special-case null (since typeof null == 'object', but null.constructor\r\n // throws)\r\n\r\n\r\n if (x === null || y === null) {\r\n return x === y;\r\n } // everything else is either an unequal primitive, or an object\r\n\r\n\r\n if (!(x instanceof Object)) {\r\n return false;\r\n } // check they are the same type of object\r\n\r\n\r\n if (x.constructor !== y.constructor || x.prototype !== y.prototype) {\r\n return false;\r\n } // special-casing for some special types of object\r\n\r\n\r\n if (x instanceof RegExp || x instanceof Date) {\r\n return x.toString() === y.toString();\r\n } // the object algorithm works for Array, but it's sub-optimal.\r\n\r\n\r\n if (x instanceof Array) {\r\n if (x.length !== y.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < x.length; i++) {\r\n if (!deepCompare(x[i], y[i])) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n // disable jshint \"The body of a for in should be wrapped in an if\r\n // statement\"\r\n\r\n /* jshint -W089 */\r\n // check that all of y's direct keys are in x\r\n let p;\r\n\r\n for (p in y) {\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n } // finally, compare each of x's keys with y\r\n\r\n\r\n for (p in y) {\r\n // eslint-disable-line guard-for-in\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n\r\n if (!deepCompare(x[p], y[p])) {\r\n return false;\r\n }\r\n }\r\n }\r\n /* jshint +W089 */\r\n\r\n\r\n return true;\r\n}\r\n/**\r\n * Copy properties from one object to another.\r\n *\r\n * All enumerable properties, included inherited ones, are copied.\r\n *\r\n * This is approximately equivalent to ES6's Object.assign, except\r\n * that the latter doesn't copy inherited properties.\r\n *\r\n * @param {Object} target The object that will receive new properties\r\n * @param {...Object} source Objects from which to copy properties\r\n *\r\n * @return {Object} target\r\n */\r\n\r\n\r\nfunction extend(...restParams) {\r\n const target = restParams[0] || {};\r\n\r\n for (let i = 1; i < restParams.length; i++) {\r\n const source = restParams[i];\r\n if (!source) continue;\r\n\r\n for (const propName in source) {\r\n // eslint-disable-line guard-for-in\r\n target[propName] = source[propName];\r\n }\r\n }\r\n\r\n return target;\r\n}\r\n/**\r\n * Run polyfills to add Array.map and Array.filter if they are missing.\r\n */\r\n\r\n\r\nfunction runPolyfills() {\r\n // Array.prototype.filter\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\r\n if (!Array.prototype.filter) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.filter = function (fun,\r\n /*, thisArg*/\r\n ...restProps) {\r\n if (this === void 0 || this === null) {\r\n throw new TypeError();\r\n }\r\n\r\n const t = Object(this);\r\n const len = t.length >>> 0;\r\n\r\n if (typeof fun !== 'function') {\r\n throw new TypeError();\r\n }\r\n\r\n const res = [];\r\n const thisArg = restProps ? restProps[0] : void 0;\r\n\r\n for (let i = 0; i < len; i++) {\r\n if (i in t) {\r\n const val = t[i]; // NOTE: Technically this should Object.defineProperty at\r\n // the next index, as push can be affected by\r\n // properties on Object.prototype and Array.prototype.\r\n // But that method's new, and collisions should be\r\n // rare, so use the more-compatible alternative.\r\n\r\n if (fun.call(thisArg, val, i, t)) {\r\n res.push(val);\r\n }\r\n }\r\n }\r\n\r\n return res;\r\n };\r\n } // Array.prototype.map\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.19\r\n // Reference: http://es5.github.io/#x15.4.4.19\r\n\r\n\r\n if (!Array.prototype.map) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.map = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this|\r\n // value as the argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal\r\n // method of O with the argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== 'function') {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let A be a new array created as if by the expression new Array(len)\r\n // where Array is the standard built-in constructor with that name and\r\n // len is the value of len.\r\n\r\n\r\n const A = new Array(len); // 7. Let k be 0\r\n\r\n k = 0; // 8. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue;\r\n let mappedValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal\r\n // method of O with argument Pk.\r\n kValue = O[k]; // ii. Let mappedValue be the result of calling the Call internal\r\n // method of callback with T as the this value and argument\r\n // list containing kValue, k, and O.\r\n\r\n mappedValue = callback.call(T, kValue, k, O); // iii. Call the DefineOwnProperty internal method of A with arguments\r\n // Pk, Property Descriptor\r\n // { Value: mappedValue,\r\n // Writable: true,\r\n // Enumerable: true,\r\n // Configurable: true },\r\n // and false.\r\n // In browsers that support Object.defineProperty, use the following:\r\n // Object.defineProperty(A, k, {\r\n // value: mappedValue,\r\n // writable: true,\r\n // enumerable: true,\r\n // configurable: true\r\n // });\r\n // For best browser support, use the following:\r\n\r\n A[k] = mappedValue;\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 9. return A\r\n\r\n\r\n return A;\r\n };\r\n } // Array.prototype.forEach\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.18\r\n // Reference: http://es5.github.io/#x15.4.4.18\r\n\r\n\r\n if (!Array.prototype.forEach) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.forEach = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this| value as the\r\n // argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal method of O with the\r\n // argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== \"function\") {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let k be 0\r\n\r\n\r\n k = 0; // 7. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with\r\n // argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal method of O with\r\n // argument Pk\r\n kValue = O[k]; // ii. Call the Call internal method of callback with T as the this value and\r\n // argument list containing kValue, k, and O.\r\n\r\n callback.call(T, kValue, k, O);\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 8. return undefined\r\n\r\n };\r\n }\r\n}\r\n/**\r\n * Inherit the prototype methods from one constructor into another. This is a\r\n * port of the Node.js implementation with an Object.create polyfill.\r\n *\r\n * @param {function} ctor Constructor function which needs to inherit the\r\n * prototype.\r\n * @param {function} superCtor Constructor function to inherit prototype from.\r\n */\r\n\r\n\r\nfunction inherits(ctor, superCtor) {\r\n // Add util.inherits from Node.js\r\n // Source:\r\n // https://github.com/joyent/node/blob/master/lib/util.js\r\n // Copyright Joyent, Inc. and other Node contributors.\r\n //\r\n // Permission is hereby granted, free of charge, to any person obtaining a\r\n // copy of this software and associated documentation files (the\r\n // \"Software\"), to deal in the Software without restriction, including\r\n // without limitation the rights to use, copy, modify, merge, publish,\r\n // distribute, sublicense, and/or sell copies of the Software, and to permit\r\n // persons to whom the Software is furnished to do so, subject to the\r\n // following conditions:\r\n //\r\n // The above copyright notice and this permission notice shall be included\r\n // in all copies or substantial portions of the Software.\r\n //\r\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n ctor.super_ = superCtor;\r\n ctor.prototype = Object.create(superCtor.prototype, {\r\n constructor: {\r\n value: ctor,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true\r\n }\r\n });\r\n}\r\n/**\r\n * Polyfills inheritance for prototypes by allowing different kinds of\r\n * super types. Typically prototypes would use `SuperType.call(this, params)`\r\n * though this doesn't always work in some environments - this function\r\n * falls back to using `Object.assign()` to clone a constructed copy\r\n * of the super type onto `thisArg`.\r\n * @param {any} thisArg The child instance. Modified in place.\r\n * @param {any} SuperType The type to act as a super instance\r\n * @param {any} params Arguments to supply to the super type's constructor\r\n */\r\n\r\n\r\nfunction polyfillSuper(thisArg, SuperType, ...params) {\r\n try {\r\n SuperType.call(thisArg, ...params);\r\n } catch (e) {\r\n // fall back to Object.assign to just clone the thing\r\n const fakeSuper = new SuperType(...params);\r\n Object.assign(thisArg, fakeSuper);\r\n }\r\n}\r\n/**\r\n * Returns whether the given value is a finite number without type-coercion\r\n *\r\n * @param {*} value the value to test\r\n * @return {boolean} whether or not value is a finite number without type-coercion\r\n */\r\n\r\n\r\nfunction isNumber(value) {\r\n return typeof value === 'number' && isFinite(value);\r\n}\r\n/**\r\n * Removes zero width chars, diacritics and whitespace from the string\r\n * Also applies an unhomoglyph on the string, to prevent similar looking chars\r\n * @param {string} str the string to remove hidden characters from\r\n * @return {string} a string with the hidden characters removed\r\n */\r\n\r\n\r\nfunction removeHiddenChars(str) {\r\n if (typeof str === \"string\") {\r\n return (0, _unhomoglyph.default)(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));\r\n }\r\n\r\n return \"\";\r\n} // Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.\r\n// Includes:\r\n// various width spaces U+2000 - U+200D\r\n// LTR and RTL marks U+200E and U+200F\r\n// LTR/RTL and other directional formatting marks U+202A - U+202F\r\n// Combining characters U+0300 - U+036F\r\n// Zero width no-break space (BOM) U+FEFF\r\n// eslint-disable-next-line no-misleading-character-class\r\n\r\n\r\nconst removeHiddenCharsRegex = /[\\u2000-\\u200F\\u202A-\\u202F\\u0300-\\u036f\\uFEFF\\s]/g;\r\n\r\nfunction escapeRegExp(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n}\r\n\r\nfunction globToRegexp(glob, extended) {\r\n extended = typeof extended === 'boolean' ? extended : true; // From\r\n // https://github.com/matrix-org/synapse/blob/abbee6b29be80a77e05730707602f3bbfc3f38cb/synapse/push/__init__.py#L132\r\n // Because micromatch is about 130KB with dependencies,\r\n // and minimatch is not much better.\r\n\r\n let pat = escapeRegExp(glob);\r\n pat = pat.replace(/\\\\\\*/g, '.*');\r\n pat = pat.replace(/\\?/g, '.');\r\n\r\n if (extended) {\r\n pat = pat.replace(/\\\\\\[(!|)(.*)\\\\]/g, function (match, p1, p2, offset, string) {\r\n const first = p1 && '^' || '';\r\n const second = p2.replace(/\\\\-/, '-');\r\n return '[' + first + second + ']';\r\n });\r\n }\r\n\r\n return pat;\r\n}\r\n\r\nfunction ensureNoTrailingSlash(url) {\r\n if (url && url.endsWith(\"/\")) {\r\n return url.substr(0, url.length - 1);\r\n } else {\r\n return url;\r\n }\r\n} // Returns a promise which resolves with a given value after the given number of ms\r\n\r\n\r\nfunction sleep(ms, value) {\r\n return new Promise(resolve => {\r\n setTimeout(resolve, ms, value);\r\n });\r\n}\r\n\r\nfunction isNullOrUndefined(val) {\r\n return val === null || val === undefined;\r\n} // Returns a Deferred\r\n\r\n\r\nfunction defer() {\r\n let resolve;\r\n let reject;\r\n const promise = new Promise((_resolve, _reject) => {\r\n resolve = _resolve;\r\n reject = _reject;\r\n });\r\n return {\r\n resolve,\r\n reject,\r\n promise\r\n };\r\n}\r\n\r\nasync function promiseMapSeries(promises, fn) {\r\n for (const o of await promises) {\r\n await fn(await o);\r\n }\r\n}\r\n\r\nfunction promiseTry(fn) {\r\n return new Promise(resolve => resolve(fn()));\r\n} // Creates and awaits all promises, running no more than `chunkSize` at the same time\r\n\r\n\r\nasync function chunkPromises(fns, chunkSize) {\r\n const results = [];\r\n\r\n for (let i = 0; i < fns.length; i += chunkSize) {\r\n results.push(...(await Promise.all(fns.slice(i, i + chunkSize).map(fn => fn()))));\r\n }\r\n\r\n return results;\r\n} // We need to be able to access the Node.js crypto library from within the\r\n// Matrix SDK without needing to `require(\"crypto\")`, which will fail in\r\n// browsers. So `index.ts` will call `setCrypto` to store it, and when we need\r\n// it, we can call `getCrypto`.\r\n\r\n\r\nlet crypto;\r\n\r\nfunction setCrypto(c) {\r\n crypto = c;\r\n}\r\n\r\nfunction getCrypto() {\r\n return crypto;\r\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"body[data-v-0635047f]{--sweetalert-icons-animation-background:transparent}.sa[data-v-0635047f]{width:140px;height:140px;padding:26px;margin:auto}.sa-loading[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);left:-4px;top:-4px;z-index:2;border-top:4px solid var(--icon-color);-webkit-animation:animateLoadingSpin-data-v-0635047f .75s infinite;animation:animateLoadingSpin-data-v-0635047f .75s infinite}.sa-error[data-v-0635047f],.sa-loading[data-v-0635047f]{box-sizing:content-box;height:80px;position:relative;width:80px}.sa-error[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);padding:0;-webkit-animation:animateErrorIcon-data-v-0635047f .5s;animation:animateErrorIcon-data-v-0635047f .5s}.sa-error[data-v-0635047f]:after,.sa-error[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-error[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-error[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-error-x[data-v-0635047f]{display:block;position:relative;z-index:2}.sa-error-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-error-fix[data-v-0635047f]{height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-error-left[data-v-0635047f],.sa-error-right[data-v-0635047f]{border-radius:2px;display:block;height:5px;position:absolute;z-index:2;background-color:var(--icon-color);top:37px;width:47px}.sa-error-left[data-v-0635047f]{left:17px;transform:rotate(45deg);-webkit-animation:animateXLeft-data-v-0635047f .75s;animation:animateXLeft-data-v-0635047f .75s}.sa-error-right[data-v-0635047f]{right:16px;transform:rotate(-45deg);-webkit-animation:animateXRight-data-v-0635047f .75s;animation:animateXRight-data-v-0635047f .75s}.sa-warning[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleWarning-data-v-0635047f .75s infinite alternate;animation:scaleWarning-data-v-0635047f .75s infinite alternate}.sa-warning[data-v-0635047f]:after,.sa-warning[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-warning[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseWarning-data-v-0635047f 2s linear infinite;animation:pulseWarning-data-v-0635047f 2s linear infinite}.sa-warning[data-v-0635047f]:after{display:block;z-index:1}.sa-warning-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-warning-body[data-v-0635047f],.sa-warning-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseWarningIns-data-v-0635047f .75s infinite alternate;animation:pulseWarningIns-data-v-0635047f .75s infinite alternate}.sa-warning-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-info[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleInfo-data-v-0635047f .75s infinite alternate;animation:scaleInfo-data-v-0635047f .75s infinite alternate}.sa-info[data-v-0635047f]:after,.sa-info[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-info[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseInfo-data-v-0635047f 2s linear infinite;animation:pulseInfo-data-v-0635047f 2s linear infinite}.sa-info[data-v-0635047f]:after{display:block;z-index:1}.sa-info-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-info-body[data-v-0635047f],.sa-info-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseInfoIns-data-v-0635047f .75s infinite alternate;animation:pulseInfoIns-data-v-0635047f .75s infinite alternate}.sa-info-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-success[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px}.sa-success[data-v-0635047f],.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{background-color:var(--sweetalert-icons-animation-background)}.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-success[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-success[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-success-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-success-fix[data-v-0635047f]{background-color:var(--sweetalert-icons-animation-background);height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-success-long[data-v-0635047f],.sa-success-tip[data-v-0635047f]{background-color:var(--icon-color);border-radius:2px;height:5px;position:absolute;z-index:2}.sa-success-tip[data-v-0635047f]{left:14px;top:46px;transform:rotate(45deg);width:25px;-webkit-animation:animateSuccessTip-data-v-0635047f .75s;animation:animateSuccessTip-data-v-0635047f .75s}.sa-success-long[data-v-0635047f]{right:8px;top:38px;transform:rotate(-45deg);width:47px;-webkit-animation:animateSuccessLong-data-v-0635047f .75s;animation:animateSuccessLong-data-v-0635047f .75s}@-webkit-keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@-webkit-keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@-webkit-keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@-webkit-keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@-webkit-keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@-webkit-keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@-webkit-keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@-webkit-keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}@keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.upgradeDatabase = upgradeDatabase;\r\nexports.Backend = exports.VERSION = void 0;\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nconst VERSION = 10;\r\nexports.VERSION = VERSION;\r\nconst PROFILE_TRANSACTIONS = false;\r\n/**\r\n * Implementation of a CryptoStore which is backed by an existing\r\n * IndexedDB connection. Generally you want IndexedDBCryptoStore\r\n * which connects to the database and defers to one of these.\r\n *\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\n\r\nclass Backend {\r\n /**\r\n * @param {IDBDatabase} db\r\n */\r\n constructor(db) {\r\n this._db = db;\r\n this._nextTxnId = 0; // make sure we close the db on `onversionchange` - otherwise\r\n // attempts to delete the database will block (and subsequent\r\n // attempts to re-create it will also block).\r\n\r\n db.onversionchange = ev => {\r\n _logger.logger.log(`versionchange for indexeddb ${this._dbName}: closing`);\r\n\r\n db.close();\r\n };\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n txn.onerror = reject; // first see if we already have an entry for this request.\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n resolve(existing);\r\n return;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n txn.oncomplete = () => {\r\n resolve(request);\r\n };\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n store.add(request);\r\n });\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n resolve(existing);\r\n });\r\n });\r\n }\r\n /**\r\n * look for an existing room key request in the db\r\n *\r\n * @private\r\n * @param {IDBTransaction} txn database transaction\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n * @param {Function} callback function to call with the results of the\r\n * search. Either passed a matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found.\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(txn, requestBody, callback) {\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const idx = store.index(\"session\");\r\n const cursorReq = idx.openCursor([requestBody.room_id, requestBody.session_id]);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n // no match found\r\n callback(null);\r\n return;\r\n }\r\n\r\n const existing = cursor.value;\r\n\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n // got a match\r\n callback(existing);\r\n return;\r\n } // look at the next entry in the index\r\n\r\n\r\n cursor.continue();\r\n };\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states. If there are multiple\r\n * requests in those states, an arbitrary one is chosen.\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n if (wantedStates.length === 0) {\r\n return Promise.resolve(null);\r\n } // this is a bit tortuous because we need to make sure we do the lookup\r\n // in a single transaction, to avoid having a race with the insertion\r\n // code.\r\n // index into the wantedStates array\r\n\r\n\r\n let stateIndex = 0;\r\n let result;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n // got a match\r\n result = cursor.value;\r\n return;\r\n } // try the next state in the list\r\n\r\n\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All elements in a given state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const index = store.index(\"state\");\r\n const request = index.getAll(wantedState);\r\n\r\n request.onsuccess = ev => resolve(ev.target.result);\r\n\r\n request.onerror = ev => reject(ev.target.error);\r\n });\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n let stateIndex = 0;\r\n const results = [];\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n const keyReq = cursor.value;\r\n\r\n if (keyReq.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(keyReq);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n // try the next state in the list\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n let result = null;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${data.state}`);\r\n\r\n return;\r\n }\r\n\r\n Object.assign(data, updates);\r\n cursor.update(data);\r\n result = data;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${data.state} ` + `(expected ${expectedState})`);\r\n\r\n return;\r\n }\r\n\r\n cursor.delete();\r\n };\r\n\r\n return promiseifyTxn(txn);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(newData, \"-\");\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"crossSigningKeys\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(`ssss_cache:${type}`);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(keys, \"crossSigningKeys\");\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(key, `ssss_cache:${type}`);\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const countReq = objectStore.count();\r\n\r\n countReq.onsuccess = function () {\r\n try {\r\n func(countReq.result);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const idx = objectStore.index(\"deviceKey\");\r\n const getReq = idx.openCursor(deviceKey);\r\n const results = {};\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n results[cursor.value.sessionId] = {\r\n session: cursor.value.session,\r\n lastReceivedMessageTs: cursor.value.lastReceivedMessageTs\r\n };\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(results);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.get([deviceKey, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n func({\r\n session: getReq.result.session,\r\n lastReceivedMessageTs: getReq.result.lastReceivedMessageTs\r\n });\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n func(cursor.value);\r\n cursor.continue();\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n objectStore.put({\r\n deviceKey,\r\n sessionId,\r\n session: sessionInfo.session,\r\n lastReceivedMessageTs: sessionInfo.lastReceivedMessageTs\r\n });\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n objectStore.put({\r\n deviceKey,\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n return promiseifyTxn(txn);\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n let result;\r\n\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n const index = objectStore.index(\"deviceKey\");\r\n const req = index.getAll(deviceKey);\r\n\r\n req.onsuccess = event => {\r\n const problems = req.result;\r\n\r\n if (!problems.length) {\r\n result = null;\r\n return;\r\n }\r\n\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n result = Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n return;\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n result = null;\r\n } else {\r\n result = lastProblem;\r\n }\r\n };\r\n\r\n await promiseifyTxn(txn);\r\n return result;\r\n } // FIXME: we should probably prune this when devices get deleted\r\n\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const txn = this._db.transaction(\"notified_error_devices\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"notified_error_devices\");\r\n const ret = [];\r\n await Promise.all(devices.map(device => {\r\n return new Promise(resolve => {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n const getReq = objectStore.get([userId, deviceInfo.deviceId]);\r\n\r\n getReq.onsuccess = function () {\r\n if (!getReq.result) {\r\n objectStore.put({\r\n userId,\r\n deviceId: deviceInfo.deviceId\r\n });\r\n ret.push(device);\r\n }\r\n\r\n resolve();\r\n };\r\n });\r\n }));\r\n return ret;\r\n } // Inbound group sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n let session = false;\r\n let withheld = false;\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n session = getReq.result.session;\r\n } else {\r\n session = null;\r\n }\r\n\r\n if (withheld !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n\r\n const withheldObjectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n const withheldGetReq = withheldObjectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n withheldGetReq.onsuccess = function () {\r\n try {\r\n if (withheldGetReq.result) {\r\n withheld = withheldGetReq.result.session;\r\n } else {\r\n withheld = null;\r\n }\r\n\r\n if (session !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n try {\r\n func({\r\n senderKey: cursor.value.senderCurve25519Key,\r\n sessionId: cursor.value.sessionId,\r\n sessionData: cursor.value.session\r\n });\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const addReq = objectStore.add({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n\r\n addReq.onerror = ev => {\r\n if (addReq.error.name === 'ConstraintError') {\r\n // This stops the error from triggering the txn's onerror\r\n ev.stopPropagation(); // ...and this stops it from aborting the transaction\r\n\r\n ev.preventDefault();\r\n\r\n _logger.logger.log(\"Ignoring duplicate inbound group session: \" + senderCurve25519Key + \" / \" + sessionId);\r\n } else {\r\n abortWithException(txn, new Error(\"Failed to add inbound group session: \" + addReq.error));\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n objectStore.put(deviceData, \"-\");\r\n }\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n const objectStore = txn.objectStore(\"rooms\");\r\n objectStore.put(roomInfo, roomId);\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n const rooms = {};\r\n const objectStore = txn.objectStore(\"rooms\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n rooms[cursor.key] = cursor.value;\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(rooms);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n } // session backups\r\n\r\n\r\n getSessionsNeedingBackup(limit) {\r\n return new Promise((resolve, reject) => {\r\n const sessions = [];\r\n\r\n const txn = this._db.transaction([\"sessions_needing_backup\", \"inbound_group_sessions\"], \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n txn.oncomplete = function () {\r\n resolve(sessions);\r\n };\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n const sessionStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n const sessionGetReq = sessionStore.get(cursor.key);\r\n\r\n sessionGetReq.onsuccess = function () {\r\n sessions.push({\r\n senderKey: sessionGetReq.result.senderCurve25519Key,\r\n sessionId: sessionGetReq.result.sessionId,\r\n sessionData: sessionGetReq.result.session\r\n });\r\n };\r\n\r\n if (!limit || sessions.length < limit) {\r\n cursor.continue();\r\n }\r\n }\r\n };\r\n });\r\n }\r\n\r\n countSessionsNeedingBackup(txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.count();\r\n req.onerror = reject;\r\n\r\n req.onsuccess = () => resolve(req.result);\r\n });\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.delete([session.senderKey, session.sessionId]);\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n markSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.put({\r\n senderCurve25519Key: session.senderKey,\r\n sessionId: session.sessionId\r\n });\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n sessions.push([senderKey, sessionId]);\r\n objectStore.put({\r\n roomId,\r\n sessions\r\n });\r\n };\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n return new Promise((resolve, reject) => {\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n resolve(sessions);\r\n };\r\n\r\n req.onerror = reject;\r\n });\r\n }\r\n\r\n doTxn(mode, stores, func, log = _logger.logger) {\r\n let startTime;\r\n let description;\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n const txnId = this._nextTxnId++;\r\n startTime = Date.now();\r\n description = `${mode} crypto store transaction ${txnId} in ${stores}`;\r\n log.debug(`Starting ${description}`);\r\n }\r\n\r\n const txn = this._db.transaction(stores, mode);\r\n\r\n const promise = promiseifyTxn(txn);\r\n const result = func(txn);\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n promise.then(() => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.debug(`Finished ${description}, took ${elapsedTime} ms`);\r\n }, () => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.error(`Failed ${description}, took ${elapsedTime} ms`);\r\n });\r\n }\r\n\r\n return promise.then(() => {\r\n return result;\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.Backend = Backend;\r\n\r\nfunction upgradeDatabase(db, oldVersion) {\r\n _logger.logger.log(`Upgrading IndexedDBCryptoStore from version ${oldVersion}` + ` to ${VERSION}`);\r\n\r\n if (oldVersion < 1) {\r\n // The database did not previously exist.\r\n createDatabase(db);\r\n }\r\n\r\n if (oldVersion < 2) {\r\n db.createObjectStore(\"account\");\r\n }\r\n\r\n if (oldVersion < 3) {\r\n const sessionsStore = db.createObjectStore(\"sessions\", {\r\n keyPath: [\"deviceKey\", \"sessionId\"]\r\n });\r\n sessionsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n }\r\n\r\n if (oldVersion < 4) {\r\n db.createObjectStore(\"inbound_group_sessions\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 5) {\r\n db.createObjectStore(\"device_data\");\r\n }\r\n\r\n if (oldVersion < 6) {\r\n db.createObjectStore(\"rooms\");\r\n }\r\n\r\n if (oldVersion < 7) {\r\n db.createObjectStore(\"sessions_needing_backup\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 8) {\r\n db.createObjectStore(\"inbound_group_sessions_withheld\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 9) {\r\n const problemsStore = db.createObjectStore(\"session_problems\", {\r\n keyPath: [\"deviceKey\", \"time\"]\r\n });\r\n problemsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n db.createObjectStore(\"notified_error_devices\", {\r\n keyPath: [\"userId\", \"deviceId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 10) {\r\n db.createObjectStore(\"shared_history_inbound_group_sessions\", {\r\n keyPath: [\"roomId\"]\r\n });\r\n } // Expand as needed.\r\n\r\n}\r\n\r\nfunction createDatabase(db) {\r\n const outgoingRoomKeyRequestsStore = db.createObjectStore(\"outgoingRoomKeyRequests\", {\r\n keyPath: \"requestId\"\r\n }); // we assume that the RoomKeyRequestBody will have room_id and session_id\r\n // properties, to make the index efficient.\r\n\r\n outgoingRoomKeyRequestsStore.createIndex(\"session\", [\"requestBody.room_id\", \"requestBody.session_id\"]);\r\n outgoingRoomKeyRequestsStore.createIndex(\"state\", \"state\");\r\n}\r\n/*\r\n * Aborts a transaction with a given exception\r\n * The transaction promise will be rejected with this exception.\r\n */\r\n\r\n\r\nfunction abortWithException(txn, e) {\r\n // We cheekily stick our exception onto the transaction object here\r\n // We could alternatively make the thing we pass back to the app\r\n // an object containing the transaction and exception.\r\n txn._mx_abortexception = e;\r\n\r\n try {\r\n txn.abort();\r\n } catch (e) {// sometimes we won't be able to abort the transaction\r\n // (ie. if it's aborted or completed)\r\n }\r\n}\r\n\r\nfunction promiseifyTxn(txn) {\r\n return new Promise((resolve, reject) => {\r\n txn.oncomplete = () => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n }\r\n\r\n resolve();\r\n };\r\n\r\n txn.onerror = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n\r\n txn.onabort = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n });\r\n}","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#linepreloader[data-v-bcf20e38]{display:inline-block;font-size:0;padding:0}#linepreloader span[data-v-bcf20e38]{vertical-align:middle;border-radius:50%;background:rgb(var(--neutral-grad-2));display:inline-block;width:6px;height:6px;margin:3px 2px;-webkit-animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate;animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate}#linepreloader span[data-v-bcf20e38]:first-child{-webkit-animation-delay:-.8;animation-delay:-.8s}#linepreloader span[data-v-bcf20e38]:nth-child(2){-webkit-animation-delay:-.53333s;animation-delay:-.53333s}#linepreloader span[data-v-bcf20e38]:nth-child(3){-webkit-animation-delay:-.26666s;animation-delay:-.26666s}@keyframes linepreloader-data-v-bcf20e38{0%{transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes linepreloader-data-v-bcf20e38{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.ReEmitter = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nclass ReEmitter {\r\n constructor(target) {\r\n (0, _defineProperty2.default)(this, \"target\", void 0);\r\n this.target = target;\r\n }\r\n\r\n reEmit(source, eventNames) {\r\n for (const eventName of eventNames) {\r\n // We include the source as the last argument for event handlers which may need it,\r\n // such as read receipt listeners on the client class which won't have the context\r\n // of the room.\r\n const forSource = (...args) => {\r\n // EventEmitter special cases 'error' to make the emit function throw if no\r\n // handler is attached, which sort of makes sense for making sure that something\r\n // handles an error, but for re-emitting, there could be a listener on the original\r\n // source object so the test doesn't really work. We *could* try to replicate the\r\n // same logic and throw if there is no listener on either the source or the target,\r\n // but this behaviour is fairly undesireable for us anyway: the main place we throw\r\n // 'error' events is for calls, where error events are usually emitted some time\r\n // later by a different part of the code where 'emit' throwing because the app hasn't\r\n // added an error handler isn't terribly helpful. (A better fix in retrospect may\r\n // have been to just avoid using the event name 'error', but backwards compat...)\r\n if (eventName === 'error' && this.target.listenerCount('error') === 0) return;\r\n this.target.emit(eventName, ...args, source);\r\n };\r\n\r\n source.on(eventName, forSource);\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.ReEmitter = ReEmitter;","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Exceptions */\n__export(require(\"./exceptions\"));\n/** Symmetric encryption APIs */\nvar aead_1 = require(\"./aead\");\nexports.AEAD = aead_1.AEAD;\nvar siv_1 = require(\"./siv\");\nexports.SIV = siv_1.SIV;\n/** STREAM streaming encryption */\nvar stream_1 = require(\"./stream\");\nexports.StreamEncryptor = stream_1.StreamEncryptor;\nexports.StreamDecryptor = stream_1.StreamDecryptor;\n/** MAC functions */\nvar cmac_1 = require(\"./mac/cmac\");\nexports.CMAC = cmac_1.CMAC;\nvar pmac_1 = require(\"./mac/pmac\");\nexports.PMAC = pmac_1.PMAC;\n/** Crypto providers */\nvar polyfill_1 = require(\"./providers/polyfill\");\nexports.PolyfillCryptoProvider = polyfill_1.PolyfillCryptoProvider;\nvar webcrypto_1 = require(\"./providers/webcrypto\");\nexports.WebCryptoProvider = webcrypto_1.WebCryptoProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Number of trailing zeros in a given byte value */\nconst CTZ_TABLE = new Uint8Array([\n 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n]);\n/** Count the number of trailing zeroes in a given number */\nfunction ctz(value) {\n return CTZ_TABLE[value];\n}\nexports.ctz = ctz;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".footer-chat[data-v-517e1e1f]{bottom:0;left:0;right:0;background:rgb(var(--background-total-theme));border-top:1px solid rgb(var(--background-secondary-theme));position:absolute;height:90px;padding-bottom:30px}.footer-chat.bout[data-v-517e1e1f]{position:fixed;will-change:transform}.footer-chat .work[data-v-517e1e1f]{height:100%;padding:0!important}.footer-chat.bin[data-v-517e1e1f]{border-top:0;position:static}.footer-chat.fix[data-v-517e1e1f]{position:absolute;height:auto}.footer-chat.fix.minimized[data-v-517e1e1f]{background:transparent;padding-bottom:0}.footer-chat.fix.minimized .menuItems[data-v-517e1e1f]{display:block;transition:.3s;padding-top:.5em}.footer-chat.fix.minimized .menuItems a[data-v-517e1e1f]{padding:0}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]{width:44px;height:44px;background:rgba(var(--neutral-grad-3),.4);color:rgba(var(--neutral-grad-3),.8);border-radius:50%;border:1px solid transparent;margin-bottom:.25em;line-height:40px;transition:.3s}.footer-chat.fix.minimized .menuItems .menuItem .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem .label[data-v-517e1e1f]{display:none}.footer-chat.fix.minimized .menuItems .menuItem i[data-v-517e1e1f]{vertical-align:middle;font-size:.8em}.footer-chat.fix.minimized .menuItems .menuItem.active[data-v-517e1e1f]{text-shadow:0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright));background:rgba(var(--color-bg-ac-bright),.9);border:1px solid rgba(var(--color-bg-ac-bright),.9);color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]:hover:not(.active){background:rgba(var(--color-bg-ac-bright),.95);color:#fff;text-shadow:0 0 10px rgb(var(--color-bg-ac-bright)),0 0 15px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 25px rgb(var(--color-bg-ac-bright)),0 0 30px #02061a,0 0 35px rgb(var(--color-bg-ac-bright)),0 0 40px #02061a}.footer-chat.fix.minimized.active .menuItems[data-v-517e1e1f]{border-top:0}.menuItems[data-v-517e1e1f]{display:flex;justify-content:space-around;align-items:center;height:100%}.menuItems a[data-v-517e1e1f]{display:block;flex-grow:1;text-align:center;padding:1em;color:#213850}.menuItems .icon[data-v-517e1e1f]{font-size:.9em;color:rgba(var(--color-txt-gray-dark),.7)}.menuItems .label[data-v-517e1e1f]{font-size:.7em;position:absolute;bottom:0;left:0;right:0;line-height:1em;text-align:center;opacity:.7}.menuItems .menuItem[data-v-517e1e1f]{position:relative;text-align:center;cursor:pointer;width:64px;height:44px;line-height:44px}.menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--color-txt-ac))}.menuItems .menuItem .unseen[data-v-517e1e1f]{position:absolute;width:22px;height:22px;right:-10%;bottom:-10%;background:rgba(var(--color-txt-ac),.9);line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em;color:rgb(var(--text-on-bg-ac-color))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.Relations = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2019 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * A container for relation events that supports easy access to common ways of\r\n * aggregating such events. Each instance holds events that of a single relation\r\n * type and event type. All of the events also relate to the same original event.\r\n *\r\n * The typical way to get one of these containers is via\r\n * EventTimelineSet#getRelationsForEvent.\r\n */\r\nclass Relations extends _events.EventEmitter {\r\n /**\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\",\r\n * \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @param {?Room} room\r\n * Room for this container. May be null for non-room cases, such as the\r\n * notification timeline.\r\n */\r\n constructor(relationType, eventType, room) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"_onEventStatus\", (event, status) => {\r\n if (!event.isSending()) {\r\n // Sending is done, so we don't need to listen anymore\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n return;\r\n }\r\n\r\n if (status !== _event.EventStatus.CANCELLED) {\r\n return;\r\n } // Event was cancelled, remove from the collection\r\n\r\n\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n\r\n this._removeEvent(event);\r\n });\r\n (0, _defineProperty2.default)(this, \"_onBeforeRedaction\", redactedEvent => {\r\n if (!this._relations.has(redactedEvent)) {\r\n return;\r\n }\r\n\r\n this._relations.delete(redactedEvent);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n // Remove the redacted annotation from aggregation by key\r\n this._removeAnnotationFromAggregation(redactedEvent);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n redactedEvent.removeListener(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.redaction\", redactedEvent);\r\n });\r\n this.relationType = relationType;\r\n this.eventType = eventType;\r\n this._relations = new Set();\r\n this._annotationsByKey = {};\r\n this._annotationsBySender = {};\r\n this._sortedAnnotationsByKey = [];\r\n this._targetEvent = null;\r\n }\r\n /**\r\n * Add relation events to this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be added.\r\n */\r\n\r\n\r\n addEvent(event) {\r\n if (this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n } // If the event is in the process of being sent, listen for cancellation\r\n // so we can remove the event from the collection.\r\n\r\n\r\n if (event.isSending()) {\r\n event.on(\"Event.status\", this._onEventStatus);\r\n }\r\n\r\n this._relations.add(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._addAnnotationToAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n event.on(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.add\", event);\r\n }\r\n /**\r\n * Remove relation event from this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The relation event to remove.\r\n */\r\n\r\n\r\n _removeEvent(event) {\r\n if (!this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n }\r\n\r\n this._relations.delete(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._removeAnnotationFromAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n this.emit(\"Relations.remove\", event);\r\n }\r\n /**\r\n * Listens for event status changes to remove cancelled events.\r\n *\r\n * @param {MatrixEvent} event The event whose status has changed\r\n * @param {EventStatus} status The new status\r\n */\r\n\r\n\r\n /**\r\n * Get all relation events in this collection.\r\n *\r\n * These are currently in the order of insertion to this collection, which\r\n * won't match timeline order in the case of scrollback.\r\n * TODO: Tweak `addEvent` to insert correctly for scrollback.\r\n *\r\n * @return {Array}\r\n * Relation events in insertion order.\r\n */\r\n getRelations() {\r\n return [...this._relations];\r\n }\r\n\r\n _addAnnotationToAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n let eventsForKey = this._annotationsByKey[key];\r\n\r\n if (!eventsForKey) {\r\n eventsForKey = this._annotationsByKey[key] = new Set();\r\n\r\n this._sortedAnnotationsByKey.push([key, eventsForKey]);\r\n } // Add the new event to the set for this key\r\n\r\n\r\n eventsForKey.add(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n\r\n const sender = event.getSender();\r\n let eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (!eventsFromSender) {\r\n eventsFromSender = this._annotationsBySender[sender] = new Set();\r\n } // Add the new event to the set for this sender\r\n\r\n\r\n eventsFromSender.add(event);\r\n }\r\n\r\n _removeAnnotationFromAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n const eventsForKey = this._annotationsByKey[key];\r\n\r\n if (eventsForKey) {\r\n eventsForKey.delete(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n }\r\n\r\n const sender = event.getSender();\r\n const eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (eventsFromSender) {\r\n eventsFromSender.delete(event);\r\n }\r\n }\r\n /**\r\n * For relations that have been redacted, we want to remove them from\r\n * aggregation data sets and emit an update event.\r\n *\r\n * To do so, we listen for `Event.beforeRedaction`, which happens:\r\n * - after the server accepted the redaction and remote echoed back to us\r\n * - before the original event has been marked redacted in the client\r\n *\r\n * @param {MatrixEvent} redactedEvent\r\n * The original relation event that is about to be redacted.\r\n */\r\n\r\n\r\n /**\r\n * Get all events in this collection grouped by key and sorted by descending\r\n * event count in each group.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Array}\r\n * An array of [key, events] pairs sorted by descending event count.\r\n * The events are stored in a Set (which preserves insertion order).\r\n */\r\n getSortedAnnotationsByKey() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._sortedAnnotationsByKey;\r\n }\r\n /**\r\n * Get all events in this collection grouped by sender.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Object}\r\n * An object with each relation sender as a key and the matching Set of\r\n * events for that sender as a value.\r\n */\r\n\r\n\r\n getAnnotationsBySender() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._annotationsBySender;\r\n }\r\n /**\r\n * Returns the most recent (and allowed) m.replace relation, if any.\r\n *\r\n * This is currently only supported for the m.replace relation type,\r\n * once the target event is known, see `addEvent`.\r\n *\r\n * @return {MatrixEvent?}\r\n */\r\n\r\n\r\n getLastReplacement() {\r\n if (this.relationType !== \"m.replace\") {\r\n // Aggregating on last only makes sense for this relation type\r\n return null;\r\n }\r\n\r\n if (!this._targetEvent) {\r\n // Don't know which replacements to accept yet.\r\n // This method shouldn't be called before the original\r\n // event is known anyway.\r\n return null;\r\n } // the all-knowning server tells us that the event at some point had\r\n // this timestamp for its replacement, so any following replacement should definitely not be less\r\n\r\n\r\n const replaceRelation = this._targetEvent.getServerAggregatedRelation(\"m.replace\");\r\n\r\n const minTs = replaceRelation && replaceRelation.origin_server_ts;\r\n return this.getRelations().reduce((last, event) => {\r\n if (event.getSender() !== this._targetEvent.getSender()) {\r\n return last;\r\n }\r\n\r\n if (minTs && minTs > event.getTs()) {\r\n return last;\r\n }\r\n\r\n if (last && last.getTs() > event.getTs()) {\r\n return last;\r\n }\r\n\r\n return event;\r\n }, null);\r\n }\r\n /*\r\n * @param {MatrixEvent} targetEvent the event the relations are related to.\r\n */\r\n\r\n\r\n setTargetEvent(event) {\r\n if (this._targetEvent) {\r\n return;\r\n }\r\n\r\n this._targetEvent = event;\r\n\r\n if (this.relationType === \"m.replace\") {\r\n const replacement = this.getLastReplacement(); // this is the initial update, so only call it if we already have something\r\n // to not emit Event.replaced needlessly\r\n\r\n if (replacement) {\r\n this._targetEvent.makeReplaced(replacement);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.Relations = Relations;","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\"","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/* (ignored) */","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=951b8314&scoped=true&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".nameofchat[data-v-72a9c575]{white-space:nowrap}.nameline[data-v-72a9c575]{display:flex;align-items:flex-end;justify-content:center}.iconGroup[data-v-72a9c575]{font-size:.4em;width:16px;text-align:center;height:16px;line-height:16px;border-radius:8px;background:rgb(var(--neutral-grad-2));margin-right:.5em;margin-block:.25em}.iconGroup i[data-v-72a9c575]{color:rgb(var(--neutral-grad-1))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./VuePageTransition.vue?vue&type=template&id=108c57b8&scoped=true&\"\nimport script from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nexport * from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./VuePageTransition.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./VuePageTransition.vue?vue&type=style&index=1&id=108c57b8&lang=scss&scoped=true&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"108c57b8\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root{--overlay-bg:#1867c0;--transition-duration:.35s}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"\", \"\"]);\n// Exports\nmodule.exports = exports;\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=06594ccd&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * AES-CTR using a WebCrypto (or similar) API\n */\nclass WebCryptoAesCtr {\n constructor(key, crypto) {\n this.key = key;\n this.crypto = crypto;\n }\n static importKey(crypto, keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n // Only AES-128 and AES-256 supported. AES-192 is not.\n if (keyData.length !== 16 && keyData.length !== 32) {\n throw new Error(`Miscreant: invalid key length: ${keyData.length} (expected 16 or 32 bytes)`);\n }\n const key = yield crypto.subtle.importKey(\"raw\", keyData, \"AES-CTR\", false, [\"encrypt\"]);\n return new WebCryptoAesCtr(key, crypto);\n });\n }\n encryptCtr(iv, plaintext) {\n return __awaiter(this, void 0, void 0, function* () {\n const ciphertext = yield this.crypto.subtle.encrypt({ name: \"AES-CTR\", counter: iv, length: 16 }, this.key, plaintext);\n return new Uint8Array(ciphertext);\n });\n }\n clear() {\n // TODO: actually clear something. Do we need to?\n return this;\n }\n}\nexports.default = WebCryptoAesCtr;\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryCryptoStore = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\r\n\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\r\n\r\n/**\r\n * Internal module. in-memory storage for e2e.\r\n *\r\n * @module\r\n */\r\n\r\n/**\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\nclass MemoryCryptoStore {\r\n constructor() {\r\n this._outgoingRoomKeyRequests = [];\r\n this._account = null;\r\n this._crossSigningKeys = null;\r\n this._privateKeys = {};\r\n this._backupKeys = {}; // Map of {devicekey -> {sessionId -> session pickle}}\r\n\r\n this._sessions = {}; // Map of {devicekey -> array of problems}\r\n\r\n this._sessionProblems = {}; // Map of {userId -> deviceId -> true}\r\n\r\n this._notifiedErrorDevices = {}; // Map of {senderCurve25519Key+'/'+sessionId -> session data object}\r\n\r\n this._inboundGroupSessions = {};\r\n this._inboundGroupSessionsWithheld = {}; // Opaque device data object\r\n\r\n this._deviceData = null; // roomId -> Opaque roomInfo object\r\n\r\n this._rooms = {}; // Set of {senderCurve25519Key+'/'+sessionId}\r\n\r\n this._sessionsNeedingBackup = {}; // roomId -> array of [senderKey, sessionId]\r\n\r\n this._sharedHistoryInboundGroupSessions = {};\r\n }\r\n /**\r\n * Ensure the database exists and is up-to-date.\r\n *\r\n * This must be called before the store can be used.\r\n *\r\n * @return {Promise} resolves to the store.\r\n */\r\n\r\n\r\n async startup() {\r\n // No startup work to do for the memory store.\r\n return this;\r\n }\r\n /**\r\n * Delete all data from this store.\r\n *\r\n * @returns {Promise} Promise which resolves when the store has been cleared.\r\n */\r\n\r\n\r\n deleteAllData() {\r\n return Promise.resolve();\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return utils.promiseTry(() => {\r\n // first see if we already have an entry for this request.\r\n const existing = this._getOutgoingRoomKeyRequest(requestBody);\r\n\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n return existing;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n this._outgoingRoomKeyRequests.push(request);\r\n\r\n return request;\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return Promise.resolve(this._getOutgoingRoomKeyRequest(requestBody));\r\n }\r\n /**\r\n * Looks for existing room key request, and returns the result synchronously.\r\n *\r\n * @internal\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {module:crypto/store/base~OutgoingRoomKeyRequest?}\r\n * the matching request, or null if not found\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(requestBody) {\r\n for (const existing of this._outgoingRoomKeyRequests) {\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n return existing;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state) {\r\n return Promise.resolve(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All OutgoingRoomKeyRequests in state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return Promise.resolve(this._outgoingRoomKeyRequests.filter(r => r.state == wantedState));\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n const results = [];\r\n\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state && req.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${req.state}`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n Object.assign(req, updates);\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n for (let i = 0; i < this._outgoingRoomKeyRequests.length; i++) {\r\n const req = this._outgoingRoomKeyRequests[i];\r\n\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${req.state} ` + `(expected ${expectedState})`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n this._outgoingRoomKeyRequests.splice(i, 1);\r\n\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n func(this._account);\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n this._account = newData;\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n func(this._crossSigningKeys);\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const result = this._privateKeys[type];\r\n return func(result || null);\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n this._crossSigningKeys = keys;\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n this._privateKeys[type] = key;\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n return Object.keys(this._sessions).length;\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const deviceSessions = this._sessions[deviceKey] || {};\r\n func(deviceSessions[sessionId] || null);\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n func(this._sessions[deviceKey] || {});\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n Object.entries(this._sessions).forEach(([deviceKey, deviceSessions]) => {\r\n Object.entries(deviceSessions).forEach(([sessionId, session]) => {\r\n func(_objectSpread(_objectSpread({}, session), {}, {\r\n deviceKey,\r\n sessionId\r\n }));\r\n });\r\n });\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n let deviceSessions = this._sessions[deviceKey];\r\n\r\n if (deviceSessions === undefined) {\r\n deviceSessions = {};\r\n this._sessions[deviceKey] = deviceSessions;\r\n }\r\n\r\n deviceSessions[sessionId] = sessionInfo;\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const problems = this._sessionProblems[deviceKey] = this._sessionProblems[deviceKey] || [];\r\n problems.push({\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n const problems = this._sessionProblems[deviceKey] || [];\r\n\r\n if (!problems.length) {\r\n return null;\r\n }\r\n\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n return Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n return null;\r\n } else {\r\n return lastProblem;\r\n }\r\n }\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const notifiedErrorDevices = this._notifiedErrorDevices;\r\n const ret = [];\r\n\r\n for (const device of devices) {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n\r\n if (userId in notifiedErrorDevices) {\r\n if (!(deviceInfo.deviceId in notifiedErrorDevices[userId])) {\r\n ret.push(device);\r\n notifiedErrorDevices[userId][deviceInfo.deviceId] = true;\r\n }\r\n } else {\r\n ret.push(device);\r\n notifiedErrorDevices[userId] = {\r\n [deviceInfo.deviceId]: true\r\n };\r\n }\r\n }\r\n\r\n return ret;\r\n } // Inbound Group Sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n func(this._inboundGroupSessions[k] || null, this._inboundGroupSessionsWithheld[k] || null);\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n for (const key of Object.keys(this._inboundGroupSessions)) {\r\n // we can't use split, as the components we are trying to split out\r\n // might themselves contain '/' characters. We rely on the\r\n // senderKey being a (32-byte) curve25519 key, base64-encoded\r\n // (hence 43 characters long).\r\n func({\r\n senderKey: key.substr(0, 43),\r\n sessionId: key.substr(44),\r\n sessionData: this._inboundGroupSessions[key]\r\n });\r\n }\r\n\r\n func(null);\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n\r\n if (this._inboundGroupSessions[k] === undefined) {\r\n this._inboundGroupSessions[k] = sessionData;\r\n }\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n this._inboundGroupSessions[senderCurve25519Key + '/' + sessionId] = sessionData;\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n this._inboundGroupSessionsWithheld[k] = sessionData;\r\n } // Device Data\r\n\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n func(this._deviceData);\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n this._deviceData = deviceData;\r\n } // E2E rooms\r\n\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n this._rooms[roomId] = roomInfo;\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n func(this._rooms);\r\n }\r\n\r\n getSessionsNeedingBackup(limit) {\r\n const sessions = [];\r\n\r\n for (const session in this._sessionsNeedingBackup) {\r\n if (this._inboundGroupSessions[session]) {\r\n sessions.push({\r\n senderKey: session.substr(0, 43),\r\n sessionId: session.substr(44),\r\n sessionData: this._inboundGroupSessions[session]\r\n });\r\n\r\n if (limit && session.length >= limit) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(sessions);\r\n }\r\n\r\n countSessionsNeedingBackup() {\r\n return Promise.resolve(Object.keys(this._sessionsNeedingBackup).length);\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n delete this._sessionsNeedingBackup[sessionKey];\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n markSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n this._sessionsNeedingBackup[sessionKey] = true;\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId) {\r\n const sessions = this._sharedHistoryInboundGroupSessions[roomId] || [];\r\n sessions.push([senderKey, sessionId]);\r\n this._sharedHistoryInboundGroupSessions[roomId] = sessions;\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId) {\r\n return Promise.resolve(this._sharedHistoryInboundGroupSessions[roomId] || []);\r\n } // Session key backups\r\n\r\n\r\n doTxn(mode, stores, func) {\r\n return Promise.resolve(func(null));\r\n }\r\n\r\n}\r\n\r\nexports.MemoryCryptoStore = MemoryCryptoStore;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.FilterComponent = FilterComponent;\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module filter-component\r\n */\r\n\r\n/**\r\n * Checks if a value matches a given field value, which may be a * terminated\r\n * wildcard pattern.\r\n * @param {String} actual_value The value to be compared\r\n * @param {String} filter_value The filter pattern to be compared\r\n * @return {bool} true if the actual_value matches the filter_value\r\n */\r\nfunction _matches_wildcard(actual_value, filter_value) {\r\n if (filter_value.endsWith(\"*\")) {\r\n const type_prefix = filter_value.slice(0, -1);\r\n return actual_value.substr(0, type_prefix.length) === type_prefix;\r\n } else {\r\n return actual_value === filter_value;\r\n }\r\n}\r\n/**\r\n * FilterComponent is a section of a Filter definition which defines the\r\n * types, rooms, senders filters etc to be applied to a particular type of resource.\r\n * This is all ported over from synapse's Filter object.\r\n *\r\n * N.B. that synapse refers to these as 'Filters', and what js-sdk refers to as\r\n * 'Filters' are referred to as 'FilterCollections'.\r\n *\r\n * @constructor\r\n * @param {Object} filter_json the definition of this filter JSON, e.g. { 'contains_url': true }\r\n */\r\n\r\n\r\nfunction FilterComponent(filter_json) {\r\n this.filter_json = filter_json;\r\n this.types = filter_json.types || null;\r\n this.not_types = filter_json.not_types || [];\r\n this.rooms = filter_json.rooms || null;\r\n this.not_rooms = filter_json.not_rooms || [];\r\n this.senders = filter_json.senders || null;\r\n this.not_senders = filter_json.not_senders || [];\r\n this.contains_url = filter_json.contains_url || null;\r\n}\r\n/**\r\n * Checks with the filter component matches the given event\r\n * @param {MatrixEvent} event event to be checked against the filter\r\n * @return {bool} true if the event matches the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype.check = function (event) {\r\n return this._checkFields(event.getRoomId(), event.getSender(), event.getType(), event.getContent() ? event.getContent().url !== undefined : false);\r\n};\r\n/**\r\n * Checks whether the filter component matches the given event fields.\r\n * @param {String} room_id the room_id for the event being checked\r\n * @param {String} sender the sender of the event being checked\r\n * @param {String} event_type the type of the event being checked\r\n * @param {String} contains_url whether the event contains a content.url field\r\n * @return {bool} true if the event fields match the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype._checkFields = function (room_id, sender, event_type, contains_url) {\r\n const literal_keys = {\r\n \"rooms\": function (v) {\r\n return room_id === v;\r\n },\r\n \"senders\": function (v) {\r\n return sender === v;\r\n },\r\n \"types\": function (v) {\r\n return _matches_wildcard(event_type, v);\r\n }\r\n };\r\n const self = this;\r\n\r\n for (let n = 0; n < Object.keys(literal_keys).length; n++) {\r\n const name = Object.keys(literal_keys)[n];\r\n const match_func = literal_keys[name];\r\n const not_name = \"not_\" + name;\r\n const disallowed_values = self[not_name];\r\n\r\n if (disallowed_values.filter(match_func).length > 0) {\r\n return false;\r\n }\r\n\r\n const allowed_values = self[name];\r\n\r\n if (allowed_values && allowed_values.length > 0) {\r\n const anyMatch = allowed_values.some(match_func);\r\n\r\n if (!anyMatch) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n const contains_url_filter = this.filter_json.contains_url;\r\n\r\n if (contains_url_filter !== undefined) {\r\n if (contains_url_filter !== contains_url) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n/**\r\n * Filters a list of events down to those which match this filter component\r\n * @param {MatrixEvent[]} events Events to be checked againt the filter component\r\n * @return {MatrixEvent[]} events which matched the filter component\r\n */\r\n\r\n\r\nFilterComponent.prototype.filter = function (events) {\r\n return events.filter(this.check, this);\r\n};\r\n/**\r\n * Returns the limit field for a given filter component, providing a default of\r\n * 10 if none is otherwise specified. Cargo-culted from Synapse.\r\n * @return {Number} the limit for this filter component.\r\n */\r\n\r\n\r\nFilterComponent.prototype.limit = function () {\r\n return this.filter_json.limit !== undefined ? this.filter_json.limit : 10;\r\n};","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","import f from \"../functions.js\";\r\nclass User {\r\n constructor(core, p){\r\n if(!p) p = {}\r\n\r\n this.core = core\r\n this.state = 0\r\n this.keysupdatetimeout = null\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n \r\n }\r\n\r\n destroy (){\r\n if(this.keysupdatetimeout){\r\n clearTimeout(this.keysupdatetimeout)\r\n }\r\n\r\n this.keysupdatetimeout = null\r\n this.state = 0\r\n\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n\r\n }\r\n\r\n setCredentials (credentials){\r\n if (credentials)\r\n this.credentials = credentials\r\n }\r\n\r\n setUsersInfo (usersinfo, reload){\r\n _.each(usersinfo || [], v => {\r\n\r\n this.core.store.commit('SET_USERINFO', {\r\n info : v,\r\n reload : reload\r\n })\r\n })\r\n }\r\n\r\n setContacts (usersinfo){\r\n \r\n //this.core.store.commit('SET_CONTACTS', usersinfo)\r\n \r\n }\r\n\r\n myMatrixId(){\r\n return this.matrixId(this.userinfo.id)\r\n }\r\n\r\n matrixId(id, domain){\r\n \r\n id || (id = '')\r\n\r\n if(id.indexOf(\"@\") == 0) return id\r\n\r\n return '@' + id + ':' + (domain || this.core.domain)\r\n }\r\n\r\n fromMatrixId(matrixid){\r\n return f.getmatrixid(matrixid)\r\n }\r\n}\r\n\r\nexport default User","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","/* (ignored) */","var EXIF = require('exif-js');\r\n\r\nimport f from '@/application/functions'\r\n\r\nvar Images = function(){\r\n var self = this;\r\n\r\n self.orientation = function(image, exif){\r\n\r\n return new Promise((resolve, reject) => {\r\n if(!exif.orientation){\r\n return resolve(image)\r\n }\r\n\r\n var img = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d');\r\n \r\n img.src = srcData;\r\n\r\n img.onload = function(){\r\n\r\n var width = img.width,\r\n height = img.height;\r\n \r\n // set proper canvas dimensions before transform & export\r\n if ($.inArray(exif.orientation, [5, 6, 7, 8]) > -1) {\r\n canvas.width = height;\r\n canvas.height = width;\r\n } else {\r\n canvas.width = width;\r\n canvas.height = height;\r\n }\r\n \r\n // transform context before drawing image\r\n switch (exif.orientation) {\r\n case 1:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 2:\r\n // flip horizontal\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 3:\r\n // rotate 180\r\n ctx.translate(width, height);\r\n ctx.rotate(Math.PI);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 4:\r\n // flip vertical\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 5:\r\n // flip vertical, rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 6:\r\n // rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(0, -height);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 7:\r\n // flip horizontal, rotate 90 counter clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(width, -height);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 8:\r\n // rotate 90 counter clockwise\r\n ctx.rotate(-Math.PI / 2);\r\n ctx.translate(-width, 0);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n default:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n return;\r\n }\r\n \r\n // Draw img into canvas\r\n // ctx.drawImage(img, 0, 0, width, height);\r\n\r\n var url = canvas.toDataURL(\"image/jpeg\", 0.95);\r\n\r\n $(canvas).remove();\r\n\r\n resolve(url)\r\n\r\n }\r\n })\r\n }\r\n\r\n self.autorotation = function(file, base64){\r\n return new Promise((resolve, reject) => {\r\n\r\n if (file && !f.isios()) {\r\n EXIF.getData(file, function() {\r\n \r\n var exif = EXIF.getAllTags(this)\r\n \r\n self.orientation(base64, exif).then(res => {\r\n return resolve(res)\r\n })\r\n \r\n })\r\n } else {\r\n return resolve(base64)\r\n }\r\n }) \r\n\r\n }\r\n\r\n self.srcToData = function(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function() {\r\n var reader = new FileReader();\r\n reader.onloadend = function() {\r\n callback(reader.result);\r\n }\r\n reader.readAsDataURL(xhr.response);\r\n };\r\n \r\n xhr.onerror = function(){}\r\n \r\n xhr.open('GET', url);\r\n xhr.responseType = 'blob';\r\n xhr.send();\r\n }\r\n\r\n self.resize = {\r\n fit : function(srcData, width, height, format, quality) {\r\n\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\";\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n\r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n var c = Math.max(((newHeight - height) / newHeight), ((newWidth - width) / newWidth))\r\n \r\n if(c > 0){\r\n newHeight = newHeight * (c + 1)\r\n newWidth = newWidth * (c + 1)\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n\r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n }) \r\n \r\n },\r\n\r\n def : function(srcData, width, height, format, quality) {\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\"\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n \r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n \r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n \r\n })\r\n \r\n \r\n }\r\n }\r\n \r\n \r\n self.grayscaleImage = function (srcData, clbk){\r\n\r\n var image = new Image();\r\n\r\n image.src = srcData;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n image.onload = function(){\r\n\r\n var myCanvas = document.createElement(\"canvas\");\r\n var myCanvasContext = myCanvas.getContext(\"2d\");\r\n\r\n var imgWidth = image.width;\r\n var imgHeight = image.height;\r\n \r\n myCanvas.width = imgWidth;\r\n myCanvas.height = imgHeight;\r\n\r\n myCanvasContext.drawImage(image, 0, 0);\r\n\r\n var imageData = myCanvasContext.getImageData(0,0, imgWidth, imgHeight);\r\n\r\n var j = 0, i = 0;\r\n\r\n for (i = 0; i < imageData.height; i++)\r\n {\r\n for (j = 0; j < imageData.width; j++)\r\n {\r\n var index=(i*4)*imageData.width+(j*4);\r\n var red=imageData.data[index];\r\n var green=imageData.data[index+1];\r\n var blue=imageData.data[index+2];\r\n var alpha=imageData.data[index+3];\r\n var average = (3 * red + green + blue)/3;\r\n\r\n imageData.data[index] = average;\r\n imageData.data[index+1]= average;\r\n imageData.data[index+2]= average;\r\n imageData.data[index+3]= alpha;\r\n }\r\n }\r\n\r\n myCanvasContext.putImageData(imageData, 0, 0, 0, 0, imageData.width, imageData.height);\r\n \r\n resolve(myCanvas.toDataURL());\r\n\r\n }\r\n\r\n })\r\n }\r\n\r\n self.wh = function(base64){\r\n const img = new Image();\r\n var imgInfo = {};\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n img.onload = function () {\r\n imgInfo.w = this.width\r\n imgInfo.h = this.height\r\n resolve(imgInfo)\r\n }\r\n\r\n img.onerror = function (e) {\r\n reject(e)\r\n }\r\n\r\n img.src = base64\r\n //this.info = imgInfo\r\n\r\n })\r\n \r\n }\r\n\r\n return self;\r\n}\r\n\r\nexport default Images","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","module.exports = require('./readable').PassThrough\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=16157ecb&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=16157ecb&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"16157ecb\",\n null\n ,true\n)\n\nexport default component.exports","import Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport f from '@/application/functions.js'\r\n\r\n\r\nVue.use(Vuex);\r\n\r\nvar themes = {\r\n\twhite: \"White\",\r\n\tblack: \"Dark\",\r\n\tclassic: \"Classic\"\r\n}\r\n\r\nvar mex = {\r\n\ttheme: function (state, value) {\r\n\r\n\t\tif (themes[value]) {\r\n\t\t\tstate.theme = value\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar activetimeout = null\r\n\r\nvar store = new Vuex.Store({\r\n\tstate: {\r\n\t\tcontacts: {},\r\n\t\tcontactsFromMatrix: {},\r\n\t\tcontactsMap: {},\r\n\t\tchats: [],\r\n\t\tprechats: [],\r\n\t\tchatsMap: {},\r\n\t\tevents: {},\r\n\t\tusers: {},\r\n\t\ttyping: {},\r\n\t\ticon: null,\r\n\t\tloading: false,\r\n\t\tonline: true,\r\n\t\tunauthorized: false,\r\n\t\ttheme: 'white',\r\n\t\tthemes: themes,\r\n\t\tsignedUpUsers: [],\r\n\t\tpocketnet: '',\r\n\t\tmobile: '',\r\n\t\tvoiceMessagesEnabled: '',\r\n\t\tcurrentPlayingVoiceMessage: null,\r\n\t\tcurrent_user: {},\r\n\t\tminimized: true,\r\n\t\tactive: false,\r\n\t\tactiveBlock: {},\r\n\t\tglobalpreloader: false,\r\n\t\tallnotifications: 0,\r\n\t\tpocketteammessages: [],\r\n\t\treadedteammessages: {},\r\n\t\tchatsready: false,\r\n\t\tautohide: false,\r\n\t\titeraction: false,\r\n\t\troomMembes: [],\r\n\t\tgallery: null,\r\n\t\tshare: null,\r\n\t\tcontact: null,\r\n\t\tconnect: null,\r\n\t\tjoinroom: null,\r\n\t\tchatusers: {},\r\n\t\tforce: {},\r\n\t\twasunhidden: false,\r\n\t\thiddenInParent: false,\r\n\t\thideOptimization: false,\r\n\t\tmodalShowed: null,\r\n\t\tmenu: null,\r\n\t\tpinchat: false,\r\n\t\tlastroom: null,\r\n\t\tdontreadreceipts: false,\r\n\t\tvoicerecording : false,\r\n\t\tdeletedrooms: {},\r\n\t\tpkoindisabled : false\r\n\t\t//share : {url : 'https://yandex.ru/'} //null\r\n\t},\r\n\tgetters: {\r\n\t\tgetUser: state => {\r\n\t\t\treturn state.user\r\n\t\t},\r\n\t\tgetConnection: state => {\r\n\t\t\treturn state.localMatrixStore\r\n\t\t},\r\n\r\n\t\tgetSignedUpUsers: state => {\r\n\t\t\treturn state.signedUpUsers\r\n\t\t},\r\n\t},\r\n\tmutations: {\r\n\t\tSET_CURRENT_PLAYING_VOICE_MESSAGE(state, message) {\r\n\t\t\tstate.currentPlayingVoiceMessage = message\r\n\t\t},\r\n\t\tsetUser(state, userData) {\r\n\t\t\tstate.current_user = userData || {}\r\n\t\t},\r\n\r\n\t\tclearall(state) {\r\n\r\n\t\t\tstate.contacts = {}\r\n\t\t\tstate.contactsFromMatrix = {}\r\n\t\t\tstate.contactsMap = {}\r\n\t\t\tstate.chats = []\r\n\t\t\tstate.prechats = []\r\n\t\t\tstate.chatsMap = {}\r\n\t\t\tstate.events = {}\r\n\t\t\tstate.users = {}\r\n\t\t\tstate.typing = {}\r\n\t\t\tstate.icon = null\r\n\t\t\tstate.loading = false\r\n\t\t\tstate.online = true\r\n\t\t\tstate.unauthorized = false\r\n\t\t\tstate.signedUpUsers = []\r\n\t\t\t/*state.pocketnet = ''*/\r\n\t\t\tstate.current_user = {}\r\n\t\t\tstate.minimized = false\r\n\t\t\tstate.active = false\r\n\t\t\tstate.activeBlock = {}\r\n\t\t\tstate.globalpreloader = false\r\n\t\t\tstate.allnotifications = 0\r\n\t\t\tstate.pocketteammessages = []\r\n\t\t\tstate.readedteammessages = {}\r\n\t\t\tstate.chatsready = false\r\n\t\t\tstate.autohide = false\r\n\t\t\tstate.gallery = null\r\n\t\t\tstate.modalShowed = null\r\n\t\t\tstate.menu = null\r\n\t\t\tstate.pinchat = false\r\n\t\t\tstate.dontreadreceipts = false\r\n\t\t\tstate.lastroom = null\r\n\t\t\tstate.voicerecording = false\r\n\r\n\t\t\t// state.share = null\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t} else state.minimized = true\r\n\r\n\t\t\tif (activetimeout) {\r\n\t\t\t\tclearTimeout(activetimeout)\r\n\t\t\t\tactivetimeout = null\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tblockactive(state, a) {\r\n\t\t\tif (a.value)\r\n\t\t\t\tVue.set(state.activeBlock, a.item, a.value)\r\n\t\t\telse\r\n\t\t\t\tVue.delete(state.activeBlock, a.item, a.value)\r\n\r\n\t\t},\r\n\r\n\t\tglobalpreloader: function (state, value) {\r\n\t\t\tstate.globalpreloader = value\r\n\t\t},\r\n\r\n\t\ticon(state, value) {\r\n\r\n\t\t\tstate.icon = value\r\n\r\n\t\t\tvar mv = f.deep(window, 'window.POCKETNETINSTANCE.mobile.vibration')\r\n\r\n\t\t\tif (mv) {\r\n\t\t\t\tmv.small()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tpkoindisabled(state, value){\r\n\t\t\tstate.pkoindisabled = value && value == 'true' ? true : false\r\n\t\t},\r\n\r\n\t\twasunhidden(state, value) {\r\n\t\t\tstate.wasunhidden = true\r\n\t\t},\r\n\r\n\t\thiddenInParent(state, value) {\r\n\t\t\tstate.hiddenInParent = value\r\n\t\t},\r\n\r\n\t\thideOptimization(state, value) {\r\n\t\t\tstate.hideOptimization = value\r\n\t\t},\r\n\r\n\t\tpinchat(state, value) {\r\n\t\t\tstate.pinchat = value\r\n\t\t\tlocalStorage['pinchat'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tdontreadreceipts(state, value) {\r\n\t\t\tstate.dontreadreceipts = value\r\n\r\n\t\t\tlocalStorage['dontreadreceipts'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tSET_LAST_ROOM(state, value) {\r\n\r\n\t\t\tif (!value) state.lastroom = null\r\n\r\n\t\t\telse\r\n\t\t\t\tstate.lastroom = {\r\n\t\t\t\t\tid: value,\r\n\t\t\t\t\ttime: new Date()\r\n\t\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tactive(state, value) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tvar time = 50;\r\n\r\n\t\t\tif (!value) time = 1000\r\n\r\n\t\t\tactivetimeout = f.slowMade(() => {\r\n\r\n\t\t\t\tif (!value) {\r\n\t\t\t\t\tif (!_.isEmpty(state.activeBlock)) {\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstate.iteraction = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstate.active = value\r\n\r\n\t\t\t\tif (!state.active) {\r\n\t\t\t\t\tstate.share = null\r\n\t\t\t\t\tdelete state.activeBlock.share\r\n\t\t\t\t}\r\n\r\n\t\t\t}, activetimeout, time)\r\n\t\t},\r\n\r\n\t\tsetiteraction(state, value) {\r\n\t\t\tstate.iteraction = value\r\n\t\t},\r\n\r\n\t\tmaximize(state, route) {\r\n\t\t\tstate.minimized = false\r\n\t\t},\r\n\r\n\t\tminimize(state, v) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif (state.minimized) {\r\n\t\t\t\tstate.activeBlock = {}\r\n\t\t\t\tstate.active = false\r\n\t\t\t}\r\n\r\n\t\t\tstate.minimized = true\r\n\t\t},\r\n\r\n\t\tsetmodal(state, v) {\r\n\t\t\tstate.modalShowed = v;\r\n\t\t},\r\n\r\n\t\tsetPocketnet(state, pocketnet) {\r\n\t\t\tstate.pocketnet = pocketnet;\r\n\t\t},\r\n\t\tsetMobile(state, mobile) {\r\n\t\t\tstate.mobile = mobile;\r\n\t\t},\r\n\r\n\t\tsetVoiceMessagesEnabled(state, voiceMessagesEnabled) {\r\n\t\t\tstate.voiceMessagesEnabled = voiceMessagesEnabled;\r\n\t\t},\r\n\r\n\t\tls(state) {\r\n\t\t\tif (typeof localStorage.getItem('pinchat') != 'undefined')\r\n\t\t\t\tstate.pinchat = localStorage.getItem('pinchat') ? true : false\r\n\r\n\t\t\tif (typeof localStorage.getItem('dontreadreceipts') != 'undefined')\r\n\t\t\t\tstate.dontreadreceipts = localStorage.getItem('dontreadreceipts') ? true : false\r\n\t\t},\r\n\r\n\t\tinit(state) {\r\n\t\t\tmex.theme(state, localStorage.getItem('theme') || 'white')\r\n\r\n\r\n\r\n\t\t},\r\n\r\n\t\tALL_NOTIFICATIONS_COUNT(state, rooms) {\r\n\r\n\t\t\tvar n = new Date()\r\n\r\n\t\t\tvar count = _.filter(rooms, room => {\r\n\r\n\t\t\t\tif (room._selfMembership === 'invite') {\r\n\t\t\t\t\tvar users = store._vm.core.mtrx.anotherChatUsers(room)\r\n\r\n\t\t\t\t\tif (users.length == 1 && store._vm.core.mtrx.blockeduser(users[0].userId)) {\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (f.date.addseconds(new Date(room.summary.lastModified), 86400) > n) return true\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tstate.allnotifications = _.reduce(rooms, (s, chat) => {\r\n\r\n\t\t\t\treturn s + (chat.getUnreadNotificationCount() || 0)\r\n\r\n\t\t\t}, 0) + count.length\r\n\r\n\r\n\t\t\tif (state.chats.length <= 3) {\r\n\t\t\t\t// Count notifications from pocketnet team room\r\n\t\t\t\tvar pocketMessages = _.filter(state.pocketteammessages, function (m) {\r\n\t\t\t\t\treturn !state.readedteammessages[m.id];\r\n\t\t\t\t}).length;\r\n\t\t\t\tstate.allnotifications += pocketMessages\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar external = f.deep(store, '_vm.core.external.clbks.ALL_NOTIFICATIONS_COUNT') || {}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(state.allnotifications)\r\n\t\t\t})\r\n\r\n\t\t\treturn state.allnotifications\r\n\t\t},\r\n\r\n\t\tSET_CHATS_READY(state, v) {\r\n\t\t\tstate.chatsready = v\r\n\t\t},\r\n\r\n\t\tSET_PRECHATS_TO_STORE(state, chats) {\r\n\t\t\tstate.prechats = chats;\r\n\t\t},\r\n\r\n\t\tSET_CHAT_TO_FORCE(state, id) {\r\n\r\n\r\n\t\t\tVue.set(state.force, id, true)\r\n\r\n\t\t},\r\n\r\n\t\tSET_CHATS_TO_STORE(state, chats) {\r\n\r\n\t\t\tstate.chats = chats;\r\n\r\n\t\t\tvar chatsMap = {}\r\n\r\n\t\t\t_.each(chats, (chat) => {\r\n\r\n\t\t\t\tvar aid = chat.info.title.replace(\"#\", '')\r\n\r\n\t\t\t\tif (!state.chatsMap[chat.roomId] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, chat.roomId, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!state.chatsMap[aid] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, aid, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchatsMap[chat.roomId] = chat\r\n\t\t\t\tchatsMap[chat.info.title.replace(\"#\", '')] = chat\r\n\r\n\t\t\t\tVue.delete(state.force, chat.roomId)\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.chatsMap, function (c, id) {\r\n\t\t\t\tif (!chatsMap[id]) Vue.delete(state.chatsMap, id)\r\n\t\t\t})\r\n\r\n\t\t\t//state.chatsMap = chatsMap;\r\n\r\n\t\t},\r\n\t\tSET_EVENTS_TO_STORE(state, events) {\r\n\t\t\t//state.events = events\r\n\t\t\t\r\n\t\t\t_.each(events, function(ev, k){\r\n\t\t\t\tvar timeline = []\r\n\r\n\t\t\t\t_.each(ev.timeline, function(__e){\r\n\t\t\t\t\tvar e = __e.event\r\n\r\n\t\t\t\t\tvar _e = {\r\n\r\n\t\t\t\t\t\tevent : {\r\n\t\t\t\t\t\t\tcontent : _.clone(e.content),\r\n\t\t\t\t\t\t\tevent_id: e.event_id,\r\n\t\t\t\t\t\t\torigin_server_ts: e.origin_server_ts,\r\n\t\t\t\t\t\t\troom_id: e.room_id,\r\n\t\t\t\t\t\t\tsender: e.sender,\r\n\t\t\t\t\t\t\tstate_key: e.state_key,\r\n\t\t\t\t\t\t\ttype: e.type\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\tget : () => __e\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttimeline.push(_e)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\tVue.set(state.events, k, {timeline})\r\n\t\t\t});\r\n\r\n\t\t},\r\n\r\n\t\tSET_TYPING_TO_STORE(state, data) {\r\n\t\t\tstate.typing[data.room] || (state.typing[data.room] = {})\r\n\t\t\tstate.typing[data.room][data.name] = data.typing\r\n\r\n\t\t\tfunction allTrue(data) {\r\n\t\t\t\tfor (var o in data)\r\n\t\t\t\t\tif (!data[o]) return false;\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tallTrue(data.typing)\r\n\r\n\t\t},\r\n\t\tDELETE_ROOM(state, roomid) {\r\n\r\n\t\t\tVue.set(state.deletedrooms, roomid, true)\r\n\r\n\r\n\r\n\t\t},\r\n\t\tSET_CONTACTS(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tmp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contacts = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CHATS_USERS(state, v) {\r\n\r\n\t\t\t_.each(v || {}, function (u, i) {\r\n\t\t\t\tif (!state.chatusers[i] || !_.isEqual(state.chatusers[i], u)) {\r\n\t\t\t\t\tVue.set(state.chatusers, i, u)\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\r\n\t\t\t//state.chatusers = v || {}\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_FROM_MATRIX(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tif (f.getmatrixid(c.id) != (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)) mp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsFromMatrix = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_MAP(state) {\r\n\r\n\t\t\tvar contactsMap = {}\r\n\r\n\t\t\t_.each(state.contacts, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.contactsFromMatrix, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsMap = contactsMap;\r\n\t\t},\r\n\r\n\t\tSET_UNAUTHORIZED(state, v) {\r\n\t\t\tstate.unauthorized = v\r\n\t\t},\r\n\r\n\t\tSET_USERINFO(state, v) {\r\n\r\n\t\t\tif (!v.info) return\r\n\r\n\t\t\tif (v.reload || !state.users[v.info.id]) Vue.set(state.users, v.info.id, v.info)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tSET_CURRENT_ROOM(state, v) {\r\n\r\n\t\t\tstate.currentRoom = v\r\n\t\t},\r\n\r\n\t\tCLEAR_USERSINFO(state, v) {\r\n\t\t\tstate.users = {}\r\n\t\t},\r\n\r\n\t\tGALLERY(state, v) {\r\n\r\n\t\t\tstate.gallery = v || null\r\n\r\n\t\t\tvar fu = null\r\n\r\n\t\t\tif(v){\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.gallerybackground')\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.background')\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif (fu) {\r\n\t\t\t\tfu()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tSHARE(state, v) {\r\n\t\t\tstate.share = v || null\r\n\r\n\t\t\tif (!state.mobile) {\r\n\t\t\t\tstate.activeBlock.share = true\r\n\t\t\t\tstate.active = true;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tCONNECT(state, v) {\r\n\t\t\tstate.connect = v\r\n\t\t},\r\n\r\n\t\tJOINROOM(state, v) {\r\n\t\t\tstate.joinroom = v\r\n\t\t},\r\n\r\n\t\tCONTACT(state, v) {\r\n\t\t\tstate.contact = v || null\r\n\t\t},\r\n\r\n\t\ttheme(state, value) {\r\n\t\t\tmex.theme(state, value)\r\n\t\t},\r\n\r\n\t\tSET_POCKETTEAMMESSAGES(state, v) {\r\n\t\t\tstate.pocketteammessages = v;\r\n\t\t\t// Check local storage\r\n\t\t\tvar readedMessagesStr = localStorage.getItem('readedpocketteammessages');\r\n\t\t\tif (readedMessagesStr) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar readedMessages = JSON.parse(readedMessagesStr);\r\n\t\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tlocalStorage.removeItem('readedpocketteammessages');\r\n\t\t\t\t\tstate.readedteammessages = {};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_READEDTEAMMESSAGES(state, v) {\r\n\t\t\tif (v && v.length > 0) {\r\n\t\t\t\tvar readedMessages = {};\r\n\t\t\t\t_.each(v, function (m) {\r\n\t\t\t\t\treadedMessages[m.id] = true;\r\n\t\t\t\t});\r\n\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t// Update local storage\r\n\t\t\t\tlocalStorage.setItem('readedpocketteammessages', JSON.stringify(readedMessages));\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_MENU(state, v) {\r\n\t\t\tstate.menu = v\r\n\r\n\t\t},\r\n\r\n\t\tSET_VOICERECORDING(state, v){\r\n\t\t\tstate.voicerecording = v\r\n\t\t}\r\n\r\n\t},\r\n\tactions: {\r\n\t\tSET_CHAT_MEMBERS({ commit }, chat) {\r\n\r\n\t\t},\r\n\t\tTYPING_EVENT({ commit }, member) {\r\n\t\t\tlet room = member.roomId\r\n\t\t\tlet name = member.name\r\n\t\t\tlet data = { room, name, typing: member.typing }\r\n\t\t\tcommit('SET_TYPING_TO_STORE', data)\r\n\t\t},\r\n\t\tCHAT_MEMBERS({ commit }) {\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY_FROMEVENTS({ commit, dispatch }, { events, event }) {\r\n\r\n\t\t\tvar images = [], index = 0\r\n\r\n\t\t\tvar encrypted = function (event) {\r\n\t\t\t\treturn f.deep(event, 'event.content.info.secrets') ? true : false\r\n\t\t\t}\r\n\r\n\t\t\t_.each(events, event => {\r\n\r\n\t\t\t\tif (event.event.content.msgtype === 'm.image') {\r\n\r\n\t\t\t\t\tvar url = event.event.content.url\r\n\r\n\t\t\t\t\tif (encrypted(event)) {\r\n\t\t\t\t\t\turl = event.event.decryptedImage\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\timages.push({\r\n\t\t\t\t\t\tsrc: url,\r\n\t\t\t\t\t\tw: event.event.content.info.w || 500,\r\n\t\t\t\t\t\th: event.event.content.info.h || 500,\r\n\t\t\t\t\t\teventId: event.event.event_id\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\t\t\timages = _.filter(images, function (i) {\r\n\t\t\t\treturn i.src\r\n\t\t\t})\r\n\r\n\t\t\tindex = images.map(function (e) {\r\n\t\t\t\treturn e.eventId\r\n\t\t\t}).indexOf(event.event.event_id)\r\n\r\n\t\t\tdispatch('SHOW_GALLERY', { images, index })\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY({ commit }, { images, index }) {\r\n\r\n\t\t\tif (!index) index = 0\r\n\r\n\t\t\tif (!images) images = []\r\n\r\n\t\t\tif (images.length) {\r\n\r\n\t\t\t\tcommit('GALLERY', {\r\n\t\t\t\t\timages: images,\r\n\t\t\t\t\tindex: index\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcommit('GALLERY', null)\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tRELOAD_CHAT_USERS({ commit }, m_chats) {\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats, true).then(i => {\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tFETCH_CHATS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar id = store._vm.core.user.myMatrixId()\r\n\r\n\t\t\tvar chats = _.map(m_chats, function (r) {\r\n\t\t\t\tif (r.getLastActiveTimestamp() === -9007199254740991) {\r\n\r\n\t\t\t\t\tif (r.getMember(id)) {\r\n\t\t\t\t\t\tr.summary.lastModified = r.getMember(id).events.member.event.origin_server_ts\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tr.summary.lastModified = r.getLastActiveTimestamp()\r\n\t\t\t\t}\r\n\t\t\t\treturn r.summary\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_PRECHATS_TO_STORE', chats)\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.allchatmembers(m_chats).then(r => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_TO_STORE', chats)\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\r\n\t\t\t\treturn store._vm.core.mtrx.kit.fillContacts(m_chats)\r\n\r\n\t\t\t})\r\n\r\n\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats).then(i => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\tcommit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n\t\t\t\t\treturn m.id !== (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)\r\n\t\t\t\t}))\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\r\n\t\tFETCH_EVENTS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar events = {}\r\n\r\n\t\t\t_.each(m_chats, function (chat) {\r\n\r\n\t\t\t\tevents[chat.roomId] = {}\r\n\r\n\t\t\t\tvar timeline = [].concat(chat.timeline, chat.currentState.getStateEvents('m.room.member'))\r\n\r\n\t\t\t\tevents[chat.roomId].timeline = timeline\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(events, function (e) {\r\n\r\n\t\t\t\te.timeline = _.sortBy(e.timeline, function (event) {\r\n\t\t\t\t\treturn event.getDate()\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_EVENTS_TO_STORE', events)\r\n\r\n\t\t\t//store._vm.core.mtrx.kit.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n\t\t\t//})\r\n\r\n\t\t},\r\n\t}\r\n})\r\n\r\n\r\nexport default store;","/*!\n * vue-router v3.5.3\n * (c) 2021 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (!condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b, onlyPath) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query))\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n (onlyPath || (\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params))\n )\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/+/g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar warnedCustomSlot;\nvar warnedTagProp;\nvar warnedEventProp;\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n custom: Boolean,\n exact: Boolean,\n exactPath: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);\n classes[activeClass] = this.exact || this.exactPath\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (process.env.NODE_ENV !== 'production' && !this.custom) {\n !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\\n\\n');\n warnedCustomSlot = true;\n }\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\" with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ('tag' in this.$options.propsData && !warnedTagProp) {\n warn(\n false,\n \"'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedTagProp = true;\n }\n if ('event' in this.$options.propsData && !warnedEventProp) {\n warn(\n false,\n \"'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedEventProp = true;\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap,\n parentRoute\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n alias: route.alias\n ? typeof route.alias === 'string'\n ? [route.alias]\n : route.alias\n : [],\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function addRoute (parentOrRoute, route) {\n var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;\n // $flow-disable-line\n createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);\n\n // add aliases of parent\n if (parent && parent.alias.length) {\n createRouteMap(\n // $flow-disable-line route is defined if parent is\n parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),\n pathList,\n pathMap,\n nameMap,\n parent\n );\n }\n }\n\n function getRoutes () {\n return pathList.map(function (path) { return pathMap[path]; })\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoute: addRoute,\n getRoutes: getRoutes,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1.ensureURL();\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1.ready) {\n this$1.ready = true;\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1.ready = true;\n this$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1.errorCbs.length) {\n this$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'uncaught error during route navigation:');\n }\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n if (route.hash) {\n handleScroll(this.router, current, route, false);\n }\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1.replace(to);\n } else {\n this$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1.pending = null;\n onComplete(route);\n if (this$1.router.app) {\n this$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1.base);\n if (this$1.current === START && location === this$1._startLocation) {\n return\n }\n\n this$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n var pathLowerCase = path.toLowerCase();\n var baseLowerCase = base.toLowerCase();\n // base=\"/a\" shouldn't turn path=\"/app\" into \"/a/pp\"\n // https://github.com/vuejs/vue-router/issues/3555\n // so we ensure the trailing slash in the base\n if (base && ((pathLowerCase === baseLowerCase) ||\n (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n this$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1.current;\n this$1.index = targetIndex;\n this$1.updateRoute(route);\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n if (process.env.NODE_ENV !== 'production') {\n warn(this instanceof VueRouter, \"Router must be called with the new operator.\");\n }\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1.apps.indexOf(app);\n if (index > -1) { this$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }\n\n if (!this$1.app) { this$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.getRoutes = function getRoutes () {\n return this.matcher.getRoutes()\n};\n\nVueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {\n this.matcher.addRoute(parentOrRoute, route);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');\n }\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.5.3';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\nVueRouter.START_LOCATION = START;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nexport default VueRouter;\n","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\n\r\nVue.use(Router);\r\n\r\n\r\nconst router = new Router({\r\n routes: [\r\n \r\n {\r\n path: '/contacts',\r\n name: 'contacts',\r\n component: () => import ('@/views/contacts')\r\n },\r\n {\r\n path: '/contact',\r\n name: 'contact',\r\n component: () => import ('@/views/contact') \r\n },\r\n {\r\n path: '/chats',\r\n name: 'chats',\r\n component: () => import ('@/views/chats')\r\n },\r\n {\r\n path: '/chat',\r\n name: 'chat',\r\n component: () => import ('@/views/chat')\r\n },\r\n {\r\n path: '/publicPreview',\r\n name: 'publicPreview',\r\n component: () => import ('@/views/publicPreview')\r\n },\r\n {\r\n path: '/chatSettings',\r\n name: 'chatSettings',\r\n component: () => import ('@/views/chatSettings')\r\n },\r\n {\r\n path: '/chatInfo',\r\n name: 'chatInfo',\r\n component: () => import ('@/views/chatinfo')\r\n },\r\n {\r\n path: '/teamRoom',\r\n name: 'teamRoom',\r\n component: () => import ('@/views/teamroom')\r\n },\r\n {\r\n path: '/settings',\r\n name: 'settings',\r\n component: () => import ('@/views/settings')\r\n },\r\n\r\n {\r\n path: '/invite',\r\n name: 'invite',\r\n component: () => import ('@/views/invite')\r\n },\r\n\r\n \r\n ],\r\n \r\n mode: document.getElementById('automomous') ? 'history' : 'abstract',\r\n \r\n})\r\n\r\n\r\nexport default router","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},attrs:{\"id\":\"modal\"}},[_c('div',{staticClass:\"modal-backdrop\",on:{\"click\":_vm.close}}),_c('div',{staticClass:\"modal-wrapper\"},[_c('div',{staticClass:\"modal\",attrs:{\"role\":\"dialog\",\"aria-labelledby\":\"modalTitle\",\"aria-describedby\":\"modalDescription\"}},[_c('div',{staticClass:\"modal-header\"},[_vm._t(\"header\",function(){return [_vm._v(\" \"+_vm._s(_vm.$t(\"caption.header\"))+\" \")]})],2),_c('div',{staticClass:\"modal-body\",attrs:{\"id\":\"modalDescription\"}},[_vm._t(\"body\")],2),(_vm.displayFooter)?_c('div',{staticClass:\"modal-footer\"}):_vm._e(),_c('div',{staticClass:\"modal-close\",on:{\"click\":_vm.close}},[_c('i',{staticClass:\"fas fa-times\"})])])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'modal',\r\n props: {\r\n displayFooter : {\r\n default : true,\r\n type : Boolean\r\n },\r\n cantclose : Boolean\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'modal'})\r\n },\r\n \r\n destroyed() {\r\n this.$store.commit('blockactive', {value : false, item : 'modal'})\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n \r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active: state => state.active,\r\n mobile: state => state.mobile,\r\n }),\r\n\r\n methods : {\r\n close : function(){\r\n this.$emit('close')\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f016832&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pmenu\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile}},[(_vm.menu)?_c('div',{staticClass:\"menubgwrapper\"},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menu.items},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"items\"},[_c('transition-group',{attrs:{\"name\":\"menulis2t\",\"tag\":\"div\"}},_vm._l((_vm.filteredItems),function(item){return _c('div',{key:item.click,staticClass:\"item\"},[_vm._t(\"default\",function(){return [_c('router-link',{attrs:{\"to\":'/' + item.route}},[_c('div',{staticClass:\"iwr\"},[(item.icon)?_c('i',{class:item.icon}):_vm._e(),_c('span',[_vm._v(_vm._s(item.name && typeof item.name === 'string' ? item.name : 'undefined'))])])])]},{\"item\":item})],2)}),0)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./simpleMenu.vue?vue&type=template&id=79bb4e47&scoped=true&\"\nimport script from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nexport * from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"79bb4e47\",\n null\n ,true\n)\n\nexport default component.exports","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'pmenu',\r\n props: {\r\n \r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n return {\r\n last : null\r\n }\r\n },\r\n\r\n watch: {\r\n \r\n },\r\n\r\n computed: {\r\n\r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent,\r\n\r\n menu : state => state.menu\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n if (this.menu){\r\n\r\n this.last = this.menu\r\n\r\n\r\n this.menu.handler(item, this.menu.item, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n })\r\n\r\n // this.$emit('itemClicked', item, this.menu.item, );\r\n }\r\n \r\n },\r\n\r\n showPopup : function(){\r\n if (this.last){\r\n this.$store.commit('SET_MENU', this.last);\r\n this.last = null\r\n }\r\n },\r\n \r\n hidePopup() {\r\n this.$store.commit('SET_MENU', null);\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=6078dda8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=6078dda8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6078dda8\",\n null\n ,true\n)\n\nexport default component.exports","/*!\n * vue-textarea-autosize v1.1.1 \n * (c) 2019 Saymon\n * Released under the MIT License.\n */\n//\n//\n//\n//\n//\n//\n//\nvar script = {\n name: 'TextareaAutosize',\n props: {\n value: {\n type: [String, Number],\n default: ''\n },\n autosize: {\n type: Boolean,\n default: true\n },\n minHeight: {\n type: [Number],\n 'default': null\n },\n maxHeight: {\n type: [Number],\n 'default': null\n },\n\n /*\n * Force !important for style properties\n */\n important: {\n type: [Boolean, Array],\n default: false\n }\n },\n data: function data() {\n return {\n // data property for v-model binding with real textarea tag\n val: null,\n // works when content height becomes more then value of the maxHeight property\n maxHeightScroll: false,\n height: 'auto'\n };\n },\n computed: {\n computedStyles: function computedStyles() {\n if (!this.autosize) return {};\n return {\n resize: !this.isResizeImportant ? 'none' : 'none !important',\n height: this.height,\n overflow: this.maxHeightScroll ? 'auto' : !this.isOverflowImportant ? 'hidden' : 'hidden !important'\n };\n },\n isResizeImportant: function isResizeImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('resize');\n },\n isOverflowImportant: function isOverflowImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('overflow');\n },\n isHeightImportant: function isHeightImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('height');\n }\n },\n watch: {\n value: function value(val) {\n this.val = val;\n },\n val: function val(_val) {\n this.$nextTick(this.resize);\n this.$emit('input', _val);\n },\n minHeight: function minHeight() {\n this.$nextTick(this.resize);\n },\n maxHeight: function maxHeight() {\n this.$nextTick(this.resize);\n },\n autosize: function autosize(val) {\n if (val) this.resize();\n }\n },\n methods: {\n resize: function resize() {\n var _this = this;\n\n var important = this.isHeightImportant ? 'important' : '';\n this.height = \"auto\".concat(important ? ' !important' : '');\n this.$nextTick(function () {\n var contentHeight = _this.$el.scrollHeight + 1;\n\n if (_this.minHeight) {\n contentHeight = contentHeight < _this.minHeight ? _this.minHeight : contentHeight;\n }\n\n if (_this.maxHeight) {\n if (contentHeight > _this.maxHeight) {\n contentHeight = _this.maxHeight;\n _this.maxHeightScroll = true;\n } else {\n _this.maxHeightScroll = false;\n }\n }\n\n var heightVal = contentHeight + 'px';\n _this.height = \"\".concat(heightVal).concat(important ? ' !important' : '');\n });\n return this;\n }\n },\n created: function created() {\n this.val = this.value;\n },\n mounted: function mounted() {\n this.resize();\n }\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\n/* server only */\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n } // Vue.extend constructor export interop.\n\n\n var options = typeof script === 'function' ? script.options : script; // render functions\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true; // functional template\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n } // scopedId\n\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n var hook;\n\n if (moduleIdentifier) {\n // server build\n hook = function hook(context) {\n // 2.3 injection\n context = context || // cached call\n this.$vnode && this.$vnode.ssrContext || // stateful\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\n // 2.2 with runInNewContext: true\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n } // inject component styles\n\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n } // register component module identifier for async chunk inference\n\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n }; // used by ssr in case component is cached and beforeCreate\n // never gets called\n\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function () {\n style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n // register for functional component in vue file\n var originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\nvar normalizeComponent_1 = normalizeComponent;\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.val),expression:\"val\"}],style:(_vm.computedStyles),domProps:{\"value\":(_vm.val)},on:{\"focus\":_vm.resize,\"input\":function($event){if($event.target.composing){ return; }_vm.val=$event.target.value;}}})};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n\n \n var TextareaAutosize = normalizeComponent_1(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n undefined,\n undefined\n );\n\nvar version = '1.1.1';\n\nvar install = function install(Vue) {\n Vue.component('TextareaAutosize', TextareaAutosize);\n};\n\nvar plugin = {\n install: install,\n version: version\n};\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(plugin);\n}\n\nexport default plugin;\n","/*!\n * vue-i18n v8.27.0 \n * (c) 2022 kazuya kawaguchi\n * Released under the MIT License.\n */\n/* */\n\n/**\n * constants\n */\n\nvar numberFormatKeys = [\n 'compactDisplay',\n 'currency',\n 'currencyDisplay',\n 'currencySign',\n 'localeMatcher',\n 'notation',\n 'numberingSystem',\n 'signDisplay',\n 'style',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits'\n];\n\n/**\n * utilities\n */\n\nfunction warn (msg, err) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.warn(err.stack);\n }\n }\n}\n\nfunction error (msg, err) {\n if (typeof console !== 'undefined') {\n console.error('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.error(err.stack);\n }\n }\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isBoolean (val) {\n return typeof val === 'boolean'\n}\n\nfunction isString (val) {\n return typeof val === 'string'\n}\n\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n return toString.call(obj) === OBJECT_STRING\n}\n\nfunction isNull (val) {\n return val === null || val === undefined\n}\n\nfunction isFunction (val) {\n return typeof val === 'function'\n}\n\nfunction parseArgs () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var locale = null;\n var params = null;\n if (args.length === 1) {\n if (isObject(args[0]) || isArray(args[0])) {\n params = args[0];\n } else if (typeof args[0] === 'string') {\n locale = args[0];\n }\n } else if (args.length === 2) {\n if (typeof args[0] === 'string') {\n locale = args[0];\n }\n /* istanbul ignore if */\n if (isObject(args[1]) || isArray(args[1])) {\n params = args[1];\n }\n }\n\n return { locale: locale, params: params }\n}\n\nfunction looseClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction remove (arr, item) {\n if (arr.delete(item)) {\n return arr\n }\n}\n\nfunction arrayFrom (arr) {\n var ret = [];\n arr.forEach(function (a) { return ret.push(a); });\n return ret\n}\n\nfunction includes (arr, item) {\n return !!~arr.indexOf(item)\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\nfunction merge (target) {\n var arguments$1 = arguments;\n\n var output = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments$1[i];\n if (source !== undefined && source !== null) {\n var key = (void 0);\n for (key in source) {\n if (hasOwn(source, key)) {\n if (isObject(source[key])) {\n output[key] = merge(output[key], source[key]);\n } else {\n output[key] = source[key];\n }\n }\n }\n }\n }\n return output\n}\n\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = isArray(a);\n var isArrayB = isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.\n * @param rawText The raw input from the user that should be escaped.\n */\nfunction escapeHtml(rawText) {\n return rawText\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\n/**\n * Escapes html tags and special symbols from all provided params which were returned from parseArgs().params.\n * This method performs an in-place operation on the params object.\n *\n * @param {any} params Parameters as provided from `parseArgs().params`.\n * May be either an array of strings or a string->any map.\n *\n * @returns The manipulated `params` object.\n */\nfunction escapeParams(params) {\n if(params != null) {\n Object.keys(params).forEach(function (key) {\n if(typeof(params[key]) == 'string') {\n params[key] = escapeHtml(params[key]);\n }\n });\n }\n return params\n}\n\n/* */\n\nfunction extend (Vue) {\n if (!Vue.prototype.hasOwnProperty('$i18n')) {\n // $FlowFixMe\n Object.defineProperty(Vue.prototype, '$i18n', {\n get: function get () { return this._i18n }\n });\n }\n\n Vue.prototype.$t = function (key) {\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n\n var i18n = this.$i18n;\n return i18n._t.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this ].concat( values ))\n };\n\n Vue.prototype.$tc = function (key, choice) {\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n\n var i18n = this.$i18n;\n return i18n._tc.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this, choice ].concat( values ))\n };\n\n Vue.prototype.$te = function (key, locale) {\n var i18n = this.$i18n;\n return i18n._te(key, i18n.locale, i18n._getMessages(), locale)\n };\n\n Vue.prototype.$d = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).d.apply(ref, [ value ].concat( args ))\n };\n\n Vue.prototype.$n = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).n.apply(ref, [ value ].concat( args ))\n };\n}\n\n/* */\n\n/**\n * Mixin\n * \n * If `bridge` mode, empty mixin is returned,\n * else regulary mixin implementation is returned.\n */\nfunction defineMixin (bridge) {\n if ( bridge === void 0 ) bridge = false;\n\n function mounted () {\n if (this !== this.$root && this.$options.__INTLIFY_META__ && this.$el) {\n this.$el.setAttribute('data-intlify', this.$options.__INTLIFY_META__);\n }\n }\n\n return bridge\n ? { mounted: mounted } // delegate `vue-i18n-bridge` mixin implementation\n : { // regulary \n beforeCreate: function beforeCreate () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n = options.__i18nBridge || options.__i18n;\n _i18n.forEach(function (resource) {\n localeMessages = merge(localeMessages, JSON.parse(resource));\n });\n Object.keys(localeMessages).forEach(function (locale) {\n options.i18n.mergeLocaleMessage(locale, localeMessages[locale]);\n });\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n this._i18n = options.i18n;\n this._i18nWatcher = this._i18n.watchI18nData();\n } else if (isPlainObject(options.i18n)) {\n var rootI18n = this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n\n ? this.$root.$i18n\n : null;\n // component local i18n\n if (rootI18n) {\n options.i18n.root = this.$root;\n options.i18n.formatter = rootI18n.formatter;\n options.i18n.fallbackLocale = rootI18n.fallbackLocale;\n options.i18n.formatFallbackMessages = rootI18n.formatFallbackMessages;\n options.i18n.silentTranslationWarn = rootI18n.silentTranslationWarn;\n options.i18n.silentFallbackWarn = rootI18n.silentFallbackWarn;\n options.i18n.pluralizationRules = rootI18n.pluralizationRules;\n options.i18n.preserveDirectiveContent = rootI18n.preserveDirectiveContent;\n }\n\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages$1 = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n$1 = options.__i18nBridge || options.__i18n;\n _i18n$1.forEach(function (resource) {\n localeMessages$1 = merge(localeMessages$1, JSON.parse(resource));\n });\n options.i18n.messages = localeMessages$1;\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n\n var ref = options.i18n;\n var sharedMessages = ref.sharedMessages;\n if (sharedMessages && isPlainObject(sharedMessages)) {\n options.i18n.messages = merge(options.i18n.messages, sharedMessages);\n }\n\n this._i18n = new VueI18n(options.i18n);\n this._i18nWatcher = this._i18n.watchI18nData();\n\n if (options.i18n.sync === undefined || !!options.i18n.sync) {\n this._localeWatcher = this.$i18n.watchLocale();\n }\n\n if (rootI18n) {\n rootI18n.onComponentInstanceCreated(this._i18n);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n // root i18n\n this._i18n = this.$root.$i18n;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n // parent i18n\n this._i18n = options.parent.$i18n;\n }\n },\n\n beforeMount: function beforeMount () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (isPlainObject(options.i18n)) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n }\n },\n\n mounted: mounted,\n\n beforeDestroy: function beforeDestroy () {\n if (!this._i18n) { return }\n\n var self = this;\n this.$nextTick(function () {\n if (self._subscribing) {\n self._i18n.unsubscribeDataChanging(self);\n delete self._subscribing;\n }\n\n if (self._i18nWatcher) {\n self._i18nWatcher();\n self._i18n.destroyVM();\n delete self._i18nWatcher;\n }\n\n if (self._localeWatcher) {\n self._localeWatcher();\n delete self._localeWatcher;\n }\n });\n }\n }\n}\n\n/* */\n\nvar interpolationComponent = {\n name: 'i18n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n path: {\n type: String,\n required: true\n },\n locale: {\n type: String\n },\n places: {\n type: [Array, Object]\n }\n },\n render: function render (h, ref) {\n var data = ref.data;\n var parent = ref.parent;\n var props = ref.props;\n var slots = ref.slots;\n\n var $i18n = parent.$i18n;\n if (!$i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return\n }\n\n var path = props.path;\n var locale = props.locale;\n var places = props.places;\n var params = slots();\n var children = $i18n.i(\n path,\n locale,\n onlyHasDefaultPlace(params) || places\n ? useLegacyPlaces(params.default, places)\n : params\n );\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag ? h(tag, data, children) : children\n }\n};\n\nfunction onlyHasDefaultPlace (params) {\n var prop;\n for (prop in params) {\n if (prop !== 'default') { return false }\n }\n return Boolean(prop)\n}\n\nfunction useLegacyPlaces (children, places) {\n var params = places ? createParamsFromPlaces(places) : {};\n\n if (!children) { return params }\n\n // Filter empty text nodes\n children = children.filter(function (child) {\n return child.tag || child.text.trim() !== ''\n });\n\n var everyPlace = children.every(vnodeHasPlaceAttribute);\n if (process.env.NODE_ENV !== 'production' && everyPlace) {\n warn('`place` attribute is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return children.reduce(\n everyPlace ? assignChildPlace : assignChildIndex,\n params\n )\n}\n\nfunction createParamsFromPlaces (places) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`places` prop is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return Array.isArray(places)\n ? places.reduce(assignChildIndex, {})\n : Object.assign({}, places)\n}\n\nfunction assignChildPlace (params, child) {\n if (child.data && child.data.attrs && child.data.attrs.place) {\n params[child.data.attrs.place] = child;\n }\n return params\n}\n\nfunction assignChildIndex (params, child, index) {\n params[index] = child;\n return params\n}\n\nfunction vnodeHasPlaceAttribute (vnode) {\n return Boolean(vnode.data && vnode.data.attrs && vnode.data.attrs.place)\n}\n\n/* */\n\nvar numberComponent = {\n name: 'i18n-n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n value: {\n type: Number,\n required: true\n },\n format: {\n type: [String, Object]\n },\n locale: {\n type: String\n }\n },\n render: function render (h, ref) {\n var props = ref.props;\n var parent = ref.parent;\n var data = ref.data;\n\n var i18n = parent.$i18n;\n\n if (!i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return null\n }\n\n var key = null;\n var options = null;\n\n if (isString(props.format)) {\n key = props.format;\n } else if (isObject(props.format)) {\n if (props.format.key) {\n key = props.format.key;\n }\n\n // Filter out number format options only\n options = Object.keys(props.format).reduce(function (acc, prop) {\n var obj;\n\n if (includes(numberFormatKeys, prop)) {\n return Object.assign({}, acc, ( obj = {}, obj[prop] = props.format[prop], obj ))\n }\n return acc\n }, null);\n }\n\n var locale = props.locale || i18n.locale;\n var parts = i18n._ntp(props.value, locale, key, options);\n\n var values = parts.map(function (part, index) {\n var obj;\n\n var slot = data.scopedSlots && data.scopedSlots[part.type];\n return slot ? slot(( obj = {}, obj[part.type] = part.value, obj.index = index, obj.parts = parts, obj )) : part.value\n });\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag\n ? h(tag, {\n attrs: data.attrs,\n 'class': data['class'],\n staticClass: data.staticClass\n }, values)\n : values\n }\n};\n\n/* */\n\nfunction bind (el, binding, vnode) {\n if (!assert(el, vnode)) { return }\n\n t(el, binding, vnode);\n}\n\nfunction update (el, binding, vnode, oldVNode) {\n if (!assert(el, vnode)) { return }\n\n var i18n = vnode.context.$i18n;\n if (localeEqual(el, vnode) &&\n (looseEqual(binding.value, binding.oldValue) &&\n looseEqual(el._localeMessage, i18n.getLocaleMessage(i18n.locale)))) { return }\n\n t(el, binding, vnode);\n}\n\nfunction unbind (el, binding, vnode, oldVNode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return\n }\n\n var i18n = vnode.context.$i18n || {};\n if (!binding.modifiers.preserve && !i18n.preserveDirectiveContent) {\n el.textContent = '';\n }\n el._vt = undefined;\n delete el['_vt'];\n el._locale = undefined;\n delete el['_locale'];\n el._localeMessage = undefined;\n delete el['_localeMessage'];\n}\n\nfunction assert (el, vnode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return false\n }\n\n if (!vm.$i18n) {\n warn('VueI18n instance does not exists in Vue instance');\n return false\n }\n\n return true\n}\n\nfunction localeEqual (el, vnode) {\n var vm = vnode.context;\n return el._locale === vm.$i18n.locale\n}\n\nfunction t (el, binding, vnode) {\n var ref$1, ref$2;\n\n var value = binding.value;\n\n var ref = parseValue(value);\n var path = ref.path;\n var locale = ref.locale;\n var args = ref.args;\n var choice = ref.choice;\n if (!path && !locale && !args) {\n warn('value type not supported');\n return\n }\n\n if (!path) {\n warn('`path` is required in v-t directive');\n return\n }\n\n var vm = vnode.context;\n if (choice != null) {\n el._vt = el.textContent = (ref$1 = vm.$i18n).tc.apply(ref$1, [ path, choice ].concat( makeParams(locale, args) ));\n } else {\n el._vt = el.textContent = (ref$2 = vm.$i18n).t.apply(ref$2, [ path ].concat( makeParams(locale, args) ));\n }\n el._locale = vm.$i18n.locale;\n el._localeMessage = vm.$i18n.getLocaleMessage(vm.$i18n.locale);\n}\n\nfunction parseValue (value) {\n var path;\n var locale;\n var args;\n var choice;\n\n if (isString(value)) {\n path = value;\n } else if (isPlainObject(value)) {\n path = value.path;\n locale = value.locale;\n args = value.args;\n choice = value.choice;\n }\n\n return { path: path, locale: locale, args: args, choice: choice }\n}\n\nfunction makeParams (locale, args) {\n var params = [];\n\n locale && params.push(locale);\n if (args && (Array.isArray(args) || isPlainObject(args))) {\n params.push(args);\n }\n\n return params\n}\n\nvar Vue;\n\nfunction install (_Vue, options) {\n if ( options === void 0 ) options = { bridge: false };\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && install.installed && _Vue === Vue) {\n warn('already installed.');\n return\n }\n install.installed = true;\n\n Vue = _Vue;\n\n var version = (Vue.version && Number(Vue.version.split('.')[0])) || -1;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && version < 2) {\n warn((\"vue-i18n (\" + (install.version) + \") need to use Vue 2.0 or later (Vue: \" + (Vue.version) + \").\"));\n return\n }\n\n extend(Vue);\n Vue.mixin(defineMixin(options.bridge));\n Vue.directive('t', { bind: bind, update: update, unbind: unbind });\n Vue.component(interpolationComponent.name, interpolationComponent);\n Vue.component(numberComponent.name, numberComponent);\n\n // use simple mergeStrategies to prevent i18n instance lose '__proto__'\n var strats = Vue.config.optionMergeStrategies;\n strats.i18n = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n };\n}\n\n/* */\n\nvar BaseFormatter = function BaseFormatter () {\n this._caches = Object.create(null);\n};\n\nBaseFormatter.prototype.interpolate = function interpolate (message, values) {\n if (!values) {\n return [message]\n }\n var tokens = this._caches[message];\n if (!tokens) {\n tokens = parse(message);\n this._caches[message] = tokens;\n }\n return compile(tokens, values)\n};\n\n\n\nvar RE_TOKEN_LIST_VALUE = /^(?:\\d)+/;\nvar RE_TOKEN_NAMED_VALUE = /^(?:\\w)+/;\n\nfunction parse (format) {\n var tokens = [];\n var position = 0;\n\n var text = '';\n while (position < format.length) {\n var char = format[position++];\n if (char === '{') {\n if (text) {\n tokens.push({ type: 'text', value: text });\n }\n\n text = '';\n var sub = '';\n char = format[position++];\n while (char !== undefined && char !== '}') {\n sub += char;\n char = format[position++];\n }\n var isClosed = char === '}';\n\n var type = RE_TOKEN_LIST_VALUE.test(sub)\n ? 'list'\n : isClosed && RE_TOKEN_NAMED_VALUE.test(sub)\n ? 'named'\n : 'unknown';\n tokens.push({ value: sub, type: type });\n } else if (char === '%') {\n // when found rails i18n syntax, skip text capture\n if (format[(position)] !== '{') {\n text += char;\n }\n } else {\n text += char;\n }\n }\n\n text && tokens.push({ type: 'text', value: text });\n\n return tokens\n}\n\nfunction compile (tokens, values) {\n var compiled = [];\n var index = 0;\n\n var mode = Array.isArray(values)\n ? 'list'\n : isObject(values)\n ? 'named'\n : 'unknown';\n if (mode === 'unknown') { return compiled }\n\n while (index < tokens.length) {\n var token = tokens[index];\n switch (token.type) {\n case 'text':\n compiled.push(token.value);\n break\n case 'list':\n compiled.push(values[parseInt(token.value, 10)]);\n break\n case 'named':\n if (mode === 'named') {\n compiled.push((values)[token.value]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Type of token '\" + (token.type) + \"' and format of value '\" + mode + \"' don't match!\"));\n }\n }\n break\n case 'unknown':\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Detect 'unknown' type of token!\");\n }\n break\n }\n index++;\n }\n\n return compiled\n}\n\n/* */\n\n/**\n * Path parser\n * - Inspired:\n * Vue.js Path parser\n */\n\n// actions\nvar APPEND = 0;\nvar PUSH = 1;\nvar INC_SUB_PATH_DEPTH = 2;\nvar PUSH_SUB_PATH = 3;\n\n// states\nvar BEFORE_PATH = 0;\nvar IN_PATH = 1;\nvar BEFORE_IDENT = 2;\nvar IN_IDENT = 3;\nvar IN_SUB_PATH = 4;\nvar IN_SINGLE_QUOTE = 5;\nvar IN_DOUBLE_QUOTE = 6;\nvar AFTER_PATH = 7;\nvar ERROR = 8;\n\nvar pathStateMachine = [];\n\npathStateMachine[BEFORE_PATH] = {\n 'ws': [BEFORE_PATH],\n 'ident': [IN_IDENT, APPEND],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[IN_PATH] = {\n 'ws': [IN_PATH],\n '.': [BEFORE_IDENT],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[BEFORE_IDENT] = {\n 'ws': [BEFORE_IDENT],\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND]\n};\n\npathStateMachine[IN_IDENT] = {\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND],\n 'ws': [IN_PATH, PUSH],\n '.': [BEFORE_IDENT, PUSH],\n '[': [IN_SUB_PATH, PUSH],\n 'eof': [AFTER_PATH, PUSH]\n};\n\npathStateMachine[IN_SUB_PATH] = {\n \"'\": [IN_SINGLE_QUOTE, APPEND],\n '\"': [IN_DOUBLE_QUOTE, APPEND],\n '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],\n ']': [IN_PATH, PUSH_SUB_PATH],\n 'eof': ERROR,\n 'else': [IN_SUB_PATH, APPEND]\n};\n\npathStateMachine[IN_SINGLE_QUOTE] = {\n \"'\": [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_SINGLE_QUOTE, APPEND]\n};\n\npathStateMachine[IN_DOUBLE_QUOTE] = {\n '\"': [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_DOUBLE_QUOTE, APPEND]\n};\n\n/**\n * Check if an expression is a literal value.\n */\n\nvar literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\nfunction isLiteral (exp) {\n return literalValueRE.test(exp)\n}\n\n/**\n * Strip quotes from a string\n */\n\nfunction stripQuotes (str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27)\n ? str.slice(1, -1)\n : str\n}\n\n/**\n * Determine the type of a character in a keypath.\n */\n\nfunction getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}\n\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n */\n\nfunction formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}\n\n/**\n * Parse a string path into an array of segments\n */\n\nfunction parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\n\n\n\n\nvar I18nPath = function I18nPath () {\n this._cache = Object.create(null);\n};\n\n/**\n * External parse that check for a cache hit first\n */\nI18nPath.prototype.parsePath = function parsePath (path) {\n var hit = this._cache[path];\n if (!hit) {\n hit = parse$1(path);\n if (hit) {\n this._cache[path] = hit;\n }\n }\n return hit || []\n};\n\n/**\n * Get path value from path string\n */\nI18nPath.prototype.getPathValue = function getPathValue (obj, path) {\n if (!isObject(obj)) { return null }\n\n var paths = this.parsePath(path);\n if (paths.length === 0) {\n return null\n } else {\n var length = paths.length;\n var last = obj;\n var i = 0;\n while (i < length) {\n var value = last[paths[i]];\n if (value === undefined || value === null) {\n return null\n }\n last = value;\n i++;\n }\n\n return last\n }\n};\n\n/* */\n\n\n\nvar htmlTagMatcher = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\nvar linkKeyMatcher = /(?:@(?:\\.[a-z]+)?:(?:[\\w\\-_|./]+|\\([\\w\\-_|./]+\\)))/g;\nvar linkKeyPrefixMatcher = /^@(?:\\.([a-z]+))?:/;\nvar bracketsMatcher = /[()]/g;\nvar defaultModifiers = {\n 'upper': function (str) { return str.toLocaleUpperCase(); },\n 'lower': function (str) { return str.toLocaleLowerCase(); },\n 'capitalize': function (str) { return (\"\" + (str.charAt(0).toLocaleUpperCase()) + (str.substr(1))); }\n};\n\nvar defaultFormatter = new BaseFormatter();\n\nvar VueI18n = function VueI18n (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #290\n /* istanbul ignore if */\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n var locale = options.locale || 'en-US';\n var fallbackLocale = options.fallbackLocale === false\n ? false\n : options.fallbackLocale || 'en-US';\n var messages = options.messages || {};\n var dateTimeFormats = options.dateTimeFormats || options.datetimeFormats || {};\n var numberFormats = options.numberFormats || {};\n\n this._vm = null;\n this._formatter = options.formatter || defaultFormatter;\n this._modifiers = options.modifiers || {};\n this._missing = options.missing || null;\n this._root = options.root || null;\n this._sync = options.sync === undefined ? true : !!options.sync;\n this._fallbackRoot = options.fallbackRoot === undefined\n ? true\n : !!options.fallbackRoot;\n this._fallbackRootWithEmptyString = options.fallbackRootWithEmptyString === undefined\n ? true\n : !!options.fallbackRootWithEmptyString;\n this._formatFallbackMessages = options.formatFallbackMessages === undefined\n ? false\n : !!options.formatFallbackMessages;\n this._silentTranslationWarn = options.silentTranslationWarn === undefined\n ? false\n : options.silentTranslationWarn;\n this._silentFallbackWarn = options.silentFallbackWarn === undefined\n ? false\n : !!options.silentFallbackWarn;\n this._dateTimeFormatters = {};\n this._numberFormatters = {};\n this._path = new I18nPath();\n this._dataListeners = new Set();\n this._componentInstanceCreatedListener = options.componentInstanceCreatedListener || null;\n this._preserveDirectiveContent = options.preserveDirectiveContent === undefined\n ? false\n : !!options.preserveDirectiveContent;\n this.pluralizationRules = options.pluralizationRules || {};\n this._warnHtmlInMessage = options.warnHtmlInMessage || 'off';\n this._postTranslation = options.postTranslation || null;\n this._escapeParameterHtml = options.escapeParameterHtml || false;\n\n if ('__VUE_I18N_BRIDGE__' in options) {\n this.__VUE_I18N_BRIDGE__ = options.__VUE_I18N_BRIDGE__;\n }\n\n /**\n * @param choice {number} a choice index given by the input to $tc: `$tc('path.to.rule', choiceIndex)`\n * @param choicesLength {number} an overall amount of available choices\n * @returns a final choice index\n */\n this.getChoiceIndex = function (choice, choicesLength) {\n var thisPrototype = Object.getPrototypeOf(this$1);\n if (thisPrototype && thisPrototype.getChoiceIndex) {\n var prototypeGetChoiceIndex = (thisPrototype.getChoiceIndex);\n return (prototypeGetChoiceIndex).call(this$1, choice, choicesLength)\n }\n\n // Default (old) getChoiceIndex implementation - english-compatible\n var defaultImpl = function (_choice, _choicesLength) {\n _choice = Math.abs(_choice);\n\n if (_choicesLength === 2) {\n return _choice\n ? _choice > 1\n ? 1\n : 0\n : 1\n }\n\n return _choice ? Math.min(_choice, 2) : 0\n };\n\n if (this$1.locale in this$1.pluralizationRules) {\n return this$1.pluralizationRules[this$1.locale].apply(this$1, [choice, choicesLength])\n } else {\n return defaultImpl(choice, choicesLength)\n }\n };\n\n\n this._exist = function (message, key) {\n if (!message || !key) { return false }\n if (!isNull(this$1._path.getPathValue(message, key))) { return true }\n // fallback for flat key\n if (message[key]) { return true }\n return false\n };\n\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n\n this._initVM({\n locale: locale,\n fallbackLocale: fallbackLocale,\n messages: messages,\n dateTimeFormats: dateTimeFormats,\n numberFormats: numberFormats\n });\n};\n\nvar prototypeAccessors = { vm: { configurable: true },messages: { configurable: true },dateTimeFormats: { configurable: true },numberFormats: { configurable: true },availableLocales: { configurable: true },locale: { configurable: true },fallbackLocale: { configurable: true },formatFallbackMessages: { configurable: true },missing: { configurable: true },formatter: { configurable: true },silentTranslationWarn: { configurable: true },silentFallbackWarn: { configurable: true },preserveDirectiveContent: { configurable: true },warnHtmlInMessage: { configurable: true },postTranslation: { configurable: true },sync: { configurable: true } };\n\nVueI18n.prototype._checkLocaleMessage = function _checkLocaleMessage (locale, level, message) {\n var paths = [];\n\n var fn = function (level, locale, message, paths) {\n if (isPlainObject(message)) {\n Object.keys(message).forEach(function (key) {\n var val = message[key];\n if (isPlainObject(val)) {\n paths.push(key);\n paths.push('.');\n fn(level, locale, val, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push(key);\n fn(level, locale, val, paths);\n paths.pop();\n }\n });\n } else if (isArray(message)) {\n message.forEach(function (item, index) {\n if (isPlainObject(item)) {\n paths.push((\"[\" + index + \"]\"));\n paths.push('.');\n fn(level, locale, item, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push((\"[\" + index + \"]\"));\n fn(level, locale, item, paths);\n paths.pop();\n }\n });\n } else if (isString(message)) {\n var ret = htmlTagMatcher.test(message);\n if (ret) {\n var msg = \"Detected HTML in message '\" + message + \"' of keypath '\" + (paths.join('')) + \"' at '\" + locale + \"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp\";\n if (level === 'warn') {\n warn(msg);\n } else if (level === 'error') {\n error(msg);\n }\n }\n }\n };\n\n fn(level, locale, message, paths);\n};\n\nVueI18n.prototype._initVM = function _initVM (data) {\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n this._vm = new Vue({ data: data, __VUE18N__INSTANCE__: true });\n Vue.config.silent = silent;\n};\n\nVueI18n.prototype.destroyVM = function destroyVM () {\n this._vm.$destroy();\n};\n\nVueI18n.prototype.subscribeDataChanging = function subscribeDataChanging (vm) {\n this._dataListeners.add(vm);\n};\n\nVueI18n.prototype.unsubscribeDataChanging = function unsubscribeDataChanging (vm) {\n remove(this._dataListeners, vm);\n};\n\nVueI18n.prototype.watchI18nData = function watchI18nData () {\n var this$1 = this;\n return this._vm.$watch('$data', function () {\n var listeners = arrayFrom(this$1._dataListeners);\n var i = listeners.length;\n while(i--) {\n Vue.nextTick(function () {\n listeners[i] && listeners[i].$forceUpdate();\n });\n }\n }, { deep: true })\n};\n\nVueI18n.prototype.watchLocale = function watchLocale (composer) {\n if (!composer) {\n /* istanbul ignore if */\n if (!this._sync || !this._root) { return null }\n var target = this._vm;\n return this._root.$i18n.vm.$watch('locale', function (val) {\n target.$set(target, 'locale', val);\n target.$forceUpdate();\n }, { immediate: true })\n } else {\n // deal with vue-i18n-bridge\n if (!this.__VUE_I18N_BRIDGE__) { return null }\n var self = this;\n var target$1 = this._vm;\n return this.vm.$watch('locale', function (val) {\n target$1.$set(target$1, 'locale', val);\n if (self.__VUE_I18N_BRIDGE__ && composer) {\n composer.locale.value = val;\n }\n target$1.$forceUpdate();\n }, { immediate: true })\n }\n};\n\nVueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {\n if (this._componentInstanceCreatedListener) {\n this._componentInstanceCreatedListener(newI18n, this);\n }\n};\n\nprototypeAccessors.vm.get = function () { return this._vm };\n\nprototypeAccessors.messages.get = function () { return looseClone(this._getMessages()) };\nprototypeAccessors.dateTimeFormats.get = function () { return looseClone(this._getDateTimeFormats()) };\nprototypeAccessors.numberFormats.get = function () { return looseClone(this._getNumberFormats()) };\nprototypeAccessors.availableLocales.get = function () { return Object.keys(this.messages).sort() };\n\nprototypeAccessors.locale.get = function () { return this._vm.locale };\nprototypeAccessors.locale.set = function (locale) {\n this._vm.$set(this._vm, 'locale', locale);\n};\n\nprototypeAccessors.fallbackLocale.get = function () { return this._vm.fallbackLocale };\nprototypeAccessors.fallbackLocale.set = function (locale) {\n this._localeChainCache = {};\n this._vm.$set(this._vm, 'fallbackLocale', locale);\n};\n\nprototypeAccessors.formatFallbackMessages.get = function () { return this._formatFallbackMessages };\nprototypeAccessors.formatFallbackMessages.set = function (fallback) { this._formatFallbackMessages = fallback; };\n\nprototypeAccessors.missing.get = function () { return this._missing };\nprototypeAccessors.missing.set = function (handler) { this._missing = handler; };\n\nprototypeAccessors.formatter.get = function () { return this._formatter };\nprototypeAccessors.formatter.set = function (formatter) { this._formatter = formatter; };\n\nprototypeAccessors.silentTranslationWarn.get = function () { return this._silentTranslationWarn };\nprototypeAccessors.silentTranslationWarn.set = function (silent) { this._silentTranslationWarn = silent; };\n\nprototypeAccessors.silentFallbackWarn.get = function () { return this._silentFallbackWarn };\nprototypeAccessors.silentFallbackWarn.set = function (silent) { this._silentFallbackWarn = silent; };\n\nprototypeAccessors.preserveDirectiveContent.get = function () { return this._preserveDirectiveContent };\nprototypeAccessors.preserveDirectiveContent.set = function (preserve) { this._preserveDirectiveContent = preserve; };\n\nprototypeAccessors.warnHtmlInMessage.get = function () { return this._warnHtmlInMessage };\nprototypeAccessors.warnHtmlInMessage.set = function (level) {\n var this$1 = this;\n\n var orgLevel = this._warnHtmlInMessage;\n this._warnHtmlInMessage = level;\n if (orgLevel !== level && (level === 'warn' || level === 'error')) {\n var messages = this._getMessages();\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n};\n\nprototypeAccessors.postTranslation.get = function () { return this._postTranslation };\nprototypeAccessors.postTranslation.set = function (handler) { this._postTranslation = handler; };\n\nprototypeAccessors.sync.get = function () { return this._sync };\nprototypeAccessors.sync.set = function (val) { this._sync = val; };\n\nVueI18n.prototype._getMessages = function _getMessages () { return this._vm.messages };\nVueI18n.prototype._getDateTimeFormats = function _getDateTimeFormats () { return this._vm.dateTimeFormats };\nVueI18n.prototype._getNumberFormats = function _getNumberFormats () { return this._vm.numberFormats };\n\nVueI18n.prototype._warnDefault = function _warnDefault (locale, key, result, vm, values, interpolateMode) {\n if (!isNull(result)) { return result }\n if (this._missing) {\n var missingRet = this._missing.apply(null, [locale, key, vm, values]);\n if (isString(missingRet)) {\n return missingRet\n }\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn(\n \"Cannot translate the value of keypath '\" + key + \"'. \" +\n 'Use the value of keypath as default.'\n );\n }\n }\n\n if (this._formatFallbackMessages) {\n var parsedArgs = parseArgs.apply(void 0, values);\n return this._render(key, interpolateMode, parsedArgs.params, key)\n } else {\n return key\n }\n};\n\nVueI18n.prototype._isFallbackRoot = function _isFallbackRoot (val) {\n return (this._fallbackRootWithEmptyString? !val : isNull(val)) && !isNull(this._root) && this._fallbackRoot\n};\n\nVueI18n.prototype._isSilentFallbackWarn = function _isSilentFallbackWarn (key) {\n return this._silentFallbackWarn instanceof RegExp\n ? this._silentFallbackWarn.test(key)\n : this._silentFallbackWarn\n};\n\nVueI18n.prototype._isSilentFallback = function _isSilentFallback (locale, key) {\n return this._isSilentFallbackWarn(key) && (this._isFallbackRoot() || locale !== this.fallbackLocale)\n};\n\nVueI18n.prototype._isSilentTranslationWarn = function _isSilentTranslationWarn (key) {\n return this._silentTranslationWarn instanceof RegExp\n ? this._silentTranslationWarn.test(key)\n : this._silentTranslationWarn\n};\n\nVueI18n.prototype._interpolate = function _interpolate (\n locale,\n message,\n key,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n if (!message) { return null }\n\n var pathRet = this._path.getPathValue(message, key);\n if (isArray(pathRet) || isPlainObject(pathRet)) { return pathRet }\n\n var ret;\n if (isNull(pathRet)) {\n /* istanbul ignore else */\n if (isPlainObject(message)) {\n ret = message[key];\n if (!(isString(ret) || isFunction(ret))) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function !\"));\n }\n return null\n }\n } else {\n return null\n }\n } else {\n /* istanbul ignore else */\n if (isString(pathRet) || isFunction(pathRet)) {\n ret = pathRet;\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function!\"));\n }\n return null\n }\n }\n\n // Check for the existence of links within the translated string\n if (isString(ret) && (ret.indexOf('@:') >= 0 || ret.indexOf('@.') >= 0)) {\n ret = this._link(locale, message, ret, host, 'raw', values, visitedLinkStack);\n }\n\n return this._render(ret, interpolateMode, values, key)\n};\n\nVueI18n.prototype._link = function _link (\n locale,\n message,\n str,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n var ret = str;\n\n // Match all the links within the local\n // We are going to replace each of\n // them with its translation\n var matches = ret.match(linkKeyMatcher);\n\n // eslint-disable-next-line no-autofix/prefer-const\n for (var idx in matches) {\n // ie compatible: filter custom array\n // prototype method\n if (!matches.hasOwnProperty(idx)) {\n continue\n }\n var link = matches[idx];\n var linkKeyPrefixMatches = link.match(linkKeyPrefixMatcher);\n var linkPrefix = linkKeyPrefixMatches[0];\n var formatterName = linkKeyPrefixMatches[1];\n\n // Remove the leading @:, @.case: and the brackets\n var linkPlaceholder = link.replace(linkPrefix, '').replace(bracketsMatcher, '');\n\n if (includes(visitedLinkStack, linkPlaceholder)) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Circular reference found. \\\"\" + link + \"\\\" is already visited in the chain of \" + (visitedLinkStack.reverse().join(' <- '))));\n }\n return ret\n }\n visitedLinkStack.push(linkPlaceholder);\n\n // Translate the link\n var translated = this._interpolate(\n locale, message, linkPlaceholder, host,\n interpolateMode === 'raw' ? 'string' : interpolateMode,\n interpolateMode === 'raw' ? undefined : values,\n visitedLinkStack\n );\n\n if (this._isFallbackRoot(translated)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(linkPlaceholder)) {\n warn((\"Fall back to translate the link placeholder '\" + linkPlaceholder + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n var root = this._root.$i18n;\n translated = root._translate(\n root._getMessages(), root.locale, root.fallbackLocale,\n linkPlaceholder, host, interpolateMode, values\n );\n }\n translated = this._warnDefault(\n locale, linkPlaceholder, translated, host,\n isArray(values) ? values : [values],\n interpolateMode\n );\n\n if (this._modifiers.hasOwnProperty(formatterName)) {\n translated = this._modifiers[formatterName](translated);\n } else if (defaultModifiers.hasOwnProperty(formatterName)) {\n translated = defaultModifiers[formatterName](translated);\n }\n\n visitedLinkStack.pop();\n\n // Replace the link with the translated\n ret = !translated ? ret : ret.replace(link, translated);\n }\n\n return ret\n};\n\nVueI18n.prototype._createMessageContext = function _createMessageContext (values, formatter, path, interpolateMode) {\n var this$1 = this;\n\n var _list = isArray(values) ? values : [];\n var _named = isObject(values) ? values : {};\n var list = function (index) { return _list[index]; };\n var named = function (key) { return _named[key]; };\n var messages = this._getMessages();\n var locale = this.locale;\n\n return {\n list: list,\n named: named,\n values: values,\n formatter: formatter,\n path: path,\n messages: messages,\n locale: locale,\n linked: function (linkedKey) { return this$1._interpolate(locale, messages[locale] || {}, linkedKey, null, interpolateMode, undefined, [linkedKey]); }\n }\n};\n\nVueI18n.prototype._render = function _render (message, interpolateMode, values, path) {\n if (isFunction(message)) {\n return message(\n this._createMessageContext(values, this._formatter || defaultFormatter, path, interpolateMode)\n )\n }\n\n var ret = this._formatter.interpolate(message, values, path);\n\n // If the custom formatter refuses to work - apply the default one\n if (!ret) {\n ret = defaultFormatter.interpolate(message, values, path);\n }\n\n // if interpolateMode is **not** 'string' ('row'),\n // return the compiled data (e.g. ['foo', VNode, 'bar']) with formatter\n return interpolateMode === 'string' && !isString(ret) ? ret.join('') : ret\n};\n\nVueI18n.prototype._appendItemToChain = function _appendItemToChain (chain, item, blocks) {\n var follow = false;\n if (!includes(chain, item)) {\n follow = true;\n if (item) {\n follow = item[item.length - 1] !== '!';\n item = item.replace(/!/g, '');\n chain.push(item);\n if (blocks && blocks[item]) {\n follow = blocks[item];\n }\n }\n }\n return follow\n};\n\nVueI18n.prototype._appendLocaleToChain = function _appendLocaleToChain (chain, locale, blocks) {\n var follow;\n var tokens = locale.split('-');\n do {\n var item = tokens.join('-');\n follow = this._appendItemToChain(chain, item, blocks);\n tokens.splice(-1, 1);\n } while (tokens.length && (follow === true))\n return follow\n};\n\nVueI18n.prototype._appendBlockToChain = function _appendBlockToChain (chain, block, blocks) {\n var follow = true;\n for (var i = 0; (i < block.length) && (isBoolean(follow)); i++) {\n var locale = block[i];\n if (isString(locale)) {\n follow = this._appendLocaleToChain(chain, locale, blocks);\n }\n }\n return follow\n};\n\nVueI18n.prototype._getLocaleChain = function _getLocaleChain (start, fallbackLocale) {\n if (start === '') { return [] }\n\n if (!this._localeChainCache) {\n this._localeChainCache = {};\n }\n\n var chain = this._localeChainCache[start];\n if (!chain) {\n if (!fallbackLocale) {\n fallbackLocale = this.fallbackLocale;\n }\n chain = [];\n\n // first block defined by start\n var block = [start];\n\n // while any intervening block found\n while (isArray(block)) {\n block = this._appendBlockToChain(\n chain,\n block,\n fallbackLocale\n );\n }\n\n // last block defined by default\n var defaults;\n if (isArray(fallbackLocale)) {\n defaults = fallbackLocale;\n } else if (isObject(fallbackLocale)) {\n /* $FlowFixMe */\n if (fallbackLocale['default']) {\n defaults = fallbackLocale['default'];\n } else {\n defaults = null;\n }\n } else {\n defaults = fallbackLocale;\n }\n\n // convert defaults to array\n if (isString(defaults)) {\n block = [defaults];\n } else {\n block = defaults;\n }\n if (block) {\n this._appendBlockToChain(\n chain,\n block,\n null\n );\n }\n this._localeChainCache[start] = chain;\n }\n return chain\n};\n\nVueI18n.prototype._translate = function _translate (\n messages,\n locale,\n fallback,\n key,\n host,\n interpolateMode,\n args\n) {\n var chain = this._getLocaleChain(locale, fallback);\n var res;\n for (var i = 0; i < chain.length; i++) {\n var step = chain[i];\n res =\n this._interpolate(step, messages[step], key, host, interpolateMode, args, [key]);\n if (!isNull(res)) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with '\" + step + \"' locale.\"));\n }\n return res\n }\n }\n return null\n};\n\nVueI18n.prototype._t = function _t (key, _locale, messages, host) {\n var ref;\n\n var values = [], len = arguments.length - 4;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 4 ];\n if (!key) { return '' }\n\n var parsedArgs = parseArgs.apply(void 0, values);\n if(this._escapeParameterHtml) {\n parsedArgs.params = escapeParams(parsedArgs.params);\n }\n\n var locale = parsedArgs.locale || _locale;\n\n var ret = this._translate(\n messages, locale, this.fallbackLocale, key,\n host, 'string', parsedArgs.params\n );\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return (ref = this._root).$t.apply(ref, [ key ].concat( values ))\n } else {\n ret = this._warnDefault(locale, key, ret, host, values, 'string');\n if (this._postTranslation && ret !== null && ret !== undefined) {\n ret = this._postTranslation(ret, key);\n }\n return ret\n }\n};\n\nVueI18n.prototype.t = function t (key) {\n var ref;\n\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n return (ref = this)._t.apply(ref, [ key, this.locale, this._getMessages(), null ].concat( values ))\n};\n\nVueI18n.prototype._i = function _i (key, locale, messages, host, values) {\n var ret =\n this._translate(messages, locale, this.fallbackLocale, key, host, 'raw', values);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to interpolate the keypath '\" + key + \"' with root locale.\"));\n }\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.i(key, locale, values)\n } else {\n return this._warnDefault(locale, key, ret, host, [values], 'raw')\n }\n};\n\nVueI18n.prototype.i = function i (key, locale, values) {\n /* istanbul ignore if */\n if (!key) { return '' }\n\n if (!isString(locale)) {\n locale = this.locale;\n }\n\n return this._i(key, locale, this._getMessages(), null, values)\n};\n\nVueI18n.prototype._tc = function _tc (\n key,\n _locale,\n messages,\n host,\n choice\n) {\n var ref;\n\n var values = [], len = arguments.length - 5;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 5 ];\n if (!key) { return '' }\n if (choice === undefined) {\n choice = 1;\n }\n\n var predefined = { 'count': choice, 'n': choice };\n var parsedArgs = parseArgs.apply(void 0, values);\n parsedArgs.params = Object.assign(predefined, parsedArgs.params);\n values = parsedArgs.locale === null ? [parsedArgs.params] : [parsedArgs.locale, parsedArgs.params];\n return this.fetchChoice((ref = this)._t.apply(ref, [ key, _locale, messages, host ].concat( values )), choice)\n};\n\nVueI18n.prototype.fetchChoice = function fetchChoice (message, choice) {\n /* istanbul ignore if */\n if (!message || !isString(message)) { return null }\n var choices = message.split('|');\n\n choice = this.getChoiceIndex(choice, choices.length);\n if (!choices[choice]) { return message }\n return choices[choice].trim()\n};\n\nVueI18n.prototype.tc = function tc (key, choice) {\n var ref;\n\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n return (ref = this)._tc.apply(ref, [ key, this.locale, this._getMessages(), null, choice ].concat( values ))\n};\n\nVueI18n.prototype._te = function _te (key, locale, messages) {\n var args = [], len = arguments.length - 3;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ];\n\n var _locale = parseArgs.apply(void 0, args).locale || locale;\n return this._exist(messages[_locale], key)\n};\n\nVueI18n.prototype.te = function te (key, locale) {\n return this._te(key, this.locale, this._getMessages(), locale)\n};\n\nVueI18n.prototype.getLocaleMessage = function getLocaleMessage (locale) {\n return looseClone(this._vm.messages[locale] || {})\n};\n\nVueI18n.prototype.setLocaleMessage = function setLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, message);\n};\n\nVueI18n.prototype.mergeLocaleMessage = function mergeLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, merge(\n typeof this._vm.messages[locale] !== 'undefined' && Object.keys(this._vm.messages[locale]).length\n ? Object.assign({}, this._vm.messages[locale])\n : {},\n message\n ));\n};\n\nVueI18n.prototype.getDateTimeFormat = function getDateTimeFormat (locale) {\n return looseClone(this._vm.dateTimeFormats[locale] || {})\n};\n\nVueI18n.prototype.setDateTimeFormat = function setDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, format);\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype.mergeDateTimeFormat = function mergeDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, merge(this._vm.dateTimeFormats[locale] || {}, format));\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype._clearDateTimeFormat = function _clearDateTimeFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._dateTimeFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._dateTimeFormatters[id];\n }\n};\n\nVueI18n.prototype._localizeDateTime = function _localizeDateTime (\n value,\n locale,\n fallback,\n dateTimeFormats,\n key\n) {\n var _locale = locale;\n var formats = dateTimeFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = dateTimeFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' datetime formats from '\" + current + \"' datetime formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n var id = _locale + \"__\" + key;\n var formatter = this._dateTimeFormatters[id];\n if (!formatter) {\n formatter = this._dateTimeFormatters[id] = new Intl.DateTimeFormat(_locale, format);\n }\n return formatter.format(value)\n }\n};\n\nVueI18n.prototype._d = function _d (value, locale, key) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && !VueI18n.availabilities.dateTimeFormat) {\n warn('Cannot format a Date value due to not supported Intl.DateTimeFormat.');\n return ''\n }\n\n if (!key) {\n return new Intl.DateTimeFormat(locale).format(value)\n }\n\n var ret =\n this._localizeDateTime(value, locale, this.fallbackLocale, this._getDateTimeFormats(), key);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to datetime localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.d(value, key, locale)\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.d = function d (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._d(value, locale, key)\n};\n\nVueI18n.prototype.getNumberFormat = function getNumberFormat (locale) {\n return looseClone(this._vm.numberFormats[locale] || {})\n};\n\nVueI18n.prototype.setNumberFormat = function setNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, format);\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype.mergeNumberFormat = function mergeNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, merge(this._vm.numberFormats[locale] || {}, format));\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype._clearNumberFormat = function _clearNumberFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._numberFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._numberFormatters[id];\n }\n};\n\nVueI18n.prototype._getNumberFormatter = function _getNumberFormatter (\n value,\n locale,\n fallback,\n numberFormats,\n key,\n options\n) {\n var _locale = locale;\n var formats = numberFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = numberFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' number formats from '\" + current + \"' number formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n\n var formatter;\n if (options) {\n // If options specified - create one time number formatter\n formatter = new Intl.NumberFormat(_locale, Object.assign({}, format, options));\n } else {\n var id = _locale + \"__\" + key;\n formatter = this._numberFormatters[id];\n if (!formatter) {\n formatter = this._numberFormatters[id] = new Intl.NumberFormat(_locale, format);\n }\n }\n return formatter\n }\n};\n\nVueI18n.prototype._n = function _n (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format a Number value due to not supported Intl.NumberFormat.');\n }\n return ''\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.format(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.format(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to number localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.n(value, Object.assign({}, { key: key, locale: locale }, options))\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.n = function n (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n var options = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n\n // Filter out number format options only\n options = Object.keys(args[0]).reduce(function (acc, key) {\n var obj;\n\n if (includes(numberFormatKeys, key)) {\n return Object.assign({}, acc, ( obj = {}, obj[key] = args[0][key], obj ))\n }\n return acc\n }, null);\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._n(value, locale, key, options)\n};\n\nVueI18n.prototype._ntp = function _ntp (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format to parts a Number value due to not supported Intl.NumberFormat.');\n }\n return []\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.formatToParts(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.formatToParts(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to format number to parts of root: key '\" + key + \"' .\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n._ntp(value, locale, key, options)\n } else {\n return ret || []\n }\n};\n\nObject.defineProperties( VueI18n.prototype, prototypeAccessors );\n\nvar availabilities;\n// $FlowFixMe\nObject.defineProperty(VueI18n, 'availabilities', {\n get: function get () {\n if (!availabilities) {\n var intlDefined = typeof Intl !== 'undefined';\n availabilities = {\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\n };\n }\n\n return availabilities\n }\n});\n\nVueI18n.install = install;\nVueI18n.version = '8.27.0';\n\nexport default VueI18n;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"m-message-fade\",\"mode\":\"in-out\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.show),expression:\"show\"}],staticClass:\"m-message-wrapper\",class:_vm.wrapperClassName,style:({\r\n width: _vm.width\r\n })},[_c('mmessage',{class:[_vm.type && 'm-message--' + _vm.type, _vm.className],attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"closable\":_vm.showClose,\"is-collapsed\":_vm.isCollapsed,\"close-handler\":_vm.close,\"click-handler\":_vm.click,\"title\":_vm.title,\"supportHTML\":_vm.supportHTML},nativeOn:{\"mouseenter\":function($event){return _vm.clearTimer.apply(null, arguments)},\"mouseleave\":function($event){return _vm.startTimer.apply(null, arguments)}}},[_c('template',{slot:\"icon\"},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg}}):(_vm.type)?_c('icon',{staticClass:\"m-message--icon\",attrs:{\"name\":_vm.type}}):_vm._e()],1)],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.visible),expression:\"visible\"}],staticClass:\"m-message\"},[(_vm.iconImg || _vm.$slots.icon)?_c('div',{staticClass:\"m-message-icons\",on:{\"click\":_vm.handleClick}},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg,\"alt\":\"Img\"}}):_vm._t(\"icon\")],2):_vm._e(),_c('div',{staticClass:\"m-message-content\",on:{\"click\":_vm.handleClick}},[(_vm.title || _vm.$slots.title)?_c('div',{staticClass:\"m-message--title\"},[_vm._t(\"title\",function(){return [_vm._v(\" \"+_vm._s(_vm.title)+\" \")]})],2):_vm._e(),(_vm.event && _vm.chat)?_c('event',{attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"preview\":true}}):_c('div',{staticClass:\"m-message--body\"},[_vm._t(\"message\")],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./mmessage.vue?vue&type=template&id=03371e2c&\"\nimport script from \"./mmessage.vue?vue&type=script&lang=js&\"\nexport * from \"./mmessage.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","'use strict'\r\nconst icons = {}\r\n\r\nexport const addIcon = function (name, options) {\r\n icons[name] = options\r\n}\r\n\r\nconst Icon = {\r\n name: 'Icon',\r\n props: {\r\n name: String,\r\n color: String\r\n },\r\n computed: {\r\n svg () {\r\n return icons[this.name]\r\n }\r\n },\r\n // eslint-disable-next-line\r\n render (h) {\r\n const svg = this.svg\r\n\r\n if (!svg) {\r\n // eslint-disable-next-line\r\n console.warn(`The name of '${this.name}' could not be found.`)\r\n return ``\r\n }\r\n\r\n const style = {\r\n color: this.color ? this.color : (svg.fill ? svg.fill : null)\r\n }\r\n\r\n return (\r\n `\r\n \r\n { svg.defs && }\r\n { svg.path && }\r\n { svg.html && }\r\n {this.$slots.default}\r\n \r\n `\r\n )\r\n }\r\n}\r\n\r\nIcon.add = addIcon\r\n\r\nexport default Icon\r\n","export default {\r\n name: 'info',\r\n fill: '#1CADF2',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z'\r\n}\r\n","export default {\r\n name: 'success',\r\n fill: '#17B77E',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z'\r\n}\r\n","export default {\r\n name: 'error',\r\n fill: '#F56C6C',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z'\r\n}\r\n","export default {\r\n name: 'warning',\r\n fill: '#FFC603',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z'\r\n}\r\n","export default {\r\n name: 'loading',\r\n viewBox: '0 0 50 50',\r\n class: 'm-loading-icon m-loading-wipe',\r\n defs: ``,\r\n html: ''\r\n}\r\n","import Icon from './icon'\r\nimport InfoIcon from './svgs/info'\r\nimport SuccessIcon from './svgs/success'\r\nimport ErrorIcon from './svgs/error'\r\nimport WarningIcon from './svgs/warning'\r\nimport LoadingIcon from './svgs/loading'\r\n\r\nIcon.add(InfoIcon.name, InfoIcon)\r\nIcon.add(SuccessIcon.name, SuccessIcon)\r\nIcon.add(ErrorIcon.name, ErrorIcon)\r\nIcon.add(WarningIcon.name, WarningIcon)\r\nIcon.add(LoadingIcon.name, LoadingIcon)\r\n\r\nexport default Icon\r\n","\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./message-template.vue?vue&type=template&id=7da7e992&\"\nimport script from \"./message-template.vue?vue&type=script&lang=js&\"\nexport * from \"./message-template.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","import MessageTemplate from './message-template'\r\nimport Vue from 'vue'\r\nconst MessageConstructor = Vue.extend(MessageTemplate)\r\n\r\nconst instances = []\r\nlet count = 1\r\nconst containers = {}\r\n\r\nconst Message = function (options) {\r\n let userOnClose = options.onClose\r\n let userOnClick = options.onClick\r\n const position = options.position || 'top-center'\r\n const hasMask = options.hasMask || false\r\n const containerKey = position + (hasMask ? '-mask' : '')\r\n let containerEl = containers[containerKey]\r\n\r\n if (!containerEl) {\r\n containerEl = containers[containerKey] = document.createElement('div')\r\n containerEl.className = [\r\n 'm-message-container',\r\n 'is-' + position,\r\n hasMask ? 'has-mask' : ''\r\n ].filter(function (e) { return !!e }).join(' ')\r\n document.body.appendChild(containerEl)\r\n }\r\n\r\n if (options.zIndex) {\r\n containerEl.style.zIndex = options.zIndex\r\n }\r\n\r\n const id = count++\r\n options.onClose = function () {\r\n Message.close(id, userOnClose)\r\n }\r\n\r\n options.onClick = function () {\r\n Message.click(id, userOnClick, userOnClose)\r\n }\r\n\r\n const instance = new MessageConstructor({\r\n el: document.createElement('div'),\r\n data: options\r\n })\r\n\r\n instance.id = id\r\n instance.containerKey = containerKey\r\n\r\n // for position of bottom-*\r\n if (position.indexOf('bottom') === 0 && containerEl.firstChild) {\r\n containerEl.insertBefore(instance.$el, containerEl.firstChild)\r\n } else {\r\n containerEl.appendChild(instance.$el)\r\n }\r\n // 挂载后再设置显示才有过渡效果\r\n instance.show = true\r\n\r\n instances.push(instance)\r\n\r\n return instance\r\n}\r\n\r\nMessage.click = function (id, userOnClick, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClick === 'function') {\r\n userOnClick(instances[i])\r\n }\r\n \r\n }\r\n }\r\n\r\n Message.close(id, userOnClose)\r\n}\r\n\r\nMessage.close = function (id, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClose === 'function') {\r\n userOnClose(instances[i])\r\n }\r\n instances[i] = null\r\n instances.splice(i, 1)\r\n\r\n const index = instances.findIndex(function (e) {\r\n return e.containerKey === containerKey\r\n })\r\n // 如果开启遮罩,300ms 后移除容器(不移除白屏时间太长)\r\n if (hasMask && index === -1) {\r\n setTimeout(function () {\r\n containers[containerKey].remove()\r\n containers[containerKey] = null\r\n }, 300)\r\n }\r\n break\r\n }\r\n }\r\n\r\n setTimeout(function () {\r\n // 当前没有消息后,移除容器\r\n if (instances.length === 0) {\r\n for (let type in containers) {\r\n if (containers[type]) {\r\n containers[type].remove()\r\n containers[type] = null\r\n }\r\n }\r\n }\r\n }, 300)\r\n}\r\n\r\nMessage.closeAll = function () {\r\n for (let i = instances.length - 1; i >= 0; i--) {\r\n instances[i].close()\r\n }\r\n}\r\n\r\nconst types = [ 'info', 'success', 'error', 'warning', 'loading' ]\r\n\r\ntypes.forEach(type => {\r\n Message[type] = function (options) {\r\n options = typeof options === 'string' ? { message: options } : options\r\n return Message({ ...options, type })\r\n }\r\n})\r\n\r\nexport default Message\r\n","import Message from './message.js'\r\nimport MessageComponent from './mmessage.vue'\r\nimport './asd.css'\r\n\r\nMessage.install = function (Vue, options) {\r\n if (options && options.name) {\r\n Vue.prototype[`$${options.name}`] = Message\r\n } else {\r\n Vue.prototype.$message = Message\r\n }\r\n}\r\n\r\nexport const MMessage = MessageComponent\r\nexport default Message\r\n","import f from \"@/application/functions\";\r\n\r\nvar cachestorage = {}\r\n\r\nclass MTRXKIT {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n }\r\n\r\n tetatetchat(m_chat){\r\n if(!m_chat) return false\r\n \r\n if(typeof m_chat.tetatet != 'undefined') return m_chat.tetatet\r\n\r\n var users = this.core.mtrx.chatUsersInfo(m_chat.roomId)\r\n var tt = false\r\n\r\n if(users.length == 2){\r\n tt = m_chat.name == '#' + this.tetatetid(users[0], users[1])\r\n }\r\n if(users.length > 1) m_chat.tetatet = tt\r\n\r\n return tt\r\n }\r\n\r\n tetatetid(user1, user2) {\r\n\r\n var seed = 2;\r\n\r\n if(user1.id == user2.id) return null\r\n\r\n var id = parseInt(user1.id, 16) * parseInt(user2.id, 16) * seed\r\n\r\n if(cachestorage[id]) return cachestorage[id]\r\n\r\n var hash = f.sha224(id.toString()).toString('hex')\r\n\r\n cachestorage[id] = hash\r\n\r\n return hash\r\n }\r\n\r\n unknowngroupusers(m_chat){\r\n return m_chat && m_chat._selfMembership === 'invite' && !m_chat.summary.members && !this.tetatetchat(this.m_chat)\r\n }\r\n\r\n usersFromChats(m_chats){\r\n var users = {}\r\n \r\n _.each(m_chats, (chat) => {\r\n\r\n users[chat.roomId] = _.map(_.uniq([].concat(_.toArray(chat.currentState.members), chat.summary.members || []), (r) => {\r\n return r.userId\r\n\r\n }), function(r){\r\n\r\n return {\r\n userId : f.getmatrixid(r.userId),\r\n membership : r.membership,\r\n powerLevel : r.powerLevel\r\n }\r\n\r\n }) \r\n })\r\n\r\n\r\n\r\n return users\r\n }\r\n\r\n prepareChat(m_chat){\r\n\t\treturn this.usersInfoForChatsStore([m_chat]).then(() => {\r\n return this.core.pcrypto.addroom(m_chat)\r\n })\r\n\t}\r\n\r\n fillContacts(m_chats){\r\n\r\n m_chats = _.filter(m_chats, (ch) => {\r\n return ch._selfMembership == 'join' && ch.name.length == 57\r\n })\r\n\r\n return this.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n this.core.store.commit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n return !this.core.user.userinfo || m.id !== this.core.user.userinfo.id\r\n }))\r\n\r\n })\r\n }\r\n\r\n usersInfoForChatsStore(m_chats, reload){\r\n\r\n return this.usersInfoForChats(m_chats, reload).then(i => {\r\n\r\n this.core.store.commit('SET_CHATS_USERS', this.usersFromChats(m_chats))\r\n\r\n return Promise.resolve(i)\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n allchatmembers(m_chats, reload, withinvite){\r\n var members = []\r\n var promises = []\r\n\r\n\r\n if(withinvite){\r\n var promises = _.map(m_chats, (chat) => {\r\n\r\n\r\n if(chat._selfMembership === 'invite' && (!chat.summary.members || reload) && !chat.summary.membersloading){\r\n \r\n chat.summary.membersloading = true\r\n \r\n return chat._loadMembersFromServer().then(r => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n chat.summary.members = _.map(r, (user) => {\r\n \r\n return {\r\n name: f.getmatrixid(user.state_key),\r\n membership: user.content.membership,\r\n user: user,\r\n userId : user.state_key,\r\n powerLevel : user.content.powerLevel || 0\r\n }\r\n \r\n })\r\n \r\n if(chat._selfMembership === 'invite' && this.core.user.userinfo){\r\n \r\n if(!_.find(chat.summary.members, (m) => {\r\n return m.userId == this.core.user.matrixId(this.core.user.userinfo.id)\r\n } )){\r\n \r\n chat.summary.members.push({\r\n name: this.core.user.userinfo.id,\r\n membership: 'invite',\r\n user: this.core.user.userinfo,\r\n userId : this.core.user.matrixId(this.core.user.userinfo.id),\r\n powerLevel : 0\r\n })\r\n \r\n }\r\n \r\n }\r\n \r\n return Promise.resolve()\r\n \r\n }).catch(e => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n return Promise.resolve()\r\n })\r\n }\r\n \r\n return Promise.resolve()\r\n \r\n })\r\n }\r\n\r\n return Promise.all(promises).then(r => {\r\n\r\n _.each(m_chats, (chat) => {\r\n members = members.concat(_.toArray(chat.currentState.members), chat.summary.members || [])\r\n })\r\n\r\n members = _.uniq(members, function(m){\r\n return m.userId\r\n })\r\n\r\n return Promise.resolve(members)\r\n })\r\n }\r\n\r\n usersInfoForChats(m_chats, reload) {\r\n\r\n /// TODO FILTER CONTACTS\r\n\r\n return this.allchatmembers(m_chats, reload).then(members => {\r\n\r\n return this.usersInfo(members, reload)\r\n })\r\n \r\n }\r\n\r\n usersInfoById(id) {\r\n\r\n var ids = [f.getmatrixid(id)]\r\n\r\n return this.core.user.usersInfo(ids, false).then( r => {\r\n return Promise.resolve(r[0])\r\n })\r\n }\r\n\r\n usersInfo(members, reload) {\r\n\r\n var ids = _.map(members, function (m) {\r\n return f.getmatrixid(m.userId)\r\n })\r\n\r\n ids = _.uniq(ids)\r\n\r\n return this.core.user.usersInfo(ids, false, reload)\r\n }\r\n\r\n groupId(users) {\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n users.forEach( (user) => {\r\n idForInviting.push( this.core.user.matrixId(user.id) )\r\n })\r\n\r\n users.forEach(function (user) {\r\n let idsForHash = parseInt(user.id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n\r\n return {hash: hash, idForInviting: idForInviting}\r\n\r\n }\r\n\r\n groupIdLight(ids) {\r\n\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n var domains = [null]\r\n\r\n if (window.chatinvitedomains) domains = [].concat(domains, window.chatinvitedomains)\r\n\r\n _.each(domains, (domain) => {\r\n\r\n _.each(ids, (id) => {\r\n idForInviting.push( this.core.user.matrixId(id, domain) )\r\n })\r\n\r\n })\r\n\r\n \r\n _.each(ids, (_id) => {\r\n let idsForHash = parseInt(_id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n return {hash: hash, idForInviting: idForInviting}\r\n }\r\n\r\n chatIsPublic(chat){\r\n var join_rules = chat.currentState.getStateEvents(\"m.room.join_rules\")\r\n\r\n console.log('join_rules', join_rules)\r\n\r\n return _.find(join_rules, (v) => {\r\n return f.deep(v, 'event.content.join_rule') == 'public'\r\n }) ? true : false\r\n }\r\n\r\n \r\n}\r\n\r\nexport default MTRXKIT","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * FingerprintJS v3.3.2 - Copyright (c) FingerprintJS, Inc, 2021 (https://fingerprintjs.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArrays } from 'tslib';\n\nvar version = \"3.3.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction forEachWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\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\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\" + selector + \"'\";\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var isFinalResultLoaded = function (loadResult) {\n return typeof loadResult !== 'function';\n };\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n var sourceGetters = Array(includedSources.length);\n // Using `forEachWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n forEachWithBreaks(includedSources, function (sourceKey, index) {\n sourceGetters[index] = loadSource(sources[sourceKey], sourceOptions);\n });\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var components, _i, includedSources_1, sourceKey, componentPromises, _loop_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n components = {};\n for (_i = 0, includedSources_1 = includedSources; _i < includedSources_1.length; _i++) {\n sourceKey = includedSources_1[_i];\n components[sourceKey] = undefined;\n }\n componentPromises = Array(includedSources.length);\n _loop_1 = function () {\n var hasAllComponentPromises;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n hasAllComponentPromises = true;\n return [4 /*yield*/, forEachWithBreaks(includedSources, function (sourceKey, index) {\n if (!componentPromises[index]) {\n // `sourceGetters` may be incomplete at this point of execution because `forEachWithBreaks` is asynchronous\n if (sourceGetters[index]) {\n componentPromises[index] = sourceGetters[index]().then(function (component) { return (components[sourceKey] = component); });\n }\n else {\n hasAllComponentPromises = false;\n }\n }\n })];\n case 1:\n _a.sent();\n if (hasAllComponentPromises) {\n return [2 /*return*/, \"break\"];\n }\n return [4 /*yield*/, wait(1)]; // Lets the source load loop continue\n case 2:\n _a.sent(); // Lets the source load loop continue\n return [2 /*return*/];\n }\n });\n };\n _a.label = 1;\n case 1: return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (state_1 === \"break\")\n return [3 /*break*/, 4];\n _a.label = 3;\n case 3: return [3 /*break*/, 1];\n case 4: return [4 /*yield*/, Promise.all(componentPromises)];\n case 5:\n _a.sent();\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprintjs.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* Timeout */ || error.name === \"suspended\" /* Suspended */) {\n return -3 /* Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n fingerprintPromise.catch(function () { return undefined; });\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n context.startRendering();\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n element.setAttribute(name_1, attributes[name_1].join(' '));\n }\n return element;\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\" + fontToDetect + \"',\" + baseFont);\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n return { winding: false, geometry: '', text: '' };\n }\n return {\n winding: doesSupportWinding(context),\n geometry: makeGeometryImage(canvas, context),\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n text: makeTextImage(canvas, context),\n };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction makeTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \" + String.fromCharCode(55357, 56835) /* 😃 */;\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n return save(canvas);\n}\nfunction makeGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n return save(canvas);\n}\nfunction save(canvas) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArrays(screenFrameBackup)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\" + (offset >= 0 ? '+' : '') + Math.abs(offset);\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * See docs/content_blockers.md to learn how to make the list\n */\nvar filters = {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n 'a[title=\"7naga poker\" i]',\n '[title=\"ALIENBOLA\" i]',\n ],\n abpvn: [\n '#quangcaomb',\n '.iosAdsiosAds-layout',\n '.quangcao',\n '[href^=\"https://r88.vn/\"]',\n '[href^=\"https://zbet.vn/\"]',\n ],\n adBlockFinland: [\n '.mainostila',\n '.sponsorit',\n '.ylamainos',\n 'a[href*=\"/clickthrgh.asp?\"]',\n 'a[href^=\"https://app.readpeak.com/ads\"]',\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n 'a[href^=\"http://g1.v.fwmrm.net/ad/\"]',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n ],\n adBlockWarningRemoval: ['#adblock-honeypot', '.adblocker-root', '.wp_adblock_detect'],\n adGuardAnnoyances: ['amp-embed[type=\"zen\"]', '.hs-sosyal', '#cookieconsentdiv', 'div[class^=\"app_gdpr\"]', '.as-oil'],\n adGuardBase: ['#ad-after', '#ad-p3', '.BetterJsPopOverlay', '#ad_300X250', '#bannerfloat22'],\n adGuardChinese: [\n '#piao_div_0[style*=\"width:140px;\"]',\n 'a[href*=\".ttz5.cn\"]',\n 'a[href*=\".yabovip2027.com/\"]',\n '.tm3all2h4b',\n '.cc5278_banner_ad',\n ],\n adGuardFrench: [\n '.zonepub',\n '[class*=\"_adLeaderboard\"]',\n '[id^=\"block-xiti_oas-\"]',\n 'a[href^=\"http://ptapjmp.com/\"]',\n 'a[href^=\"https://go.alvexo.com/\"]',\n ],\n adGuardGerman: [\n '.banneritemwerbung_head_1',\n '.boxstartwerbung',\n '.werbung3',\n 'a[href^=\"http://www.eis.de/index.phtml?refid=\"]',\n 'a[href^=\"https://www.tipico.com/?affiliateId=\"]',\n ],\n adGuardJapanese: [\n '#kauli_yad_1',\n '#ad-giftext',\n '#adsSPRBlock',\n 'a[href^=\"http://ad2.trafficgate.net/\"]',\n 'a[href^=\"http://www.rssad.jp/\"]',\n ],\n adGuardMobile: ['amp-auto-ads', '#mgid_iframe', '.amp_ad', 'amp-embed[type=\"24smi\"]', '#mgid_iframe1'],\n adGuardRussian: [\n 'a[href^=\"https://ya-distrib.ru/r/\"]',\n 'a[href^=\"https://ad.letmeads.com/\"]',\n '.reclama',\n 'div[id^=\"smi2adblock\"]',\n 'div[id^=\"AdFox_banner_\"]',\n ],\n adGuardSocial: [\n 'a[href^=\"//www.stumbleupon.com/submit?url=\"]',\n 'a[href^=\"//telegram.me/share/url?\"]',\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: [\n '#barraPublicidade',\n '#Publicidade',\n '#publiEspecial',\n '#queTooltip',\n '[href^=\"http://ads.glispa.com/\"]',\n ],\n adGuardTrackingProtection: [\n 'amp-embed[type=\"taboola\"]',\n '#qoo-counter',\n 'a[href^=\"http://click.hotlog.ru/\"]',\n 'a[href^=\"http://hitcounter.ru/top/stat.php\"]',\n 'a[href^=\"http://top.mail.ru/jump\"]',\n ],\n adGuardTurkish: [\n '#backkapat',\n '#reklami',\n 'a[href^=\"http://adserv.ontek.com.tr/\"]',\n 'a[href^=\"http://izlenzi.com/campaign/\"]',\n 'a[href^=\"http://www.installads.net/\"]',\n ],\n bulgarian: ['td#freenet_table_ads', '#adbody', '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: ['#AD_banner_bottom', '#Ads_google_02', '#N-ad-article-rightRail-1', '#ad-fullbanner2', '#ad-zone-2'],\n easyListChina: [\n 'a[href*=\".wensixuetang.com/\"]',\n 'A[href*=\"/hth107.com/\"]',\n '.appguide-wrap[onclick*=\"bcebos.com\"]',\n '.frontpageAdvM',\n '#taotaole',\n ],\n easyListCookie: ['#adtoniq-msg-bar', '#CoockiesPage', '#CookieModal_cookiemodal', '#DO_CC_PANEL', '#ShowCookie'],\n easyListCzechSlovak: ['#onlajny-stickers', '#reklamni-box', '.reklama-megaboard', '.sklik', '[id^=\"sklikReklama\"]'],\n easyListDutch: [\n '#advertentie',\n '#vipAdmarktBannerBlock',\n '.adstekst',\n 'a[href^=\"https://xltube.nl/click/\"]',\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n 'a[href^=\"http://www.hw-area.com/?dp=\"]',\n 'a[href^=\"https://ads.sunmaker.com/tracking.php?\"]',\n '.werbung-skyscraper2',\n '.bannergroup_werbung',\n '.ads_rechts',\n ],\n easyListItaly: [\n '.box_adv_annunci',\n '.sb-box-pubbliredazionale',\n 'a[href^=\"http://affiliazioniads.snai.it/\"]',\n 'a[href^=\"https://adserver.html.it/\"]',\n 'a[href^=\"https://affiliazioniads.snai.it/\"]',\n ],\n easyListLithuania: [\n '.reklamos_tarpas',\n '.reklamos_nuorodos',\n 'img[alt=\"Reklaminis skydelis\"]',\n 'img[alt=\"Dedikuoti.lt serveriai\"]',\n 'img[alt=\"Hostingas Serveriai.lt\"]',\n ],\n estonian: ['A[href*=\"http://pay4results24.eu\"]'],\n fanboyAnnoyances: [\n '#feedback-tab',\n '#taboola-below-article',\n '.feedburnerFeedBlock',\n '.widget-feedburner-counter',\n '[title=\"Subscribe to our blog\"]',\n ],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: [\n '.td-tags-and-social-wrapper-box',\n '.twitterContainer',\n '.youtube-social',\n 'a[title^=\"Like us on Facebook\"]',\n 'img[alt^=\"Share on Digg\"]',\n ],\n frellwitSwedish: [\n 'a[href*=\"casinopro.se\"][target=\"_blank\"]',\n 'a[href*=\"doktor-se.onelink.me\"]',\n 'article.category-samarbete',\n 'div.holidAds',\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n 'A[href*=\"adman.otenet.gr/click?\"]',\n 'A[href*=\"http://axiabanners.exodus.gr/\"]',\n 'A[href*=\"http://interactive.forthnet.gr/click?\"]',\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n 'A[href*=\"ad.eval.hu\"]',\n 'A[href*=\"ad.netmedia.hu\"]',\n 'A[href*=\"daserver.ultraweb.hu\"]',\n '#cemp_doboz',\n '.optimonk-iframe-container',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '.cookie-msg-info-container',\n '#cookies-policy-sticky',\n ],\n icelandicAbp: ['A[href^=\"/framework/resources/forms/ads.aspx\"]'],\n latvian: [\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 120px; height: 40px; overflow: hidden; position: relative;\"]',\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 88px; height: 31px; overflow: hidden; position: relative;\"]',\n ],\n listKr: [\n 'a[href*=\"//kingtoon.slnk.kr\"]',\n 'a[href*=\"//playdsb.com/kr\"]',\n 'div.logly-lift-adz',\n 'div[data-widget_id=\"ml6EJ074\"]',\n 'ins.daum_ddn_area',\n ],\n listeAr: [\n '.geminiLB1Ad',\n '.right-and-left-sponsers',\n 'a[href*=\".aflam.info\"]',\n 'a[href*=\"booraq.org\"]',\n 'a[href*=\"dubizzle.com/ar/?utm_source=\"]',\n ],\n listeFr: [\n 'a[href^=\"http://promo.vador.com/\"]',\n '#adcontainer_recherche',\n 'a[href*=\"weborama.fr/fcgi-bin/\"]',\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n '[href^=\"https://aff.sendhub.pl/\"]',\n 'a[href^=\"http://advmanager.techfun.pl/redirect/\"]',\n 'a[href^=\"http://www.trizer.pl/?utm_source\"]',\n 'div#skapiec_ad',\n ],\n ro: [\n 'a[href^=\"//afftrk.altex.ro/Counter/Click\"]',\n 'a[href^=\"/magazin/\"]',\n 'a[href^=\"https://blackfridaysales.ro/trk/shop/\"]',\n 'a[href^=\"https://event.2performant.com/events/click\"]',\n 'a[href^=\"https://l.profitshare.ro/\"]',\n ],\n ruAd: [\n 'a[href*=\"//febrare.ru/\"]',\n 'a[href*=\"//utimg.ru/\"]',\n 'a[href*=\"://chikidiki.ru\"]',\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: ['a[href*=macau-uta-popup]', '#ads-google-middle_rectangle-group', '.ads300s', '.bumq', '.img-kosana'],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n '.ctpl-fullbanner',\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n};\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var debug = (_a === void 0 ? {} : _a).debug;\n return __awaiter(this, void 0, void 0, function () {\n var filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filterNames = Object.keys(filters);\n allSelectors = (_b = []).concat.apply(_b, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _c.sent();\n if (debug) {\n printDebug(blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\" + filterName + \":\";\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \" + selector + \" \" + (blockedSelectors[selector] ? '🚫' : '➡️');\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(message + \"\\n```\");\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \" + gamut + \")\").matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch('inverted')) {\n return true;\n }\n if (doesMatch('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(inverted-colors: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$1('active')) {\n return true;\n }\n if (doesMatch$1('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(forced-colors: \" + value + \")\").matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \" + i + \")\").matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$3('reduce')) {\n return true;\n }\n if (doesMatch$3('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(prefers-reduced-motion: \" + value + \")\").matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch$4('high')) {\n return true;\n }\n if (doesMatch$4('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(dynamic-range: \" + value + \")\").matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = containerWidthPx + \"px\";\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\" + 1 / iframeWindow.devicePixelRatio;\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArrays(Array((containerWidthPx / 20) << 0)).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\" + proConfidenceScore) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\" + (result ? '|' : '') + componentKey.replace(/([:|\\\\])/g, '\\\\$1') + \":\" + value;\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \" + result.version + \"\\nuserAgent: \" + navigator.userAgent + \"\\ntimeBetweenLoadAndGet: \" + (startTime - creationTime) + \"\\nvisitorId: \" + result.visitorId + \"\\ncomponents: \" + componentsToDebugString(components) + \"\\n```\");\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.01) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://openfpcdn.io/fingerprintjs/v\" + version + \"/npm-monitoring\", true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport default index;\nexport { componentsToDebugString, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources };\n","const sdk = require('@/matrix-js-sdk');\r\n\r\nimport MTRXKIT from \"./mtrxkit\";\r\nimport f from \"./functions\";\r\nimport images from \"./utils/images\";\r\nimport FingerprintJS from '@fingerprintjs/fingerprintjs';\r\n\r\nimport qs from 'qs';\r\nimport fileSaver from 'file-saver';\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar axios = require('axios');\r\n\r\nconsole.log(\"sdk\", sdk)\r\n\r\n\r\nclass MTRX {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n this.baseUrl = p.baseUrl\r\n this.ready = false\r\n this.error = false\r\n this.kit = new MTRXKIT(this.core, p)\r\n this.sdk = sdk\r\n this.sync = ''\r\n this.nd = false\r\n this.version = 4\r\n this.dversion = '2'\r\n this.backup = {}\r\n this.db = null\r\n\r\n this.customrequest = true\r\n\r\n this.devicekey = 'm8_device'\r\n }\r\n\r\n\r\n async setCredentials() {\r\n return this.core.user.matrixCredentials().then(credentials => {\r\n this.credentials = credentials\r\n return Promise.resolve(credentials)\r\n })\r\n\r\n }\r\n\r\n getDevices() {\r\n var devices = localStorage[this.devicekey] || ''\r\n\r\n if (devices) {\r\n try {\r\n var d = JSON.parse(devices)\r\n\r\n return d\r\n } catch (e) {\r\n }\r\n }\r\n\r\n return {}\r\n }\r\n\r\n setDevice(device, userkey) {\r\n\r\n var devices = this.getDevices()\r\n\r\n devices[userkey] = device\r\n\r\n localStorage[this.devicekey] = JSON.stringify(devices)\r\n localStorage.device_ = JSON.stringify(device)\r\n\r\n }\r\n\r\n getDevice(userkey) {\r\n // return localStorage.m8_device;\r\n // var devices = this.getDevices()\r\n // return devices[userkey] || null\r\n }\r\n\r\n request(opts, clbk) {\r\n\r\n var response = null;\r\n\r\n var error = null\r\n\r\n const cancelTokenSource = axios.CancelToken.source();\r\n\r\n var aopts = {\r\n url: opts.uri,\r\n params: opts.qs,\r\n data: JSON.parse(opts.body || \"{}\"),\r\n timeout: opts.timeout,\r\n headers: opts.headers,\r\n json: opts.json,\r\n method: opts.method,\r\n withCredentials: opts.withCredentials,\r\n _matrix_opts: opts,\r\n cancelToken: cancelTokenSource.token,\r\n\r\n paramsSerializer: function (params) {\r\n return qs.stringify(params, opts.qsStringifyOptions)\r\n },\r\n }\r\n\r\n var req = axios(aopts).then(response => {\r\n\r\n\r\n return Promise.resolve(response)\r\n }).catch(e => {\r\n\r\n error = e\r\n response = e.response\r\n\r\n return Promise.resolve(response)\r\n\r\n }).then(response => {\r\n\r\n var parsederror = error\r\n\r\n if (error) {\r\n\r\n try {\r\n parsederror = JSON.parse(f.deep(response, 'request.responseText'))\r\n\r\n error = new sdk.MatrixError(parsederror)\r\n\r\n } catch (e) {\r\n }\r\n\r\n //error.error = parsederror\r\n\r\n }\r\n\r\n clbk(error, response, f.deep(response, 'request.responseText') || '')\r\n\r\n /*if (error)\r\n return Promise.reject(parsederror)*/\r\n })\r\n\r\n req.abort = function () {\r\n cancelTokenSource.cancel();\r\n }\r\n\r\n return req\r\n\r\n /*\r\n uri\tstring\tThe complete URI.\r\n method\tstring\tThe HTTP method.\r\n qs\tObject\tThe query parameters to append to the URI.\r\n body\tObject\tThe JSON-serializable object.\r\n json\tboolean\tTrue if this is a JSON request.\r\n _matrix_opts\r\n */\r\n\r\n\r\n }\r\n\r\n async getFingerprint() {\r\n var fp = await FingerprintJS.load()\r\n var result = await fp.get()\r\n return result.visitorId + this.dversion\r\n }\r\n\r\n createMtrxClient(opts) {\r\n\r\n var client = sdk.createClient(opts);\r\n\r\n client.getProfileInfo = function () {\r\n return Promise.resolve({\r\n avatar_url: '',\r\n displayname: 'test'\r\n })\r\n }\r\n\r\n return client\r\n }\r\n\r\n async getClient() {\r\n\r\n await this.setCredentials();\r\n\r\n var userClientData = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n var opts = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n if (this.customrequest)\r\n opts.request = this.request\r\n\r\n var client = this.createMtrxClient(opts);\r\n\r\n\r\n try {\r\n var userData = await client.login('m.login.password', {\r\n user: this.credentials.username,\r\n password: this.credentials.password,\r\n })\r\n\r\n } catch (e) {\r\n\r\n if(e && e.indexOf && e.indexOf('M_USER_DEACTIVATED') > -1){\r\n this.error = 'M_USER_DEACTIVATED'\r\n return null\r\n }\r\n\r\n if (await client.isUsernameAvailable(this.credentials.username)) {\r\n\r\n userData = await client.register(\r\n this.credentials.username,\r\n this.credentials.password,\r\n null,\r\n {\r\n type: 'm.login.dummy',\r\n //signature : this.core.user.signature('matrix')\r\n }\r\n )\r\n\r\n } else {\r\n throw 'Signup error, username is not available: ' + e\r\n }\r\n }\r\n\r\n localStorage.accessToken = userData.access_token\r\n var store = new sdk.IndexedDBStore({\r\n indexedDB: window.indexedDB,\r\n dbName: 'matrix-js-sdk:' + this.credentials.username\r\n })\r\n await store.startup()\r\n\r\n Object.assign(userClientData, {\r\n userId: userData.user_id,\r\n accessToken: userData.access_token,\r\n unstableClientRelationAggregation: true,\r\n timelineSupport: true,\r\n store: store,\r\n\r\n // deviceId: userData.device_id,\r\n })\r\n\r\n if (this.customrequest)\r\n userClientData.request = this.request\r\n\r\n\r\n var userClient = this.createMtrxClient(userClientData)\r\n window.client = userClient\r\n window.core = this.core\r\n\r\n await userClient.startClient({\r\n pollTimeout: 60000,\r\n resolveInvitesToProfiles: true\r\n });\r\n\r\n\r\n this.access = userClientData\r\n\r\n this.client = userClient\r\n\r\n return userClient;\r\n }\r\n\r\n clearstorage(key) {\r\n var keys = Object.keys(localStorage), i = keys.length;\r\n\r\n while (i--) {\r\n if (keys[i] && keys[i].indexOf(key) == 0) {\r\n localStorage.removeItem(keys[i]);\r\n }\r\n }\r\n }\r\n\r\n clearstore() {\r\n\r\n var version = Number(localStorage.matrixversion || '0')\r\n\r\n if (version < this.version) {\r\n\r\n this.clearstorage('crypto.')\r\n this.clearstorage('session.')\r\n\r\n var keys = ['', '2', '3', '4', '5', '6', '8']\r\n\r\n _.each(keys, function (key) {\r\n delete localStorage['m' + key + '_device']\r\n })\r\n\r\n }\r\n\r\n localStorage.matrixversion = this.version\r\n }\r\n\r\n async createClient() {\r\n try {\r\n this.client = await this.getClient()\r\n this.store = this.client.store\r\n this.ready = true\r\n\r\n } catch (e) {\r\n this.error = e\r\n }\r\n\r\n\r\n return true\r\n }\r\n\r\n wait() {\r\n return f.pretry(() => {\r\n return this.ready\r\n }).then(() => {\r\n\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n waitchats() {\r\n\r\n return f.pretry(() => {\r\n\r\n return this.chatsready\r\n\r\n }).then(() => {\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n me(id) {\r\n return f.getmatrixid(id) == this.core.user.userinfo?.id\r\n }\r\n\r\n reciepts(event) {\r\n var room = null;\r\n\r\n return f.pretry(() => {\r\n\r\n var rooms = this.core.mtrx.store.rooms\r\n\r\n room = rooms[event.getRoomId()]\r\n\r\n return room\r\n\r\n }).then(() => {\r\n\r\n return room.getReceiptsForEvent(event)\r\n\r\n })\r\n }\r\n\r\n storeFileLocal(url, file){\r\n\r\n return file.arrayBuffer().then((arrayBuffer) => {\r\n const blob = new Blob([new Uint8Array(arrayBuffer)], {type: file.type });\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n return window.POCKETNETINSTANCE.storage.saveFile(url, blob);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n return this.db.set(url, blob)\r\n }\r\n }\r\n \r\n });\r\n \r\n \r\n }\r\n\r\n download(url) {\r\n\r\n // Function to download the file\r\n var dlFile = () => {\r\n return f.fetchLocal(url).then(response => {\r\n // Update the storage before returning\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n window.POCKETNETINSTANCE.storage.saveFile(url, response.data);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n this.db.set(url, response.data)\r\n }\r\n }\r\n\r\n return Promise.resolve(response.data);\r\n })\r\n }\r\n\r\n\r\n // Check if file is saved in the storage\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova) {\r\n return window.POCKETNETINSTANCE.storage.loadFile(url).then((file) => {\r\n return Promise.resolve(file);\r\n }, (e) => {\r\n\r\n // Nothing in storage, download file\r\n return dlFile();\r\n });\r\n } else {\r\n\r\n if(this.db){\r\n\r\n return this.db.get(url).then((file) => {\r\n\r\n return Promise.resolve(file);\r\n\r\n }).catch(() => {\r\n return dlFile();\r\n })\r\n \r\n }\r\n\r\n return dlFile();\r\n\r\n }\r\n \r\n \r\n }\r\n\r\n customRoomType(roomId) {\r\n var room = this.core.mtrx.client.getRoom(roomId)\r\n\r\n if (!room) return null\r\n\r\n var ev = room.currentState.getStateEvents(\"m.room.custom\", \"\") || {};\r\n\r\n return ev.event?.content.type\r\n\r\n }\r\n\r\n isReaded(event, me) {\r\n\r\n return this.reciepts(event).then(reciepts => {\r\n return Promise.resolve(\r\n _.find(reciepts, reciept => {\r\n var m = this.me(reciept.userId)\r\n\r\n\r\n return reciept.type == 'm.read' && ((me && m) || (!m && !me))\r\n })\r\n )\r\n })\r\n\r\n\r\n }\r\n\r\n initEvents() {\r\n\r\n let self = this\r\n\r\n let userId = this.core.mtrx.client.credentials.userId\r\n\r\n this.client.on(\"RoomMember.membership\", (event, member) => {\r\n\r\n\r\n if (!this.chatsready) return\r\n\r\n\r\n if ((member.membership === \"invite\" || member.membership === \"join\") && event.getSender() !== userId) {\r\n this.core.notifier.event(event)\r\n }\r\n\r\n });\r\n\r\n this.client.on(\"Room.timeline\", (message, member) => {\r\n\r\n if (!this.chatsready) return\r\n\r\n if (!message.event.content) return\r\n\r\n if (message.event.content.msgtype === 'm.file') {\r\n message.event.content.pbody = JSON.parse(message.event.content.body)\r\n }\r\n\r\n\r\n if (message.getSender() !== userId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(message.event.room_id)\r\n\r\n if (message.event.content['m.relates_to'] && message.event.content['m.relates_to'][\"rel_type\"] == 'm.replace') return false\r\n\r\n if (m_chat && this.core.pcrypto.rooms[message.event.room_id]) this.core.notifier.event(message, m_chat)\r\n\r\n }\r\n\r\n\r\n });\r\n\r\n this.client.on(\"RoomMember.typing\", (event, member) => {\r\n this.core.store.dispatch('TYPING_EVENT', member)\r\n });\r\n\r\n\r\n this.client.on('sync', (state, prevState, res) => {\r\n\r\n if (state === 'PREPARED') {\r\n this.setready()\r\n }\r\n\r\n this.core.store.dispatch('FETCH_CHATS').then(r => {\r\n this.core.store.dispatch('FETCH_EVENTS')\r\n this.core.store.commit('ALL_NOTIFICATIONS_COUNT', this.client.getRooms())\r\n })\r\n\r\n\r\n });\r\n\r\n }\r\n\r\n setready() {\r\n\r\n if (!this.chatsready) {\r\n this.chatsready = true\r\n this.core.store.commit('SET_CHATS_READY', true)\r\n }\r\n\r\n }\r\n\r\n initdb(){\r\n return ChatStorage('files', 1).then((db) => {\r\n this.db = db\r\n return Promise.resolve()\r\n }).catch(() => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n init() {\r\n return this.createClient().then(() => {\r\n\r\n if(this.error){\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return this.initdb()\r\n \r\n }).then(() => {\r\n\r\n this.initEvents()\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n deactivateAccount(){\r\n\r\n if (this.client) {\r\n return this.client.deactivateAccount(this.credentials, true)\r\n }\r\n\r\n return Promise.reject('noclient')\r\n }\r\n\r\n destroy() {\r\n if (this.client) {\r\n // Before client is stopped, delete the pusher if needed\r\n if (window.cordova) {\r\n this.deletePusher();\r\n }\r\n\r\n this.client.stopClient()\r\n }\r\n\r\n this.chatsready = false\r\n this.ready = false\r\n this.error = false\r\n }\r\n\r\n // Try to delete the current pusher if needed\r\n deletePusher() {\r\n // Try to get a saved token\r\n\r\n if (!window.cordova) return\r\n\r\n var savedToken;\r\n if (localStorage)\r\n savedToken = localStorage.getItem('fcmtoken5');\r\n if (savedToken && this.client.setPusher) {\r\n var appName = 'pocketnet';\r\n var pusherData = {\r\n app_display_name: appName,\r\n app_id: appName + window.cordova.platformId,\r\n\r\n data: {\r\n url: this.core.mtrx.baseUrl + '/_matrix/push/v1/notify',\r\n default_payload: {\r\n aps: {\r\n \"sound\": \"default\",\r\n \"content-available\": 1\r\n }\r\n }\r\n },\r\n\r\n device_display_name: window.device.manufacturer + \" \" + window.device.model,\r\n kind: null,\t// Set to null to delete the pusher\r\n lang: localStorage.getItem('loc') || 'en',\r\n pushkey: savedToken\r\n\r\n };\r\n\r\n this.core.mtrx.client.setPusher(pusherData).then(() => {\r\n localStorage.removeItem('fcmtoken5');\r\n }, (err) => {\r\n console.log(err);\r\n });\r\n }\r\n }\r\n\r\n uploadContent(file, save) {\r\n return this.client.uploadContent(file).then(src => {\r\n return Promise.resolve(this.core.mtrx.client.mxcUrlToHttp(src))\r\n }).then(url => {\r\n\r\n if(save){\r\n return this.storeFileLocal(url, file).then(() => {\r\n return Promise.resolve(url)\r\n }).catch(e => {\r\n return Promise.resolve(url)\r\n })\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n /*transaction(roomId, txId){\r\n this.client.sendEvent(roomId, \"m.room.message\", {\r\n\r\n txId: roomId,\r\n msgtype: \"m.notice\"\r\n\r\n }, \"\");\r\n }*/\r\n\r\n\r\n originalEvent(id, timeline) {\r\n var rtr = timeline._timelineSet.getRelationsForEvent(e.event.event_id, 'm.reference', 'm.room.message')\r\n\r\n if (rtr) {\r\n var events = rtr.getRelations()\r\n return events[0]\r\n }\r\n }\r\n\r\n clearEventId(event) {\r\n var previd = null\r\n\r\n if (\r\n event.event.content['m.relates_to'] &&\r\n event.event.content['m.relates_to']['rel_type'] == 'm.replace') previd = event.event.content['m.relates_to']['event_id']\r\n\r\n\r\n return previd || event.getId()\r\n\r\n }\r\n\r\n textEvent(chat, text) {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return chat.pcrypto.encryptEvent(text)\r\n }\r\n\r\n return Promise.resolve(this.sdk.ContentHelpers.makeTextMessage(text))\r\n }\r\n\r\n sendtext(chat, text, {relation, from}) {\r\n\r\n return this.textEvent(chat, text).then(r => {\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return this.client.sendEvent(chat.roomId, 'm.room.message', r)\r\n } else\r\n return this.client.sendMessage(chat.roomId, r)\r\n })\r\n\r\n\r\n }\r\n\r\n sendFile(chat, file, meta, {relation, from}, notenc) {\r\n\r\n if (!meta) meta = {}\r\n\r\n var fileInfo = {}\r\n fileInfo.name = file.name\r\n fileInfo.size = file.size\r\n\r\n var encpromise = (() => Promise.resolve(file))()\r\n var promise = null\r\n\r\n if (chat.pcrypto.canBeEncrypt() && !notenc) {\r\n\r\n encpromise = chat.pcrypto.encryptFile(file).then(r => {\r\n\r\n fileInfo.secrets = r.secrets\r\n\r\n return Promise.resolve(r.file)\r\n\r\n })\r\n\r\n }\r\n\r\n return encpromise.then(file => {\r\n\r\n promise = this.client.uploadContent(file)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n\r\n }).then(src => {\r\n\r\n if (meta.aborted)\r\n return Promise.reject('aborted')\r\n\r\n return Promise.resolve(this.client.mxcUrlToHttp(src))\r\n\r\n }).then((url) => {\r\n\r\n fileInfo.url = url\r\n\r\n let body = JSON.stringify(fileInfo)\r\n\r\n var r = {\r\n body: body,\r\n msgtype: 'm.file'\r\n }\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n return this.client.sendMessage(chat.roomId, r)\r\n\r\n })\r\n\r\n }\r\n\r\n sendImageBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendImage(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendAudioBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendAudio(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendImage(chat, base64, file, meta, {relation, from} = {}) {\r\n if (!file) return this.sendImageBase64(chat, base64, meta)\r\n\r\n var i = new images()\r\n var info = {}\r\n\r\n if (!meta) meta = {}\r\n\r\n return i.wh(base64).then(_info => {\r\n info = _info\r\n\r\n if (from)\r\n info.from = from\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return Promise.resolve(r.file)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve(file)\r\n\r\n\r\n }).then(file => {\r\n var promise = this.core.mtrx.uploadContent(file, true)\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((image) => {\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendImageMessage(chat.roomId, image, info, 'Image')\r\n })\r\n }\r\n\r\n sendAudio(chat, base64, file, meta, {relation, from} = {}) {\r\n\r\n\r\n if (!file) return this.sendAudioBase64(chat, base64, meta)\r\n\r\n \r\n let info = {}\r\n\r\n info.from = from\r\n\r\n return new Promise(resolve => {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n console.log(\"??????????\")\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return resolve(r.file)\r\n })\r\n }\r\n\r\n resolve(file) \r\n\r\n }).then(file => {\r\n\r\n let promise = this.core.mtrx.uploadContent(file, true)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((audio) => {\r\n\r\n console.log(audio, info)\r\n\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendAudioMessage(chat.roomId, audio, info, 'Audio')\r\n })\r\n\r\n }\r\n\r\n async getFile(chat, event) {\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n\r\n return this.download(event.event.content.pbody.url).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return Promise.resolve({\r\n file: r,\r\n name: event.event.content.pbody.name\r\n });\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n async downloadFile(chat, event) {\r\n\r\n return this.getFile(chat, event).then(r => {\r\n\r\n if (window.cordova && f.saveFileCordova) {\r\n return new Promise((resolve, reject) => {\r\n\r\n f.saveFileCordova(r.file, r.name, function (i, e) {\r\n\r\n if (e) {\r\n console.error(e)\r\n }\r\n\r\n if (!e) resolve()\r\n\r\n else reject('unable')\r\n })\r\n })\r\n }\r\n\r\n return fileSaver.saveAs(r.file, r.name);\r\n\r\n }).catch(e => {\r\n console.error(e)\r\n return Promise.reject(e)\r\n })\r\n\r\n\r\n }\r\n\r\n async getAudioUnencrypt(chat, event){\r\n\r\n console.log('getAudioUnencrypt')\r\n\r\n if(event.event.content.audioData){\r\n return Promise.resolve(event.event.content.audioData)\r\n }\r\n\r\n return this.download(event.event.content.url, true).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.content.audioData = arraybuffer\r\n\r\n return Promise.resolve(arraybuffer)\r\n })\r\n\r\n }\r\n\r\n async getAudio(chat, event) {\r\n\r\n if (event.event.decryptedAudio) {\r\n return Promise.resolve(event.event.decryptedAudio)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.decryptedAudio = arraybuffer\r\n\r\n return Promise.resolve(event.event.decryptedAudio)\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n }\r\n }\r\n\r\n async getImage(chat, event) {\r\n\r\n if (event.event.decryptedImage) {\r\n return Promise.resolve(event.event.decryptedImage)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n return f.Base64.fromFile(r)\r\n }).then(url => {\r\n\r\n event.event.decryptedImage = url.replace('data:file;', 'data:image/jpeg;')\r\n return Promise.resolve(event.event.decryptedImage)\r\n\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n }\r\n\r\n\r\n shareInChat(id, share) {\r\n var m_chat = this.client.getRoom(id)\r\n\r\n\r\n //// share.openwithItems []\r\n\r\n //// https://github.com/j3k0/cordova-plugin-openwith (item.type ---> resize)\r\n\r\n return this.core.mtrx.kit.prepareChat(m_chat).then(r => {\r\n\r\n var promises = []\r\n\r\n //// todo resize images.resize.fit\r\n _.each(share.images, (base64) => {\r\n\r\n var promise = this.sendImageBase64(m_chat, base64, {}, {from: share.from})\r\n\r\n promises.push(promise)\r\n\r\n })\r\n\r\n _.each(share.files, (file) => {\r\n\r\n promises.push(this.sendFile(m_chat, file, {}, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.urls, (url) => {\r\n\r\n promises.push(this.sendtext(m_chat, url, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.messages, (text) => {\r\n\r\n promises.push(this.sendtext(m_chat, text, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.audio, (arraybuffer) => {\r\n\r\n var base64 = 'data:audio/mpeg;base64,' + f._arrayBufferToBase64(arraybuffer)\r\n\r\n promises.push(this.sendAudioBase64(m_chat, base64,{}, {from: share.from}))\r\n\r\n })\r\n\r\n return Promise.all(promises)\r\n\r\n })\r\n }\r\n\r\n opencontact(contact) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: contact.name,\r\n type: 'contact',\r\n data: {\r\n contact: contact\r\n }\r\n })\r\n }\r\n\r\n complain(caption, p) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: caption,\r\n type: 'complain',\r\n data: p\r\n })\r\n }\r\n\r\n blockeduser(id) {\r\n\r\n if (!this.core.mtrx.client) return\r\n\r\n return this.core.mtrx.client.isUserIgnored(this.core.user.matrixId(id))\r\n }\r\n\r\n blockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList.push(userId)\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n fastsync = function () {\r\n\r\n var state = this.client.getSyncState()\r\n\r\n if (state === \"PREPARED\" || state === \"SYNCING\") {\r\n\r\n } else {\r\n return this.client.retryImmediately().catch(e => {\r\n console.log('fastsyncerror', e)\r\n })\r\n }\r\n\r\n\r\n }\r\n\r\n unblockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (!this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList = _.filter(blackList, function (_id) {\r\n return userId != _id\r\n })\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n chatUsersInfo(roomId, m) {\r\n\r\n if (!m) m = 'chatUsers'\r\n\r\n var _users = this.core.store.state.users\r\n\r\n return _.filter(_.map(this[m](roomId), (user) => {\r\n return _users[user.userId]\r\n }), function (u) {\r\n return u\r\n })\r\n\r\n }\r\n\r\n chatUsers(roomId) {\r\n return this.core.store.state.chatusers[roomId] || []\r\n }\r\n\r\n\r\n anotherChatUsers(roomId) {\r\n return _.filter(this.chatUsers(roomId), (user) => {\r\n return user.userId != this.core.user.userinfo.id\r\n })\r\n }\r\n}\r\n\r\nexport default MTRX\r\n","//require('ion-sound')\r\nimport f from \"./functions\";\r\n//const { Howl, Howler } = require('howler');\r\n\r\nclass Notifier {\r\n\r\n\tconstructor(core, p) {\r\n\t\tif (!p) p = {}\r\n\r\n\t\tthis.core = core\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\r\n\t\tthis.ion = null\r\n\r\n\t\tif (typeof ion != 'undefined') this.ion = ion\r\n\r\n\t\t/*ion.sound({\r\n\t\t sounds: [\r\n\t\t\t{\r\n\t\t\t name: \"glass\"\r\n\t\t\t}\r\n\t\t ],\r\n\t\t path: \"sounds/\",\r\n\t\t preload: true\r\n\t\t});*/\r\n\t}\r\n\r\n\tkey = 'showednotifications'\r\n\tshowed = {}\r\n\r\n\taddshowed(id) {\r\n\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\t\tthis.showed[id] = true\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\r\n\t}\r\n\r\n\tclearshowed() {\r\n\t\tthis.showed = {}\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\t}\r\n\r\n\tplaysound() {\r\n\t\t// If cordova is available, use the media plugin to play a sound\r\n\t\tif (window.Media && window.cordova && window.cordova.file && window.cordova.file.applicationDirectory) {\r\n\r\n\t\t\tvar soundSrc = window.cordova.file.applicationDirectory + 'www/sounds/glass.mp3';\r\n\t\t\tif (soundSrc.startsWith('file://'))\r\n\t\t\t\tsoundSrc = soundSrc.substring(7);\r\n\t\t\tvar notificationSound = new Media(soundSrc);\r\n\t\t\t// Play audio\r\n\t\t\tnotificationSound.play();\r\n\t\t}\r\n\r\n\t\t// Else, try to use the Howler sound plugin\r\n\t\telse if (window.ion) {\r\n\r\n\t\t\tion.sound.play('glass')\r\n\r\n\t\t\t/*var notificationSound = new Howl({\r\n\t\t\t\tsrc: ['sounds/glass.mp3'],\r\n\t\t\t\thtml5: true\r\n\t\t\t});\r\n\t\t\tnotificationSound.play();*/\r\n\t\t}\r\n\t}\r\n\r\n\tnotifySoundOrAction() {\r\n\r\n\t\tvar lastsounddate = localStorage['lastsounddate'] || null\r\n\r\n\t\tif (lastsounddate) {\r\n\t\t\tlastsounddate = new Date(lastsounddate)\r\n\r\n\t\t\tif (f.date.addseconds(lastsounddate, 10) > (new Date())) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlocalStorage['lastsounddate'] = (new Date())\r\n\r\n\t\tif (window.cordova && window.POCKETNETINSTANCE) {\r\n\t\t\twindow.POCKETNETINSTANCE.mobile.vibration.small()\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.playsound()\r\n\t\t}\r\n\t}\r\n\r\n\tdecrypt(event, chat) {\r\n\r\n\t\treturn this.core.mtrx.kit.prepareChat(chat).then(r => {\r\n\r\n\t\t\t\r\n\t\t\tif (event.event.decrypted) {\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}\r\n\r\n\t\t\treturn chat.pcrypto.decryptEvent(event.event)\r\n\t\t\t \r\n\t\t}).catch(e => {\r\n\t\t\treturn Promise.resolve()\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tmessage(event, user, chat) {\r\n\r\n\t\tvar state = this.core.vm.$store.state\r\n\r\n\r\n\t\tif (this.showed[event.event.event_id]) return\r\n\r\n\t\tthis.addshowed(event.event.event_id)\r\n\r\n\t\tvar external = f.deep(this, 'core.external.clbks.NOTIFICATION') || {}\r\n\t\tvar ctype = ''\r\n\r\n\t\tvar t = f.deep(event, 'event.type')\r\n\r\n\t\tif (['m.room.member'].indexOf(t) > -1) ctype = 'invite'\r\n\t\tif (['m.room.message'].indexOf(t) > -1) ctype = 'message'\r\n\t\tif (['m.room.name'].indexOf(t) > -1) ctype = ''\r\n\t\tif (['m.room.power_levels'].indexOf(t) > -1) ctype = 'moder'\r\n\t\tif (['m.room.redaction'].indexOf(t) > -1) ctype = 'redaction'\r\n\t\tif (f.deep(event, 'event.content.msgtype') == 'm.encrypted') ctype = 'encrypted'\r\n\r\n\t\tvar c = () => {\r\n\r\n\t\t\t\r\n\t\t\tvar msg = {\r\n\t\t\t\ttitle: user.name,\r\n\t\t\t\tevent: event,\r\n\t\t\t\tmessage: event.event.content.type == 'm.encrypted' ? \"***\" : event.event.content.body, // event.content.body,\r\n\t\t\t\troomId: event.event.room_id,\r\n\t\t\t\ticon: user.image,\r\n\t\t\t\tchat: chat,\r\n\t\t\t\tctype: ctype\r\n\t\t\t}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(msg)\r\n\t\t\t})\r\n\r\n\t\t\tif (state.currentRoom === event.event.room_id && !this.core.hiddenInParent) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.notifySoundOrAction()\r\n\t\t\tthis.show(msg, '/chat?id=' + event.event.room_id)\r\n\t\t}\r\n\r\n\t\tif (ctype == 'encrypted') {\r\n\t\t\tthis.decrypt(event, chat).then(c)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tc()\r\n\t\t}\r\n\r\n\r\n\t}\r\n\r\n\tevent(event, chat) {\r\n\t\tlet pushAction = this.core.mtrx.client.getPushActionsForEvent(event)\r\n\r\n\r\n\t\tif (!pushAction.notify) return\r\n\r\n\t\t//let timeFromNow = moment(moment.utc(event.event.origin_server_ts).toDate()).local().fromNow()\r\n\r\n\t\tvar date = moment(moment.utc(event.event.origin_server_ts).toDate()).local().toDate()\r\n\t\tvar iftime = f.date.addseconds(date, 10) > moment().toDate()\r\n\r\n\r\n\t\tif (!iftime) return\r\n\r\n\t\tthis.core.mtrx.isReaded(event, true).then(r => {\r\n\r\n\t\t\tif (r) return\r\n\r\n\t\t\tif (!this.core.mtrx.me(event.getSender()) && event.getSender() && event.getSender() !== this.core.mtrx.client.credentials.userId) {\r\n\r\n\r\n\t\t\t\tthis.core.user.usersInfo([f.getmatrixid(event.getSender())]).then(info => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tinfo && info[0]\r\n\t\t\t\t\t) {\r\n\r\n\r\n\t\t\t\t\t\tthis.message(event, info[0], chat)\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tshow = function (info, click) {\r\n\t\tif (typeof click != 'function') {\r\n\t\t\tvar route = click\r\n\t\t\tclick = () => {\r\n\t\t\t\tthis.core.vm.$router.push(route).catch(e => {})\r\n\r\n\t\t\t\tif (this.core.apptochat) this.core.apptochat()\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar position = \"bottom-right\";\r\n\r\n\t\tif (this.core.vm.$store.state.mobile) {\r\n\t\t\tposition = 'top-left'\r\n\t\t}\r\n\r\n\t\tthis.core.vm.$message({\r\n\t\t\tevent: info.event,\r\n\t\t\ttitle: info.title,\r\n\t\t\tmessage: info.message,\r\n\t\t\troomId: info.roomId,\r\n\t\t\ticonImg: info.icon || null,\r\n\t\t\tonClick: click,\r\n\t\t\tzIndex: 999,\r\n\t\t\tsupportHTML: true,\r\n\t\t\twrapperClassName: \"notificationWrapper\",\r\n\t\t\tposition: position,\r\n\t\t\ttype: 'info',\r\n\t\t\tchat: info.chat,\r\n\t\t\tduration: 5000\r\n\t\t})\r\n\t}\r\n}\r\n\r\nexport default Notifier","var Axios = require('axios');\r\nimport axiosRequest from '@nelsonomuto/axios-request-timeout';\r\nvar { error, byError } = require('./error')\r\n\r\nimport f from '@/application/functions'\r\nimport qs from 'qs';\r\n\r\nvar Axios = function(){\r\n\r\n var datakeys = [\r\n 'data.result'\r\n ]\r\n\r\n var errorkeys = [\r\n 'data.error'\r\n ]\r\n\r\n async function axios ({\r\n to : to,\r\n data : data\r\n }){\r\n\r\n data || (data = {})\r\n\r\n _.each(data, (v, i) => {\r\n if(_.isArray(v) || _.isObject(v)){\r\n data[i] = JSON.stringify(v)\r\n }\r\n }) \r\n\r\n var response = null;\r\n\r\n try{\r\n response = await axiosRequest({\r\n method: 'post',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n url: to,\r\n data: qs.stringify(data),\r\n timeout: 35000\r\n })\r\n\r\n }\r\n catch(e){\r\n response = e.response\r\n }\r\n \r\n\r\n if(!response){\r\n return Promise.reject('noresponse')\r\n }\r\n\r\n ////errors\r\n \r\n var ke = _.find(errorkeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (ke){\r\n return Promise.reject(byError(f.deep(response.data, ke)))\r\n }\r\n\r\n ////result\r\n\r\n var k = _.find(datakeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (k){\r\n return Promise.resolve(f.deep(response.data, k))\r\n }\r\n\r\n ////result\r\n \r\n return Promise.reject('error')\r\n \r\n\r\n }\r\n\r\n return {\r\n axios\r\n }\r\n\r\n}\r\n\r\nexport default Axios","import f from './functions'\r\nimport Axios from './axios'\r\nvar { error } = require('./error')\r\n\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar ApiWrapper = function (core) {\r\n\r\n\tvar self = this;\r\n\tvar a = new Axios();\r\n\r\n\tvar cache = {}\r\n\tvar loading = {}\r\n\tvar storages = {}\r\n\r\n\tvar apis = {\r\n\t\tpocketnet : null\r\n\t}\r\n\r\n\tvar ep = function(){\r\n\t\treturn Promise.resolve()\r\n\t}\r\n\r\n\tvar getstorage = function(p){\r\n\r\n\t\tif(!storages[p.storage]){\r\n\t\t\treturn ChatStorage(p.storage, p.version || 1, p.time).then(storage => {\r\n\r\n\t\t\t\tstorages[p.storage] = storage\r\n\r\n\t\t\t\treturn Promise.resolve(storage)\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve(storages[p.storage])\r\n\t}\r\n\r\n\t\r\n\tvar scasheAct = function (ids, key, resultsKey, reload, storageparameters) {\r\n\r\n\t\tif (!_.isArray(ids)) ids = [ids]\r\n\r\n\t\tvar waitLoading = {}\r\n\r\n\t\tif(!resultsKey) \r\n\t\t\tresultsKey = key\r\n\r\n\t\tif(!cache[key]) {\r\n\t\t\tcache[key] = {}\r\n\t\t}\r\n\r\n\t\tif(!loading[key]) {\r\n\t\t\tloading[key] = {}\r\n\t\t}\r\n\r\n\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\r\n\t\t\tif (storage){\r\n\r\n\t\t\t\treturn Promise.all(_.map(ids, (id) => {\r\n\r\n\t\t\t\t\tif (cache[key][id]){\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn storage.get(id).then((stored) => {\r\n\t\t\t\t\t\tcache[key][stored[resultsKey]] = stored\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}))\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\r\n\t\t}).then(r => {\r\n\r\n\t\t\tvar idtoloadPrev = _.uniq(_.filter(ids, function (id) {\r\n\t\t\t\treturn reload || !cache[key][id] || cache[key][id].nocache\r\n\t\t\t}))\r\n\t\r\n\t\t\tvar idtoload = _.filter(idtoloadPrev, function (id) {\r\n\t\r\n\t\t\t\tif(!loading[key][id]) {\r\n\t\t\t\t\tloading[key][id] = true\r\n\t\t\t\t\treturn true\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\twaitLoading[id] = true\r\n\t\t\t})\r\n\t\r\n\t\t\tvar handleResults = function (result, _ids) {\r\n\r\n\t\t\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(storage){\r\n\t\t\t\t\t\treturn Promise.all(_.map(result, (row) => {\r\n\r\n\t\t\t\t\t\t\tif(!row[resultsKey]){\r\n\t\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn storage.set(row[resultsKey], row)\r\n\r\n\t\t\t\t\t\t}))\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(() => {\r\n\r\n\t\t\t\t\t_.each(result, function (row) {\r\n\r\n\t\t\t\t\t\tif (row[resultsKey]) {\r\n\t\t\t\t\t\t\tcache[key][row[resultsKey]] = row\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t_.each(_ids, function(id){\r\n\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\r\n\t\t\t\t\t\tif(!cache[key][id])\r\n\t\t\t\t\t\t\tcache[key][id] = 'error'\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\tvar nresult = {};\r\n\t\t\r\n\t\t\t\t\treturn f.pretry(() => {\r\n\t\t\r\n\t\t\t\t\t\t_.each(ids, function (id) {\r\n\t\t\r\n\t\t\t\t\t\t\tif (cache[key][id]) {\r\n\t\t\r\n\t\t\t\t\t\t\t\tif (cache[key][id] != 'error')\r\n\t\t\r\n\t\t\t\t\t\t\t\t\tnresult[id] = (cache[key][id])\r\n\t\t\r\n\t\t\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t\treturn _.toArray(waitLoading).length == 0\r\n\t\t\r\n\t\t\t\t\t}).then(() => {\r\n\t\t\t\t\t\treturn Promise.resolve(nresult)\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t})\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.resolve({\r\n\t\t\t\tid: idtoload,\r\n\t\t\t\thandle: handleResults\r\n\t\t\t})\r\n\t\t})\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t}\r\n\r\n\tvar waitonline = function () {\r\n\r\n\t\tif (!core || !core.waitonline) {\r\n\t\t\treturn Promise.resolve()\r\n\t\t}\r\n\r\n\t\treturn core.waitonline()\r\n\r\n\t}\r\n\r\n\tvar crequest = function (ids, key, rkey, reload, storageparameters) {\r\n\r\n\t\treturn scasheAct(ids, key, rkey, reload, storageparameters).then(sh => {\r\n\r\n\t\t\tif (!sh.id.length) {\r\n\t\t\t\treturn sh.handle([])\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.reject(sh)\r\n\r\n\t\t})\r\n\r\n\t\t\r\n\t}\r\n\r\n\tvar request = function (data, to) {\r\n\r\n\t\treturn waitonline().then(() => {\r\n\r\n\t\t\tdata || (data = {})\r\n\r\n\t\t\treturn a.axios({\r\n\t\t\t\tto,\r\n\t\t\t\tdata,\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\t\t\t\t.catch(e => {\r\n\r\n\t\t\t\t\tif (e == 'noresponse') {\r\n\r\n\t\t\t\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\trequest(data, to).then(r => {\r\n\r\n\r\n\t\t\t\t\t\t\t\t\treturn resolve(r)\r\n\r\n\t\t\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\t\t\treturn reject(e)\r\n\r\n\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t\t}, 3000)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\r\n\t\t})\r\n\r\n\r\n\t}\r\n\r\n\tself.clearCache = function (key) {\r\n\r\n\t\tif (!key) {\r\n\t\t\tcache = {}\r\n\t\t} else {\r\n\t\t\tdelete cache[key]\r\n\t\t}\r\n\t}\r\n\r\n\tself.pocketnet = {\r\n\r\n\t\tcommon: (data, method) => {\r\n\r\n\t\t\tif(!data) data = {}\r\n\r\n\t\t\tif(!apis.pocketnet)\r\n\t\t\t\tapis.pocketnet = f.deep(window, 'POCKETNETINSTANCE.api')\r\n\t\t\t\t\r\n\t\t\tif(!apis.pocketnet && typeof Api != 'undefined'){\r\n\t\t\t\tapis.pocketnet = new Api(core)\r\n\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\tif (apis.pocketnet) {\r\n\r\n\t\t\t\treturn apis.pocketnet.initIf().then(() => {\r\n\t\t\t\t\treturn apis.pocketnet.wait.ready('use', 3000)\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\treturn apis.pocketnet.rpc(method, data.parameters)\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\terror : e\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t})\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tdata.method = method\r\n\t\t\tdata.node = '185.148.147.15'\r\n\t\t\tdata.parameters = f.hexEncode(JSON.stringify(data.parameters || \"\"))\r\n\r\n\t\t\treturn request(data, servers.pocketnet + '/rpc-' + (method || \"common\"))\r\n\r\n\t\t},\r\n\t\t\r\n\t\tuserState: (addresses) => {\r\n\r\n\t\t\tif (!_.isArray(addresses)) addresses = [addresses]\r\n\r\n\t\t\tvar parameters = [addresses.join(',')];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserstate')\r\n\t\t},\r\n\r\n\t\tuserStateMe: (address) => {\r\n\r\n\t\t\tvar cacheresult = f.deep(window, 'POCKETNETINSTANCE.platform.sdk.ustate.storage.' + address)\r\n\r\n\t\t\tif(cacheresult){\r\n\t\t\t\treturn Promise.resolve(cacheresult)\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userState(address)\r\n\t\t},\r\n\r\n\t\tuserInfoCached: (addresses, reload) => {\r\n\r\n\t\t\tvar rescached = []\r\n\r\n\t\t\tif(!reload){\r\n\r\n\t\t\t\trescached = _.filter(_.map(addresses, (address) => {\r\n\t\t\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.sdk.userscl.storage.' + address) || null\r\n\t\t\t\t}), (u) => {return u})\r\n\r\n\t\t\t\taddresses = _.filter(addresses, (a) => {\r\n\t\t\t\t\treturn !_.find(rescached, (r) => {\r\n\t\t\t\t\t\treturn r.address == a\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userInfo(addresses, reload).then(rs => {\r\n\r\n\t\t\t\t\r\n\t\t\t\trs = _.toArray(rs)\r\n\r\n\t\t\t\t_.each(rescached, (c) => {\r\n\t\t\t\t\trs.push(c)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\treturn Promise.resolve(rs)\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tsearch: (text) => {\r\n\r\n\t\t\tvar parameters = [text, 'users'];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'searchusers').then(data => {\r\n\t\t\t\treturn Promise.resolve(data || [])\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tuserInfo: (addresses, reload) => {\r\n\r\n\t\t\tif(!addresses.length){\r\n\t\t\t\treturn Promise.resolve([])\r\n\t\t\t}\r\n\r\n\t\t\treturn crequest(addresses, 'pocketnet_userInfo', 'address', reload, {\r\n\t\t\t\tstorage : 'userInfo',\r\n\t\t\t\ttime : 60 * 60 * 24 \r\n\t\t\t}).catch(sh => {\r\n\r\n\t\t\t\tif(!sh || !sh.id) {\r\n\t\t\t\t\treturn Promise.reject(sh)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar parameters = [sh.id, '1'];\r\n\r\n\t\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\t\treturn sh.handle(results, sh.id)\r\n\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpostInfo: (params) => {\r\n\r\n\t\t\tvar parameters = [[params.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getrawtransactionwithmessagebyid').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileAddress: (profile_name) => {\r\n\r\n\t\t\tvar parameters = [[profile_name.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuseraddress').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileInfo: (profile_address) => {\r\n\r\n\t\t\tvar parameters = [[profile_address.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\r\n\t}\r\n\r\n\treturn self;\r\n}\r\n\r\nexport default ApiWrapper\r\n\r\n","import f from './functions';\r\n\r\nvar Media = function () {\r\n var self = this\r\n\r\n self.gettingmedia = false\r\n\r\n var permissions = {\r\n\r\n ios : {\r\n audio : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n window.audioinput.checkMicrophonePermission(function(hasPermission) {\r\n if (hasPermission) {\r\n \r\n resolve();\r\n } \r\n else {\t \r\n // Ask the user for permission to access the microphone\r\n window.audioinput.getMicrophonePermission(function(hasPermission, message) {\r\n if (hasPermission) {\r\n resolve()\r\n } else {\r\n reject('permissions')\r\n }\r\n });\r\n }\r\n });\r\n\r\n })\r\n \r\n },\r\n\r\n video : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n \r\n var needMic = true;\r\n var needCamera = true;\r\n\r\n cordova.plugins.iosrtc.requestPermission(needMic, needCamera, function (permissionApproved) {\r\n // permissionApproved will be true if user accepted permission otherwise will be false.\r\n if(permissionApproved) resolve()\r\n else reject('permissions')\r\n\r\n })\r\n\r\n })\r\n \r\n } \r\n },\r\n\r\n audio : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n var request = function(){\r\n permissions.requestPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n reject('permissions')\r\n\r\n });\r\n }\r\n\r\n permissions.checkPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else {\r\n request()\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n request()\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n },\r\n\r\n video : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n permissions.hasPermission(permissions.CAMERA, (status) => {\r\n\r\n if (status.hasPermission) {\r\n\r\n resolve()\r\n\r\n }\r\n else {\r\n\r\n permissions.requestPermission(permissions.CAMERA, () => {\r\n\r\n resolve()\r\n\r\n }, () => {\r\n\r\n reject('permissions')\r\n\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n }\r\n \r\n }\r\n\r\n var initPermissions = function(mediasettings){\r\n\r\n var callperm = function(f, setting){\r\n if (setting){\r\n return f()\r\n }\r\n else{\r\n return Promise.resolve()\r\n }\r\n }\r\n\r\n if(window.cordova && window.device){\r\n\r\n var ios = f.isios()\r\n\r\n return callperm(ios ? permissions.ios.audio : permissions.audio, mediasettings.audio).then(() => {\r\n return callperm(ios ? permissions.ios.video : permissions.video, mediasettings.video)\r\n }).catch(e => {\r\n console.error(\"E\", e)\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }\r\n\r\n var initMedia = function(mediasettings){\r\n\r\n return new Promise((resolve, reject)=> {\r\n\r\n\r\n initPermissions(mediasettings).then(() => {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n navigator.mediaDevices.getUserMedia(mediasettings).then(resolve).catch(reject);\r\n } else {\r\n (\r\n navigator.getUserMedia ||\r\n navigator.webkitGetUserMedia ||\r\n navigator.mozGetUserMedia ||\r\n navigator.msGetUserMedia\r\n )\r\n (mediasettings, resolve, reject);\r\n }\r\n\r\n }).catch(reject)\r\n\r\n })\r\n \r\n }\r\n \r\n self.get = function(mediasettings){\r\n\r\n return initMedia(mediasettings)\r\n\r\n }\r\n\r\n self.permissions = initPermissions\r\n\r\n}\r\n\r\n\r\nexport default Media","// Copied from https://github.com/chris-rudmin/Recorderjs\n\nexport default () => {\n let BYTES_PER_SAMPLE = 2\n\n let recorded = []\n\n function encode (buffer) {\n let length = buffer.length\n let data = new Uint8Array(length * BYTES_PER_SAMPLE)\n for (let i = 0; i < length; i++) {\n let index = i * BYTES_PER_SAMPLE\n let sample = buffer[i]\n if (sample > 1) {\n sample = 1\n } else if (sample < -1) {\n sample = -1\n }\n sample = sample * 32768\n data[index] = sample\n data[index + 1] = sample >> 8\n }\n recorded.push(data)\n }\n\n function dump (sampleRate) {\n let bufferLength = recorded.length ? recorded[0].length : 0\n let length = recorded.length * bufferLength\n let wav = new Uint8Array(44 + length)\n let view = new DataView(wav.buffer)\n\n // RIFF identifier 'RIFF'\n view.setUint32(0, 1380533830, false)\n // file length minus RIFF identifier length and file description length\n view.setUint32(4, 36 + length, true)\n // RIFF type 'WAVE'\n view.setUint32(8, 1463899717, false)\n // format chunk identifier 'fmt '\n view.setUint32(12, 1718449184, false)\n // format chunk length\n view.setUint32(16, 16, true)\n // sample format (raw)\n view.setUint16(20, 1, true)\n // channel count\n view.setUint16(22, 1, true)\n // sample rate\n view.setUint32(24, sampleRate, true)\n // byte rate (sample rate * block align)\n view.setUint32(28, sampleRate * BYTES_PER_SAMPLE, true)\n // block align (channel count * bytes per sample)\n view.setUint16(32, BYTES_PER_SAMPLE, true)\n // bits per sample\n view.setUint16(34, 8 * BYTES_PER_SAMPLE, true)\n // data chunk identifier 'data'\n view.setUint32(36, 1684108385, false)\n // data chunk length\n view.setUint32(40, length, true)\n\n // eslint-disable-next-line unicorn/no-for-loop\n for (let i = 0; i < recorded.length; i++) {\n wav.set(recorded[i], i * bufferLength + 44)\n }\n\n recorded = []\n postMessage(wav.buffer, [wav.buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else if (e.data[0] === 'dump') {\n dump(e.data[1])\n }\n }\n}\n","import waveEncoder from './wave-encoder/index.js'\n\nlet AudioContext = window.AudioContext || window.webkitAudioContext\n\nlet createWorker = fn => {\n let js = fn\n .toString()\n .replace(/^(\\(\\)\\s*=>|function\\s*\\(\\))\\s*{/, '')\n .replace(/}$/, '')\n let blob = new Blob([js])\n return new Worker(URL.createObjectURL(blob))\n}\n\nlet error = method => {\n let event = new Event('error')\n event.data = new Error('Wrong state for ' + method)\n return event\n}\n\nlet context\n\n/**\n * Audio Recorder with MediaRecorder API.\n *\n * @example\n * navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {\n * let recorder = new MediaRecorder(stream)\n * })\n */\nclass MediaRecorder {\n /**\n * @param {MediaStream} stream The audio stream to record.\n */\n constructor (stream, config = null) {\n /**\n * The `MediaStream` passed into the constructor.\n * @type {MediaStream}\n */\n this.stream = stream\n this.config = config\n /**\n * The current state of recording process.\n * @type {\"inactive\"|\"recording\"|\"paused\"}\n */\n this.state = 'inactive'\n\n this.em = document.createDocumentFragment()\n this.encoder = createWorker(MediaRecorder.encoder)\n\n let recorder = this\n this.encoder.addEventListener('message', e => {\n let event = new Event('dataavailable')\n event.data = new Blob([e.data], { type: recorder.mimeType })\n recorder.em.dispatchEvent(event)\n if (recorder.state === 'inactive') {\n recorder.em.dispatchEvent(new Event('stop'))\n }\n })\n }\n\n /**\n * Begins recording media.\n *\n * @param {number} [timeslice] The milliseconds to record into each `Blob`.\n * If this parameter isn’t included, single `Blob`\n * will be recorded.\n *\n * @return {undefined}\n *\n * @example\n * recordButton.addEventListener('click', () => {\n * recorder.start()\n * })\n */\n start (timeslice) {\n if (this.state !== 'inactive') {\n return this.em.dispatchEvent(error('start'))\n }\n\n this.state = 'recording'\n\n if (!context) {\n context = new AudioContext(this.config)\n }\n this.clone = this.stream.clone()\n this.input = context.createMediaStreamSource(this.clone)\n this.processor = context.createScriptProcessor(2048, 1, 1)\n\n this.encoder.postMessage(['init', context.sampleRate])\n\n this.processor.onaudioprocess = e => {\n if (this.state === 'recording') {\n this.encoder.postMessage(['encode', e.inputBuffer.getChannelData(0)])\n }\n }\n\n this.input.connect(this.processor)\n this.processor.connect(context.destination)\n\n this.em.dispatchEvent(new Event('start'))\n\n if (timeslice) {\n this.slicing = setInterval(() => {\n if (this.state === 'recording') this.requestData()\n }, timeslice)\n }\n\n return undefined\n }\n\n /**\n * Stop media capture and raise `dataavailable` event with recorded data.\n *\n * @return {undefined}\n *\n * @example\n * finishButton.addEventListener('click', () => {\n * recorder.stop()\n * })\n */\n stop () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('stop'))\n }\n\n this.requestData()\n this.state = 'inactive'\n this.clone.getTracks().forEach(track => {\n track.stop()\n })\n this.processor.disconnect()\n this.input.disconnect()\n return clearInterval(this.slicing)\n }\n\n /**\n * Pauses recording of media streams.\n *\n * @return {undefined}\n *\n * @example\n * pauseButton.addEventListener('click', () => {\n * recorder.pause()\n * })\n */\n pause () {\n if (this.state !== 'recording') {\n return this.em.dispatchEvent(error('pause'))\n }\n\n this.state = 'paused'\n return this.em.dispatchEvent(new Event('pause'))\n }\n\n /**\n * Resumes media recording when it has been previously paused.\n *\n * @return {undefined}\n *\n * @example\n * resumeButton.addEventListener('click', () => {\n * recorder.resume()\n * })\n */\n resume () {\n if (this.state !== 'paused') {\n return this.em.dispatchEvent(error('resume'))\n }\n\n this.state = 'recording'\n return this.em.dispatchEvent(new Event('resume'))\n }\n\n /**\n * Raise a `dataavailable` event containing the captured media.\n *\n * @return {undefined}\n *\n * @example\n * this.on('nextData', () => {\n * recorder.requestData()\n * })\n */\n requestData () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('requestData'))\n }\n\n return this.encoder.postMessage(['dump', context.sampleRate])\n }\n\n /**\n * Add listener for specified event type.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The listener function.\n *\n * @return {undefined}\n *\n * @example\n * recorder.addEventListener('dataavailable', e => {\n * audio.src = URL.createObjectURL(e.data)\n * })\n */\n addEventListener (...args) {\n this.em.addEventListener(...args)\n }\n\n /**\n * Remove event listener.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The same function used in `addEventListener`.\n *\n * @return {undefined}\n */\n removeEventListener (...args) {\n this.em.removeEventListener(...args)\n }\n\n /**\n * Calls each of the listeners registered for a given event.\n *\n * @param {Event} event The event object.\n *\n * @return {boolean} Is event was no canceled by any listener.\n */\n dispatchEvent (...args) {\n this.em.dispatchEvent(...args)\n }\n}\n\n/**\n * The MIME type that is being used for recording.\n * @type {string}\n */\nMediaRecorder.prototype.mimeType = 'audio/wav'\n\n/**\n * Returns `true` if the MIME type specified is one the polyfill can record.\n *\n * This polyfill supports `audio/wav` and `audio/mpeg`.\n *\n * @param {string} mimeType The mimeType to check.\n *\n * @return {boolean} `true` on `audio/wav` and `audio/mpeg` MIME type.\n */\nMediaRecorder.isTypeSupported = mimeType => {\n return MediaRecorder.prototype.mimeType === mimeType\n}\n\n/**\n * `true` if MediaRecorder can not be polyfilled in the current browser.\n * @type {boolean}\n *\n * @example\n * if (MediaRecorder.notSupported) {\n * showWarning('Audio recording is not supported in this browser')\n * }\n */\nMediaRecorder.notSupported = !navigator.mediaDevices || !AudioContext\n\n/**\n * Converts RAW audio buffer to compressed audio files.\n * It will be loaded to Web Worker.\n * By default, WAVE encoder will be used.\n * @type {function}\n *\n * @example\n * MediaRecorder.prototype.mimeType = 'audio/ogg'\n * MediaRecorder.encoder = oggEncoder\n */\nMediaRecorder.encoder = waveEncoder\n\nexport default MediaRecorder\n","\n\n\nexport default () => {\n importScripts(\n 'https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js'\n )\n\n let CHANNELS = 1\n let KBPS = 128\n let DEFAULT_SAMPLE_RATE = 44100\n\n let encoder\n let recorded = new Int8Array()\n\n function concat (a, b) {\n if (b.length === 0) {\n return a\n }\n let c = new Int8Array(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n\n function init (sampleRate) {\n encoder = new lamejs.Mp3Encoder(\n CHANNELS,\n sampleRate || DEFAULT_SAMPLE_RATE,\n KBPS\n )\n }\n\n function encode (buffer) {\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = buffer[i] * 32767.5\n }\n\n let buf = encoder.encodeBuffer(buffer)\n recorded = concat(recorded, buf)\n }\n\n function dump () {\n let buf = encoder.flush()\n recorded = concat(recorded, buf)\n let buffer = recorded.buffer\n recorded = new Int8Array()\n postMessage(buffer, [buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'init') {\n init(e.data[1])\n } else if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else {\n dump(e.data[1])\n }\n }\n}\n","\r\n\r\nimport MTRX from \"./mtrx.js\";\r\nimport Notifier from \"./notifier.js\";\r\nimport PNUser from \"./user/pnuser.js\";\r\nimport ApiWrapper from \"./api.js\";\r\nimport Pcrypto from \"./pcrypto.js\";\r\nimport listeners from './listeners'\r\nimport f from './functions'\r\nimport Media from './media'\r\n/*\r\nimport pcm from '@/application/utils/pcm.js'\r\nlet Mp3 = require('js-mp3');\r\n*/\r\n/*\r\nvar {register} = require('extendable-media-recorder')\r\nvar {connect} = require('extendable-media-recorder-wav-encoder')*/\r\n\r\n\r\nimport AudioRecorder from 'audio-recorder-polyfill'\r\nimport mpegEncoder from 'audio-recorder-polyfill/mpeg-encoder'\r\n\r\nAudioRecorder.encoder = mpegEncoder\r\nAudioRecorder.prototype.mimeType = 'audio/mpeg'\r\n\r\n\r\n\r\n\r\nclass Core {\r\n constructor(vm, p){\r\n if(!p) p = {}\r\n\r\n this.options = {\r\n listofproxies : p.listofproxies\r\n }\r\n\r\n if(!p.mtrx) p.mtrx = {}\r\n p.mtrx.baseUrl = 'https://' + p.domain\r\n\r\n if (p.mtrx.baseUrl == 'https://test.matrix.pocketnet.app'){\r\n \r\n this.options.burn = {\r\n v : 'minutes',\r\n w : 120,\r\n m : 30,\r\n b : 15\r\n }\r\n }\r\n else{\r\n this.options.burn = {\r\n v : 'days',\r\n w : 7,\r\n m : 2,\r\n b : 1\r\n }\r\n }\r\n\r\n \r\n\r\n this.apiHandlers = {\r\n error : function(){},\r\n success : function(){}\r\n }\r\n\r\n this.domain = p.domain\r\n\r\n this.vm = vm\r\n this.mtrx = new MTRX(this, p.mtrx)\r\n this.user = new PNUser(this, p.user || {})\r\n this.notifier = new Notifier(this, p.notifier || {})\r\n this.pcrypto = new Pcrypto(this, p.pcrypto || {})\r\n this.api = new ApiWrapper(this, p.servers)\r\n\r\n this.onlineListener = new listeners.online(this)\r\n this.focusListener = new listeners.focus(this)\r\n this.online = true\r\n this.focus = true\r\n this.store = vm.$store\r\n this.loading = true\r\n\r\n this.external = {}\r\n this.hiddenInParent = false\r\n\r\n this.customRecorderConnected = false\r\n\r\n this.pcrypto.init(this.user)\r\n\r\n this.media = new Media()\r\n this.audioContext = null\r\n\r\n }\r\n\r\n hideOptimization = function(v){\r\n\r\n //this.hideOptimization = v\r\n this.store.commit('hideOptimization', v)\r\n\r\n }\r\n\r\n hideInParent = function(v){\r\n this.hiddenInParent = v\r\n this.store.commit('hiddenInParent', v)\r\n\r\n\r\n /*if(!v)\r\n this.store.commit('wasunhidden', true)*/\r\n }\r\n\r\n canback = function(){\r\n return this.store.state.gallery ? false : true\r\n }\r\n\r\n update = function({block}){\r\n\r\n this.pcrypto.set.block(block)\r\n }\r\n\r\n logerror = function(type, data){\r\n\r\n\r\n if (window.POCKETNETINSTANCE){\r\n\r\n window.POCKETNETINSTANCE.Logger.error({\r\n err: type,\r\n payload: data,\r\n code: 402,\r\n });\r\n\r\n }\r\n }\r\n\r\n destroy = function(){\r\n this.store.commit('clearall')\r\n this.removeEvents()\r\n\r\n if(!this.vm.$route.name != 'chats')\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n this.user.destroy()\r\n this.mtrx.destroy()\r\n this.pcrypto.destroy()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.unlink(this)\r\n }\r\n\r\n this.vm.$destroy();\r\n\r\n }\r\n\r\n init = function(){\r\n \r\n this.focusListener.init()\r\n this.onlineListener.init()\r\n\r\n this.initEvents()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.link(this)\r\n }\r\n }\r\n \r\n\r\n setUnauthorized = function(v){\r\n this.unauthorized = v\r\n this.store.commit('SET_UNAUTHORIZED', v)\r\n }\r\n\r\n initWithUserBase = function(){\r\n\r\n this.loading = true\r\n\r\n return this.user.checkCredentials().then(state => {\r\n\r\n return this.user.userInfo()\r\n\r\n }).then(r => {\r\n\r\n if(!r){\r\n return Promise.reject('unknown')\r\n }\r\n\r\n if(r.deleted){\r\n return Promise.reject('deleted')\r\n }\r\n\r\n return this.pcrypto.prepare()\r\n\r\n }).then(r => {\r\n\r\n return this.mtrx.init()\r\n\r\n }).then(r => {\r\n\r\n this.loading = false\r\n this.setUnauthorized(null)\r\n\r\n this.pcrypto.helpers.checkuser()\r\n\r\n if (f.deep(this.user,'userinfo.name'))\r\n this.mtrx.client.setDisplayName(f.deep(this.user,'userinfo.name'))\r\n\r\n return Promise.resolve()\r\n\r\n }).catch(e => {\r\n\r\n console.log(\"E\", e)\r\n \r\n this.loading = false\r\n\r\n if(e == 'unauthorized' || e == 'unknown' || e == 'deleted'){\r\n this.setUnauthorized(e)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n initWithUser = function(credentials){\r\n\r\n\r\n this.user.setCredentials(credentials)\r\n\r\n return this.initWithUserBase().then(() => {\r\n return this.user.initKeysProcess()\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n }\r\n\r\n waitonline = function(){\r\n\r\n if(this.online) return Promise.resolve()\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n f.retry(() => {\r\n return this.online;\r\n }, function () {\r\n\r\n resolve()\r\n\r\n }, 5)\r\n\r\n })\r\n\r\n\r\n }\r\n\r\n removeEvents = function(){\r\n delete this.focusListener.clbks.resume.core\r\n delete this.focusListener.clbks.pause.core\r\n delete this.onlineListener.clbks.online.core\r\n delete this.onlineListener.clbks.offline.core\r\n }\r\n\r\n initEvents = function(){\r\n this.focusListener.clbks.resume.core = (time) => {\r\n\r\n this.focus = this.focusListener.focus\r\n\r\n if(time > 60){\r\n }\r\n }\r\n\r\n this.focusListener.clbks.pause.core = () => {\r\n this.focus = this.focusListener.focus\r\n }\r\n\r\n this.onlineListener.clbks.online.core = (time) => {\r\n this.online = this.onlineListener.online\r\n }\r\n\r\n this.onlineListener.clbks.offline.core = () => {\r\n this.online = this.onlineListener.online\r\n }\r\n }\r\n\r\n externalLink = function(pobj){\r\n this.external = pobj\r\n\r\n }\r\n\r\n destroyExternalLink = function(){\r\n this.external = {}\r\n }\r\n\r\n currentTime = function () {\r\n var created = Math.floor((new Date().getTime()) / 1000)\r\n\r\n if (this.timeDifference) {\r\n created += this.timeDifference\r\n }\r\n\r\n return created;\r\n }\r\n\r\n wait = function(){\r\n return f.pretry(() => {\r\n\t\t\treturn !this.loading\r\n\t\t}).then(() => {\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t})\r\n }\r\n\r\n joinRoom(roomid){\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('JOINROOM', roomid)\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }).then(info => {\r\n\r\n if (this.store.state.chatsMap[roomid]){\r\n /// old chat\r\n this.vm.$router.push('/chat?id=' + roomid).catch(e => {})\r\n }\r\n else\r\n {\r\n this.store.commit('JOINROOM', roomid)\r\n this.vm.$router.push('/publicPreview?id=' + roomid).catch(e => {})\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n connect(address){\r\n\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('CONNECT', f.hexEncode(address))\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n else{\r\n return this.user.usersInfo([address], true)\r\n }\r\n\r\n }).then(info => {\r\n\r\n var roomId = this.mtrx.kit.tetatetid(info[0], this.user.userinfo)\r\n\r\n\r\n if(!roomId) return Promise.reject('roomId')\r\n\r\n if (this.store.state.chatsMap[roomId]){\r\n /// old chat\r\n\r\n this.gotoRoute('/chat?id=' + roomId)\r\n /*this.vm.$router.push('/chat?id=' + roomId).catch(e => {\r\n console.error('e', e)\r\n })*/\r\n }\r\n else\r\n {\r\n\r\n this.gotoRoute('/contact?id=' + f.hexEncode(address))\r\n //this.store.commit('CONTACT', roomId)\r\n //this.gotoRoute('/chat?id=' + roomId + '&u=' + f.hexEncode(address))\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n cancelshare(){\r\n this.store.commit('SHARE', null)\r\n\r\n return Promise.resolve()\r\n }\r\n\r\n share(share){\r\n\t\tthis.store.commit('SHARE', share)\r\n\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n return Promise.resolve()\r\n\t}\r\n\r\n goto(roomId){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push('/chat?id=' + roomId).catch(e => {});\r\n });\r\n }\r\n\r\n gotoRoute(route){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push(route).catch(e => {});\r\n });\r\n }\r\n\r\n updateUser(){\r\n \r\n return this.user.userInfo(true).then(r => {\r\n\r\n /*if (this.unauthorized){\r\n return this.initWithUserBase()\r\n }*/\r\n \r\n })\r\n }\r\n\r\n isactive(){\r\n return this.vm.$store.state.minimized && this.vm.$store.state.active && this.vm.$store.state.pocketnet\r\n } \r\n\r\n sitemessage(title){\r\n\r\n var position = \"bottom-right\";\r\n\r\n if (this.vm.$store.state.mobile){\r\n position = 'top-left'\r\n }\r\n \r\n this.vm.$message({\r\n title: title,\r\n zIndex: 999,\r\n supportHTML: true,\r\n wrapperClassName: \"notificationWrapper\",\r\n position: position,\r\n type: 'info',\r\n duration : 2000\r\n })\r\n }\r\n\r\n menu(v){\r\n\r\n this.store.commit('SET_MENU', v ? {\r\n\t\t\titems : v.items,\r\n\t\t\titem : v.item,\r\n handler : v.handler\r\n\t\t} : null)\r\n }\r\n\r\n invitepnt(){\r\n\r\n var ui = f.deep(this, 'user.userinfo.source')\r\n\r\n if(ui){\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.platform){\r\n \r\n if(this.backtoapp) this.backtoapp()\r\n\r\n window.POCKETNETINSTANCE.platform.ui.socialshare('welcome?connect=' + ui.address, {\r\n sharing : {\r\n image : '',\r\n images : [ui.i],\r\n title : this.vm.$i18n.t(\"caption.joinApp\"),\r\n html : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n },\r\n \r\n text : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n }\r\n \r\n },\r\n embedding : {\r\n type : 'connect',\r\n id : ui.address\r\n }\r\n })\r\n\r\n }\r\n else{\r\n var l = 'https://bastyon.com/welcome?connect=' + ui.address\r\n\r\n f.copytext(l)\r\n\r\n this.sitemessage('The link was copied successfully')\r\n }\r\n\r\n }\r\n\r\n else{\r\n this.sitemessage('The error was occuried')\r\n }\r\n\r\n \r\n }\r\n\r\n async convertAudioToBase64(blob) {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(blob)\r\n return new Promise(resolve => {\r\n reader.onloadend = () => {\r\n resolve(reader.result)\r\n }\r\n })\r\n }\r\n\r\n /*async connectCustomRecorder() {\r\n\r\n if (this.customRecorderConnected) return\r\n this.customRecorderConnected = true\r\n \r\n await register(await connect());\r\n \r\n }*/\r\n\r\n /*mp3ToWav(base64Audio){\r\n\r\n var mp3ArrayBuffer = f._base64ToArrayBuffer(base64Audio.split(',')[1])\r\n\r\n var decoder = Mp3.newDecoder(mp3ArrayBuffer);\r\n var pcmArrayBuffer = decoder.decode();\r\n\r\n var dataURI = new pcm({channels: 1, rate: 8000, depth: 8}).toWav(pcmArrayBuffer).encode();\r\n\r\n return dataURI\r\n\r\n }*/\r\n\r\n initMediaRecorder() {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n\r\n\r\n return this.media.get({ audio: true }).then(stream => {\r\n\r\n let mediaRecorder = new AudioRecorder(stream, { audioBitsPerSecond : 32000 })\r\n \r\n return mediaRecorder\r\n \r\n }).catch(function (err) {\r\n return Promise.reject(err)\r\n });\r\n\r\n } else {\r\n return Promise.reject()\r\n }\r\n }\r\n\r\n getAudioContext(){\r\n\r\n if(this.audioContext && this.audioContext.state != 'closed') {\r\n\r\n\r\n if(this.audioContext.state === \"suspended\") this.audioContext.resume()\r\n\r\n\r\n\r\n return this.audioContext\r\n }\r\n else{\r\n }\r\n\r\n this.audioContext = new (window.AudioContext || window.webkitAudioContext)() || null;\r\n\r\n if(f.isios() && window.unmute){\r\n unmute(this.audioContext, false, false);\r\n }\r\n\r\n return this.audioContext\r\n }\r\n}\r\n\r\nexport default Core\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"preloader\",\"platform\":_vm.platform}},[_vm._m(0)])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"variant \"},[_c('div',{staticClass:\"iospreloadercenter\"},[_c('div',{staticClass:\"spinner-eff spinner-eff-3\"},[_c('div',{staticClass:\"circle circle-1\"}),_c('div',{staticClass:\"circle circle-2\"}),_c('div',{staticClass:\"circle circle-3\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\nimport f from '@/application/functions'\r\nexport default {\r\n name: 'preloader',\r\n props: {\r\n },\r\n\r\n computed : mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active : state => state.active,\r\n platform : function(){\r\n return f.deep(window, 'device.platform') || 'browser'\r\n },\r\n })\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3e6353d6&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index_ex.sass?vue&type=style&index=0&id=3e6353d6&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3e6353d6\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"wai-fixedmessageicon\"}},[_c('div',{staticClass:\"wrapper\"},[_c('div',{staticClass:\"table\"},[_c('div',{staticClass:\"cell\"},[(_vm.icon)?_c('div',{staticClass:\"iconWrapper\"},[_c('sweetalert',{attrs:{\"icon\":_vm.icon}})],1):_vm._e(),(_vm.message)?_c('div',{staticClass:\"message\"},[_c('div',[_vm._v(_vm._s(_vm.message))])]):_vm._e()])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa\",style:(_vm.cssVars)},[(_vm.isIcon('error'))?_c('div',{staticClass:\"sa-error\"},[_vm._m(0),_c('div',{staticClass:\"sa-error-placeholder\"}),_c('div',{staticClass:\"sa-error-fix\"})]):(_vm.isIcon('warning'))?_c('div',{staticClass:\"sa-warning\"},[_c('div',{staticClass:\"sa-warning-body\"}),_c('div',{staticClass:\"sa-warning-dot\"})]):(_vm.isIcon('info'))?_c('div',{staticClass:\"sa-info\"},[_c('div',{staticClass:\"sa-info-body\"}),_c('div',{staticClass:\"sa-info-dot\"})]):(_vm.isIcon('loading'))?_c('div',{staticClass:\"sa-loading\"},[_c('div',{staticClass:\"sa-loading-body\"})]):_c('div',{staticClass:\"sa-success\"},[_c('div',{staticClass:\"sa-success-tip\"}),_c('div',{staticClass:\"sa-success-long\"}),_c('div',{staticClass:\"sa-success-placeholder\"}),_c('div',{staticClass:\"sa-success-fix\"})])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa-error-x\"},[_c('div',{staticClass:\"sa-error-left\"}),_c('div',{staticClass:\"sa-error-right\"})])}]\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=0635047f&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=0635047f&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0635047f\",\n null\n ,true\n)\n\nexport default component.exports","import { mapState } from 'vuex';\r\nimport sweetalert from '@/editedplugins/vue-sweetalert-icons/src/components/icon.vue'\r\nexport default {\r\n name: 'fixedmessageicon',\r\n props: {\r\n \r\n },\r\n\r\n components : {\r\n sweetalert\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n icon : {\r\n immediate: true,\r\n handler(){\r\n this.init()\r\n }\r\n }\r\n },\r\n\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n icon : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.icon : null\r\n },\r\n\r\n message : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.message : null\r\n },\r\n\r\n \r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n init : function(){\r\n var t = this\r\n\r\n const timeout = this.$store.state.icon?.timeout;\r\n\r\n if(this.$store.state.icon.manual) return\r\n\r\n setTimeout(function(){\r\n\r\n t.$store.commit('icon', null)\r\n\r\n }, timeout || 2000)\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1cf419f0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1cf419f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1cf419f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{attrs:{\"id\":\"wai-date\"}},[_vm._v(_vm._s(_vm.label))])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'date',\r\n props: ['date'],\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n label : function(){\r\n\r\n moment.locale(this.$i18n.locale)\r\n\r\n return moment(moment.utc(this.date).toDate()).local().fromNow();\r\n\r\n }\r\n }),\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=eb4df516&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=eb4df516&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"eb4df516\",\n null\n ,true\n)\n\nexport default component.exports","var render = function (_h,_vm) {var _c=_vm._c;return _c('div',{staticClass:\"userpic\"},[_c('div',{staticClass:\"userpicSquareWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\",class:_vm.props.status},[(_vm.props.userinfo.image)?_c('bgimage',{attrs:{\"src\":_vm.props.userinfo.image}}):_vm._e(),(!_vm.props.userinfo.image && _vm.props.userinfo.name && (_vm.props.status != 'blocked' && _vm.props.status != 'invite' && _vm.props.status != 'ban'))?_c('div',{staticClass:\"charAvatar\"},[_c('span',[_vm._v(_vm._s(_vm.props.userinfo.name.charAt(0)))])]):_vm._e(),_c('div',{staticClass:\"statusIcon\"},[(_vm.props.status == 'blocked' || _vm.props.status == 'ban')?_c('i',{staticClass:\"fas fa-ban\"}):_vm._e(),(_vm.props.status == 'invite')?_c('i',{staticClass:\"fas fa-user-plus\"}):_vm._e()])],1)])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nexport default {\r\n name: 'userpic',\r\n props: {\r\n userinfo: {\r\n type : Object,\r\n default : {}\r\n },\r\n status : ''\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=5034d1e2&scoped=true&functional=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=5034d1e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n true,\n injectStyles,\n \"5034d1e2\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.users)?_c('div',{staticClass:\"userspic\",class:{oneuser : _vm.users && _vm.users.length === 1}},[(_vm.users.length === 0)?_c('userpic',{attrs:{\"userinfo\":_vm.single,\"status\":_vm.single.status}}):_vm._e(),(_vm.users.length === 1)?_c('userpic',{attrs:{\"status\":_vm.status[_vm.users[0].id],\"userinfo\":_vm.users[0],\"unseen\":_vm.unseen}}):_vm._e(),(_vm.users.length > 1)?_c('many',{attrs:{\"slidesPerView\":_vm.slidesPerView,\"status\":_vm.status,\"userinfo\":_vm.users,\"unseen\":_vm.unseen}}):_vm._e(),(_vm.unseen)?_c('div',{staticClass:\"unseen\"},[_vm._v(\" \"+_vm._s(_vm.unseen > 99 ? '99' : _vm.unseen)+\" \")]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import many from '@/components/assets/userspic/many.vue'\r\n\r\nexport default {\r\n name: 'userspic',\r\n props: {\r\n users: Array,\r\n single: {},\r\n unseen: Number,\r\n slidesPerView: Number,\r\n status : {\r\n type : Object,\r\n default : {}\r\n }\r\n \r\n },\r\n\r\n data : function(){\r\n return {}\r\n },\r\n components: {\r\n many\r\n },\r\n\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=792279b0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=792279b0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"792279b0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"bgimage\",class:{loaded: _vm.loaded, hasimage : _vm.src},style:('background-image:url('+_vm.imageSrc+'); background-size: cover; background-position: center center; background-repeat: no-repeat')},[_vm._t(\"cnt\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./bgimage.vue?vue&type=template&id=5d20f73c&scoped=true&\"\nimport script from \"./bgimage.vue?vue&type=script&lang=js&\"\nexport * from \"./bgimage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"5d20f73c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"wai-logotype\"}},[_c('div',{staticClass:\"items\"},[_c('div',{staticClass:\"item\"},[_c('div',{staticClass:\"logo\"},[_c('img',{attrs:{\"src\":'img/ldpiwide-' + _vm.themeL + '.png'}})])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nvar bwl = {\r\n black : 'black',\r\n white : 'white',\r\n classic : 'white'\r\n\r\n}\r\n\r\nexport default {\r\n name: 'wai-logotype',\r\n props: {\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n themeL : function(state){\r\n return bwl[state.theme] || 'white'\r\n }\r\n }),\r\n\r\n methods : {\r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e33cd7cc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e33cd7cc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e33cd7cc\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"outer-div\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},on:{\"click\":function($event){$event.stopPropagation();}}},[(_vm.menuIsVisible && !_vm.hiddenInParent)?_c('div',{staticClass:\"dropdown\",class:{visible: _vm.menuIsVisible}},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.hidePopup),expression:\"hidePopup\"}],staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menuItems},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e(),_c('div',{staticClass:\"dropDownIcon\",on:{\"click\":_vm.onClickHandler}},[_c('i',{class:'icon ' + (_vm.icon || 'fas fa-ellipsis-h')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'dropdownMenu',\r\n props: {\r\n menuItems: {\r\n type: Array,\r\n required: true\r\n },\r\n\r\n rowObject: {\r\n type: Object,\r\n },\r\n\r\n icon : String\r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false,\r\n menuIsVisible: false,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n menuIsVisible: function(newValue) {\r\n this.$emit('menuIsVisible', newValue);\r\n }\r\n },\r\n\r\n computed: {\r\n\r\n dropdownWidthInner(){\r\n return this.dropdownWidth;\r\n },\r\n \r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n this.$emit('itemClicked', item, this.rowObject, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n });\r\n },\r\n onClickHandler() {\r\n this.menuIsVisible = !this.menuIsVisible;\r\n\r\n\r\n },\r\n hidePopup() {\r\n this.menuIsVisible = false;\r\n\r\n },\r\n showPopup() {\r\n \r\n this.menuIsVisible = true;\r\n\r\n\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e4f39dca&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e4f39dca&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e4f39dca\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"back\",on:{\"click\":_vm.click}},[_c('div',{staticClass:\"iconbutton\"},[_c('i',{class:(_vm.icon || 'fas fa-angle-left')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7e97eec1&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7e97eec1&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7e97eec1\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active, unauthorized: _vm.unauthorized, modalShowed : _vm.modalShowed ? true : false, mobile: _vm.mobile},attrs:{\"id\":\"maincontent\"},on:{\"mouseenter\":_vm.mouseenter,\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"headerSpacerWrapper\"},[_c('div',{staticClass:\"headerSpacerWrapperOvf\"},[_c('div',{ref:\"scrollable\",staticClass:\"headerSpacer\"},[_vm._t(\"content\",function(){return [_vm._v(\"   \")]})],2)]),_c('pmenu'),(_vm.modalShowed && _vm.modalShowed.data && !_vm.hiddenInParent)?_c('modal',{on:{\"close\":_vm.closeModal},scopedSlots:_vm._u([{key:\"header\",fn:function(){return [_vm._v(_vm._s(_vm.modalShowed.caption))]},proxy:true},{key:\"body\",fn:function(){return [_c('div',{staticClass:\"modalcommoncontent\"},[(_vm.modalShowed.type == 'complain')?_c('complain',{attrs:{\"p\":_vm.modalShowed.data}}):_vm._e(),(_vm.modalShowed.type == 'contact')?_c('contact',{attrs:{\"contact\":_vm.modalShowed.data.contact}}):_vm._e(),(_vm.modalShowed.type == 'showuserselect')?_c('contacts',{attrs:{\"users\":_vm.modalShowed.data.users,\"mode\":\"Select\"},on:{\"close\":_vm.closeModal,\"select\":function (contact) {_vm.modalShowed.data.userselected(contact); _vm.closeModal()}}}):_vm._e()],1)]},proxy:true},{key:\"footer\",fn:function(){return undefined},proxy:true}],null,false,3972288297)}):_vm._e(),(!_vm.unauthorized && _vm.rbackexp)?_c('div',{staticClass:\"expandp\",on:{\"click\":_vm.setactive,\"mousemove\":_vm.effect}},[_vm._m(0)]):_vm._e()],1),(_vm.iconshow)?_c('transition',{attrs:{\"name\":\"fade\"}},[_c('fixedmessageicon')],1):_vm._e()],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"etablew\"},[_c('div',{staticClass:\"etable table\"},[_c('div',[_c('i',{staticClass:\"fas fa-expand-arrows-alt\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'maincontent',\r\n props: {\r\n rbackexp : Boolean\r\n },\r\n\r\n components : {\r\n\r\n 'contact': () => import('@/components/contact/index.vue'),\r\n 'contacts': () => import('@/components/contacts/list/index.vue'),\r\n 'complain': () => import('@/components/complain/index.vue')\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n iconshow: function() {\r\n\t\t\treturn this.$store.state.icon ? true : false\r\n\t\t},\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n modalShowed : state => state.modalShowed,\r\n hiddenInParent : state => state.hiddenInParent,\r\n mobile : state => state.mobile,\r\n unauthorized : state => state.unauthorized\r\n }),\r\n\r\n methods : {\r\n setactive : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})\r\n this.$store.commit('setiteraction', true)\r\n },\r\n mouseenter : function(){\r\n /*this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})*/\r\n },\r\n\r\n mouseleave : function(){\r\n\r\n if (this.$store.state.autohide){\r\n this.$store.commit('active', false)\r\n }\r\n this.$store.commit('blockactive', {value : false, item : 'main'})\r\n },\r\n\r\n effect : function(e){\r\n /*const x = e.pageX - e.target.offsetLeft\r\n const y = e.pageY - e.target.offsetTop\r\n\r\n e.target.style.setProperty('--x', `${ x }px`)\r\n e.target.style.setProperty('--y', `${ y }px`)*/\r\n },\r\n\r\n closeModal : function(){\r\n this.$store.commit('setmodal', null)\r\n },\r\n\r\n scroll : function(v){\r\n this.$refs['scrollable'].scrollTop = v || 0\r\n },\r\n \r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a8a70f9c&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=a8a70f9c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a8a70f9c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"search\"}},[_c('div',{staticClass:\"searchWrapper\"},[_c('div',{staticClass:\"inputWrapper\"},[_c('input',{ref:\"input\",attrs:{\"placeholder\":_vm.placeholder || this.$i18n.t('caption.search'),\"type\":\"text\"},domProps:{\"value\":_vm.searchTxt},on:{\"keyup\":_vm.change,\"input\":_vm.change,\"focus\":_vm.focused,\"blur\":_vm.blured}})]),(!_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\"},[_c('i',{staticClass:\"fas fa-search\"})]):_vm._e(),(_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-times\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import {mapState} from 'vuex';\r\n// TODO IGOR' SEARCH ALL COMPONENTS\r\nexport default {\r\n name: 'search',\r\n props: {\r\n placeholder: String,\r\n minimize: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n isTyping: false,\r\n searchTxt: ''\r\n }\r\n\r\n },\r\n\r\n created: () => {\r\n\r\n },\r\n\r\n watch: {\r\n searchTxt : {\r\n handler : _.debounce(function() {\r\n\r\n var text = this.searchTxt.toLowerCase()\r\n this.$emit('search', text)\r\n \r\n }, 500)\r\n }\r\n },\r\n computed: mapState({\r\n auth: state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active: function (state) {\r\n return state.active || !this.minimize\r\n },\r\n }),\r\n\r\n methods: {\r\n change : function(event){\r\n this.searchTxt = event.target.value\r\n },\r\n\r\n clear : function(event){\r\n this.searchTxt = ''\r\n }, \r\n \r\n clickicon: function () {\r\n this.$refs['input'].focus()\r\n },\r\n\r\n blured: function () {\r\n this.$store.commit('blockactive', {value: false, item: 'input'})\r\n },\r\n\r\n focused: function () {\r\n this.$store.commit('blockactive', {value: true, item: 'input'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1774f2a8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1774f2a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1774f2a8\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"linepreloader\"}},[_c('span'),_c('span'),_c('span')])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'linepreloader',\r\n props: {\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=bcf20e38&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=bcf20e38&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"bcf20e38\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=01d24e5e&shadow\"\nimport script from \"./App.vue?vue&type=script&lang=js&shadow\"\nexport * from \"./App.vue?vue&type=script&lang=js&shadow\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./editedplugins/vue-m-message/dist/index.css?vue&type=style&index=0&lang=css&shadow\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&lang=sass&shadow\")\nif (style1.__inject__) style1.__inject__(context)\nvar style2 = require(\"./App.vue?vue&type=style&index=2&lang=css&shadow\")\nif (style2.__inject__) style2.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","import './setPublicPath'\nimport Vue from 'vue'\nimport wrap from '@vue/web-component-wrapper'\n\n// runtime shared by every component chunk\nimport 'css-loader/dist/runtime/api.js'\nimport 'vue-style-loader/lib/addStylesShadow'\nimport 'vue-loader/lib/runtime/componentNormalizer'\n\nimport matrixElement from '~root/src/App.vue?shadow'\nwindow.customElements.define('matrix-element', wrap(Vue, matrixElement))","var MD5 = require('md5.js')\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n","module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var a=r[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var a in e)n.d(t,a,function(r){return e[r]}.bind(null,a));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,\"a\",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p=\"\",n(n.s=0)}([function(e,r,n){\"use strict\";n.r(r),n.d(r,\"validateHTMLColorName\",(function(){return l})),n.d(r,\"validateHTMLColorSpecialName\",(function(){return i})),n.d(r,\"validateHTMLColorHex\",(function(){return u})),n.d(r,\"validateHTMLColorRgb\",(function(){return d})),n.d(r,\"validateHTMLColorHsl\",(function(){return f})),n.d(r,\"validateHTMLColorHwb\",(function(){return h})),n.d(r,\"validateHTMLColorLab\",(function(){return g})),n.d(r,\"validateHTMLColor\",(function(){return m}));const t=e=>e&&\"string\"==typeof e,a=[\"AliceBlue\",\"AntiqueWhite\",\"Aqua\",\"Aquamarine\",\"Azure\",\"Beige\",\"Bisque\",\"Black\",\"BlanchedAlmond\",\"Blue\",\"BlueViolet\",\"Brown\",\"BurlyWood\",\"CadetBlue\",\"Chartreuse\",\"Chocolate\",\"Coral\",\"CornflowerBlue\",\"Cornsilk\",\"Crimson\",\"Cyan\",\"DarkBlue\",\"DarkCyan\",\"DarkGoldenrod\",\"DarkGray\",\"DarkGreen\",\"DarkKhaki\",\"DarkMagenta\",\"DarkOliveGreen\",\"DarkOrange\",\"DarkOrchid\",\"DarkRed\",\"DarkSalmon\",\"DarkSeaGreen\",\"DarkSlateBlue\",\"DarkSlateGray\",\"DarkTurquoise\",\"DarkViolet\",\"DeepPink\",\"DeepSkyBlue\",\"DimGray\",\"DodgerBlue\",\"FireBrick\",\"FloralWhite\",\"ForestGreen\",\"Fuchsia\",\"Gainsboro\",\"GhostWhite\",\"Gold\",\"Goldenrod\",\"Gray\",\"Green\",\"GreenYellow\",\"HoneyDew\",\"HotPink\",\"IndianRed\",\"Indigo\",\"Ivory\",\"Khaki\",\"Lavender\",\"LavenderBlush\",\"LawnGreen\",\"LemonChiffon\",\"LightBlue\",\"LightCoral\",\"LightCyan\",\"LightGoldenrodYellow\",\"LightGray\",\"LightGreen\",\"LightPink\",\"LightSalmon\",\"LightSalmon\",\"LightSeaGreen\",\"LightSkyBlue\",\"LightSlateGray\",\"LightSteelBlue\",\"LightYellow\",\"Lime\",\"LimeGreen\",\"Linen\",\"Magenta\",\"Maroon\",\"MediumAquamarine\",\"MediumBlue\",\"MediumOrchid\",\"MediumPurple\",\"MediumSeaGreen\",\"MediumSlateBlue\",\"MediumSlateBlue\",\"MediumSpringGreen\",\"MediumTurquoise\",\"MediumVioletRed\",\"MidnightBlue\",\"MintCream\",\"MistyRose\",\"Moccasin\",\"NavajoWhite\",\"Navy\",\"OldLace\",\"Olive\",\"OliveDrab\",\"Orange\",\"OrangeRed\",\"Orchid\",\"PaleGoldenrod\",\"PaleGreen\",\"PaleTurquoise\",\"PaleVioletRed\",\"PapayaWhip\",\"PeachPuff\",\"Peru\",\"Pink\",\"Plum\",\"PowderBlue\",\"Purple\",\"RebeccaPurple\",\"Red\",\"RosyBrown\",\"RoyalBlue\",\"SaddleBrown\",\"Salmon\",\"SandyBrown\",\"SeaGreen\",\"SeaShell\",\"Sienna\",\"Silver\",\"SkyBlue\",\"SlateBlue\",\"SlateGray\",\"Snow\",\"SpringGreen\",\"SteelBlue\",\"Tan\",\"Teal\",\"Thistle\",\"Tomato\",\"Turquoise\",\"Violet\",\"Wheat\",\"White\",\"WhiteSmoke\",\"Yellow\",\"YellowGreen\"],o=[\"currentColor\",\"inherit\",\"transparent\"],l=e=>{let r=!1;return t(e)&&a.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},i=e=>{let r=!1;return t(e)&&o.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},u=e=>{if(t(e)){const r=/^#([\\da-f]{3}){1,2}$|^#([\\da-f]{4}){1,2}$/i;return e&&r.test(e)}},d=e=>{if(t(e)){const r=/(rgb)a?\\((\\s*\\d+%?\\s*?,?\\s*){2}(\\s*\\d+%?\\s*?,?\\s*\\)?)(\\s*,?\\s*\\/?\\s*(0?\\.?\\d+%?\\s*)?|1|0)?\\)$/i;return e&&r.test(e)}},s=\"(([0-9]|[1-9][0-9]|100)%)\",c=`\\\\s*?\\\\)?)(\\\\s*?(\\\\/?)\\\\s+${`(((${s}))|(0?(\\\\.\\\\d+)?)|1))?`}\\\\s*?\\\\)$`,f=e=>{if(t(e)){const r=new RegExp(`(hsl)a?\\\\((\\\\s*?(${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}|${\"(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)gra)\"}|${\"((([0-5])?\\\\.\\\\d+|6\\\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)\"}|${\"((0?(\\\\.\\\\d+)?|1)turn)\"})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})\\\\s*?\\\\)?)(\\\\s*?(\\\\/?|,?)\\\\s*?(((${s}))|(0?(\\\\.\\\\d+)?)|1))?\\\\)$`);return e&&r.test(e)}},h=e=>{if(t(e)){const r=new RegExp(`(hwb\\\\(\\\\s*?${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}\\\\s+)((0|${s})\\\\s+)((0|${s})${c}`);return e&&r.test(e)}},g=e=>{if(t(e)){const r=\"(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])(\\\\.\\\\d+)??|160))\",n=new RegExp(`(lab\\\\(\\\\s*?((\\\\d*(\\\\.\\\\d+)?)%)\\\\s+${r}\\\\s+${r}${c}`);return e&&n.test(e)}},m=e=>!!(e&&u(e)||d(e)||f(e)||h(e)||g(e));r.default=e=>!!(e&&u(e)||l(e)||i(e)||d(e)||f(e)||h(e)||g(e))}]);","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#teamroom.mobile[data-v-9b340a7a]{margin-bottom:10px}#teamroom[data-v-9b340a7a]:hover{cursor:pointer}#teamroom .teamChatWrapper[data-v-9b340a7a]{padding:.5em .25em;display:flex;align-items:center;transition:.3s}#teamroom .teamChatWrapper .iconWrapper[data-v-9b340a7a]{width:44px;display:flex;align-items:center;min-width:44px;height:44px;position:relative}#teamroom .teamChatWrapper .iconWrapper .logo[data-v-9b340a7a]{background-size:cover;background-position:50%;background-repeat:no-repeat;height:44px;width:44px;margin-left:0;margin-top:0;position:absolute;background:rgb(var(--text-on-bg-ac-color));border-radius:50%;padding-top:8px;text-align:center}#teamroom .teamChatWrapper .iconWrapper .logo img[data-v-9b340a7a]{width:28px;height:28px;margin:0 auto}#teamroom .teamChatWrapper .iconWrapper .unseen[data-v-9b340a7a]{background:rgba(var(--color-bg-ac),.9);color:rgb(var(--text-on-bg-ac-color));position:absolute;width:22px;height:22px;right:-10%;top:-10%;line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em}#teamroom .teamChatWrapper .infoWrapper[data-v-9b340a7a]{padding-left:.5em}#teamroom .teamChatWrapper .infoWrapper>div[data-v-9b340a7a]{display:flex;align-content:center}#teamroom .teamChatWrapper .infoWrapper .infoName span[data-v-9b340a7a]{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;display:inline-block;max-width:190px;color:rgb(var(--text-color))}#teamroom .teamChatWrapper .infoWrapper .previewMessage[data-v-9b340a7a]{display:flex;justify-content:flex-start;align-items:center;width:100%}#teamroom .teamChatWrapper .infoWrapper .previewMessage span[data-v-9b340a7a]{display:block;color:rgb(var(--color-txt-gray));font-size:.9em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:210px}#teamroom.minimized:not(.active) .teamChatWrapper[data-v-9b340a7a]{padding:.5em 0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n'use strict';\n\nvar eos;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\n\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\n\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true; // request.destroy just do .end - .abort is what we want\n\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\n\nfunction call(fn) {\n fn();\n}\n\nfunction pipe(from, to) {\n return from.pipe(to);\n}\n\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\n\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\n\nmodule.exports = pipeline;","// style-loader: Adds some css to the DOM by adding a \n","import mod from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ClipLoader.vue?vue&type=template&id=7edc50d8&\"\nimport script from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nexport * from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ClipLoader.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3d50eb11&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"listPreview\"},[(_vm.urlpreview && _vm.metaPreviewLink)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"linkTitle txt\"},[_vm._v(\"sent link: \"+_vm._s(_vm.meta['og:title'])+\" \")]),(_vm.meta['og:site_name'] === 'Pocketnet')?_c('span',{staticClass:\"pocketnetLink\"},[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")]):_c('span',[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.file')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" sent file: \"+_vm._s(JSON.parse(_vm.content.body).name)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.bad.encrypted')?_c('div',{staticClass:\"previewMessage\"},[_c('span',[_vm._v(\" \"+_vm._s(_vm.$t(\"caption.unabletoDecrypt\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.redaction')?_c('div',{staticClass:\"previewMessage\"},[_c('span',{staticClass:\"txt\"},[_c('i',{staticClass:\"fas fa-eraser\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.messageDeleted\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.power_levels')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" \"+_vm._s(_vm.powerLevels)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.image')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentImage\")))])]):_vm._e(),(_vm.content.msgtype === 'm.audio')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentVoiceMessage\")))])]):_vm._e(),((_vm.content.msgtype === 'm.text') && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.content.body}})],1)]):_vm._e(),(_vm.content.msgtype === 'm.encrypted' && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.decryptEvent.body}})],1)]):_vm._e(),(_vm.content.membership === 'invite')?_c('div',{staticClass:\"invitedEvent\"},[(_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToChat\")))]):_vm._e(),(!_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToRoom\")))]):_vm._e()]):_vm._e(),(_vm.content.membership === 'leave')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt sname\"},[_vm._v(\" \"+_vm._s(_vm.name)+\" \")]),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.leftChat\")))])]):_vm._e(),(_vm.content.membership === 'ban')?_c('div',[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"txt\"},[_vm._v(\"banned \"+_vm._s(_vm.content.displayname))])]):_vm._e(),(_vm.content.membership === 'join' && _vm.event.getSender() !== _vm.userId)?_c('div',{staticClass:\"invitedEvent\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.joined\")))])]):_vm._e(),(_vm.content.name)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatRenamed\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.name))])])]):_vm._e(),(_vm.content.topic)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatTopic\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.topic.replace(/_/g, ' ')))])])]):_vm._e(),(_vm.readed)?_c('div',{staticClass:\"statusWrapper\"},[(_vm.my)?_c('div',{staticClass:\"my\"},[_c('i',{staticClass:\"fas fa-check-double\"})]):_vm._e()]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',_vm._l((_vm.chunks),function(chunk,index){return _c('label',{key:index,attrs:{\"chunks\":_vm.chunks}},[(chunk.id)?_c('label',{staticClass:\"likelink\",on:{\"click\":function($event){return _vm.show(chunk)}}},[_vm._v(\"@\"+_vm._s(chunk.name))]):_c('label',[_vm._v(_vm._s(chunk))])])}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./incomingMessage.vue?vue&type=template&id=6b3704ba&scoped=true&\"\nimport script from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nexport * from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./incomingMessage.vue?vue&type=style&index=0&id=6b3704ba&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6b3704ba\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=ba5ac396&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=ba5ac396&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"ba5ac396\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"urlMessage\",attrs:{\"id\":\"url\"}},[(_vm.urltype!= 'impty' && !_vm.error)?_c('div',{staticClass:\"urlwrapper\"},[(!_vm.loading)?_c('metaMessage',{ref:\"metamessage\",attrs:{\"type\":_vm.urltype,\"name\":_vm.meta['og:site_name'],\"title\":_vm.meta['og:title'],\"description\":_vm.meta['og:description'],\"image\":_vm.previewImageUrl,\"url\":_vm.url,\"h\":_vm.meta['og:image:height'],\"w\":_vm.meta['og:image:width']},on:{\"updatedSize\":_vm.updatedSize}}):_c('div',[_c('div',{staticClass:\"preloaderWrapperLocal\"},[_c('linepreloader')],1)])],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=791cf1f7&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=791cf1f7&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"791cf1f7\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"voiceMessage\",class:{playing:_vm.isPlaying}},[_c('div',{staticClass:\"voiceMessage_wrapper\"},[_c('button',{staticClass:\"voiceMessage_toggle\",class:{encrypted: _vm.encrypted},on:{\"touchend\":_vm.audioToggle,\"click\":_vm.audioToggleClick}},[_c('i',{class:_vm.isPlaying ? 'fas fa-pause': 'fas fa-play'})]),_c('div',{staticClass:\"voiceMessage_graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"width\":\"100\",\"height\":\"50\"},on:{\"mousedown\":_vm.goTo}})]),_c('div',{staticClass:\"voiceMessage_options\"},[(!_vm.error)?_c('span',[_vm._v(_vm._s(_vm.getDurationString))]):_vm._e(),(_vm.error)?_c('i',{staticClass:\"fas fa-exclamation-circle\"}):_vm._e()]),(_vm.encrypted && !_vm.error)?_c('div',{staticClass:\"encsign\"},[_c('i',{staticClass:\"fas fa-lock\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0438bc11&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0438bc11&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0438bc11\",\n null\n ,true\n)\n\nexport default component.exports","import actions from \"@/components/events/event/actions/index.vue\";\r\nimport filePreview from \"@/components/events/previews/filePreview/index.vue\";\r\nimport fileMessage from \"@/components/events/event/fileMessage/index.vue\";\r\nimport listPreview from \"@/components/events/event/message/listPreview/index.vue\";\r\nimport f from '@/application/functions'\r\nimport url from '@/components/events/event/url/index.vue'\r\nimport imagesLoaded from 'vue-images-loaded'\r\nimport dummypreviews from \"@/components/chats/dummypreviews\";\r\nimport IncomingMessage from \"./incomingMessage/incomingMessage.vue\"\r\nimport VoiceMessage from '@/components/events/event/VoiceMessage';\r\n\r\nexport default {\r\n name: 'eventsMessage',\r\n props: {\r\n decryptEvent: {},\r\n origin: Object,\r\n prevevent : Object,\r\n event: Object,\r\n preview: Boolean,\r\n userinfo: Object,\r\n readed: Object,\r\n downloaded: Boolean,\r\n baseImg: {\r\n type: String,\r\n default: 'empty'\r\n },\r\n filePreview: Object,\r\n imgEvent: {},\r\n add_image: Function,\r\n goToGallery: Function,\r\n chat: Object,\r\n encrypted: false,\r\n encryptedData: Boolean,\r\n decryptedInfo: null,\r\n error: String,\r\n withImage: Boolean,\r\n reference: Object,\r\n last : Boolean,\r\n showmyicontrue : false,\r\n fromreference : Boolean,\r\n multiSelect: {\r\n default: false,\r\n type: Boolean,\r\n },\r\n selectedMessages: {\r\n default: [],\r\n type: Array,\r\n },\r\n isRemoveSelectedMessages: false,\r\n audioBuffer : null\r\n },\r\n directives: {\r\n imagesLoaded\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n referenceshowed : false,\r\n }\r\n\r\n },\r\n components: {\r\n actions,\r\n filePreview,\r\n fileMessage,\r\n listPreview,\r\n url,\r\n dummypreviews,\r\n IncomingMessage,\r\n VoiceMessage,\r\n },\r\n watch : {\r\n isRemoveSelectedMessages: {\r\n immediate: true,\r\n handler: function () {\r\n if (this.isRemoveSelectedMessages) {\r\n for (let i = 0; i < this.selectedMessages.length; i++) {\r\n if (\r\n this.selectedMessages[i].message_id === this.origin.event.event_id\r\n ) {\r\n this.$emit('remove');\r\n\r\n return this.core.mtrx.client.redactEvent(\r\n this.chat.roomId,\r\n this.origin.event.event_id,\r\n null,\r\n {\r\n reason: 'messagedeleting',\r\n }\r\n );\r\n }\r\n }\r\n this.$emit('messagesIsDeleted', true);\r\n }\r\n },\r\n },\r\n readyToRender : {\r\n immediate : true,\r\n handler : function(){\r\n if(this.readyToRender) this.$emit('readyToRender')\r\n }\r\n }\r\n },\r\n computed: {\r\n showburn : function(){ \r\n\r\n if(new Date() < new Date(2021,11,28)) {\r\n return ''\r\n }\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.b) return 'big'\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.m) return 'medium'\r\n\r\n return ''\r\n },\r\n willburn : function(){\r\n\r\n var d = moment(this.origin._localTimestamp).add(this.core.options.burn.w, this.core.options.burn.v)\r\n\r\n return d\r\n\r\n },\r\n\r\n readyToRender : function(){\r\n\r\n var r = ( this.content.msgtype === 'm.encrypted' && !this.textWithoutLinks && this.badenctypted ) || \r\n\r\n (this.content.membership) ||\r\n\r\n ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && this.textWithoutLinks) ||\r\n (this.file) || (this.error) || \r\n (this.content.msgtype === 'm.image' && this.imageUrl) ||\r\n (this.content.msgtype === 'm.audio' && this.audioUrl) ||\r\n (this.urlpreview) || \r\n (this.preview)\r\n\r\n return r \r\n\r\n },\r\n my: function () {\r\n return this.userinfo.id === this.core.user.userinfo?.id\r\n },\r\n stateChat: function () {\r\n var id = this.$route.query.id\r\n\r\n return this.$store.state.chatsMap[id]\r\n },\r\n\r\n\r\n sending: function () {\r\n return this.origin.status == 'sending'\r\n },\r\n\r\n showmeta : function(){\r\n if(!this.prevevent) return true\r\n\r\n var prevuser = this.$f.getmatrixid(this.prevevent.getSender())\r\n\r\n var t = 10 * 60000\r\n\r\n if((moment().diff(this.origin._localTimestamp, 'days')) != 0){\r\n t = 60 * 1000 * 60 * 24\r\n }\r\n\r\n if (prevuser != this.userinfo.id || this.prevevent._localTimestamp + t < this.origin._localTimestamp){\r\n return true\r\n }\r\n \r\n },\r\n\r\n imageFrom: function () {\r\n if (this.content && this.content.info) return this.content.info.from\r\n },\r\n\r\n showmyicon: function () {\r\n \r\n return this.showmyicontrue || \r\n this.content.msgtype === 'm.image' ||\r\n /*this.content.msgtype === 'm.audio' ||*/\r\n this.content.msgtype === 'm.file' || \r\n this.urlpreview || (!this.$store.state.active && this.$store.state.minimized)\r\n\r\n\r\n },\r\n\r\n file: function () {\r\n if (this.content.msgtype === 'm.file') {\r\n return this.body\r\n }\r\n },\r\n\r\n replacedmintionsbody:function(){\r\n return this.body.replace(/@\\w{68}:(\\w{1,50})/g, function(str, l){\r\n return '@' + l\r\n })\r\n\r\n },\r\n\r\n body: function () {\r\n\r\n var bc = this.origin.event.content\r\n\r\n if (this.origin.event.content.msgtype == 'm.encrypted') {\r\n bc = this.decryptEvent\r\n }\r\n\r\n return bc.pbody || bc.body || ''\r\n },\r\n\r\n content: function () {\r\n return this.origin.event.content\r\n },\r\n\r\n badenctypted: function () {\r\n return this.decryptEvent.msgtype == 'm.bad.encrypted'\r\n },\r\n\r\n \r\n\r\n textWithoutLinks: function () {\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (!this.urlpreview || this.urlpreview.length < 10 ||\r\n (trimmed.indexOf(this.urlpreview) > 0 && trimmed.indexOf(this.urlpreview) + this.urlpreview.length < trimmed.length)\r\n ) {\r\n return trimmed\r\n }\r\n\r\n return this.$f.trim(trimmed.replace(this.urlpreview, ''))\r\n\r\n },\r\n\r\n imageUrl: function () {\r\n if (this.content.msgtype === 'm.image') {\r\n\r\n if (this.encryptedData) {\r\n return this.decryptedInfo\r\n } else {\r\n\r\n \r\n\r\n return this.content && this.content.url;\r\n }\r\n\r\n }\r\n },\r\n\r\n audioUrl: function () {\r\n if (this.content.msgtype === 'm.audio') {\r\n\r\n if(this.encryptedData && this.decryptedInfo) return this.decryptedInfo\r\n\r\n return this.audioBuffer\r\n\r\n //return this.content && this.content.audioData\r\n }\r\n },\r\n\r\n\r\n canediting: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n cancopy: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n menuItems: function () {\r\n var menu = [\r\n {\r\n click: \"reply\",\r\n title: this.$i18n.t(\"button.reply\"),\r\n icon: \"fas fa-reply\"\r\n },\r\n {\r\n click: \"showMultiSelect\",\r\n title: this.$i18n.t(\"button.select\"),\r\n icon: \"fas fa-check-circle\",\r\n },\r\n ]\r\n\r\n if(!this.file){\r\n menu.push({\r\n click: \"share\",\r\n title: this.$i18n.t(\"button.share\"),\r\n icon: \"fas fa-share-alt\"\r\n })\r\n }\r\n\r\n\r\n if (this.my) {\r\n menu.push({\r\n click: \"delete\",\r\n title: this.$i18n.t(\"button.delete\"),\r\n icon: \"far fa-trash-alt\"\r\n })\r\n }\r\n\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n menu.unshift({\r\n click: \"copy\",\r\n title: this.$i18n.t(\"button.copy\"),\r\n icon: \"far fa-copy\"\r\n })\r\n\r\n if (this.my && this.canediting)\r\n menu.unshift({\r\n click: \"edit\",\r\n title: this.$i18n.t(\"button.edit\"),\r\n icon: \"far fa-edit\"\r\n })\r\n }\r\n\r\n return menu\r\n },\r\n\r\n\r\n urlpreview: function () {\r\n if (!this.preview && this.content.msgtype !== 'm.file') {\r\n\r\n\r\n var url = f.getUrl(this.body)\r\n\r\n if (url){\r\n var _u = new URL(url)\r\n\r\n if(_u.pathname == '/'){\r\n if(f.knsite(url)) return ''\r\n }\r\n\r\n return url\r\n }\r\n\r\n return url || ''\r\n }\r\n },\r\n\r\n edited: function () {\r\n if (this.content.edited) return true\r\n\r\n if (\r\n this.origin.event.content['m.relates_to'] &&\r\n this.origin.event.content['m.relates_to']['rel_type'] == 'm.replace') return true\r\n },\r\n\r\n selectedMessage: function () {\r\n const elem = this.selectedMessages.filter(\r\n (item) => item.message_id === this.origin.event.event_id\r\n );\r\n return elem[0]?.message_id === this.origin.event.event_id ? true : false;\r\n },\r\n },\r\n\r\n mounted() {\r\n\r\n },\r\n\r\n methods: {\r\n gotoreference: function () {\r\n var id = this.reference.getId()\r\n\r\n this.$emit('gotoreference', id)\r\n },\r\n\r\n showwhenburn : function(){\r\n\r\n var text = ''\r\n\r\n //console.log(this.willburn.toDate(), new Date(), this.willburn.toDate() > new Date())\r\n\r\n if(this.willburn.toDate() < new Date()){\r\n text = this.$i18n.t(\"messagewasburn\")\r\n }\r\n else{\r\n text = this.$i18n.t(\"messagewillburn\")\r\n\r\n //this.willburn.locale(this.$i18n.locale).format('DD MMMM YYYY')\r\n }\r\n\r\n this.$store.commit('icon', {\r\n\t\t\t\ticon: 'info',\r\n\t\t\t\tmessage: text\r\n \r\n \r\n\t\t\t})\r\n\r\n },\r\n\r\n imagesLoaded: function () {\r\n this.updatedSize()\r\n },\r\n updatedSize: function (before) {\r\n this.$emit('updatedSize', before)\r\n },\r\n\r\n dropDownMenuShow: function () {\r\n\r\n if(this.urlpreview) return\r\n\r\n setTimeout(() => {\r\n this.setmenu()\r\n }, 200)\r\n\r\n },\r\n\r\n setmenu : function(){\r\n this.core.menu({\r\n items : this.menuItems,\r\n handler : this.menuItemClickHandler,\r\n item : {}\r\n })\r\n },\r\n\r\n menushare: function () {\r\n\r\n var sharing = {}\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (this.content.msgtype === 'm.image' && this.imageUrl) sharing.images = [this.imageUrl]\r\n\r\n if (this.content.msgtype === 'm.audio' && this.audioUrl) sharing.audio = [this.audioUrl]\r\n\r\n if ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && trimmed) sharing.messages = [trimmed]\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id\r\n\r\n this.$emit('share', sharing)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menuedit: function () {\r\n this.$emit('editing', this.body)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menushowMultiSelect: function () {\r\n this.$emit('showMultiSelect');\r\n this.selectMessage();\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menureply: function () {\r\n\r\n this.$emit('reply')\r\n\r\n return Promise.resolve()\r\n },\r\n menucopy: function () {\r\n\r\n \r\n\r\n this.$f.copytext(this.replacedmintionsbody)\r\n\r\n return Promise.resolve()\r\n },\r\n menudelete: function () {\r\n\r\n return this.$dialog.confirm(\r\n 'Do you really want to delete message?', {\r\n okText: this.$i18n.t(\"yes\"),\r\n cancelText: this.$i18n.t(\"cancel\")\r\n })\r\n\r\n .then((dialog) => {\r\n\r\n this.$emit('remove')\r\n\r\n\r\n return this.core.mtrx.client.redactEvent(this.chat.roomId, this.origin.event.event_id, null, {\r\n reason: \"messagedeleting\",\r\n })\r\n\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n\r\n },\r\n menuItemClickHandler: function (item, d, p) {\r\n\r\n p.hidePopup()\r\n\r\n this['menu' + item.click]().then(r => {\r\n\r\n }).catch(e => {\r\n p.showPopup()\r\n })\r\n\r\n },\r\n\r\n imagePaddingStyle : function(c){\r\n\r\n if(c.info && c.info.h && c.info.w){\r\n\r\n var cc = c.info.h / c.info.w\r\n\r\n if (cc > 1.7) cc = 1.7\r\n\r\n var h = 'padding-bottom:' + ((cc) * 100) + '%'\r\n\r\n return h\r\n }\r\n\r\n return ''\r\n },\r\n parser(event) {\r\n return JSON.parse(event)['og:title']\r\n },\r\n openImage(img) {\r\n this.$emit('openImg', img)\r\n },\r\n\r\n format_date(value) {\r\n if (value) {\r\n if ((moment().diff(value, 'days')) === 0) {\r\n return new Date(value).toLocaleTimeString([], {hour: '2-digit', minute: \"2-digit\", hour12: false})\r\n } else {\r\n if (moment().year() === moment(value).year()) {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM')\r\n } else {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM YYYY')\r\n }\r\n }\r\n }\r\n },\r\n\r\n download: function () {\r\n this.$emit('download')\r\n },\r\n\r\n decryptagain : function(){\r\n this.$emit('decryptagain')\r\n },\r\n \r\n openImageGallery(msgEvent) {\r\n this.$emit('openGalleryImg', msgEvent)\r\n },\r\n reshareKeys() {\r\n let roomId = this.chat.roomId\r\n },\r\n textDonation: function (withTx = false) {\r\n var from = this.$i18n.t(\"caption.somebody\"), msg = '';\r\n try {\r\n from = this.$f.deep(this, '$store.state.users.' + this.content.from).name;\r\n } catch (err) {\r\n }\r\n var to = this.$i18n.t(\"caption.somebody\");\r\n try {\r\n to = this.$f.deep(this, '$store.state.users.' + this.content.to).name;\r\n } catch (err) {\r\n }\r\n msg += from + this.$i18n.t(\"caption.sent\") + this.content.amount + this.$i18n.t(\"caption.sent\") + to;\r\n return msg;\r\n },\r\n\r\n menuIsVisibleHandler(isVisible) {\r\n this.$emit('menuIsVisible', isVisible);\r\n },\r\n\r\n showreference : function(){\r\n this.referenceshowed = !this.referenceshowed\r\n },\r\n\r\n selectMessage: function () {\r\n var sharing = {};\r\n\r\n var trimmed = this.$f.trim(this.body);\r\n\r\n if (this.content.msgtype === 'm.image' && this.imageUrl)\r\n sharing.images = [this.imageUrl];\r\n\r\n if (this.content.msgtype === 'm.audio' && this.decryptedInfo)\r\n sharing.audio = [this.decryptedInfo];\r\n\r\n if (\r\n (this.content.msgtype === 'm.text' ||\r\n this.content.msgtype === 'm.encrypted') &&\r\n trimmed\r\n )\r\n sharing.messages = [trimmed];\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true;\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id;\r\n this.$emit('selectMessage', {\r\n message_id: this.origin.event.event_id,\r\n ...sharing,\r\n });\r\n },\r\n removeMessage: function () {\r\n this.$emit('removeMessage', {\r\n message_id: this.origin.event.event_id,\r\n });\r\n },\r\n\r\n eventMessage: function (state) {\r\n state ? this.removeMessage() : this.selectMessage()\r\n }\r\n }\r\n}","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=c8f458dc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=c8f458dc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"c8f458dc\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=659136c0&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=659136c0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"659136c0\",\n null\n ,true\n)\n\nexport default component.exports","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\"","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.EventTimelineSet = EventTimelineSet;\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _eventTimeline = require(\"./event-timeline\");\r\n\r\nvar _event = require(\"./event\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _relations = require(\"./relations\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module models/event-timeline-set\r\n */\r\n// var DEBUG = false;\r\nconst DEBUG = true;\r\nlet debuglog;\r\n\r\nif (DEBUG) {\r\n // using bind means that we get to keep useful line numbers in the console\r\n debuglog = _logger.logger.log.bind(_logger.logger);\r\n} else {\r\n debuglog = function () {};\r\n}\r\n/**\r\n * Construct a set of EventTimeline objects, typically on behalf of a given\r\n * room. A room may have multiple EventTimelineSets for different levels\r\n * of filtering. The global notification list is also an EventTimelineSet, but\r\n * lacks a room.\r\n *\r\n *

This is an ordered sequence of timelines, which may or may not\r\n * be continuous. Each timeline lists a series of events, as well as tracking\r\n * the room state at the start and the end of the timeline (if appropriate).\r\n * It also tracks forward and backward pagination tokens, as well as containing\r\n * links to the next timeline in the sequence.\r\n *\r\n *

There is one special timeline - the 'live' timeline, which represents the\r\n * timeline to which events are being added in real-time as they are received\r\n * from the /sync API. Note that you should not retain references to this\r\n * timeline - even if it is the current timeline right now, it may not remain\r\n * so if the server gives us a timeline gap in /sync.\r\n *\r\n *

In order that we can find events from their ids later, we also maintain a\r\n * map from event_id to timeline and index.\r\n *\r\n * @constructor\r\n * @param {?Room} room\r\n * Room for this timelineSet. May be null for non-room cases, such as the\r\n * notification timeline.\r\n * @param {Object} opts Options inherited from Room.\r\n *\r\n * @param {boolean} [opts.timelineSupport = false]\r\n * Set to true to enable improved timeline support.\r\n * @param {Object} [opts.filter = null]\r\n * The filter object, if any, for this timelineSet.\r\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\r\n * Optional. Set to true to enable client-side aggregation of event relations\r\n * via `getRelationsForEvent`.\r\n * This feature is currently unstable and the API may change without notice.\r\n */\r\n\r\n\r\nfunction EventTimelineSet(room, opts) {\r\n this.room = room;\r\n this._timelineSupport = Boolean(opts.timelineSupport);\r\n this._liveTimeline = new _eventTimeline.EventTimeline(this);\r\n this._unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation; // just a list - *not* ordered.\r\n\r\n this._timelines = [this._liveTimeline];\r\n this._eventIdToTimeline = {};\r\n this._filter = opts.filter || null;\r\n\r\n if (this._unstableClientRelationAggregation) {\r\n // A tree of objects to access a set of relations for an event, as in:\r\n // this._relations[relatesToEventId][relationType][relationEventType]\r\n this._relations = {};\r\n }\r\n}\r\n\r\nutils.inherits(EventTimelineSet, _events.EventEmitter);\r\n/**\r\n * Get all the timelines in this set\r\n * @return {module:models/event-timeline~EventTimeline[]} the timelines in this set\r\n */\r\n\r\nEventTimelineSet.prototype.getTimelines = function () {\r\n return this._timelines;\r\n};\r\n/**\r\n * Get the filter object this timeline set is filtered on, if any\r\n * @return {?Filter} the optional filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getFilter = function () {\r\n return this._filter;\r\n};\r\n/**\r\n * Set the filter object this timeline set is filtered on\r\n * (passed to the server when paginating via /messages).\r\n * @param {Filter} filter the filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setFilter = function (filter) {\r\n this._filter = filter;\r\n};\r\n/**\r\n * Get the list of pending sent events for this timelineSet's room, filtered\r\n * by the timelineSet's filter if appropriate.\r\n *\r\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\r\n * waiting for remote echo.\r\n *\r\n * @throws If opts.pendingEventOrdering was not 'detached'\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getPendingEvents = function () {\r\n if (!this.room) {\r\n return [];\r\n }\r\n\r\n if (this._filter) {\r\n return this._filter.filterRoomTimeline(this.room.getPendingEvents());\r\n } else {\r\n return this.room.getPendingEvents();\r\n }\r\n};\r\n/**\r\n * Get the live timeline for this room.\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} live timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getLiveTimeline = function () {\r\n return this._liveTimeline;\r\n};\r\n/**\r\n * Return the timeline (if any) this event is in.\r\n * @param {String} eventId the eventId being sought\r\n * @return {module:models/event-timeline~EventTimeline} timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.eventIdToTimeline = function (eventId) {\r\n return this._eventIdToTimeline[eventId];\r\n};\r\n/**\r\n * Track a new event as if it were in the same timeline as an old event,\r\n * replacing it.\r\n * @param {String} oldEventId event ID of the original event\r\n * @param {String} newEventId event ID of the replacement event\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.replaceEventId = function (oldEventId, newEventId) {\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n }\r\n};\r\n/**\r\n * Reset the live timeline, and start a new one.\r\n *\r\n *

This is used when /sync returns a 'limited' timeline.\r\n *\r\n * @param {string=} backPaginationToken token for back-paginating the new timeline\r\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\r\n * if absent or null, all timelines are reset.\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timelineReset\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.resetLiveTimeline = function (backPaginationToken, forwardPaginationToken) {\r\n // Each EventTimeline has RoomState objects tracking the state at the start\r\n // and end of that timeline. The copies at the end of the live timeline are\r\n // special because they will have listeners attached to monitor changes to\r\n // the current room state, so we move this RoomState from the end of the\r\n // current live timeline to the end of the new one and, if necessary,\r\n // replace it with a newly created one. We also make a copy for the start\r\n // of the new timeline.\r\n // if timeline support is disabled, forget about the old timelines\r\n const resetAllTimelines = !this._timelineSupport || !forwardPaginationToken;\r\n const oldTimeline = this._liveTimeline;\r\n const newTimeline = resetAllTimelines ? oldTimeline.forkLive(_eventTimeline.EventTimeline.FORWARDS) : oldTimeline.fork(_eventTimeline.EventTimeline.FORWARDS);\r\n\r\n if (resetAllTimelines) {\r\n this._timelines = [newTimeline];\r\n this._eventIdToTimeline = {};\r\n } else {\r\n this._timelines.push(newTimeline);\r\n }\r\n\r\n if (forwardPaginationToken) {\r\n // Now set the forward pagination token on the old live timeline\r\n // so it can be forward-paginated.\r\n oldTimeline.setPaginationToken(forwardPaginationToken, _eventTimeline.EventTimeline.FORWARDS);\r\n } // make sure we set the pagination token before firing timelineReset,\r\n // otherwise clients which start back-paginating will fail, and then get\r\n // stuck without realising that they *can* back-paginate.\r\n\r\n\r\n newTimeline.setPaginationToken(backPaginationToken, _eventTimeline.EventTimeline.BACKWARDS); // Now we can swap the live timeline to the new one.\r\n\r\n this._liveTimeline = newTimeline;\r\n this.emit(\"Room.timelineReset\", this.room, this, resetAllTimelines);\r\n};\r\n/**\r\n * Get the timeline which contains the given event, if any\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\r\n * the given event, or null if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getTimelineForEvent = function (eventId) {\r\n const res = this._eventIdToTimeline[eventId];\r\n return res === undefined ? null : res;\r\n};\r\n/**\r\n * Get an event which is stored in our timelines\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event~MatrixEvent} the given event, or undefined if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.findEventById = function (eventId) {\r\n const tl = this.getTimelineForEvent(eventId);\r\n\r\n if (!tl) {\r\n return undefined;\r\n }\r\n\r\n return utils.findElement(tl.getEvents(), function (ev) {\r\n return ev.getId() == eventId;\r\n });\r\n};\r\n/**\r\n * Add a new timeline to this timeline list\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addTimeline = function () {\r\n if (!this._timelineSupport) {\r\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" + \" parameter to true when creating MatrixClient to enable\" + \" it.\");\r\n }\r\n\r\n const timeline = new _eventTimeline.EventTimeline(this);\r\n\r\n this._timelines.push(timeline);\r\n\r\n return timeline;\r\n};\r\n/**\r\n * Add events to a timeline\r\n *\r\n *

Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent[]} events A list of events to add.\r\n *\r\n * @param {boolean} toStartOfTimeline True to add these events to the start\r\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\r\n * event will be the last element of 'events'.\r\n *\r\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\r\n * add events to.\r\n *\r\n * @param {string=} paginationToken token for the next batch of events\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n *\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventsToTimeline = function (events, toStartOfTimeline, timeline, paginationToken) {\r\n if (!timeline) {\r\n throw new Error(\"'timeline' not specified for EventTimelineSet.addEventsToTimeline\");\r\n }\r\n\r\n if (!toStartOfTimeline && timeline == this._liveTimeline) {\r\n throw new Error(\"EventTimelineSet.addEventsToTimeline cannot be used for adding events to \" + \"the live timeline - use Room.addLiveEvents instead\");\r\n }\r\n\r\n if (this._filter) {\r\n events = this._filter.filterRoomTimeline(events);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const direction = toStartOfTimeline ? _eventTimeline.EventTimeline.BACKWARDS : _eventTimeline.EventTimeline.FORWARDS;\r\n const inverseDirection = toStartOfTimeline ? _eventTimeline.EventTimeline.FORWARDS : _eventTimeline.EventTimeline.BACKWARDS; // Adding events to timelines can be quite complicated. The following\r\n // illustrates some of the corner-cases.\r\n //\r\n // Let's say we start by knowing about four timelines. timeline3 and\r\n // timeline4 are neighbours:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M] [P] [S] <------> [T]\r\n //\r\n // Now we paginate timeline1, and get the following events from the server:\r\n // [M, N, P, R, S, T, U].\r\n //\r\n // 1. First, we ignore event M, since we already know about it.\r\n //\r\n // 2. Next, we append N to timeline 1.\r\n //\r\n // 3. Next, we don't add event P, since we already know about it,\r\n // but we do link together the timelines. We now have:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P] [S] <------> [T]\r\n //\r\n // 4. Now we add event R to timeline2:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] [S] <------> [T]\r\n //\r\n // Note that we have switched the timeline we are working on from\r\n // timeline1 to timeline2.\r\n //\r\n // 5. We ignore event S, but again join the timelines:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T]\r\n //\r\n // 6. We ignore event T, and the timelines are already joined, so there\r\n // is nothing to do.\r\n //\r\n // 7. Finally, we add event U to timeline4:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T, U]\r\n //\r\n // The important thing to note in the above is what happened when we\r\n // already knew about a given event:\r\n //\r\n // - if it was appropriate, we joined up the timelines (steps 3, 5).\r\n // - in any case, we started adding further events to the timeline which\r\n // contained the event we knew about (steps 3, 5, 6).\r\n //\r\n //\r\n // So much for adding events to the timeline. But what do we want to do\r\n // with the pagination token?\r\n //\r\n // In the case above, we will be given a pagination token which tells us how to\r\n // get events beyond 'U' - in this case, it makes sense to store this\r\n // against timeline4. But what if timeline4 already had 'U' and beyond? in\r\n // that case, our best bet is to throw away the pagination token we were\r\n // given and stick with whatever token timeline4 had previously. In short,\r\n // we want to only store the pagination token if the last event we receive\r\n // is one we didn't previously know about.\r\n //\r\n // We make an exception for this if it turns out that we already knew about\r\n // *all* of the events, and we weren't able to join up any timelines. When\r\n // that happens, it means our existing pagination token is faulty, since it\r\n // is only telling us what we already know. Rather than repeatedly\r\n // paginating with the same token, we might as well use the new pagination\r\n // token in the hope that we eventually work our way out of the mess.\r\n\r\n let didUpdate = false;\r\n let lastEventWasNew = false;\r\n\r\n for (let i = 0; i < events.length; i++) {\r\n const event = events[i];\r\n const eventId = event.getId();\r\n const existingTimeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!existingTimeline) {\r\n // we don't know about this event yet. Just add it to the timeline.\r\n this.addEventToTimeline(event, timeline, toStartOfTimeline);\r\n lastEventWasNew = true;\r\n didUpdate = true;\r\n continue;\r\n }\r\n\r\n lastEventWasNew = false;\r\n\r\n if (existingTimeline == timeline) {\r\n debuglog(\"Event \" + eventId + \" already in timeline \" + timeline);\r\n continue;\r\n }\r\n\r\n const neighbour = timeline.getNeighbouringTimeline(direction);\r\n\r\n if (neighbour) {\r\n // this timeline already has a neighbour in the relevant direction;\r\n // let's assume the timelines are already correctly linked up, and\r\n // skip over to it.\r\n //\r\n // there's probably some edge-case here where we end up with an\r\n // event which is in a timeline a way down the chain, and there is\r\n // a break in the chain somewhere. But I can't really imagine how\r\n // that would happen, so I'm going to ignore it for now.\r\n //\r\n if (existingTimeline == neighbour) {\r\n debuglog(\"Event \" + eventId + \" in neighbouring timeline - \" + \"switching to \" + existingTimeline);\r\n } else {\r\n debuglog(\"Event \" + eventId + \" already in a different \" + \"timeline \" + existingTimeline);\r\n }\r\n\r\n timeline = existingTimeline;\r\n continue;\r\n } // time to join the timelines.\r\n\r\n\r\n _logger.logger.info(\"Already have timeline for \" + eventId + \" - joining timeline \" + timeline + \" to \" + existingTimeline); // Variables to keep the line length limited below.\r\n\r\n\r\n const existingIsLive = existingTimeline === this._liveTimeline;\r\n const timelineIsLive = timeline === this._liveTimeline;\r\n const backwardsIsLive = direction === _eventTimeline.EventTimeline.BACKWARDS && existingIsLive;\r\n const forwardsIsLive = direction === _eventTimeline.EventTimeline.FORWARDS && timelineIsLive;\r\n\r\n if (backwardsIsLive || forwardsIsLive) {\r\n // The live timeline should never be spliced into a non-live position.\r\n // We use independent logging to better discover the problem at a glance.\r\n if (backwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set a preceding existingTimeLine on our \" + \"timeline as the existingTimeLine is live (\" + existingTimeline + \")\");\r\n }\r\n\r\n if (forwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set our preceding timeline on a existingTimeLine \" + \"as our timeline is live (\" + timeline + \")\");\r\n }\r\n\r\n continue; // abort splicing - try next event\r\n }\r\n\r\n timeline.setNeighbouringTimeline(existingTimeline, direction);\r\n existingTimeline.setNeighbouringTimeline(timeline, inverseDirection);\r\n timeline = existingTimeline;\r\n didUpdate = true;\r\n } // see above - if the last event was new to us, or if we didn't find any\r\n // new information, we update the pagination token for whatever\r\n // timeline we ended up on.\r\n\r\n\r\n if (lastEventWasNew || !didUpdate) {\r\n if (direction === _eventTimeline.EventTimeline.FORWARDS && timeline === this._liveTimeline) {\r\n _logger.logger.warn({\r\n lastEventWasNew,\r\n didUpdate\r\n }); // for debugging\r\n\r\n\r\n _logger.logger.warn(`Refusing to set forwards pagination token of live timeline ` + `${timeline} to ${paginationToken}`);\r\n\r\n return;\r\n }\r\n\r\n timeline.setPaginationToken(paginationToken, direction);\r\n }\r\n};\r\n/**\r\n * Add an event to the end of this live timeline.\r\n *\r\n * @param {MatrixEvent} event Event to be added\r\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addLiveEvent = function (event, duplicateStrategy, fromCache) {\r\n if (this._filter) {\r\n const events = this._filter.filterRoomTimeline([event]);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const timeline = this._eventIdToTimeline[event.getId()];\r\n\r\n if (timeline) {\r\n if (duplicateStrategy === \"replace\") {\r\n debuglog(\"EventTimelineSet.addLiveEvent: replacing duplicate event \" + event.getId());\r\n const tlEvents = timeline.getEvents();\r\n\r\n for (let j = 0; j < tlEvents.length; j++) {\r\n if (tlEvents[j].getId() === event.getId()) {\r\n // still need to set the right metadata on this event\r\n _eventTimeline.EventTimeline.setEventMetadata(event, timeline.getState(_eventTimeline.EventTimeline.FORWARDS), false);\r\n\r\n if (!tlEvents[j].encryptedType) {\r\n tlEvents[j] = event;\r\n } // XXX: we need to fire an event when this happens.\r\n\r\n\r\n break;\r\n }\r\n }\r\n } else {\r\n debuglog(\"EventTimelineSet.addLiveEvent: ignoring duplicate event \" + event.getId());\r\n }\r\n\r\n return;\r\n }\r\n\r\n this.addEventToTimeline(event, this._liveTimeline, false, fromCache);\r\n};\r\n/**\r\n * Add event to the given timeline, and emit Room.timeline. Assumes\r\n * we have already checked we don't know about this event.\r\n *\r\n * Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent} event\r\n * @param {EventTimeline} timeline\r\n * @param {boolean} toStartOfTimeline\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventToTimeline = function (event, timeline, toStartOfTimeline, fromCache) {\r\n const eventId = event.getId();\r\n timeline.addEvent(event, toStartOfTimeline);\r\n this._eventIdToTimeline[eventId] = timeline;\r\n this.setRelationsTarget(event);\r\n this.aggregateRelations(event);\r\n const data = {\r\n timeline: timeline,\r\n liveEvent: !toStartOfTimeline && timeline == this._liveTimeline && !fromCache\r\n };\r\n this.emit(\"Room.timeline\", event, this.room, Boolean(toStartOfTimeline), false, data);\r\n};\r\n/**\r\n * Replaces event with ID oldEventId with one with newEventId, if oldEventId is\r\n * recognised. Otherwise, add to the live timeline. Used to handle remote echos.\r\n *\r\n * @param {MatrixEvent} localEvent the new event to be added to the timeline\r\n * @param {String} oldEventId the ID of the original event\r\n * @param {boolean} newEventId the ID of the replacement event\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.handleRemoteEcho = function (localEvent, oldEventId, newEventId) {\r\n // XXX: why don't we infer newEventId from localEvent?\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n } else {\r\n if (this._filter) {\r\n if (this._filter.filterRoomTimeline([localEvent]).length) {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n } else {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n }\r\n};\r\n/**\r\n * Removes a single event from this room.\r\n *\r\n * @param {String} eventId The id of the event to remove\r\n *\r\n * @return {?MatrixEvent} the removed event, or null if the event was not found\r\n * in this room.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.removeEvent = function (eventId) {\r\n const timeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!timeline) {\r\n return null;\r\n }\r\n\r\n const removed = timeline.removeEvent(eventId);\r\n\r\n if (removed) {\r\n delete this._eventIdToTimeline[eventId];\r\n const data = {\r\n timeline: timeline\r\n };\r\n this.emit(\"Room.timeline\", removed, this.room, undefined, true, data);\r\n }\r\n\r\n return removed;\r\n};\r\n/**\r\n * Determine where two events appear in the timeline relative to one another\r\n *\r\n * @param {string} eventId1 The id of the first event\r\n * @param {string} eventId2 The id of the second event\r\n\r\n * @return {?number} a number less than zero if eventId1 precedes eventId2, and\r\n * greater than zero if eventId1 succeeds eventId2. zero if they are the\r\n * same event; null if we can't tell (either because we don't know about one\r\n * of the events, or because they are in separate timelines which don't join\r\n * up).\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.compareEventOrdering = function (eventId1, eventId2) {\r\n if (eventId1 == eventId2) {\r\n // optimise this case\r\n return 0;\r\n }\r\n\r\n const timeline1 = this._eventIdToTimeline[eventId1];\r\n const timeline2 = this._eventIdToTimeline[eventId2];\r\n\r\n if (timeline1 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline2 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline1 === timeline2) {\r\n // both events are in the same timeline - figure out their\r\n // relative indices\r\n let idx1;\r\n let idx2;\r\n const events = timeline1.getEvents();\r\n\r\n for (let idx = 0; idx < events.length && (idx1 === undefined || idx2 === undefined); idx++) {\r\n const evId = events[idx].getId();\r\n\r\n if (evId == eventId1) {\r\n idx1 = idx;\r\n }\r\n\r\n if (evId == eventId2) {\r\n idx2 = idx;\r\n }\r\n }\r\n\r\n return idx1 - idx2;\r\n } // the events are in different timelines. Iterate through the\r\n // linkedlist to see which comes first.\r\n // first work forwards from timeline1\r\n\r\n\r\n let tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline1 is before timeline2\r\n return -1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.FORWARDS);\r\n } // now try backwards from timeline1\r\n\r\n\r\n tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline2 is before timeline1\r\n return 1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.BACKWARDS);\r\n } // the timelines are not contiguous.\r\n\r\n\r\n return null;\r\n};\r\n/**\r\n * Get a collection of relations to a given event in this timeline set.\r\n *\r\n * @param {String} eventId\r\n * The ID of the event that you'd like to access relation events for.\r\n * For example, with annotations, this would be the ID of the event being annotated.\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\", \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @throws If eventId, relationType or eventType\r\n * are not valid.\r\n *\r\n * @returns {?Relations}\r\n * A container for relation events or undefined if there are no relation events for\r\n * the relationType.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getRelationsForEvent = function (eventId, relationType, eventType) {\r\n if (!this._unstableClientRelationAggregation) {\r\n throw new Error(\"Client-side relation aggregation is disabled\");\r\n }\r\n\r\n if (!eventId || !relationType || !eventType) {\r\n throw new Error(\"Invalid arguments for `getRelationsForEvent`\");\r\n } // debuglog(\"Getting relations for: \", eventId, relationType, eventType);\r\n\r\n\r\n const relationsForEvent = this._relations[eventId] || {};\r\n const relationsWithRelType = relationsForEvent[relationType] || {};\r\n return relationsWithRelType[eventType];\r\n};\r\n/**\r\n * Set an event as the target event if any Relations exist for it already\r\n *\r\n * @param {MatrixEvent} event\r\n * The event to check as relation target.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setRelationsTarget = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n const relationsForEvent = this._relations[event.getId()];\r\n\r\n if (!relationsForEvent) {\r\n return;\r\n } // don't need it for non m.replace relations for now\r\n\r\n\r\n const relationsWithRelType = relationsForEvent[\"m.replace\"];\r\n\r\n if (!relationsWithRelType) {\r\n return;\r\n } // only doing replacements for messages for now (e.g. edits)\r\n\r\n\r\n const relationsWithEventType = relationsWithRelType[\"m.room.message\"];\r\n\r\n if (relationsWithEventType) {\r\n relationsWithEventType.setTargetEvent(event);\r\n }\r\n};\r\n/**\r\n * Add relation events to the relevant relation collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be aggregated.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.aggregateRelations = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n if (event.isRedacted() || event.status === _event.EventStatus.CANCELLED) {\r\n return;\r\n } // If the event is currently encrypted, wait until it has been decrypted.\r\n\r\n\r\n if (event.isBeingDecrypted()) {\r\n event.once(\"Event.decrypted\", () => {\r\n this.aggregateRelations(event);\r\n });\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n return;\r\n }\r\n\r\n const relatesToEventId = relation.event_id;\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType(); // debuglog(\"Aggregating relation: \", event.getId(), eventType, relation);\r\n\r\n let relationsForEvent = this._relations[relatesToEventId];\r\n\r\n if (!relationsForEvent) {\r\n relationsForEvent = this._relations[relatesToEventId] = {};\r\n }\r\n\r\n let relationsWithRelType = relationsForEvent[relationType];\r\n\r\n if (!relationsWithRelType) {\r\n relationsWithRelType = relationsForEvent[relationType] = {};\r\n }\r\n\r\n let relationsWithEventType = relationsWithRelType[eventType];\r\n let isNewRelations = false;\r\n let relatesToEvent;\r\n\r\n if (!relationsWithEventType) {\r\n relationsWithEventType = relationsWithRelType[eventType] = new _relations.Relations(relationType, eventType, this.room);\r\n isNewRelations = true;\r\n relatesToEvent = this.findEventById(relatesToEventId) || this.room.getPendingEvent(relatesToEventId);\r\n\r\n if (relatesToEvent) {\r\n relationsWithEventType.setTargetEvent(relatesToEvent);\r\n }\r\n }\r\n\r\n relationsWithEventType.addEvent(event); // only emit once event has been added to relations\r\n\r\n if (isNewRelations && relatesToEvent) {\r\n relatesToEvent.emit(\"Event.relationsCreated\", relationType, eventType);\r\n }\r\n};\r\n/**\r\n * Fires whenever the timeline in a room is updated.\r\n * @event module:client~MatrixClient#\"Room.timeline\"\r\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\r\n * @param {?Room} room The room, if any, whose timeline was updated.\r\n * @param {boolean} toStartOfTimeline True if this event was added to the start\r\n * @param {boolean} removed True if this event has just been removed from the timeline\r\n * (beginning; oldest) of the timeline e.g. due to pagination.\r\n *\r\n * @param {object} data more data about the event\r\n *\r\n * @param {module:models/event-timeline.EventTimeline} data.timeline the timeline the\r\n * event was added to/removed from\r\n *\r\n * @param {boolean} data.liveEvent true if the event was a real-time event\r\n * added to the end of the live timeline\r\n *\r\n * @example\r\n * matrixClient.on(\"Room.timeline\",\r\n * function(event, room, toStartOfTimeline, removed, data) {\r\n * if (!toStartOfTimeline && data.liveEvent) {\r\n * var messageToAppend = room.timeline.[room.timeline.length - 1];\r\n * }\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever the live timeline in a room is reset.\r\n *\r\n * When we get a 'limited' sync (for example, after a network outage), we reset\r\n * the live timeline to be empty before adding the recent events to the new\r\n * timeline. This event is fired after the timeline is reset, and before the\r\n * new events are added.\r\n *\r\n * @event module:client~MatrixClient#\"Room.timelineReset\"\r\n * @param {Room} room The room whose live timeline was reset, if any\r\n * @param {EventTimelineSet} timelineSet timelineSet room whose live timeline was reset\r\n * @param {boolean} resetAllTimelines True if all timelines were reset.\r\n */","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.logger = void 0;\r\n\r\nvar _loglevel = _interopRequireDefault(require(\"loglevel\"));\r\n\r\n/*\r\nCopyright 2018 André Jaenisch\r\nCopyright 2019, 2021 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module logger\r\n */\r\n// This is to demonstrate, that you can use any namespace you want.\r\n// Namespaces allow you to turn on/off the logging for specific parts of the\r\n// application.\r\n// An idea would be to control this via an environment variable (on Node.js).\r\n// See https://www.npmjs.com/package/debug to see how this could be implemented\r\n// Part of #332 is introducing a logging library in the first place.\r\nconst DEFAULT_NAMESPACE = \"matrix\"; // because rageshakes in react-sdk hijack the console log, also at module load time,\r\n// initializing the logger here races with the initialization of rageshakes.\r\n// to avoid the issue, we override the methodFactory of loglevel that binds to the\r\n// console methods at initialization time by a factory that looks up the console methods\r\n// when logging so we always get the current value of console methods.\r\n\r\n_loglevel.default.methodFactory = function (methodName, logLevel, loggerName) {\r\n return function (...args) {\r\n /* eslint-disable @babel/no-invalid-this */\r\n if (this.prefix) {\r\n args.unshift(this.prefix);\r\n }\r\n /* eslint-enable @babel/no-invalid-this */\r\n\r\n\r\n const supportedByConsole = methodName === \"error\" || methodName === \"warn\" || methodName === \"trace\" || methodName === \"info\";\r\n /* eslint-disable no-console */\r\n\r\n return\r\n\r\n if (supportedByConsole) {\r\n return console[methodName](...args);\r\n } else {\r\n return console.log(...args);\r\n }\r\n /* eslint-enable no-console */\r\n\r\n };\r\n};\r\n/**\r\n * Drop-in replacement for console using {@link https://www.npmjs.com/package/loglevel|loglevel}.\r\n * Can be tailored down to specific use cases if needed.\r\n */\r\n\r\n\r\nconst logger = _loglevel.default.getLogger(DEFAULT_NAMESPACE);\r\n\r\nexports.logger = logger;\r\nlogger.setLevel(_loglevel.default.levels.DEBUG);\r\n\r\nfunction extendLogger(logger) {\r\n logger.withPrefix = function (prefix) {\r\n const existingPrefix = this.prefix || \"\";\r\n return getPrefixedLogger(existingPrefix + prefix);\r\n };\r\n}\r\n\r\nextendLogger(logger);\r\n\r\nfunction getPrefixedLogger(prefix) {\r\n const prefixLogger = _loglevel.default.getLogger(`${DEFAULT_NAMESPACE}-${prefix}`);\r\n\r\n if (prefixLogger.prefix !== prefix) {\r\n // Only do this setup work the first time through, as loggers are saved by name.\r\n extendLogger(prefixLogger);\r\n prefixLogger.prefix = prefix;\r\n prefixLogger.setLevel(_loglevel.default.levels.DEBUG);\r\n }\r\n\r\n return prefixLogger;\r\n}","var Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar StringDecoder = require('string_decoder').StringDecoder\nvar inherits = require('inherits')\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.SyncApi = SyncApi;\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"./utils\"));\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nvar _pushprocessor = require(\"./pushprocessor\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/*\r\n * TODO:\r\n * This class mainly serves to take all the syncing logic out of client.js and\r\n * into a separate file. It's all very fluid, and this class gut wrenches a lot\r\n * of MatrixClient props (e.g. _http). Given we want to support WebSockets as\r\n * an alternative syncing API, we may want to have a proper syncing interface\r\n * for HTTP and WS at some point.\r\n */\r\nconst DEBUG = true; // /sync requests allow you to set a timeout= but the request may continue\r\n// beyond that and wedge forever, so we need to track how long we are willing\r\n// to keep open the connection. This constant is *ADDED* to the timeout= value\r\n// to determine the max time we're willing to wait.\r\n\r\nconst BUFFER_PERIOD_MS = 80 * 1000; // Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\r\n// to RECONNECTING. This is needed to inform the client of server issues when the\r\n// keepAlive is successful but the server /sync fails.\r\n\r\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\r\n\r\nfunction getFilterName(userId, suffix) {\r\n // scope this on the user ID because people may login on many accounts\r\n // and they all need to be stored!\r\n return \"FILTER_SYNC_\" + userId + (suffix ? \"_\" + suffix : \"\");\r\n}\r\n\r\nfunction debuglog(...params) {\r\n if (!DEBUG) {\r\n return;\r\n }\r\n\r\n _logger.logger.log(...params);\r\n}\r\n/**\r\n * Internal class - unstable.\r\n * Construct an entity which is able to sync with a homeserver.\r\n * @constructor\r\n * @param {MatrixClient} client The matrix client instance to use.\r\n * @param {Object} opts Config options\r\n * @param {module:crypto=} opts.crypto Crypto manager\r\n * @param {Function=} opts.canResetEntireTimeline A function which is called\r\n * with a room ID and returns a boolean. It should return 'true' if the SDK can\r\n * SAFELY remove events from this room. It may not be safe to remove events if\r\n * there are other references to the timelines for this room.\r\n * Default: returns false.\r\n * @param {Boolean=} opts.disablePresence True to perform syncing without automatically\r\n * updating presence.\r\n */\r\n\r\n\r\nfunction SyncApi(client, opts) {\r\n this.client = client;\r\n opts = opts || {};\r\n opts.initialSyncLimit = opts.initialSyncLimit === undefined ? 8 : opts.initialSyncLimit;\r\n opts.resolveInvitesToProfiles = opts.resolveInvitesToProfiles || false;\r\n opts.pollTimeout = opts.pollTimeout || 30 * 1000;\r\n opts.pendingEventOrdering = opts.pendingEventOrdering || \"chronological\";\r\n\r\n if (!opts.canResetEntireTimeline) {\r\n opts.canResetEntireTimeline = function (roomId) {\r\n return false;\r\n };\r\n }\r\n\r\n this.opts = opts;\r\n this._peekRoom = null;\r\n this._currentSyncRequest = null;\r\n this._syncState = null;\r\n this._syncStateData = null; // additional data (eg. error object for failed sync)\r\n\r\n this._catchingUp = false;\r\n this._running = false;\r\n this._keepAliveTimer = null;\r\n this._connectionReturnedDefer = null;\r\n this._notifEvents = []; // accumulator of sync events in the current sync response\r\n\r\n this._failedSyncCount = 0; // Number of consecutive failed /sync requests\r\n\r\n this._storeIsInvalid = false; // flag set if the store needs to be cleared before we can start\r\n\r\n if (client.getNotifTimelineSet()) {\r\n client.reEmitter.reEmit(client.getNotifTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\r\n }\r\n}\r\n/**\r\n * @param {string} roomId\r\n * @return {Room}\r\n */\r\n\r\n\r\nSyncApi.prototype.createRoom = function (roomId) {\r\n const client = this.client;\r\n const {\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n } = client;\r\n const room = new _room.Room(roomId, client, client.getUserId(), {\r\n lazyLoadMembers: this.opts.lazyLoadMembers,\r\n pendingEventOrdering: this.opts.pendingEventOrdering,\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n });\r\n client.reEmitter.reEmit(room, [\"Room.name\", \"Room.avatar\", \"Room.timeline\", \"Room.redaction\", \"Room.redactionCancelled\", \"Room.receipt\", \"Room.tags\", \"Room.timelineReset\", \"Room.localEchoUpdated\", \"Room.accountData\", \"Room.myMembership\", \"Room.replaceEvent\"]);\r\n\r\n this._registerStateListeners(room);\r\n\r\n return room;\r\n};\r\n/**\r\n * @param {string} groupId\r\n * @return {Group}\r\n */\r\n\r\n\r\nSyncApi.prototype.createGroup = function (groupId) {\r\n const client = this.client;\r\n const group = new _group.Group(groupId);\r\n client.reEmitter.reEmit(group, [\"Group.profile\", \"Group.myMembership\"]);\r\n client.store.storeGroup(group);\r\n return group;\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._registerStateListeners = function (room) {\r\n const client = this.client; // we need to also re-emit room state and room member events, so hook it up\r\n // to the client now. We need to add a listener for RoomState.members in\r\n // order to hook them correctly. (TODO: find a better way?)\r\n\r\n client.reEmitter.reEmit(room.currentState, [\"RoomState.events\", \"RoomState.members\", \"RoomState.newMember\"]);\r\n room.currentState.on(\"RoomState.newMember\", function (event, state, member) {\r\n member.user = client.getUser(member.userId);\r\n client.reEmitter.reEmit(member, [\"RoomMember.name\", \"RoomMember.typing\", \"RoomMember.powerLevel\", \"RoomMember.membership\"]);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._deregisterStateListeners = function (room) {\r\n // could do with a better way of achieving this.\r\n room.currentState.removeAllListeners(\"RoomState.events\");\r\n room.currentState.removeAllListeners(\"RoomState.members\");\r\n room.currentState.removeAllListeners(\"RoomState.newMember\");\r\n};\r\n/**\r\n * Sync rooms the user has left.\r\n * @return {Promise} Resolved when they've been added to the store.\r\n */\r\n\r\n\r\nSyncApi.prototype.syncLeftRooms = function () {\r\n const client = this.client;\r\n const self = this; // grab a filter with limit=1 and include_leave=true\r\n\r\n const filter = new _filter.Filter(this.client.credentials.userId);\r\n filter.setTimelineLimit(1);\r\n filter.setIncludeLeaveRooms(true);\r\n const localTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;\r\n const qps = {\r\n timeout: 0 // don't want to block since this is a single isolated req\r\n\r\n };\r\n return client.getOrCreateFilter(getFilterName(client.credentials.userId, \"LEFT_ROOMS\"), filter).then(function (filterId) {\r\n qps.filter = filterId;\r\n return client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, localTimeoutMs);\r\n }).then(function (data) {\r\n let leaveRooms = [];\r\n\r\n if (data.rooms && data.rooms.leave) {\r\n leaveRooms = self._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n\r\n const rooms = [];\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n rooms.push(room);\r\n\r\n if (!leaveObj.isBrandNewRoom) {\r\n // the intention behind syncLeftRooms is to add in rooms which were\r\n // *omitted* from the initial /sync. Rooms the user were joined to\r\n // but then left whilst the app is running will appear in this list\r\n // and we do not want to bother with them since they will have the\r\n // current state already (and may get dupe messages if we add\r\n // yet more timeline events!), so skip them.\r\n // NB: When we persist rooms to localStorage this will be more\r\n // complicated...\r\n return;\r\n }\r\n\r\n leaveObj.timeline = leaveObj.timeline || {};\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room); // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n\r\n\r\n room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n });\r\n return rooms;\r\n });\r\n};\r\n/**\r\n * Peek into a room. This will result in the room in question being synced so it\r\n * is accessible via getRooms(). Live updates for the room will be provided.\r\n * @param {string} roomId The room ID to peek into.\r\n * @return {Promise} A promise which resolves once the room has been added to the\r\n * store.\r\n */\r\n\r\n\r\nSyncApi.prototype.peek = function (roomId) {\r\n if (this._peekRoom && this._peekRoom.roomId === roomId) {\r\n return Promise.resolve(this._peekRoom);\r\n }\r\n\r\n const client = this.client;\r\n this._peekRoom = this.createRoom(roomId);\r\n return this.client.roomInitialSync(roomId, 20).then(response => {\r\n // make sure things are init'd\r\n response.messages = response.messages || {};\r\n response.messages.chunk = response.messages.chunk || [];\r\n response.state = response.state || []; // FIXME: Mostly duplicated from _processRoomEvents but not entirely\r\n // because \"state\" in this API is at the BEGINNING of the chunk\r\n\r\n const oldStateEvents = utils.map(utils.deepCopy(response.state), client.getEventMapper());\r\n const stateEvents = utils.map(response.state, client.getEventMapper());\r\n const messages = utils.map(response.messages.chunk, client.getEventMapper()); // XXX: copypasted from /sync until we kill off this\r\n // minging v1 API stuff)\r\n // handle presence events (User objects)\r\n\r\n if (response.presence && utils.isArray(response.presence)) {\r\n response.presence.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // set the pagination token before adding the events in case people\r\n // fire off pagination requests in response to the Room.timeline\r\n // events.\r\n\r\n\r\n if (response.messages.start) {\r\n this._peekRoom.oldState.paginationToken = response.messages.start;\r\n } // set the state of the room to as it was after the timeline executes\r\n\r\n\r\n this._peekRoom.oldState.setStateEvents(oldStateEvents);\r\n\r\n this._peekRoom.currentState.setStateEvents(stateEvents);\r\n\r\n this._resolveInvites(this._peekRoom);\r\n\r\n this._peekRoom.recalculate(); // roll backwards to diverge old state. addEventsToTimeline\r\n // will overwrite the pagination token, so make sure it overwrites\r\n // it with the right thing.\r\n\r\n\r\n this._peekRoom.addEventsToTimeline(messages.reverse(), true, this._peekRoom.getLiveTimeline(), response.messages.start);\r\n\r\n client.store.storeRoom(this._peekRoom);\r\n client.emit(\"Room\", this._peekRoom);\r\n\r\n this._peekPoll(this._peekRoom);\r\n\r\n return this._peekRoom;\r\n });\r\n};\r\n/**\r\n * Stop polling for updates in the peeked room. NOPs if there is no room being\r\n * peeked.\r\n */\r\n\r\n\r\nSyncApi.prototype.stopPeeking = function () {\r\n this._peekRoom = null;\r\n};\r\n/**\r\n * Do a peek room poll.\r\n * @param {Room} peekRoom\r\n * @param {string?} token from= token\r\n */\r\n\r\n\r\nSyncApi.prototype._peekPoll = function (peekRoom, token) {\r\n if (this._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n }\r\n\r\n const self = this; // FIXME: gut wrenching; hard-coded timeout values\r\n\r\n this.client._http.authedRequest(undefined, \"GET\", \"/events\", {\r\n room_id: peekRoom.roomId,\r\n timeout: 30 * 1000,\r\n from: token\r\n }, undefined, 50 * 1000).then(function (res) {\r\n if (self._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n } // We have a problem that we get presence both from /events and /sync\r\n // however, /sync only returns presence for users in rooms\r\n // you're actually joined to.\r\n // in order to be sure to get presence for all of the users in the\r\n // peeked room, we handle presence explicitly here. This may result\r\n // in duplicate presence events firing for some users, which is a\r\n // performance drain, but such is life.\r\n // XXX: copypasted from /sync until we can kill this minging v1 stuff.\r\n\r\n\r\n res.chunk.filter(function (e) {\r\n return e.type === \"m.presence\";\r\n }).map(self.client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = self.client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(self.client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n self.client.store.storeUser(user);\r\n }\r\n\r\n self.client.emit(\"event\", presenceEvent);\r\n }); // strip out events which aren't for the given room_id (e.g presence)\r\n // and also ephemeral events (which we're assuming is anything without\r\n // and event ID because the /events API doesn't separate them).\r\n\r\n const events = res.chunk.filter(function (e) {\r\n return e.room_id === peekRoom.roomId && e.event_id;\r\n }).map(self.client.getEventMapper());\r\n peekRoom.addLiveEvents(events);\r\n\r\n self._peekPoll(peekRoom, res.end);\r\n }, function (err) {\r\n _logger.logger.error(\"[%s] Peek poll failed: %s\", peekRoom.roomId, err);\r\n\r\n setTimeout(function () {\r\n self._peekPoll(peekRoom, token);\r\n }, 30 * 1000);\r\n });\r\n};\r\n/**\r\n * Returns the current state of this sync object\r\n * @see module:client~MatrixClient#event:\"sync\"\r\n * @return {?String}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncState = function () {\r\n return this._syncState;\r\n};\r\n/**\r\n * Returns the additional data object associated with\r\n * the current sync state, or null if there is no\r\n * such data.\r\n * Sync errors, if available, are put in the 'error' key of\r\n * this object.\r\n * @return {?Object}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncStateData = function () {\r\n return this._syncStateData;\r\n};\r\n\r\nSyncApi.prototype.recoverFromSyncStartupError = async function (savedSyncPromise, err) {\r\n // Wait for the saved sync to complete - we send the pushrules and filter requests\r\n // before the saved sync has finished so they can run in parallel, but only process\r\n // the results after the saved sync is done. Equivalently, we wait for it to finish\r\n // before reporting failures from these functions.\r\n await savedSyncPromise;\r\n\r\n const keepaliveProm = this._startKeepAlives();\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n\r\n await keepaliveProm;\r\n};\r\n/**\r\n * Is the lazy loading option different than in previous session?\r\n * @param {bool} lazyLoadMembers current options for lazy loading\r\n * @return {bool} whether or not the option has changed compared to the previous session */\r\n\r\n\r\nSyncApi.prototype._wasLazyLoadingToggled = async function (lazyLoadMembers) {\r\n lazyLoadMembers = !!lazyLoadMembers; // assume it was turned off before\r\n // if we don't know any better\r\n\r\n let lazyLoadMembersBefore = false;\r\n const isStoreNewlyCreated = await this.client.store.isNewlyCreated();\r\n\r\n if (!isStoreNewlyCreated) {\r\n const prevClientOptions = await this.client.store.getClientOptions();\r\n\r\n if (prevClientOptions) {\r\n lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers;\r\n }\r\n\r\n return lazyLoadMembersBefore !== lazyLoadMembers;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nSyncApi.prototype._shouldAbortSync = function (error) {\r\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\r\n // The logout already happened, we just need to stop.\r\n _logger.logger.warn(\"Token no longer valid - assuming logout\");\r\n\r\n this.stop();\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n/**\r\n * Main entry point\r\n */\r\n\r\n\r\nSyncApi.prototype.sync = function () {\r\n const client = this.client;\r\n const self = this;\r\n this._running = true;\r\n\r\n if (global.window && global.window.addEventListener) {\r\n this._onOnlineBound = this._onOnline.bind(this);\r\n global.window.addEventListener(\"online\", this._onOnlineBound, false);\r\n }\r\n\r\n let savedSyncPromise = Promise.resolve();\r\n let savedSyncToken = null; // We need to do one-off checks before we can begin the /sync loop.\r\n // These are:\r\n // 1) We need to get push rules so we can check if events should bing as we get\r\n // them from /sync.\r\n // 2) We need to get/create a filter which we can use for /sync.\r\n // 3) We need to check the lazy loading option matches what was used in the\r\n // stored sync. If it doesn't, we can't use the stored sync.\r\n\r\n async function getPushRules() {\r\n try {\r\n debuglog(\"Getting push rules...\");\r\n const result = await client.getPushRules();\r\n debuglog(\"Got push rules\");\r\n client.pushRules = result;\r\n } catch (err) {\r\n _logger.logger.error(\"Getting push rules failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying push rules...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getPushRules();\r\n return;\r\n }\r\n\r\n checkLazyLoadStatus(); // advance to the next stage\r\n }\r\n\r\n function buildDefaultFilter() {\r\n const filter = new _filter.Filter(client.credentials.userId);\r\n filter.setTimelineLimit(self.opts.initialSyncLimit);\r\n return filter;\r\n }\r\n\r\n const checkLazyLoadStatus = async () => {\r\n debuglog(\"Checking lazy load status...\");\r\n\r\n if (this.opts.lazyLoadMembers && client.isGuest()) {\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers) {\r\n debuglog(\"Checking server lazy load support...\");\r\n const supported = await client.doesServerSupportLazyLoading();\r\n\r\n if (supported) {\r\n debuglog(\"Enabling lazy load on sync filter...\");\r\n\r\n if (!this.opts.filter) {\r\n this.opts.filter = buildDefaultFilter();\r\n }\r\n\r\n this.opts.filter.setLazyLoadMembers(true);\r\n } else {\r\n debuglog(\"LL: lazy loading requested but not supported \" + \"by server, so disabling\");\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n } // need to vape the store when enabling LL and wasn't enabled before\r\n\r\n\r\n debuglog(\"Checking whether lazy loading has changed in store...\");\r\n const shouldClear = await this._wasLazyLoadingToggled(this.opts.lazyLoadMembers);\r\n\r\n if (shouldClear) {\r\n this._storeIsInvalid = true;\r\n const reason = _errors.InvalidStoreError.TOGGLED_LAZY_LOADING;\r\n const error = new _errors.InvalidStoreError(reason, !!this.opts.lazyLoadMembers);\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error\r\n }); // bail out of the sync loop now: the app needs to respond to this error.\r\n // we leave the state as 'ERROR' which isn't great since this normally means\r\n // we're retrying. The client must be stopped before clearing the stores anyway\r\n // so the app should stop the client, clear the store and start it again.\r\n\r\n\r\n _logger.logger.warn(\"InvalidStoreError: store is not usable: stopping sync.\");\r\n\r\n return;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers && this.opts.crypto) {\r\n this.opts.crypto.enableLazyLoading();\r\n }\r\n\r\n try {\r\n debuglog(\"Storing client options...\");\r\n await this.client._storeClientOptions();\r\n debuglog(\"Stored client options\");\r\n } catch (err) {\r\n _logger.logger.error(\"Storing client options failed\", err);\r\n\r\n throw err;\r\n }\r\n\r\n getFilter(); // Now get the filter and start syncing\r\n };\r\n\r\n async function getFilter() {\r\n debuglog(\"Getting filter...\");\r\n let filter;\r\n\r\n if (self.opts.filter) {\r\n filter = self.opts.filter;\r\n } else {\r\n filter = buildDefaultFilter();\r\n }\r\n\r\n let filterId;\r\n\r\n try {\r\n filterId = await client.getOrCreateFilter(getFilterName(client.credentials.userId), filter);\r\n } catch (err) {\r\n _logger.logger.error(\"Getting filter failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying filter...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getFilter();\r\n return;\r\n } // reset the notifications timeline to prepare it to paginate from\r\n // the current point in time.\r\n // The right solution would be to tie /sync pagination tokens into\r\n // /notifications API somehow.\r\n\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n if (self._currentSyncRequest === null) {\r\n // Send this first sync request here so we can then wait for the saved\r\n // sync data to finish processing before we process the results of this one.\r\n debuglog(\"Sending first sync request...\");\r\n self._currentSyncRequest = self._doSyncRequest({\r\n filterId\r\n }, savedSyncToken);\r\n } // Now wait for the saved sync to finish...\r\n\r\n\r\n debuglog(\"Waiting for saved sync before starting sync processing...\");\r\n await savedSyncPromise;\r\n\r\n self._sync({\r\n filterId\r\n });\r\n }\r\n\r\n if (client.isGuest()) {\r\n // no push rules for guests, no access to POST filter for guests.\r\n self._sync({});\r\n } else {\r\n // Pull the saved sync token out first, before the worker starts sending\r\n // all the sync data which could take a while. This will let us send our\r\n // first incremental sync request before we've processed our saved data.\r\n debuglog(\"Getting saved sync token...\");\r\n savedSyncPromise = client.store.getSavedSyncToken().then(tok => {\r\n debuglog(\"Got saved sync token\");\r\n savedSyncToken = tok;\r\n debuglog(\"Getting saved sync...\");\r\n return client.store.getSavedSync();\r\n }).then(savedSync => {\r\n debuglog(`Got reply from saved sync, exists? ${!!savedSync}`);\r\n\r\n if (savedSync) {\r\n return self._syncFromCache(savedSync);\r\n }\r\n }).catch(err => {\r\n _logger.logger.error(\"Getting saved sync failed\", err);\r\n }); // Now start the first incremental sync request: this can also\r\n // take a while so if we set it going now, we can wait for it\r\n // to finish while we process our saved sync data.\r\n\r\n getPushRules();\r\n }\r\n};\r\n/**\r\n * Stops the sync object from syncing.\r\n */\r\n\r\n\r\nSyncApi.prototype.stop = function () {\r\n debuglog(\"SyncApi.stop\");\r\n\r\n if (global.window) {\r\n global.window.removeEventListener(\"online\", this._onOnlineBound, false);\r\n this._onOnlineBound = undefined;\r\n }\r\n\r\n this._running = false;\r\n\r\n if (this._currentSyncRequest) {\r\n this._currentSyncRequest.abort();\r\n }\r\n\r\n if (this._keepAliveTimer) {\r\n clearTimeout(this._keepAliveTimer);\r\n this._keepAliveTimer = null;\r\n }\r\n};\r\n/**\r\n * Retry a backed off syncing request immediately. This should only be used when\r\n * the user explicitly attempts to retry their lost connection.\r\n * @return {boolean} True if this resulted in a request being retried.\r\n */\r\n\r\n\r\nSyncApi.prototype.retryImmediately = function () {\r\n if (!this._connectionReturnedDefer) {\r\n return false;\r\n }\r\n\r\n this._startKeepAlives(0);\r\n\r\n return true;\r\n};\r\n/**\r\n * Process a single set of cached sync data.\r\n * @param {Object} savedSync a saved sync that was persisted by a store. This\r\n * should have been acquired via client.store.getSavedSync().\r\n */\r\n\r\n\r\nSyncApi.prototype._syncFromCache = async function (savedSync) {\r\n debuglog(\"sync(): not doing HTTP hit, instead returning stored /sync data\");\r\n const nextSyncToken = savedSync.nextBatch; // Set sync token for future incremental syncing\r\n\r\n this.client.store.setSyncToken(nextSyncToken); // No previous sync, set old token to null\r\n\r\n const syncEventData = {\r\n oldSyncToken: null,\r\n nextSyncToken,\r\n catchingUp: false,\r\n fromCache: true\r\n };\r\n const data = {\r\n next_batch: nextSyncToken,\r\n rooms: savedSync.roomsData,\r\n groups: savedSync.groupsData,\r\n account_data: {\r\n events: savedSync.accountData\r\n }\r\n };\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n _logger.logger.error(\"Error processing cached sync\", e.stack || e);\r\n } // Don't emit a prepared if we've bailed because the store is invalid:\r\n // in this case the client will not be usable until stopped & restarted\r\n // so this would be useless and misleading.\r\n\r\n\r\n if (!this._storeIsInvalid) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n }\r\n};\r\n/**\r\n * Invoke me to do /sync calls\r\n * @param {Object} syncOptions\r\n * @param {string} syncOptions.filterId\r\n * @param {boolean} syncOptions.hasSyncedBefore\r\n */\r\n\r\n\r\nSyncApi.prototype._sync = async function (syncOptions) {\r\n const client = this.client;\r\n\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting.\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n const syncToken = client.store.getSyncToken();\r\n let data;\r\n\r\n try {\r\n //debuglog('Starting sync since=' + syncToken);\r\n if (this._currentSyncRequest === null) {\r\n this._currentSyncRequest = this._doSyncRequest(syncOptions, syncToken);\r\n }\r\n\r\n data = await this._currentSyncRequest;\r\n } catch (e) {\r\n this._onSyncError(e, syncOptions);\r\n\r\n return;\r\n } finally {\r\n this._currentSyncRequest = null;\r\n } //debuglog('Completed sync, next_batch=' + data.next_batch);\r\n // set the sync token NOW *before* processing the events. We do this so\r\n // if something barfs on an event we can skip it rather than constantly\r\n // polling with the same token.\r\n\r\n\r\n client.store.setSyncToken(data.next_batch); // Reset after a successful sync\r\n\r\n this._failedSyncCount = 0;\r\n await client.store.setSyncData(data);\r\n const syncEventData = {\r\n oldSyncToken: syncToken,\r\n nextSyncToken: data.next_batch,\r\n catchingUp: this._catchingUp\r\n };\r\n\r\n if (this.opts.crypto) {\r\n // tell the crypto module we're about to process a sync\r\n // response\r\n await this.opts.crypto.onSyncWillProcess(syncEventData);\r\n }\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n // log the exception with stack if we have it, else fall back\r\n // to the plain description\r\n _logger.logger.error(\"Caught /sync error\", e.stack || e); // Emit the exception for client handling\r\n\r\n\r\n this.client.emit(\"sync.unexpectedError\", e);\r\n } // update this as it may have changed\r\n\r\n\r\n syncEventData.catchingUp = this._catchingUp; // emit synced events\r\n\r\n if (!syncOptions.hasSyncedBefore) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n\r\n syncOptions.hasSyncedBefore = true;\r\n } // tell the crypto module to do its processing. It may block (to do a\r\n // /keys/changes request).\r\n\r\n\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.onSyncCompleted(syncEventData);\r\n } // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates\r\n\r\n\r\n this._updateSyncState(\"SYNCING\", syncEventData);\r\n\r\n if (client.store.wantsSave()) {\r\n // We always save the device list (if it's dirty) before saving the sync data:\r\n // this means we know the saved device list data is at least as fresh as the\r\n // stored sync data which means we don't have to worry that we may have missed\r\n // device changes. We can also skip the delay since we're not calling this very\r\n // frequently (and we don't really want to delay the sync for it).\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.saveDeviceList(0);\r\n } // tell databases that everything is now in a consistent state and can be saved.\r\n\r\n\r\n client.store.save();\r\n } // Begin next sync\r\n\r\n\r\n this._sync(syncOptions);\r\n};\r\n\r\nSyncApi.prototype._doSyncRequest = function (syncOptions, syncToken) {\r\n const qps = this._getSyncParams(syncOptions, syncToken);\r\n\r\n return this.client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, qps.timeout + BUFFER_PERIOD_MS);\r\n};\r\n\r\nSyncApi.prototype._getSyncParams = function (syncOptions, syncToken) {\r\n let pollTimeout = this.opts.pollTimeout;\r\n\r\n if (this.getSyncState() !== 'SYNCING' || this._catchingUp) {\r\n // unless we are happily syncing already, we want the server to return\r\n // as quickly as possible, even if there are no events queued. This\r\n // serves two purposes:\r\n //\r\n // * When the connection dies, we want to know asap when it comes back,\r\n // so that we can hide the error from the user. (We don't want to\r\n // have to wait for an event or a timeout).\r\n //\r\n // * We want to know if the server has any to_device messages queued up\r\n // for us. We do that by calling it with a zero timeout until it\r\n // doesn't give us any more to_device messages.\r\n this._catchingUp = true;\r\n pollTimeout = 0;\r\n }\r\n\r\n let filterId = syncOptions.filterId;\r\n\r\n if (this.client.isGuest() && !filterId) {\r\n filterId = this._getGuestFilter();\r\n }\r\n\r\n const qps = {\r\n filter: filterId,\r\n timeout: pollTimeout\r\n };\r\n\r\n if (this.opts.disablePresence) {\r\n qps.set_presence = \"offline\";\r\n }\r\n\r\n if (syncToken) {\r\n qps.since = syncToken;\r\n } else {\r\n // use a cachebuster for initialsyncs, to make sure that\r\n // we don't get a stale sync\r\n // (https://github.com/vector-im/vector-web/issues/1354)\r\n qps._cacheBuster = Date.now();\r\n }\r\n\r\n if (this.getSyncState() == 'ERROR' || this.getSyncState() == 'RECONNECTING') {\r\n // we think the connection is dead. If it comes back up, we won't know\r\n // about it till /sync returns. If the timeout= is high, this could\r\n // be a long time. Set it to 0 when doing retries so we don't have to wait\r\n // for an event or a timeout before emiting the SYNCING event.\r\n qps.timeout = 0;\r\n }\r\n\r\n return qps;\r\n};\r\n\r\nSyncApi.prototype._onSyncError = function (err, syncOptions) {\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n _logger.logger.error(\"/sync error %s\", err);\r\n\r\n _logger.logger.error(err);\r\n\r\n if (this._shouldAbortSync(err)) {\r\n return;\r\n }\r\n\r\n this._failedSyncCount++;\r\n\r\n _logger.logger.log('Number of consecutive failed sync requests:', this._failedSyncCount);\r\n\r\n debuglog(\"Starting keep-alive\"); // Note that we do *not* mark the sync connection as\r\n // lost yet: we only do this if a keepalive poke\r\n // fails, since long lived HTTP connections will\r\n // go away sometimes and we shouldn't treat this as\r\n // erroneous. We set the state to 'reconnecting'\r\n // instead, so that clients can observe this state\r\n // if they wish.\r\n\r\n this._startKeepAlives().then(connDidFail => {\r\n // Only emit CATCHUP if we detected a connectivity error: if we didn't,\r\n // it's quite likely the sync will fail again for the same reason and we\r\n // want to stay in ERROR rather than keep flip-flopping between ERROR\r\n // and CATCHUP.\r\n if (connDidFail && this.getSyncState() === 'ERROR') {\r\n this._updateSyncState(\"CATCHUP\", {\r\n oldSyncToken: null,\r\n nextSyncToken: null,\r\n catchingUp: true\r\n });\r\n }\r\n\r\n this._sync(syncOptions);\r\n });\r\n\r\n this._currentSyncRequest = null; // Transition from RECONNECTING to ERROR after a given number of failed syncs\r\n\r\n this._updateSyncState(this._failedSyncCount >= FAILED_SYNC_ERROR_THRESHOLD ? \"ERROR\" : \"RECONNECTING\", {\r\n error: err\r\n });\r\n};\r\n/**\r\n * Process data returned from a sync response and propagate it\r\n * into the model objects\r\n *\r\n * @param {Object} syncEventData Object containing sync tokens associated with this sync\r\n * @param {Object} data The response from /sync\r\n */\r\n\r\n\r\nSyncApi.prototype._processSyncResponse = async function (syncEventData, data) {\r\n const client = this.client;\r\n const self = this; // data looks like:\r\n // {\r\n // next_batch: $token,\r\n // presence: { events: [] },\r\n // account_data: { events: [] },\r\n // device_lists: { changed: [\"@user:server\", ... ]},\r\n // to_device: { events: [] },\r\n // device_one_time_keys_count: { signed_curve25519: 42 },\r\n // rooms: {\r\n // invite: {\r\n // $roomid: {\r\n // invite_state: { events: [] }\r\n // }\r\n // },\r\n // join: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token, limited: true },\r\n // ephemeral: { events: [] },\r\n // summary: {\r\n // m.heroes: [ $user_id ],\r\n // m.joined_member_count: $count,\r\n // m.invited_member_count: $count\r\n // },\r\n // account_data: { events: [] },\r\n // unread_notifications: {\r\n // highlight_count: 0,\r\n // notification_count: 0,\r\n // }\r\n // }\r\n // },\r\n // leave: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token }\r\n // }\r\n // }\r\n // },\r\n // groups: {\r\n // invite: {\r\n // $groupId: {\r\n // inviter: $inviter,\r\n // profile: {\r\n // avatar_url: $avatarUrl,\r\n // name: $groupName,\r\n // },\r\n // },\r\n // },\r\n // join: {},\r\n // leave: {},\r\n // },\r\n // }\r\n // TODO-arch:\r\n // - Each event we pass through needs to be emitted via 'event', can we\r\n // do this in one place?\r\n // - The isBrandNewRoom boilerplate is boilerplatey.\r\n // handle presence events (User objects)\r\n\r\n if (data.presence && utils.isArray(data.presence.events)) {\r\n data.presence.events.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getSender());\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getSender());\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // handle non-room account_data\r\n\r\n\r\n if (data.account_data && utils.isArray(data.account_data.events)) {\r\n const events = data.account_data.events.map(client.getEventMapper());\r\n const prevEventsMap = events.reduce((m, c) => {\r\n m[c.getId()] = client.store.getAccountData(c.getType());\r\n return m;\r\n }, {});\r\n client.store.storeAccountDataEvents(events);\r\n events.forEach(function (accountDataEvent) {\r\n // Honour push rules that come down the sync stream but also\r\n // honour push rules that were previously cached. Base rules\r\n // will be updated when we receive push rules via getPushRules\r\n // (see SyncApi.prototype.sync) before syncing over the network.\r\n if (accountDataEvent.getType() === 'm.push_rules') {\r\n const rules = accountDataEvent.getContent();\r\n client.pushRules = _pushprocessor.PushProcessor.rewriteDefaultRules(rules);\r\n }\r\n\r\n const prevEvent = prevEventsMap[accountDataEvent.getId()];\r\n client.emit(\"accountData\", accountDataEvent, prevEvent);\r\n return accountDataEvent;\r\n });\r\n } // handle to-device events\r\n\r\n\r\n if (data.to_device && utils.isArray(data.to_device.events) && data.to_device.events.length > 0) {\r\n const cancelledKeyVerificationTxns = [];\r\n data.to_device.events.map(client.getEventMapper()).map(toDeviceEvent => {\r\n // map is a cheap inline forEach\r\n // We want to flag m.key.verification.start events as cancelled\r\n // if there's an accompanying m.key.verification.cancel event, so\r\n // we pull out the transaction IDs from the cancellation events\r\n // so we can flag the verification events as cancelled in the loop\r\n // below.\r\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\r\n const txnId = toDeviceEvent.getContent()['transaction_id'];\r\n\r\n if (txnId) {\r\n cancelledKeyVerificationTxns.push(txnId);\r\n }\r\n } // as mentioned above, .map is a cheap inline forEach, so return\r\n // the unmodified event.\r\n\r\n\r\n return toDeviceEvent;\r\n }).forEach(function (toDeviceEvent) {\r\n const content = toDeviceEvent.getContent();\r\n\r\n if (toDeviceEvent.getType() == \"m.room.message\" && content.msgtype == \"m.bad.encrypted\") {\r\n // the mapper already logged a warning.\r\n _logger.logger.log('Ignoring undecryptable to-device event from ' + toDeviceEvent.getSender());\r\n\r\n return;\r\n }\r\n\r\n if (toDeviceEvent.getType() === \"m.key.verification.start\" || toDeviceEvent.getType() === \"m.key.verification.request\") {\r\n const txnId = content['transaction_id'];\r\n\r\n if (cancelledKeyVerificationTxns.includes(txnId)) {\r\n toDeviceEvent.flagCancelled();\r\n }\r\n }\r\n\r\n client.emit(\"toDeviceEvent\", toDeviceEvent);\r\n });\r\n } else {\r\n // no more to-device events: we can stop polling with a short timeout.\r\n this._catchingUp = false;\r\n }\r\n\r\n if (data.groups) {\r\n if (data.groups.invite) {\r\n this._processGroupSyncEntry(data.groups.invite, 'invite');\r\n }\r\n\r\n if (data.groups.join) {\r\n this._processGroupSyncEntry(data.groups.join, 'join');\r\n }\r\n\r\n if (data.groups.leave) {\r\n this._processGroupSyncEntry(data.groups.leave, 'leave');\r\n }\r\n } // the returned json structure is a bit crap, so make it into a\r\n // nicer form (array) after applying sanity to make sure we don't fail\r\n // on missing keys (on the off chance)\r\n\r\n\r\n let inviteRooms = [];\r\n let joinRooms = [];\r\n let leaveRooms = [];\r\n\r\n if (data.rooms) {\r\n if (data.rooms.invite) {\r\n inviteRooms = this._mapSyncResponseToRoomArray(data.rooms.invite);\r\n }\r\n\r\n if (data.rooms.join) {\r\n joinRooms = this._mapSyncResponseToRoomArray(data.rooms.join);\r\n }\r\n\r\n if (data.rooms.leave) {\r\n leaveRooms = this._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n }\r\n\r\n this._notifEvents = []; // Handle invites\r\n\r\n inviteRooms.forEach(function (inviteObj) {\r\n const room = inviteObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(inviteObj.invite_state, room);\r\n\r\n self._processRoomEvents(room, stateEvents);\r\n\r\n if (inviteObj.isBrandNewRoom) {\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"invite\");\r\n }); // Handle joins\r\n\r\n await utils.promiseMapSeries(joinRooms, async function (joinObj) {\r\n const room = joinObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(joinObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(joinObj.timeline, room);\r\n\r\n const ephemeralEvents = self._mapSyncEventsFormat(joinObj.ephemeral);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(joinObj.account_data); // we do this first so it's correct when any of the events fire\r\n\r\n\r\n if (joinObj.unread_notifications) {\r\n room.setUnreadNotificationCount('total', joinObj.unread_notifications.notification_count); // We track unread notifications ourselves in encrypted rooms, so don't\r\n // bother setting it here. We trust our calculations better than the\r\n // server's for this case, and therefore will assume that our non-zero\r\n // count is accurate.\r\n\r\n const encrypted = client.isRoomEncrypted(room.roomId);\r\n\r\n if (!encrypted || encrypted && room.getUnreadNotificationCount('highlight') <= 0) {\r\n room.setUnreadNotificationCount('highlight', joinObj.unread_notifications.highlight_count);\r\n }\r\n }\r\n\r\n joinObj.timeline = joinObj.timeline || {};\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n room.getLiveTimeline().setPaginationToken(joinObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n } else if (joinObj.timeline.limited) {\r\n let limited = true; // we've got a limited sync, so we *probably* have a gap in the\r\n // timeline, so should reset. But we might have been peeking or\r\n // paginating and already have some of the events, in which\r\n // case we just want to append any subsequent events to the end\r\n // of the existing timeline.\r\n //\r\n // This is particularly important in the case that we already have\r\n // *all* of the events in the timeline - in that case, if we reset\r\n // the timeline, we'll end up with an entirely empty timeline,\r\n // which we'll try to paginate but not get any new events (which\r\n // will stop us linking the empty timeline into the chain).\r\n //\r\n\r\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\r\n const eventId = timelineEvents[i].getId();\r\n\r\n if (room.getTimelineForEvent(eventId)) {\r\n debuglog(\"Already have event \" + eventId + \" in limited \" + \"sync - not resetting\");\r\n limited = false; // we might still be missing some of the events before i;\r\n // we don't want to be adding them to the end of the\r\n // timeline because that would put them out of order.\r\n\r\n timelineEvents.splice(0, i); // XXX: there's a problem here if the skipped part of the\r\n // timeline modifies the state set in stateEvents, because\r\n // we'll end up using the state from stateEvents rather\r\n // than the later state from timelineEvents. We probably\r\n // need to wind stateEvents forward over the events we're\r\n // skipping.\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (limited) {\r\n self._deregisterStateListeners(room);\r\n\r\n room.resetLiveTimeline(joinObj.timeline.prev_batch, self.opts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken); // We have to assume any gap in any timeline is\r\n // reason to stop incrementally tracking notifications and\r\n // reset the timeline.\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n self._registerStateListeners(room);\r\n }\r\n }\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache); // set summary after processing events,\r\n // because it will trigger a name calculation\r\n // which needs the room state to be up to date\r\n\r\n\r\n if (joinObj.summary) {\r\n room.setSummary(joinObj.summary);\r\n } // we deliberately don't add ephemeral events to the timeline\r\n\r\n\r\n room.addEphemeralEvents(ephemeralEvents); // we deliberately don't add accountData to the timeline\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n async function processRoomEvent(e) {\r\n client.emit(\"event\", e);\r\n\r\n if (e.isState() && e.getType() == \"m.room.encryption\" && self.opts.crypto) {\r\n await self.opts.crypto.onCryptoEvent(e);\r\n }\r\n\r\n if (e.isState() && e.getType() === \"im.vector.user_status\") {\r\n let user = client.store.getUser(e.getStateKey());\r\n\r\n if (user) {\r\n user._unstable_updateStatusMessage(e);\r\n } else {\r\n user = createNewUser(client, e.getStateKey());\r\n\r\n user._unstable_updateStatusMessage(e);\r\n\r\n client.store.storeUser(user);\r\n }\r\n }\r\n }\r\n\r\n await utils.promiseMapSeries(stateEvents, processRoomEvent);\r\n await utils.promiseMapSeries(timelineEvents, processRoomEvent);\r\n ephemeralEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"join\");\r\n }); // Handle leaves (e.g. kicked rooms)\r\n\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(leaveObj.account_data);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (leaveObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n timelineEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"leave\");\r\n }); // update the notification timeline, if appropriate.\r\n // we only do this for live events, as otherwise we can't order them sanely\r\n // in the timeline relative to ones paginated in by /notifications.\r\n // XXX: we could fix this by making EventTimeline support chronological\r\n // ordering... but it doesn't, right now.\r\n\r\n if (syncEventData.oldSyncToken && this._notifEvents.length) {\r\n this._notifEvents.sort(function (a, b) {\r\n return a.getTs() - b.getTs();\r\n });\r\n\r\n this._notifEvents.forEach(function (event) {\r\n client.getNotifTimelineSet().addLiveEvent(event);\r\n });\r\n } // Handle device list updates\r\n\r\n\r\n if (data.device_lists) {\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists);\r\n } else {// FIXME if we *don't* have a crypto module, we still need to\r\n // invalidate the device lists. But that would require a\r\n // substantial bit of rework :/.\r\n }\r\n } // Handle one_time_keys_count\r\n\r\n\r\n if (this.opts.crypto && data.device_one_time_keys_count) {\r\n const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0;\r\n this.opts.crypto.updateOneTimeKeyCount(currentCount);\r\n }\r\n\r\n if (this.opts.crypto && data[\"org.matrix.msc2732.device_unused_fallback_key_types\"]) {\r\n // The presence of device_unused_fallback_key_types indicates that the\r\n // server supports fallback keys. If there's no unused\r\n // signed_curve25519 fallback key we need a new one.\r\n const unusedFallbackKeys = data[\"org.matrix.msc2732.device_unused_fallback_key_types\"];\r\n this.opts.crypto.setNeedsNewFallback(unusedFallbackKeys instanceof Array && !unusedFallbackKeys.includes(\"signed_curve25519\"));\r\n }\r\n};\r\n/**\r\n * Starts polling the connectivity check endpoint\r\n * @param {number} delay How long to delay until the first poll.\r\n * defaults to a short, randomised interval (to prevent\r\n * tightlooping if /versions succeeds but /sync etc. fail).\r\n * @return {promise} which resolves once the connection returns\r\n */\r\n\r\n\r\nSyncApi.prototype._startKeepAlives = function (delay) {\r\n if (delay === undefined) {\r\n delay = 2000 + Math.floor(Math.random() * 5000);\r\n }\r\n\r\n if (this._keepAliveTimer !== null) {\r\n clearTimeout(this._keepAliveTimer);\r\n }\r\n\r\n const self = this;\r\n\r\n if (delay > 0) {\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self), delay);\r\n } else {\r\n self._pokeKeepAlive();\r\n }\r\n\r\n if (!this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer = utils.defer();\r\n }\r\n\r\n return this._connectionReturnedDefer.promise;\r\n};\r\n/**\r\n * Make a dummy call to /_matrix/client/versions, to see if the HS is\r\n * reachable.\r\n *\r\n * On failure, schedules a call back to itself. On success, resolves\r\n * this._connectionReturnedDefer.\r\n *\r\n * @param {bool} connDidFail True if a connectivity failure has been detected. Optional.\r\n */\r\n\r\n\r\nSyncApi.prototype._pokeKeepAlive = function (connDidFail) {\r\n if (connDidFail === undefined) connDidFail = false;\r\n const self = this;\r\n\r\n function success() {\r\n clearTimeout(self._keepAliveTimer);\r\n\r\n if (self._connectionReturnedDefer) {\r\n self._connectionReturnedDefer.resolve(connDidFail);\r\n\r\n self._connectionReturnedDefer = null;\r\n }\r\n }\r\n\r\n this.client._http.request(undefined, // callback\r\n \"GET\", \"/_matrix/client/versions\", undefined, // queryParams\r\n undefined, // data\r\n {\r\n prefix: '',\r\n localTimeoutMs: 15 * 1000\r\n }).then(function () {\r\n success();\r\n }, function (err) {\r\n if (err.httpStatus == 400 || err.httpStatus == 404) {\r\n // treat this as a success because the server probably just doesn't\r\n // support /versions: point is, we're getting a response.\r\n // We wait a short time though, just in case somehow the server\r\n // is in a mode where it 400s /versions responses and sync etc.\r\n // responses fail, this will mean we don't hammer in a loop.\r\n self._keepAliveTimer = setTimeout(success, 2000);\r\n } else {\r\n connDidFail = true;\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self, connDidFail), 5000 + Math.floor(Math.random() * 5000)); // A keepalive has failed, so we emit the\r\n // error state (whether or not this is the\r\n // first failure).\r\n // Note we do this after setting the timer:\r\n // this lets the unit tests advance the mock\r\n // clock when they get the error.\r\n\r\n self._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n }\r\n });\r\n};\r\n/**\r\n * @param {Object} groupsSection Groups section object, eg. response.groups.invite\r\n * @param {string} sectionName Which section this is ('invite', 'join' or 'leave')\r\n */\r\n\r\n\r\nSyncApi.prototype._processGroupSyncEntry = function (groupsSection, sectionName) {\r\n // Processes entries from 'groups' section of the sync stream\r\n for (const groupId of Object.keys(groupsSection)) {\r\n const groupInfo = groupsSection[groupId];\r\n let group = this.client.store.getGroup(groupId);\r\n const isBrandNew = group === null;\r\n\r\n if (group === null) {\r\n group = this.createGroup(groupId);\r\n }\r\n\r\n if (groupInfo.profile) {\r\n group.setProfile(groupInfo.profile.name, groupInfo.profile.avatar_url);\r\n }\r\n\r\n if (groupInfo.inviter) {\r\n group.setInviter({\r\n userId: groupInfo.inviter\r\n });\r\n }\r\n\r\n group.setMyMembership(sectionName);\r\n\r\n if (isBrandNew) {\r\n // Now we've filled in all the fields, emit the Group event\r\n this.client.emit(\"Group\", group);\r\n }\r\n }\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @return {Object[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncResponseToRoomArray = function (obj) {\r\n // Maps { roomid: {stuff}, roomid: {stuff} }\r\n // to\r\n // [{stuff+Room+isBrandNewRoom}, {stuff+Room+isBrandNewRoom}]\r\n const client = this.client;\r\n const self = this;\r\n return utils.keys(obj).map(function (roomId) {\r\n const arrObj = obj[roomId];\r\n let room = client.store.getRoom(roomId);\r\n let isBrandNewRoom = false;\r\n\r\n if (!room) {\r\n room = self.createRoom(roomId);\r\n isBrandNewRoom = true;\r\n }\r\n\r\n arrObj.room = room;\r\n arrObj.isBrandNewRoom = isBrandNewRoom;\r\n return arrObj;\r\n });\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @param {Room} room\r\n * @return {MatrixEvent[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncEventsFormat = function (obj, room) {\r\n if (!obj || !utils.isArray(obj.events)) {\r\n return [];\r\n }\r\n\r\n const mapper = this.client.getEventMapper();\r\n return obj.events.map(function (e) {\r\n if (room) {\r\n e.room_id = room.roomId;\r\n }\r\n\r\n return mapper(e);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n */\r\n\r\n\r\nSyncApi.prototype._resolveInvites = function (room) {\r\n if (!room || !this.opts.resolveInvitesToProfiles) {\r\n return;\r\n }\r\n\r\n const client = this.client; // For each invited room member we want to give them a displayname/avatar url\r\n // if they have one (the m.room.member invites don't contain this).\r\n\r\n room.getMembersWithMembership(\"invite\").forEach(function (member) {\r\n if (member._requestedProfileInfo) {\r\n return;\r\n }\r\n\r\n member._requestedProfileInfo = true; // try to get a cached copy first.\r\n\r\n const user = client.getUser(member.userId);\r\n let promise;\r\n\r\n if (user) {\r\n promise = Promise.resolve({\r\n avatar_url: user.avatarUrl,\r\n displayname: user.displayName\r\n });\r\n } else {\r\n promise = client.getProfileInfo(member.userId);\r\n }\r\n\r\n promise.then(function (info) {\r\n // slightly naughty by doctoring the invite event but this means all\r\n // the code paths remain the same between invite/join display name stuff\r\n // which is a worthy trade-off for some minor pollution.\r\n const inviteEvent = member.events.member;\r\n\r\n if (inviteEvent.getContent().membership !== \"invite\") {\r\n // between resolving and now they have since joined, so don't clobber\r\n return;\r\n }\r\n\r\n inviteEvent.getContent().avatar_url = info.avatar_url;\r\n inviteEvent.getContent().displayname = info.displayname; // fire listeners\r\n\r\n member.setMembershipEvent(inviteEvent, room.currentState);\r\n }, function (err) {// OH WELL.\r\n });\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} stateEventList A list of state events. This is the state\r\n * at the *START* of the timeline list if it is supplied.\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processRoomEvents = function (room, stateEventList, timelineEventList, fromCache) {\r\n // If there are no events in the timeline yet, initialise it with\r\n // the given state events\r\n const liveTimeline = room.getLiveTimeline();\r\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\r\n\r\n if (timelineWasEmpty) {\r\n // Passing these events into initialiseState will freeze them, so we need\r\n // to compute and cache the push actions for them now, otherwise sync dies\r\n // with an attempt to assign to read only property.\r\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\r\n // these functions that it shouldn't be. We should probably either store the\r\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\r\n // find some solution where MatrixEvents are immutable but allow for a cache\r\n // field.\r\n for (const ev of stateEventList) {\r\n this.client.getPushActionsForEvent(ev);\r\n }\r\n\r\n liveTimeline.initialiseState(stateEventList);\r\n }\r\n\r\n this._resolveInvites(room); // recalculate the room name at this point as adding events to the timeline\r\n // may make notifications appear which should have the right name.\r\n // XXX: This looks suspect: we'll end up recalculating the room once here\r\n // and then again after adding events (_processSyncResponse calls it after\r\n // calling us) even if no state events were added. It also means that if\r\n // one of the room events in timelineEventList is something that needs\r\n // a recalculation (like m.room.name) we won't recalculate until we've\r\n // finished adding all the events, which will cause the notification to have\r\n // the old room name rather than the new one.\r\n\r\n\r\n room.recalculate(); // If the timeline wasn't empty, we process the state events here: they're\r\n // defined as updates to the state before the start of the timeline, so this\r\n // starts to roll the state forward.\r\n // XXX: That's what we *should* do, but this can happen if we were previously\r\n // peeking in a room, in which case we obviously do *not* want to add the\r\n // state events here onto the end of the timeline. Historically, the js-sdk\r\n // has just set these new state events on the old and new state. This seems\r\n // very wrong because there could be events in the timeline that diverge the\r\n // state, in which case this is going to leave things out of sync. However,\r\n // for now I think it;s best to behave the same as the code has done previously.\r\n\r\n if (!timelineWasEmpty) {\r\n // XXX: As above, don't do this...\r\n //room.addLiveEvents(stateEventList || []);\r\n // Do this instead...\r\n room.oldState.setStateEvents(stateEventList || []);\r\n room.currentState.setStateEvents(stateEventList || []);\r\n } // execute the timeline events. This will continue to diverge the current state\r\n // if the timeline has any state events in it.\r\n // This also needs to be done before running push rules on the events as they need\r\n // to be decorated with sender etc.\r\n\r\n\r\n room.addLiveEvents(timelineEventList || [], null, fromCache);\r\n};\r\n/**\r\n * Takes a list of timelineEvents and adds and adds to _notifEvents\r\n * as appropriate.\r\n * This must be called after the room the events belong to has been stored.\r\n *\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processEventsForNotifs = function (room, timelineEventList) {\r\n // gather our notifications into this._notifEvents\r\n if (this.client.getNotifTimelineSet()) {\r\n for (let i = 0; i < timelineEventList.length; i++) {\r\n const pushActions = this.client.getPushActionsForEvent(timelineEventList[i]);\r\n\r\n if (pushActions && pushActions.notify && pushActions.tweaks && pushActions.tweaks.highlight) {\r\n this._notifEvents.push(timelineEventList[i]);\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * @return {string}\r\n */\r\n\r\n\r\nSyncApi.prototype._getGuestFilter = function () {\r\n const guestRooms = this.client._guestRooms; // FIXME: horrible gut-wrenching\r\n\r\n if (!guestRooms) {\r\n return \"{}\";\r\n } // we just need to specify the filter inline if we're a guest because guests\r\n // can't create filters.\r\n\r\n\r\n return JSON.stringify({\r\n room: {\r\n timeline: {\r\n limit: 20\r\n }\r\n }\r\n });\r\n};\r\n/**\r\n * Sets the sync state and emits an event to say so\r\n * @param {String} newState The new state string\r\n * @param {Object} data Object of additional data to emit in the event\r\n */\r\n\r\n\r\nSyncApi.prototype._updateSyncState = function (newState, data) {\r\n const old = this._syncState;\r\n this._syncState = newState;\r\n this._syncStateData = data;\r\n this.client.emit(\"sync\", this._syncState, old, data);\r\n};\r\n/**\r\n * Event handler for the 'online' event\r\n * This event is generally unreliable and precise behaviour\r\n * varies between browsers, so we poll for connectivity too,\r\n * but this might help us reconnect a little faster.\r\n */\r\n\r\n\r\nSyncApi.prototype._onOnline = function () {\r\n debuglog(\"Browser thinks we are back online\");\r\n\r\n this._startKeepAlives(0);\r\n};\r\n\r\nfunction createNewUser(client, userId) {\r\n const user = new _user.User(userId);\r\n client.reEmitter.reEmit(user, [\"User.avatarUrl\", \"User.displayName\", \"User.presence\", \"User.currentlyActive\", \"User.lastPresenceTs\"]);\r\n return user;\r\n}","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\"","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".topheader[data-v-62a1ab6a]{top:0;z-index:999}.newChat[data-v-62a1ab6a] #maincontent .headerSpacer,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapper,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapperOvf{overflow:visible!important}.newChat.minimized.active[data-v-62a1ab6a] #maincontent .desktopList{display:none}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"br[data-v-ba5ac396]{content:\\\"\\\"}.sname[data-v-ba5ac396]{font-weight:700}.listPreview[data-v-ba5ac396]{display:flex;align-items:center}.statusWrapper[data-v-ba5ac396]{padding-left:.5em}.statusWrapper .my[data-v-ba5ac396]{font-size:.6em;opacity:.5}.previewMessage[data-v-ba5ac396]{min-height:25px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar colorString = require('color-string');\nvar convert = require('color-convert');\n\nvar _slice = [].slice;\n\nvar skippedModels = [\n\t// to be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// shouldn't really be in color-convert either...\n\t'hex'\n];\n\nvar hashedModelKeys = {};\nObject.keys(convert).forEach(function (model) {\n\thashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;\n});\n\nvar limiters = {};\n\nfunction Color(obj, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tvar i;\n\tvar channels;\n\n\tif (obj == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (obj instanceof Color) {\n\t\tthis.model = obj.model;\n\t\tthis.color = obj.color.slice();\n\t\tthis.valpha = obj.valpha;\n\t} else if (typeof obj === 'string') {\n\t\tvar result = colorString.get(obj);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + obj);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (obj.length) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tvar newArr = _slice.call(obj, 0, channels);\n\t\tthis.color = zeroArray(newArr, channels);\n\t\tthis.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;\n\t} else if (typeof obj === 'number') {\n\t\t// this is always RGB - can be converted later on.\n\t\tobj &= 0xFFFFFF;\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(obj >> 16) & 0xFF,\n\t\t\t(obj >> 8) & 0xFF,\n\t\t\tobj & 0xFF\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tvar keys = Object.keys(obj);\n\t\tif ('alpha' in obj) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;\n\t\t}\n\n\t\tvar hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(obj));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tvar labels = convert[this.model].labels;\n\t\tvar color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(obj[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tvar limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString: function () {\n\t\treturn this.string();\n\t},\n\n\ttoJSON: function () {\n\t\treturn this[this.model]();\n\t},\n\n\tstring: function (places) {\n\t\tvar self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to[self.model](args);\n\t},\n\n\tpercentString: function (places) {\n\t\tvar self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to.rgb.percent(args);\n\t},\n\n\tarray: function () {\n\t\treturn this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);\n\t},\n\n\tobject: function () {\n\t\tvar result = {};\n\t\tvar channels = convert[this.model].channels;\n\t\tvar labels = convert[this.model].labels;\n\n\t\tfor (var i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray: function () {\n\t\tvar rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject: function () {\n\t\tvar rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround: function (places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);\n\t},\n\n\talpha: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(100)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(100)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn colorString.to.hex(this.rgb().round().color);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.rgb().color;\n\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.rgb().color;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight: function () {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = this.rgb();\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\t\treturn rgb;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale: function () {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar rgb = this.rgb().color;\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(val, val, val);\n\t},\n\n\tfade: function (ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer: function (ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.hsl();\n\t\tvar hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix: function (mixinColor, weight) {\n\t\t// ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\t\tvar color1 = mixinColor.rgb();\n\t\tvar color2 = this.rgb();\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t}\n};\n\n// model conversion methods and static constructors\nObject.keys(convert).forEach(function (model) {\n\tif (skippedModels.indexOf(model) !== -1) {\n\t\treturn;\n\t}\n\n\tvar channels = convert[model].channels;\n\n\t// conversion methods\n\tColor.prototype[model] = function () {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments.length) {\n\t\t\treturn new Color(arguments, model);\n\t\t}\n\n\t\tvar newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;\n\t\treturn new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (color) {\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(_slice.call(arguments), channels);\n\t\t}\n\t\treturn new Color(color, model);\n\t};\n});\n\nfunction roundTo(num, places) {\n\treturn Number(num.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (num) {\n\t\treturn roundTo(num, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tmodel.forEach(function (m) {\n\t\t(limiters[m] || (limiters[m] = []))[channel] = modifier;\n\t});\n\n\tmodel = model[0];\n\n\treturn function (val) {\n\t\tvar result;\n\n\t\tif (arguments.length) {\n\t\t\tif (modifier) {\n\t\t\t\tval = modifier(val);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = val;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(val) {\n\treturn Array.isArray(val) ? val : [val];\n}\n\nfunction zeroArray(arr, length) {\n\tfor (var i = 0; i < length; i++) {\n\t\tif (typeof arr[i] !== 'number') {\n\t\t\tarr[i] = 0;\n\t\t}\n\t}\n\n\treturn arr;\n}\n\nmodule.exports = Color;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__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 (_) 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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar axios_1 = __importDefault(require(\"axios\"));\nvar CancelToken = axios_1.default.CancelToken;\n/**\n * Axios request with timeout throw\n */\nfunction axiosRequest(config) {\n return __awaiter(this, void 0, void 0, function () {\n var timeout, cancel;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n timeout = config.timeout;\n if (timeout) {\n config.cancelToken = new CancelToken(function (c) { return cancel = c; });\n setTimeout(function () {\n cancel('timeout cancel', { timeout: timeout });\n }, timeout);\n }\n return [4 /*yield*/, axios_1.default(config)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexports.default = axiosRequest;\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryStore = MemoryStore;\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link MemoryStore} for the public class.\r\n * @module store/memory\r\n */\r\nfunction isValidFilterId(filterId) {\r\n const isValidStr = typeof filterId === \"string\" && !!filterId && filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\r\n filterId !== \"null\";\r\n return isValidStr || typeof filterId === \"number\";\r\n}\r\n/**\r\n * Construct a new in-memory data store for the Matrix Client.\r\n * @constructor\r\n * @param {Object=} opts Config options\r\n * @param {LocalStorage} opts.localStorage The local storage instance to persist\r\n * some forms of data such as tokens. Rooms will NOT be stored.\r\n */\r\n\r\n\r\nfunction MemoryStore(opts) {\r\n opts = opts || {};\r\n this.rooms = {// roomId: Room\r\n };\r\n this.groups = {// groupId: Group\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n this.localStorage = opts.localStorage;\r\n this._oobMembers = {// roomId: [member events]\r\n };\r\n this._clientOptions = {};\r\n}\r\n\r\nMemoryStore.prototype = {\r\n /**\r\n * Retrieve the token to stream from.\r\n * @return {string} The token or null.\r\n */\r\n getSyncToken: function () {\r\n return this.syncToken;\r\n },\r\n\r\n /** @return {Promise} whether or not the database was newly created in this session. */\r\n isNewlyCreated: function () {\r\n return Promise.resolve(true);\r\n },\r\n\r\n /**\r\n * Set the token to stream from.\r\n * @param {string} token The token to stream from.\r\n */\r\n setSyncToken: function (token) {\r\n this.syncToken = token;\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Group} group The group to be stored\r\n */\r\n storeGroup: function (group) {\r\n this.groups[group.groupId] = group;\r\n },\r\n\r\n /**\r\n * Retrieve a group by its group ID.\r\n * @param {string} groupId The group ID.\r\n * @return {Group} The group or null.\r\n */\r\n getGroup: function (groupId) {\r\n return this.groups[groupId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known groups.\r\n * @return {Group[]} A list of groups, which may be empty.\r\n */\r\n getGroups: function () {\r\n return utils.values(this.groups);\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Room} room The room to be stored. All properties must be stored.\r\n */\r\n storeRoom: function (room) {\r\n this.rooms[room.roomId] = room; // add listeners for room member changes so we can keep the room member\r\n // map up-to-date.\r\n\r\n room.currentState.on(\"RoomState.members\", this._onRoomMember.bind(this)); // add existing members\r\n\r\n const self = this;\r\n room.currentState.getMembers().forEach(function (m) {\r\n self._onRoomMember(null, room.currentState, m);\r\n });\r\n },\r\n\r\n /**\r\n * Called when a room member in a room being tracked by this store has been\r\n * updated.\r\n * @param {MatrixEvent} event\r\n * @param {RoomState} state\r\n * @param {RoomMember} member\r\n */\r\n _onRoomMember: function (event, state, member) {\r\n if (member.membership === \"invite\") {\r\n // We do NOT add invited members because people love to typo user IDs\r\n // which would then show up in these lists (!)\r\n return;\r\n }\r\n\r\n const user = this.users[member.userId] || new _user.User(member.userId);\r\n\r\n if (member.name) {\r\n user.setDisplayName(member.name);\r\n\r\n if (member.events.member) {\r\n user.setRawDisplayName(member.events.member.getDirectionalContent().displayname);\r\n }\r\n }\r\n\r\n if (member.events.member && member.events.member.getContent().avatar_url) {\r\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\r\n }\r\n\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a room by its' room ID.\r\n * @param {string} roomId The room ID.\r\n * @return {Room} The room or null.\r\n */\r\n getRoom: function (roomId) {\r\n return this.rooms[roomId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known rooms.\r\n * @return {Room[]} A list of rooms, which may be empty.\r\n */\r\n getRooms: function () {\r\n return utils.values(this.rooms);\r\n },\r\n\r\n /**\r\n * Permanently delete a room.\r\n * @param {string} roomId\r\n */\r\n removeRoom: function (roomId) {\r\n if (this.rooms[roomId]) {\r\n this.rooms[roomId].removeListener(\"RoomState.members\", this._onRoomMember);\r\n }\r\n\r\n delete this.rooms[roomId];\r\n },\r\n\r\n /**\r\n * Retrieve a summary of all the rooms.\r\n * @return {RoomSummary[]} A summary of each room.\r\n */\r\n getRoomSummaries: function () {\r\n return utils.map(utils.values(this.rooms), function (room) {\r\n return room.summary;\r\n });\r\n },\r\n\r\n /**\r\n * Store a User.\r\n * @param {User} user The user to store.\r\n */\r\n storeUser: function (user) {\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a User by its' user ID.\r\n * @param {string} userId The user ID.\r\n * @return {User} The user or null.\r\n */\r\n getUser: function (userId) {\r\n return this.users[userId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known users.\r\n * @return {User[]} A list of users, which may be empty.\r\n */\r\n getUsers: function () {\r\n return utils.values(this.users);\r\n },\r\n\r\n /**\r\n * Retrieve scrollback for this room.\r\n * @param {Room} room The matrix room\r\n * @param {integer} limit The max number of old events to retrieve.\r\n * @return {Array} An array of objects which will be at most 'limit'\r\n * length and at least 0. The objects are the raw event JSON.\r\n */\r\n scrollback: function (room, limit) {\r\n return [];\r\n },\r\n\r\n /**\r\n * Store events for a room. The events have already been added to the timeline\r\n * @param {Room} room The room to store events for.\r\n * @param {Array} events The events to store.\r\n * @param {string} token The token associated with these events.\r\n * @param {boolean} toStart True if these are paginated results.\r\n */\r\n storeEvents: function (room, events, token, toStart) {// no-op because they've already been added to the room instance.\r\n },\r\n\r\n /**\r\n * Store a filter.\r\n * @param {Filter} filter\r\n */\r\n storeFilter: function (filter) {\r\n if (!filter) {\r\n return;\r\n }\r\n\r\n if (!this.filters[filter.userId]) {\r\n this.filters[filter.userId] = {};\r\n }\r\n\r\n this.filters[filter.userId][filter.filterId] = filter;\r\n },\r\n\r\n /**\r\n * Retrieve a filter.\r\n * @param {string} userId\r\n * @param {string} filterId\r\n * @return {?Filter} A filter or null.\r\n */\r\n getFilter: function (userId, filterId) {\r\n if (!this.filters[userId] || !this.filters[userId][filterId]) {\r\n return null;\r\n }\r\n\r\n return this.filters[userId][filterId];\r\n },\r\n\r\n /**\r\n * Retrieve a filter ID with the given name.\r\n * @param {string} filterName The filter name.\r\n * @return {?string} The filter ID or null.\r\n */\r\n getFilterIdByName: function (filterName) {\r\n if (!this.localStorage) {\r\n return null;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName; // XXX Storage.getItem doesn't throw ...\r\n // or are we using something different\r\n // than window.localStorage in some cases\r\n // that does throw?\r\n // that would be very naughty\r\n\r\n try {\r\n const value = this.localStorage.getItem(key);\r\n\r\n if (isValidFilterId(value)) {\r\n return value;\r\n }\r\n } catch (e) {}\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Set a filter name to ID mapping.\r\n * @param {string} filterName\r\n * @param {string} filterId\r\n */\r\n setFilterIdByName: function (filterName, filterId) {\r\n if (!this.localStorage) {\r\n return;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName;\r\n\r\n try {\r\n if (isValidFilterId(filterId)) {\r\n this.localStorage.setItem(key, filterId);\r\n } else {\r\n this.localStorage.removeItem(key);\r\n }\r\n } catch (e) {}\r\n },\r\n\r\n /**\r\n * Store user-scoped account data events.\r\n * N.B. that account data only allows a single event per type, so multiple\r\n * events with the same type will replace each other.\r\n * @param {Array} events The events to store.\r\n */\r\n storeAccountDataEvents: function (events) {\r\n const self = this;\r\n events.forEach(function (event) {\r\n self.accountData[event.getType()] = event;\r\n });\r\n },\r\n\r\n /**\r\n * Get account data event by event type\r\n * @param {string} eventType The event type being queried\r\n * @return {?MatrixEvent} the user account_data event of given type, if any\r\n */\r\n getAccountData: function (eventType) {\r\n return this.accountData[eventType];\r\n },\r\n\r\n /**\r\n * setSyncData does nothing as there is no backing data store.\r\n *\r\n * @param {Object} syncData The sync data\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n setSyncData: function (syncData) {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * We never want to save becase we have nothing to save to.\r\n *\r\n * @return {boolean} If the store wants to save\r\n */\r\n wantsSave: function () {\r\n return false;\r\n },\r\n\r\n /**\r\n * Save does nothing as there is no backing data store.\r\n * @param {bool} force True to force a save (but the memory\r\n * store still can't save anything)\r\n */\r\n save: function (force) {},\r\n\r\n /**\r\n * Startup does nothing as this store doesn't require starting up.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n startup: function () {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n getSavedSync: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n getSavedSyncToken: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * Delete all data from this store.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n deleteAllData: function () {\r\n this.rooms = {// roomId: Room\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n getOutOfBandMembers: function (roomId) {\r\n return Promise.resolve(this._oobMembers[roomId] || null);\r\n },\r\n\r\n /**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n setOutOfBandMembers: function (roomId, membershipEvents) {\r\n this._oobMembers[roomId] = membershipEvents;\r\n return Promise.resolve();\r\n },\r\n clearOutOfBandMembers: function () {\r\n this._oobMembers = {};\r\n return Promise.resolve();\r\n },\r\n getClientOptions: function () {\r\n return Promise.resolve(this._clientOptions);\r\n },\r\n storeClientOptions: function (options) {\r\n this._clientOptions = Object.assign({}, options);\r\n return Promise.resolve();\r\n }\r\n};","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"wrapper table\"},[_c('div',{staticClass:\"filecontent\"},[_c('div',{staticClass:\"name\"},[_c('span',[_vm._v(_vm._s(_vm.file.name))])]),_c('div',{staticClass:\"size\"},[_c('span',[_vm._v(_vm._s(_vm.humanReadableSize(_vm.file.size)))])]),(!_vm.encryptedData)?_c('div',{staticClass:\"download\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('button',{staticClass:\"button small rounded\"},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]):_c('div',{staticClass:\"download\"},[_c('button',{staticClass:\"button small rounded\",on:{\"click\":_vm.download}},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]),_c('div',{staticClass:\"icon\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('i',{staticClass:\"fas fa-file-download\"})])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f8b05de&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0f8b05de&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0f8b05de\",\n null\n ,true\n)\n\nexport default component.exports","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".m-message-container{position:fixed;z-index:1010;pointer-events:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;padding:15px}.m-message-container.is-top-center,.m-message-container.is-top-left,.m-message-container.is-top-right{width:100%;top:0;left:0}.m-message-container.is-top-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-top-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-top-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.is-center{width:100%;height:100%;left:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-message-container.is-bottom-center,.m-message-container.is-bottom-left,.m-message-container.is-bottom-right{bottom:0;left:0;width:100%;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.m-message-container.is-bottom-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-bottom-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-bottom-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.has-mask{background-color:hsla(0,0%,100%,.5);width:100%;height:100%;pointer-events:all}.m-message-wrapper{display:inline-block;max-width:500px}.m-message-wrapper+.m-message-wrapper{margin-top:15px}.m-message-wrapper:after,.m-message-wrapper:before{content:\\\"\\\";clear:both;display:table}.m-message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 16px;font-size:14px;overflow:hidden;border-radius:4px;-webkit-box-shadow:0 1px 8px rgba(0,0,0,.15);box-shadow:0 1px 8px rgba(0,0,0,.15);color:rgba(0,0,0,.65);background:hsla(0,0%,100%,.95);pointer-events:all;position:relative}.m-message,.m-message-icons{-webkit-box-sizing:border-box;box-sizing:border-box}.m-message-icons{float:left;margin-right:10px}.m-message--title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-message-content{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto;width:100%}.m-message--description{line-height:1.6;color:#777}.m-message--title+.m-message--description{margin-top:5px}.m-message--icon{width:25px;height:25px;vertical-align:middle;display:inline-block;border-radius:50%}.m-message--control{position:relative;height:100%;-ms-flex-item-align:start;align-self:flex-start;white-space:nowrap;margin-right:-5px;margin-left:10px}.m-message--button{border:none;outline:none;background:none;cursor:pointer;font-size:15px;color:#646464;font-weight:600;padding:0;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle}.m-message--button:hover{color:#f56c6c}.m-message--arrow-down.is-collapsed{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.m-message-fade-enter-active{-webkit-animation:m-message-fade-in-down .3s;animation:m-message-fade-in-down .3s}.m-message-fade-leave-active{-webkit-animation:m-message-fade-out .3s;animation:m-message-fade-out .3s}@-webkit-keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}@keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","\"use strict\";\n// Copyright (C) 2017 Tony Arcieri\n// MIT License. See LICENSE file for details.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst block_1 = require(\"../../internals/block\");\n/**\n * WebCrypto-based implementation of the AES block cipher.\n *\n * This implementation (ab)uses AES-CBC mode to implement AES-ECB. This is\n * likely to be rather slow, as it requires an async call per block, and\n * discards half the buffer.\n *\n * In theory it should be constant time due to the use of WebCrypto (provided\n * the browser's implementation is constant time), but it could probably benefit\n * from some clever optimization work, or improvements to the WebCrypto API.\n *\n * Some WebCrypto implementations (e.g. node-webcrypto-ossl) support ECB mode\n * natively, so we could take advantage of that to potentially encrypt multiple\n * blocks in a single invocation.\n *\n * Key size: 16 or 32 bytes, block size: 16 bytes.\n */\nclass WebCryptoAes {\n constructor(_crypto, _key) {\n this._crypto = _crypto;\n this._key = _key;\n // An initialization vector of all zeros, exposing the raw AES function\n this._iv = new block_1.default();\n this._emptyPromise = Promise.resolve(this);\n }\n /**\n * Create a new WebCryptoAes instance\n *\n * @param {Crypto} crypto - the Web Cryptography provider\n * @param {Uint8Array} keyData - the AES secret key\n * @returns {Promise}\n */\n encryptBlock(block) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = { name: \"AES-CBC\", iv: this._iv.data };\n const ctBlock = yield this._crypto.subtle.encrypt(params, this._key, block.data);\n // TODO: a more efficient way to do in-place encryption?\n block.data.set(new Uint8Array(ctBlock, 0, block_1.default.SIZE));\n return this._emptyPromise;\n });\n }\n}\nexports.default = WebCryptoAes;\n","\"use strict\";\n/** Type which represents AES blocks */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst constant_time_1 = require(\"./constant-time\");\nconst wipe_1 = require(\"./wipe\");\n/** An AES block (128-bits) */\nclass Block {\n constructor() {\n this.data = new Uint8Array(Block.SIZE);\n }\n /**\n * Clear the given array by setting its values to zero.\n *\n * WARNING: The fact that it sets bytes to zero can be relied on.\n *\n * There is no guarantee that this function makes data disappear from memory,\n * as runtime implementation can, for example, have copying garbage collector\n * that will make copies of sensitive data before we wipe it. Or that an\n * operating system will write our data to swap or sleep image. Another thing\n * is that an optimizing compiler can remove calls to this function or make it\n * no-op. There's nothing we can do with it, so we just do our best and hope\n * that everything will be okay and good will triumph over evil.\n */\n clear() {\n wipe_1.wipe(this.data);\n }\n /**\n * Make a copy of this block, returning a new block\n */\n clone() {\n const ret = new Block();\n ret.copy(this);\n return ret;\n }\n /** Copy the contents of another block into this one */\n copy(other) {\n this.data.set(other.data);\n }\n /**\n * Double a value over GF(2^128):\n *\n * a<<1 if firstbit(a)=0\n * (a<<1) ⊕ 0¹²⁰10000111 if firstbit(a)=1\n */\n dbl() {\n let carry = 0;\n for (let i = Block.SIZE - 1; i >= 0; i--) {\n const b = (this.data[i] >>> 7) & 0xff;\n this.data[i] = (this.data[i] << 1) | carry;\n carry = b;\n }\n this.data[Block.SIZE - 1] ^= constant_time_1.select(carry, Block.R, 0);\n carry = 0;\n }\n}\n/** Size of a block as used by the AES cipher */\nBlock.SIZE = 16;\n/** Minimal irreducible polynomial for a 128-bit block size */\nBlock.R = 0x87;\nexports.default = Block;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chats.vue?vue&type=template&id=62a1ab6a&scoped=true&\"\nimport script from \"./chats.vue?vue&type=script&lang=js&\"\nexport * from \"./chats.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"62a1ab6a\",\n null\n ,true\n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7ed73c7c&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7ed73c7c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7ed73c7c\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./name.vue?vue&type=template&id=72a9c575&scoped=true&\"\nimport script from \"./name.vue?vue&type=script&lang=js&\"\nexport * from \"./name.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"72a9c575\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".previewWrapper[data-v-691bf714]{height:60px;position:absolute;top:0;width:100%;display:flex;align-items:center;justify-content:flex-start;padding:0;border-bottom:1px solid rgb(var(--background-main))}.previewWrapper .previewContact[data-v-691bf714],.previewWrapper .previewContactSelect[data-v-691bf714]{width:100%}.previewWrapper .previewBox[data-v-691bf714]{width:100%;display:flex;justify-content:space-between;align-items:center}.previewWrapper .previewBox .previewWrapper[data-v-691bf714]{flex-grow:1;width:100%}.previewWrapper .checkBox[data-v-691bf714]{text-align:center;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList[data-v-691bf714]{margin-bottom:8px}.contactList .title[data-v-691bf714]{padding:0 .5em}.contactList.minimized .title[data-v-691bf714]{display:none}.contactList.minimized .previewWrapper[data-v-691bf714]{padding:.5em 0;border-bottom:0;cursor:pointer}.contactList.minimized .previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList.minimized .previewWrapper[data-v-691bf714] .previewWrapper{padding:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".matrin[data-v-9d2b1700]{margin:0 auto 0 0!important}.msgAction[data-v-9d2b1700]{position:absolute}.msgAction[data-v-9d2b1700]:before{content:\\\"\\\";display:block;width:100%;height:100%;position:fixed;z-index:10;opacity:.9;left:0;right:0;top:0;bottom:0}.msgAction .contentAction[data-v-9d2b1700],.msgAction[data-v-9d2b1700]:before{background-color:rgb(var(--background-main))}.msgAction .contentAction[data-v-9d2b1700]{width:180px;position:relative;z-index:300;border:.1em solid rgb(var(--neutral-grad-0));border-radius:.8em;margin:.6em 0 0 auto}.msgAction .contentAction ul[data-v-9d2b1700]{padding:0;list-style:none;margin:0;display:block;width:100%;height:100%}.msgAction .contentAction ul li[data-v-9d2b1700]{display:flex;justify-content:space-between;padding:.2em .8em;align-items:center;border-top:.1em solid rgb(var(--neutral-grad-1));font-size:1em}.msgAction .contentAction ul li[data-v-9d2b1700]:first-child{border:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".outer-div[data-v-e4f39dca]{line-height:inherit;border-radius:50%}.dropDownIcon[data-v-e4f39dca]{width:35px;height:35px;line-height:35px}.dropDownIcon i[data-v-e4f39dca]{line-height:35px!important}.menuwrapper[data-v-e4f39dca]{padding-left:1em;padding-right:1em;padding-bottom:1em;position:absolute;z-index:100;bottom:0;left:0;right:0}.menuwrapper[data-v-e4f39dca] .items{max-height:500px;overflow-y:auto;border-radius:3px;padding-left:.5em;padding-right:.5em;padding-bottom:.5em}.dropdown[data-v-e4f39dca]{z-index:10000;position:absolute;width:100%;right:0;height:auto;color:rgb(var(--text-color));transition:.3s;bottom:-100em;top:100em}.dropdown .backgr[data-v-e4f39dca]{background:rgba(var(--background-total-theme),.15);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);position:fixed;z-index:100;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}.dropdown.visible[data-v-e4f39dca]{bottom:0;top:0}.dropdown.visible .backgr[data-v-e4f39dca]{opacity:1}.dropdown[data-v-e4f39dca] .contentWrapper{margin-top:.25em;border-radius:10px;overflow:hidden}.dropdown .contentWrapper[data-v-e4f39dca],.dropdown[data-v-e4f39dca] .contentWrapper{border-top:1px solid rgba(var(--neutral-grad-1),.5);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .cancelWrapper .menu-item[data-v-e4f39dca]{margin-top:0;box-shadow:none;color:rgb(var(--neutral-grad-3));box-shadow:0 5px 5px -3px rgba(var(--color-shadow-base),.4)}.dropdown .menu-item[data-v-e4f39dca]{padding:.5em;background:rgb(var(--background-total-theme));color:rgb(var(--neutral-grad-3));line-height:44px;margin-top:.25em;display:flex;border-radius:10px;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .menu-item .title[data-v-e4f39dca]{flex-grow:2;padding-right:44px;text-align:center}.dropdown .menu-item .iconWrapper[data-v-e4f39dca]{width:44px;text-align:center}.dropdown .blocker[data-v-e4f39dca]{position:fixed;top:0;left:0;bottom:0;right:0;content:\\\" \\\"}.cancelWrapper[data-v-e4f39dca]{border-radius:3px;padding-left:.5em;padding-right:.5em;color:rgb(var(--neutral-grad-3))}.small[data-v-e4f39dca]{font-size:.85em}.outer-div.mobile .menuwrapper[data-v-e4f39dca]{position:fixed}.outer-div.minimized[data-v-e4f39dca]{position:static}.outer-div.minimized .backgr[data-v-e4f39dca]{border-radius:4px;height:1000px;bottom:0;top:auto;background:transparent;position:absolute}.outer-div.minimized .dropdown[data-v-e4f39dca]{z-index:10000;right:0}.outer-div.minimized .menuwrapper[data-v-e4f39dca]{border-radius:4px;padding-top:.5em}.outer-div.minimized .menuwrapper[data-v-e4f39dca] .menu-item{margin-top:.25em;border-radius:5px;background:rgba(var(--background-total-theme),.95)}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nmodule.exports = Readable;\n/**/\n\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n/**/\n\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\n\n\nvar Stream = require('./internal/streams/stream');\n/**/\n\n\nvar Buffer = require('buffer').Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n\nvar debugUtil = require('util');\n\nvar debug;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\n\nvar BufferList = require('./internal/streams/buffer_list');\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.\n\n\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\n\nrequire('inherits')(Readable, Stream);\n\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')\n\n this.autoDestroy = !!options.autoDestroy; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n } // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n\n\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n\n return er;\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8\n\n this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:\n\n var p = this._readableState.buffer.head;\n var content = '';\n\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n\n this._readableState.buffer.clear();\n\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n}; // Don't raise the hwm > 1GB\n\n\nvar MAX_HWM = 0x40000000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true;\n\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\n\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n } // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n\n\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused\n\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true; // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume'); // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n\n state.paused = false;\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n\n if (!state.reading) {\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n this._readableState.paused = true;\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {\n ;\n }\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n\n return createReadableStreamAsyncIterator(this);\n };\n}\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n}); // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.\n\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\n\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n\n return from(Readable, iterable, opts);\n };\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","module.exports = require('./lib/_stream_writable.js');\n","export * from \"-!../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst aes_1 = require(\"./polyfill/aes\");\nconst aes_ctr_1 = require(\"./polyfill/aes_ctr\");\n/**\n * Pure JavaScript cryptography implementations\n *\n * WARNING: Not constant time! May leak keys or have other security issues.\n */\nclass PolyfillCryptoProvider {\n constructor() {\n // This class doesn't do anything, it just signals that polyfill impls should be used\n }\n importBlockCipherKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_1.default(keyData);\n });\n }\n importCTRKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_ctr_1.default(new aes_1.default(keyData));\n });\n }\n}\nexports.PolyfillCryptoProvider = PolyfillCryptoProvider;\n","// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./many.vue?vue&type=template&id=71d5e826&scoped=true&\"\nimport script from \"./many.vue?vue&type=script&lang=js&\"\nexport * from \"./many.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./many.vue?vue&type=style&index=0&id=71d5e826&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"71d5e826\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.IndexedDBStore = IndexedDBStore;\r\n\r\nvar _memory = require(\"./memory\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _indexeddbLocalBackend = require(\"./indexeddb-local-backend.js\");\r\n\r\nvar _indexeddbRemoteBackend = require(\"./indexeddb-remote-backend.js\");\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* eslint-disable @babel/no-invalid-this */\r\n\r\n/**\r\n * This is an internal module. See {@link IndexedDBStore} for the public class.\r\n * @module store/indexeddb\r\n */\r\n// If this value is too small we'll be writing very often which will cause\r\n// noticable stop-the-world pauses. If this value is too big we'll be writing\r\n// so infrequently that the /sync size gets bigger on reload. Writing more\r\n// often does not affect the length of the pause since the entire /sync\r\n// response is persisted each time.\r\nconst WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes\r\n\r\n/**\r\n * Construct a new Indexed Database store, which extends MemoryStore.\r\n *\r\n * This store functions like a MemoryStore except it periodically persists\r\n * the contents of the store to an IndexedDB backend.\r\n *\r\n * All data is still kept in-memory but can be loaded from disk by calling\r\n * startup(). This can make startup times quicker as a complete\r\n * sync from the server is not required. This does not reduce memory usage as all\r\n * the data is eagerly fetched when startup() is called.\r\n *
\r\n * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };\r\n * let store = new IndexedDBStore(opts);\r\n * await store.startup(); // load from indexed db\r\n * let client = sdk.createClient({\r\n *     store: store,\r\n * });\r\n * client.startClient();\r\n * client.on(\"sync\", function(state, prevState, data) {\r\n *     if (state === \"PREPARED\") {\r\n *         console.log(\"Started up, now with go faster stripes!\");\r\n *     }\r\n * });\r\n * 
\r\n *\r\n * @constructor\r\n * @extends MemoryStore\r\n * @param {Object} opts Options object.\r\n * @param {Object} opts.indexedDB The Indexed DB interface e.g.\r\n * window.indexedDB\r\n * @param {string=} opts.dbName Optional database name. The same name must be used\r\n * to open the same database.\r\n * @param {string=} opts.workerScript Optional URL to a script to invoke a web\r\n * worker with to run IndexedDB queries on the web worker. The IndexedDbStoreWorker\r\n * class is provided for this purpose and requires the application to provide a\r\n * trivial wrapper script around it.\r\n * @param {Object=} opts.workerApi The webWorker API object. If omitted, the global Worker\r\n * object will be used if it exists.\r\n * @prop {IndexedDBStoreBackend} backend The backend instance. Call through to\r\n * this API if you need to perform specific indexeddb actions like deleting the\r\n * database.\r\n */\r\n\r\nfunction IndexedDBStore(opts) {\r\n _memory.MemoryStore.call(this, opts);\r\n\r\n if (!opts.indexedDB) {\r\n throw new Error('Missing required option: indexedDB');\r\n }\r\n\r\n if (opts.workerScript) {\r\n // try & find a webworker-compatible API\r\n let workerApi = opts.workerApi;\r\n\r\n if (!workerApi) {\r\n // default to the global Worker object (which is where it in a browser)\r\n workerApi = global.Worker;\r\n }\r\n\r\n this.backend = new _indexeddbRemoteBackend.RemoteIndexedDBStoreBackend(opts.workerScript, opts.dbName, workerApi);\r\n } else {\r\n this.backend = new _indexeddbLocalBackend.LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);\r\n }\r\n\r\n this.startedUp = false;\r\n this._syncTs = 0; // Records the last-modified-time of each user at the last point we saved\r\n // the database, such that we can derive the set if users that have been\r\n // modified since we last saved.\r\n\r\n this._userModifiedMap = {// user_id : timestamp\r\n };\r\n}\r\n\r\nutils.inherits(IndexedDBStore, _memory.MemoryStore);\r\nutils.extend(IndexedDBStore.prototype, _events.EventEmitter.prototype);\r\n\r\nIndexedDBStore.exists = function (indexedDB, dbName) {\r\n return _indexeddbLocalBackend.LocalIndexedDBStoreBackend.exists(indexedDB, dbName);\r\n};\r\n/**\r\n * @return {Promise} Resolved when loaded from indexed db.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.startup = function () {\r\n if (this.startedUp) {\r\n _logger.logger.log(`IndexedDBStore.startup: already started`);\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n _logger.logger.log(`IndexedDBStore.startup: connecting to backend`);\r\n\r\n return this.backend.connect().then(() => {\r\n _logger.logger.log(`IndexedDBStore.startup: loading presence events`);\r\n\r\n return this.backend.getUserPresenceEvents();\r\n }).then(userPresenceEvents => {\r\n _logger.logger.log(`IndexedDBStore.startup: processing presence events`);\r\n\r\n userPresenceEvents.forEach(([userId, rawEvent]) => {\r\n const u = new _user.User(userId);\r\n\r\n if (rawEvent) {\r\n u.setPresenceEvent(new _event.MatrixEvent(rawEvent));\r\n }\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n this.storeUser(u);\r\n });\r\n });\r\n};\r\n/**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.getSavedSync = degradable(function () {\r\n return this.backend.getSavedSync();\r\n}, \"getSavedSync\");\r\n/** @return {Promise} whether or not the database was newly created in this session. */\r\n\r\nIndexedDBStore.prototype.isNewlyCreated = degradable(function () {\r\n return this.backend.isNewlyCreated();\r\n}, \"isNewlyCreated\");\r\n/**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n\r\nIndexedDBStore.prototype.getSavedSyncToken = degradable(function () {\r\n return this.backend.getNextBatchToken();\r\n}, \"getSavedSyncToken\"),\r\n/**\r\n * Delete all data from this store.\r\n * @return {Promise} Resolves if the data was deleted from the database.\r\n */\r\nIndexedDBStore.prototype.deleteAllData = degradable(function () {\r\n _memory.MemoryStore.prototype.deleteAllData.call(this);\r\n\r\n return this.backend.clearDatabase().then(() => {\r\n _logger.logger.log(\"Deleted indexeddb data.\");\r\n }, err => {\r\n _logger.logger.error(`Failed to delete indexeddb data: ${err}`);\r\n\r\n throw err;\r\n });\r\n});\r\n/**\r\n * Whether this store would like to save its data\r\n * Note that obviously whether the store wants to save or\r\n * not could change between calling this function and calling\r\n * save().\r\n *\r\n * @return {boolean} True if calling save() will actually save\r\n * (at the time this function is called).\r\n */\r\n\r\nIndexedDBStore.prototype.wantsSave = function () {\r\n const now = Date.now();\r\n return now - this._syncTs > WRITE_DELAY_MS;\r\n};\r\n/**\r\n * Possibly write data to the database.\r\n *\r\n * @param {bool} force True to force a save to happen\r\n * @return {Promise} Promise resolves after the write completes\r\n * (or immediately if no write is performed)\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.save = function (force) {\r\n if (force || this.wantsSave()) {\r\n return this._reallySave();\r\n }\r\n\r\n return Promise.resolve();\r\n};\r\n\r\nIndexedDBStore.prototype._reallySave = degradable(function () {\r\n this._syncTs = Date.now(); // set now to guard against multi-writes\r\n // work out changed users (this doesn't handle deletions but you\r\n // can't 'delete' users as they are just presence events).\r\n\r\n const userTuples = [];\r\n\r\n for (const u of this.getUsers()) {\r\n if (this._userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;\r\n if (!u.events.presence) continue;\r\n userTuples.push([u.userId, u.events.presence.event]); // note that we've saved this version of the user\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n }\r\n\r\n return this.backend.syncToDatabase(userTuples);\r\n});\r\nIndexedDBStore.prototype.setSyncData = degradable(function (syncData) {\r\n return this.backend.setSyncData(syncData);\r\n}, \"setSyncData\");\r\n/**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n\r\nIndexedDBStore.prototype.getOutOfBandMembers = degradable(function (roomId) {\r\n return this.backend.getOutOfBandMembers(roomId);\r\n}, \"getOutOfBandMembers\");\r\n/**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n\r\nIndexedDBStore.prototype.setOutOfBandMembers = degradable(function (roomId, membershipEvents) {\r\n _memory.MemoryStore.prototype.setOutOfBandMembers.call(this, roomId, membershipEvents);\r\n\r\n return this.backend.setOutOfBandMembers(roomId, membershipEvents);\r\n}, \"setOutOfBandMembers\");\r\nIndexedDBStore.prototype.clearOutOfBandMembers = degradable(function (roomId) {\r\n _memory.MemoryStore.prototype.clearOutOfBandMembers.call(this);\r\n\r\n return this.backend.clearOutOfBandMembers(roomId);\r\n}, \"clearOutOfBandMembers\");\r\nIndexedDBStore.prototype.getClientOptions = degradable(function () {\r\n return this.backend.getClientOptions();\r\n}, \"getClientOptions\");\r\nIndexedDBStore.prototype.storeClientOptions = degradable(function (options) {\r\n _memory.MemoryStore.prototype.storeClientOptions.call(this, options);\r\n\r\n return this.backend.storeClientOptions(options);\r\n}, \"storeClientOptions\");\r\n/**\r\n * All member functions of `IndexedDBStore` that access the backend use this wrapper to\r\n * watch for failures after initial store startup, including `QuotaExceededError` as\r\n * free disk space changes, etc.\r\n *\r\n * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`\r\n * in place so that the current operation and all future ones are in-memory only.\r\n *\r\n * @param {Function} func The degradable work to do.\r\n * @param {String} fallback The method name for fallback.\r\n * @returns {Function} A wrapped member function.\r\n */\r\n\r\nfunction degradable(func, fallback) {\r\n return async function (...args) {\r\n try {\r\n return await func.call(this, ...args);\r\n } catch (e) {\r\n _logger.logger.error(\"IndexedDBStore failure, degrading to MemoryStore\", e);\r\n\r\n this.emit(\"degraded\", e);\r\n\r\n try {\r\n // We try to delete IndexedDB after degrading since this store is only a\r\n // cache (the app will still function correctly without the data).\r\n // It's possible that deleting repair IndexedDB for the next app load,\r\n // potenially by making a little more space available.\r\n _logger.logger.log(\"IndexedDBStore trying to delete degraded data\");\r\n\r\n await this.backend.clearDatabase();\r\n\r\n _logger.logger.log(\"IndexedDBStore delete after degrading succeeeded\");\r\n } catch (e) {\r\n _logger.logger.warn(\"IndexedDBStore delete after degrading failed\", e);\r\n } // Degrade the store from being an instance of `IndexedDBStore` to instead be\r\n // an instance of `MemoryStore` so that future API calls use the memory path\r\n // directly and skip IndexedDB entirely. This should be safe as\r\n // `IndexedDBStore` already extends from `MemoryStore`, so we are making the\r\n // store become its parent type in a way. The mutator methods of\r\n // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are\r\n // not overridden at all).\r\n\r\n\r\n Object.setPrototypeOf(this, _memory.MemoryStore.prototype);\r\n\r\n if (fallback) {\r\n return await _memory.MemoryStore.prototype[fallback].call(this, ...args);\r\n }\r\n }\r\n };\r\n}","(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Scrollparent = factory();\n }\n}(this, function () {\n var regex = /(auto|scroll)/;\n\n var parents = function (node, ps) {\n if (node.parentNode === null) { return ps; }\n\n return parents(node.parentNode, ps.concat([node]));\n };\n\n var style = function (node, prop) {\n return getComputedStyle(node, null).getPropertyValue(prop);\n };\n\n var overflow = function (node) {\n return style(node, \"overflow\") + style(node, \"overflow-y\") + style(node, \"overflow-x\");\n };\n\n var scroll = function (node) {\n return regex.test(overflow(node));\n };\n\n var scrollParent = function (node) {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return ;\n }\n\n var ps = parents(node.parentNode, []);\n\n for (var i = 0; i < ps.length; i += 1) {\n if (scroll(ps[i])) {\n return ps[i];\n }\n }\n\n return document.scrollingElement || document.documentElement;\n };\n\n return scrollParent;\n}));\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".bgimage[data-v-5d20f73c]{width:100%;height:100%;opacity:0;transition:.3s}.bgimage.loaded[data-v-5d20f73c]{opacity:1}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.PushProcessor = PushProcessor;\r\n\r\nvar _utils = require(\"./utils\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module pushprocessor\r\n */\r\nconst RULEKINDS_IN_ORDER = ['override', 'content', 'room', 'sender', 'underride']; // The default override rules to apply to the push rules that arrive from the server.\r\n// We do this for two reasons:\r\n// 1. Synapse is unlikely to send us the push rule in an incremental sync - see\r\n// https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for\r\n// more details.\r\n// 2. We often want to start using push rules ahead of the server supporting them,\r\n// and so we can put them here.\r\n\r\nconst DEFAULT_OVERRIDE_RULES = [{\r\n // For homeservers which don't support MSC1930 yet\r\n rule_id: \".m.rule.tombstone\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.room.tombstone\"\r\n }, {\r\n kind: \"event_match\",\r\n key: \"state_key\",\r\n pattern: \"\"\r\n }],\r\n actions: [\"notify\", {\r\n set_tweak: \"highlight\",\r\n value: true\r\n }]\r\n}, {\r\n // For homeservers which don't support MSC2153 yet\r\n rule_id: \".m.rule.reaction\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.reaction\"\r\n }],\r\n actions: [\"dont_notify\"]\r\n}];\r\n/**\r\n * Construct a Push Processor.\r\n * @constructor\r\n * @param {Object} client The Matrix client object to use\r\n */\r\n\r\nfunction PushProcessor(client) {\r\n const cachedGlobToRegex = {// $glob: RegExp,\r\n };\r\n\r\n const matchingRuleFromKindSet = (ev, kindset) => {\r\n for (let ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) {\r\n const kind = RULEKINDS_IN_ORDER[ruleKindIndex];\r\n const ruleset = kindset[kind];\r\n\r\n if (!ruleset) {\r\n continue;\r\n }\r\n\r\n for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) {\r\n const rule = ruleset[ruleIndex];\r\n\r\n if (!rule.enabled) {\r\n continue;\r\n }\r\n\r\n const rawrule = templateRuleToRaw(kind, rule);\r\n\r\n if (!rawrule) {\r\n continue;\r\n }\r\n\r\n if (this.ruleMatchesEvent(rawrule, ev)) {\r\n rule.kind = kind;\r\n return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const templateRuleToRaw = function (kind, tprule) {\r\n const rawrule = {\r\n 'rule_id': tprule.rule_id,\r\n 'actions': tprule.actions,\r\n 'conditions': []\r\n };\r\n\r\n switch (kind) {\r\n case 'underride':\r\n case 'override':\r\n rawrule.conditions = tprule.conditions;\r\n break;\r\n\r\n case 'room':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'room_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'sender':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'user_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'content':\r\n if (!tprule.pattern) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'content.body',\r\n 'pattern': tprule.pattern\r\n });\r\n break;\r\n }\r\n\r\n return rawrule;\r\n };\r\n\r\n const eventFulfillsCondition = function (cond, ev) {\r\n const condition_functions = {\r\n \"event_match\": eventFulfillsEventMatchCondition,\r\n \"contains_display_name\": eventFulfillsDisplayNameCondition,\r\n \"room_member_count\": eventFulfillsRoomMemberCountCondition,\r\n \"sender_notification_permission\": eventFulfillsSenderNotifPermCondition\r\n };\r\n\r\n if (condition_functions[cond.kind]) {\r\n return condition_functions[cond.kind](cond, ev);\r\n } // unknown conditions: we previously matched all unknown conditions,\r\n // but given that rules can be added to the base rules on a server,\r\n // it's probably better to not match unknown conditions.\r\n\r\n\r\n return false;\r\n };\r\n\r\n const eventFulfillsSenderNotifPermCondition = function (cond, ev) {\r\n const notifLevelKey = cond['key'];\r\n\r\n if (!notifLevelKey) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState) {\r\n return false;\r\n } // Note that this should not be the current state of the room but the state at\r\n // the point the event is in the DAG. Unfortunately the js-sdk does not store\r\n // this.\r\n\r\n\r\n return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender());\r\n };\r\n\r\n const eventFulfillsRoomMemberCountCondition = function (cond, ev) {\r\n if (!cond.is) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members) {\r\n return false;\r\n }\r\n\r\n const memberCount = room.currentState.getJoinedMemberCount();\r\n const m = cond.is.match(/^([=<>]*)([0-9]*)$/);\r\n\r\n if (!m) {\r\n return false;\r\n }\r\n\r\n const ineq = m[1];\r\n const rhs = parseInt(m[2]);\r\n\r\n if (isNaN(rhs)) {\r\n return false;\r\n }\r\n\r\n switch (ineq) {\r\n case '':\r\n case '==':\r\n return memberCount == rhs;\r\n\r\n case '<':\r\n return memberCount < rhs;\r\n\r\n case '>':\r\n return memberCount > rhs;\r\n\r\n case '<=':\r\n return memberCount <= rhs;\r\n\r\n case '>=':\r\n return memberCount >= rhs;\r\n\r\n default:\r\n return false;\r\n }\r\n };\r\n\r\n const eventFulfillsDisplayNameCondition = function (cond, ev) {\r\n let content = ev.getContent();\r\n\r\n if (ev.isEncrypted() && ev.getClearContent()) {\r\n content = ev.getClearContent();\r\n }\r\n\r\n if (!content || !content.body || typeof content.body != 'string') {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members || !room.currentState.getMember(client.credentials.userId)) {\r\n return false;\r\n }\r\n\r\n const displayName = room.currentState.getMember(client.credentials.userId).name; // N.B. we can't use \\b as it chokes on unicode. however \\W seems to be okay\r\n // as shorthand for [^0-9A-Za-z_].\r\n\r\n const pat = new RegExp(\"(^|\\\\W)\" + (0, _utils.escapeRegExp)(displayName) + \"(\\\\W|$)\", 'i');\r\n return content.body.search(pat) > -1;\r\n };\r\n\r\n const eventFulfillsEventMatchCondition = function (cond, ev) {\r\n if (!cond.key) {\r\n return false;\r\n }\r\n\r\n const val = valueForDottedKey(cond.key, ev);\r\n\r\n if (typeof val !== 'string') {\r\n return false;\r\n }\r\n\r\n if (cond.value) {\r\n return cond.value === val;\r\n }\r\n\r\n if (typeof cond.pattern !== 'string') {\r\n return false;\r\n }\r\n\r\n let regex;\r\n\r\n if (cond.key == 'content.body') {\r\n regex = createCachedRegex('(^|\\\\W)', cond.pattern, '(\\\\W|$)');\r\n } else {\r\n regex = createCachedRegex('^', cond.pattern, '$');\r\n }\r\n\r\n return !!val.match(regex);\r\n };\r\n\r\n const createCachedRegex = function (prefix, glob, suffix) {\r\n if (cachedGlobToRegex[glob]) {\r\n return cachedGlobToRegex[glob];\r\n }\r\n\r\n cachedGlobToRegex[glob] = new RegExp(prefix + (0, _utils.globToRegexp)(glob) + suffix, 'i');\r\n return cachedGlobToRegex[glob];\r\n };\r\n\r\n const valueForDottedKey = function (key, ev) {\r\n const parts = key.split('.');\r\n let val; // special-case the first component to deal with encrypted messages\r\n\r\n const firstPart = parts[0];\r\n\r\n if (firstPart === 'content') {\r\n val = ev.getContent();\r\n parts.shift();\r\n } else if (firstPart === 'type') {\r\n val = ev.getType();\r\n parts.shift();\r\n } else {\r\n // use the raw event for any other fields\r\n val = ev.event;\r\n }\r\n\r\n while (parts.length > 0) {\r\n const thisPart = parts.shift();\r\n\r\n if ((0, _utils.isNullOrUndefined)(val[thisPart])) {\r\n return null;\r\n }\r\n\r\n val = val[thisPart];\r\n }\r\n\r\n return val;\r\n };\r\n\r\n const matchingRuleForEventWithRulesets = function (ev, rulesets) {\r\n if (!rulesets) {\r\n return null;\r\n }\r\n\r\n if (ev.getSender() === client.credentials.userId) {\r\n return null;\r\n }\r\n\r\n return matchingRuleFromKindSet(ev, rulesets.global);\r\n };\r\n\r\n const pushActionsForEventAndRulesets = function (ev, rulesets) {\r\n const rule = matchingRuleForEventWithRulesets(ev, rulesets);\r\n\r\n if (!rule) {\r\n return {};\r\n }\r\n\r\n const actionObj = PushProcessor.actionListToActionsObject(rule.actions); // Some actions are implicit in some situations: we add those here\r\n\r\n if (actionObj.tweaks.highlight === undefined) {\r\n // if it isn't specified, highlight if it's a content\r\n // rule but otherwise not\r\n actionObj.tweaks.highlight = rule.kind == 'content';\r\n }\r\n\r\n return actionObj;\r\n };\r\n\r\n this.ruleMatchesEvent = function (rule, ev) {\r\n let ret = true;\r\n\r\n for (let i = 0; i < rule.conditions.length; ++i) {\r\n const cond = rule.conditions[i];\r\n ret &= eventFulfillsCondition(cond, ev);\r\n } //console.log(\"Rule \"+rule.rule_id+(ret ? \" matches\" : \" doesn't match\"));\r\n\r\n\r\n return ret;\r\n };\r\n /**\r\n * Get the user's push actions for the given event\r\n *\r\n * @param {module:models/event.MatrixEvent} ev\r\n *\r\n * @return {PushAction}\r\n */\r\n\r\n\r\n this.actionsForEvent = function (ev) {\r\n return pushActionsForEventAndRulesets(ev, client.pushRules);\r\n };\r\n /**\r\n * Get one of the users push rules by its ID\r\n *\r\n * @param {string} ruleId The ID of the rule to search for\r\n * @return {object} The push rule, or null if no such rule was found\r\n */\r\n\r\n\r\n this.getPushRuleById = function (ruleId) {\r\n for (const scope of ['global']) {\r\n if (client.pushRules[scope] === undefined) continue;\r\n\r\n for (const kind of RULEKINDS_IN_ORDER) {\r\n if (client.pushRules[scope][kind] === undefined) continue;\r\n\r\n for (const rule of client.pushRules[scope][kind]) {\r\n if (rule.rule_id === ruleId) return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n}\r\n/**\r\n * Convert a list of actions into a object with the actions as keys and their values\r\n * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ]\r\n * becomes { notify: true, tweaks: { sound: 'default' } }\r\n * @param {array} actionlist The actions list\r\n *\r\n * @return {object} A object with key 'notify' (true or false) and an object of actions\r\n */\r\n\r\n\r\nPushProcessor.actionListToActionsObject = function (actionlist) {\r\n const actionobj = {\r\n 'notify': false,\r\n 'tweaks': {}\r\n };\r\n\r\n for (let i = 0; i < actionlist.length; ++i) {\r\n const action = actionlist[i];\r\n\r\n if (action === 'notify') {\r\n actionobj.notify = true;\r\n } else if (typeof action === 'object') {\r\n if (action.value === undefined) {\r\n action.value = true;\r\n }\r\n\r\n actionobj.tweaks[action.set_tweak] = action.value;\r\n }\r\n }\r\n\r\n return actionobj;\r\n};\r\n/**\r\n * Rewrites conditions on a client's push rules to match the defaults\r\n * where applicable. Useful for upgrading push rules to more strict\r\n * conditions when the server is falling behind on defaults.\r\n * @param {object} incomingRules The client's existing push rules\r\n * @returns {object} The rewritten rules\r\n */\r\n\r\n\r\nPushProcessor.rewriteDefaultRules = function (incomingRules) {\r\n let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone\r\n // These lines are mostly to make the tests happy. We shouldn't run into these\r\n // properties missing in practice.\r\n\r\n if (!newRules) newRules = {};\r\n if (!newRules.global) newRules.global = {};\r\n if (!newRules.global.override) newRules.global.override = []; // Merge the client-level defaults with the ones from the server\r\n\r\n const globalOverrides = newRules.global.override;\r\n\r\n for (const override of DEFAULT_OVERRIDE_RULES) {\r\n const existingRule = globalOverrides.find(r => r.rule_id === override.rule_id);\r\n\r\n if (existingRule) {\r\n // Copy over the actions, default, and conditions. Don't touch the user's\r\n // preference.\r\n existingRule.default = override.default;\r\n existingRule.conditions = override.conditions;\r\n existingRule.actions = override.actions;\r\n } else {\r\n // Add the rule\r\n const ruleId = override.rule_id;\r\n\r\n _logger.logger.warn(`Adding default global override for ${ruleId}`);\r\n\r\n globalOverrides.push(override);\r\n }\r\n }\r\n\r\n return newRules;\r\n};\r\n/**\r\n * @typedef {Object} PushAction\r\n * @type {Object}\r\n * @property {boolean} notify Whether this event should notify the user or not.\r\n * @property {Object} tweaks How this event should be notified.\r\n * @property {boolean} tweaks.highlight Whether this event should be highlighted\r\n * on the UI.\r\n * @property {boolean} tweaks.sound Whether this notification should produce a\r\n * noise.\r\n */","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\"","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\"","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vue-js-toggle-button\"] = factory();\n\telse\n\t\troot[\"vue-js-toggle-button\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(8)\n\nvar Component = __webpack_require__(6)(\n /* script */\n __webpack_require__(1),\n /* template */\n __webpack_require__(7),\n /* scopeId */\n \"data-v-25adc6c0\",\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(3);\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\nvar DEFAULT_COLOR_CHECKED = '#75c791';\nvar DEFAULT_COLOR_UNCHECKED = '#bfcbd9';\nvar DEFAULT_LABEL_CHECKED = 'on';\nvar DEFAULT_LABEL_UNCHECKED = 'off';\nvar DEFAULT_SWITCH_COLOR = '#fff';\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'ToggleButton',\n props: {\n value: {\n type: Boolean,\n default: false\n },\n name: {\n type: String\n },\n disabled: {\n type: Boolean,\n default: false\n },\n tag: {\n type: String\n },\n sync: {\n type: Boolean,\n default: false\n },\n speed: {\n type: Number,\n default: 300\n },\n color: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'disabled');\n }\n },\n switchColor: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked');\n }\n },\n cssColors: {\n type: Boolean,\n default: false\n },\n labels: {\n type: [Boolean, Object],\n default: false,\n validator: function validator(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' ? value.checked || value.unchecked : typeof value === 'boolean';\n }\n },\n height: {\n type: Number,\n default: 22\n },\n width: {\n type: Number,\n default: 50\n },\n margin: {\n type: Number,\n default: 3\n },\n fontSize: {\n type: Number\n }\n },\n computed: {\n className: function className() {\n var toggled = this.toggled,\n disabled = this.disabled;\n\n\n return ['vue-js-switch', {\n toggled: toggled,\n disabled: disabled\n }];\n },\n coreStyle: function coreStyle() {\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n backgroundColor: this.cssColors ? null : this.disabled ? this.colorDisabled : this.colorCurrent,\n borderRadius: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(Math.round(this.height / 2))\n };\n },\n buttonRadius: function buttonRadius() {\n return this.height - this.margin * 2;\n },\n distance: function distance() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width - this.height + this.margin);\n },\n buttonStyle: function buttonStyle() {\n var transition = 'transform ' + this.speed + 'ms';\n var margin = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.margin);\n\n var transform = this.toggled ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(this.distance, margin) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(margin, margin);\n\n var background = this.switchColor ? this.switchColorCurrent : null;\n\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n transition: transition,\n transform: transform,\n background: background\n };\n },\n labelStyle: function labelStyle() {\n return {\n lineHeight: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n fontSize: this.fontSize ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.fontSize) : null\n };\n },\n colorChecked: function colorChecked() {\n var color = this.color;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(color)) {\n return color || DEFAULT_COLOR_CHECKED;\n }\n\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(color, 'checked', DEFAULT_COLOR_CHECKED);\n },\n colorUnchecked: function colorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'unchecked', DEFAULT_COLOR_UNCHECKED);\n },\n colorDisabled: function colorDisabled() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'disabled', this.colorCurrent);\n },\n colorCurrent: function colorCurrent() {\n return this.toggled ? this.colorChecked : this.colorUnchecked;\n },\n labelChecked: function labelChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'checked', DEFAULT_LABEL_CHECKED);\n },\n labelUnchecked: function labelUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'unchecked', DEFAULT_LABEL_UNCHECKED);\n },\n switchColorChecked: function switchColorChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'checked', DEFAULT_SWITCH_COLOR);\n },\n switchColorUnchecked: function switchColorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'unchecked', DEFAULT_SWITCH_COLOR);\n },\n switchColorCurrent: function switchColorCurrent() {\n var switchColor = this.switchColor;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(this.switchColor)) {\n return this.switchColor || DEFAULT_SWITCH_COLOR;\n }\n\n return this.toggled ? this.switchColorChecked : this.switchColorUnchecked;\n }\n },\n watch: {\n value: function value(_value) {\n if (this.sync) {\n this.toggled = !!_value;\n }\n }\n },\n data: function data() {\n return {\n toggled: !!this.value\n };\n },\n\n methods: {\n toggle: function toggle(event) {\n var toggled = !this.toggled;\n\n if (!this.sync) {\n this.toggled = toggled;\n }\n\n this.$emit('input', toggled);\n this.$emit('change', {\n value: toggled,\n tag: this.tag,\n srcEvent: event\n });\n }\n }\n});\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Button_vue__);\n/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, \"ToggleButton\", function() { return __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a; });\n\n\nvar installed = false;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n install: function install(Vue) {\n if (installed) {\n return;\n }\n\n Vue.component('ToggleButton', __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a);\n installed = true;\n }\n});\n\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return isString; });\n/* unused harmony export isBoolean */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return px; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return translate3d; });\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isString = function isString(value) {\n return typeof value === 'string';\n};\n\nvar isBoolean = function isBoolean(value) {\n return typeof value === 'boolean';\n};\n\nvar isObject = function isObject(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';\n};\n\nvar has = function has(object, key) {\n return isObject(object) && object.hasOwnProperty(key);\n};\n\nvar get = function get(object, key, defaultValue) {\n return has(object, key) ? object[key] : defaultValue;\n};\n\nvar px = function px(value) {\n return value + 'px';\n};\n\nvar translate3d = function translate3d(x, y) {\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0px';\n\n return 'translate3d(' + x + ', ' + y + ', ' + z + ')';\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)();\n// imports\n\n\n// module\nexports.push([module.i, \".vue-js-switch[data-v-25adc6c0]{display:inline-block;position:relative;vertical-align:middle;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input[data-v-25adc6c0]{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label[data-v-25adc6c0]{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left[data-v-25adc6c0]{left:10px}.vue-js-switch .v-switch-label.v-right[data-v-25adc6c0]{right:10px}.vue-js-switch .v-switch-core[data-v-25adc6c0]{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;user-select:none}.vue-js-switch .v-switch-core .v-switch-button[data-v-25adc6c0]{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:#fff;z-index:2}.vue-js-switch.disabled[data-v-25adc6c0]{pointer-events:none;opacity:.6}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n scopeId,\n cssModules\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n // inject cssModules\n if (cssModules) {\n var computed = Object.create(options.computed || null)\n Object.keys(cssModules).forEach(function (key) {\n var module = cssModules[key]\n computed[key] = function () { return module }\n })\n options.computed = computed\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('label', {\n class: _vm.className\n }, [_c('input', {\n staticClass: \"v-switch-input\",\n attrs: {\n \"type\": \"checkbox\",\n \"name\": _vm.name,\n \"disabled\": _vm.disabled\n },\n domProps: {\n \"checked\": _vm.value\n },\n on: {\n \"change\": function($event) {\n $event.stopPropagation();\n return _vm.toggle($event)\n }\n }\n }), _vm._v(\" \"), _c('div', {\n staticClass: \"v-switch-core\",\n style: (_vm.coreStyle)\n }, [_c('div', {\n staticClass: \"v-switch-button\",\n style: (_vm.buttonStyle)\n })]), _vm._v(\" \"), (_vm.labels) ? [(_vm.toggled) ? _c('span', {\n staticClass: \"v-switch-label v-left\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"checked\", [\n [_vm._v(_vm._s(_vm.labelChecked))]\n ])], 2) : _c('span', {\n staticClass: \"v-switch-label v-right\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"unchecked\", [\n [_vm._v(_vm._s(_vm.labelUnchecked))]\n ])], 2)] : _vm._e()], 2)\n},staticRenderFns: []}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ModalWindow.vue?vue&type=template&id=96a5a68e&scoped=true&\"\nimport script from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nexport * from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ModalWindow.vue?vue&type=style&index=0&id=96a5a68e&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"96a5a68e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapActions, mapGetters, mapState} from 'vuex'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport ModalWindow from '@/components/utils/ModalWindow.vue'\r\n\r\n\r\nexport default {\r\n name: \"contactsList\",\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n }\r\n\r\n },\r\n components: {\r\n preview,\r\n ModalWindow\r\n },\r\n\r\n props: {\r\n mode: {\r\n default: '',\r\n type: String\r\n },\r\n users: Array,\r\n selected : Object,\r\n title: String,\r\n },\r\n \r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n minimized : state => state.minimized,\r\n\r\n ...mapActions([\r\n 'PREPARE_USERDATA'\r\n ]),\r\n\r\n ...mapState([\r\n 'contactsMap',\r\n 'signedUpUsers',\r\n ]),\r\n\r\n }),\r\n\r\n methods: {\r\n select(contact) {\r\n this.$emit('select', contact)\r\n },\r\n\r\n navigateToProfile(id, contact) {\r\n\r\n if(this.mode == \"Select\"){\r\n this.select(contact)\r\n }\r\n else{\r\n this.$router.push({path: `/contact?id=${id}`}).catch(e => {})\r\n }\r\n },\r\n\r\n toggleUser(contact){\r\n this.$emit('toggleUser', contact.id)\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=691bf714&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=691bf714&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"691bf714\",\n null\n ,true\n)\n\nexport default component.exports","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=9b340a7a&scoped=true&lang=sass&\"","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./time.vue?vue&type=template&id=9218004e&scoped=true&\"\nimport script from \"./time.vue?vue&type=script&lang=js&\"\nexport * from \"./time.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./time.vue?vue&type=style&index=0&id=9218004e&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"9218004e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapState} from 'vuex';\r\nimport chatName from '@/components/chats/assets/name.vue'\r\nimport chatTime from '@/components/chats/assets/time.vue'\r\nimport chatIcon from '@/components/chats/assets/icon.vue'\r\n\r\n\r\nexport default {\r\n name: 'preview',\r\n props: {\r\n chat: Object,\r\n dummy: Boolean,\r\n },\r\n\r\n components: {\r\n chatName,\r\n chatTime,\r\n chatIcon,\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n roomMuted: false,\r\n ready: false,\r\n lastEvent: {},\r\n userStatusRoom: String,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n m_chat: {\r\n immediate: true,\r\n handler: function () {\r\n\r\n this.ready = false\r\n\r\n if (this.m_chat && !_.isEmpty(this.m_chat)) {\r\n\r\n this.core.mtrx.kit.prepareChat(this.m_chat).then(r => {\r\n this.ready = true\r\n })\r\n }\r\n \r\n }\r\n }\r\n\r\n },\r\n\r\n\r\n mounted : function(){\r\n\r\n \r\n },\r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n blockedCheck: function () {\r\n var users = this.core.mtrx.anotherChatUsers(this.m_chat.roomId)\r\n\r\n if (users.length == 1) {\r\n return this.core.mtrx.blockeduser(users[0].userId)\r\n }\r\n\r\n },\r\n m_chat: function () {\r\n\r\n if (!this.core.mtrx.client || !this.chat) return null\r\n\r\n let pushRules = this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId)\r\n\r\n if (pushRules !== null) {\r\n this.roomMuted = true\r\n }\r\n\r\n if (this.chat.roomId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(this.chat.roomId)\r\n\r\n return m_chat || null\r\n }\r\n\r\n },\r\n chatevents: function () {\r\n return (this.events[this.chat.roomId] || {}).timeline || []\r\n },\r\n\r\n key: function () {\r\n if (this.event) return this.event.event_id\r\n\r\n return 'key'\r\n },\r\n\r\n unknowngroupusers : function(){\r\n return this.core.mtrx.kit.unknowngroupusers(this.chat)\r\n },\r\n\r\n matrixevent : function(){\r\n var e = this.event\r\n\r\n if (e){\r\n return e.get()\r\n }\r\n },\r\n\r\n event: function () {\r\n\r\n if (this.chat && this.chat.roomId) {\r\n\r\n var members = this.m_chat.currentState.getMembers()\r\n\r\n var events = _.filter(this.chatevents, (e) => {\r\n \r\n if (members.length <= 2 &&\r\n (e.event.type === 'm.room.power_levels' || (\r\n e.event.type === 'm.room.member' && e.event.content.membership !== 'invite'\r\n ))\r\n\r\n ) {\r\n return false\r\n }\r\n if (e.event.type === 'm.room.redaction') {\r\n return false\r\n }\r\n\r\n return !(e.event.content['m.relates_to'] && e.event.content['m.relates_to'][\"rel_type\"] === 'm.replace');\r\n\r\n })\r\n\r\n events = _.sortBy(events, function (e) {\r\n return e.event.origin_server_ts\r\n })\r\n\r\n if (events.length) {\r\n return events[events.length - 1]\r\n }\r\n\r\n }\r\n\r\n },\r\n\r\n ...mapState([\r\n 'minimized',\r\n 'active',\r\n 'events'\r\n ]),\r\n }),\r\n\r\n methods: {},\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=33d22462&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"33d22462\",\n null\n ,true\n)\n\nexport default component.exports","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"topheader\"},on:{\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"topheader \"},[_c('div',{staticClass:\"work\"},[_c('div',{staticClass:\"headerLine\"},[_c('div',{staticClass:\"leftIcon icon\",on:{\"mouseenter\":_vm.mouseenter}},[_vm._t(\"left\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"leftaddIcon iconsmall\"},[_vm._t(\"leftadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"infoPart\",on:{\"mouseenter\":_vm.mouseenter}},[_c('div',[_vm._t(\"info\",function(){return [_vm._v(\"   \")]})],2)]),_c('div',{staticClass:\"rightaddIcons iconsmall\"},[_vm._t(\"rightadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"rightIcons icon\"},[_vm._t(\"right\",function(){return [_vm._v(\"   \")]})],2)]),_vm._t(\"additional\")],2)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'topheader',\r\n props: { },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : function() {\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n mouseenter : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'header'})\r\n },\r\n\r\n mouseleave : function(){\r\n if (this.$store.state.autohide)\r\n this.$store.commit('active', false)\r\n\r\n this.$store.commit('blockactive', {value : false, item : 'header'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=52afd868&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=52afd868&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"52afd868\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {};\r\nexports.default = void 0;\r\n\r\nvar matrixcs = _interopRequireWildcard(require(\"./matrix\"));\r\n\r\nObject.keys(matrixcs).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === matrixcs[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return matrixcs[key];\r\n }\r\n });\r\n});\r\n\r\nvar _browserRequest = _interopRequireDefault(require(\"browser-request\"));\r\n\r\nvar _qs = _interopRequireDefault(require(\"qs\"));\r\n\r\n/*\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nmatrixcs.request(function (opts, fn) {\r\n // We manually fix the query string for browser-request because\r\n // it doesn't correctly handle cases like ?via=one&via=two. Instead\r\n // we mimic `request`'s query string interface to make it all work\r\n // as expected.\r\n // browser-request will happily take the constructed string as the\r\n // query string without trying to modify it further.\r\n opts.qs = _qs.default.stringify(opts.qs || {}, opts.qsStringifyOptions);\r\n return (0, _browserRequest.default)(opts, fn);\r\n}); // just *accessing* indexedDB throws an exception in firefox with\r\n// indexeddb disabled.\r\n\r\nlet indexedDB;\r\n\r\ntry {\r\n indexedDB = global.indexedDB;\r\n} catch (e) {} // if our browser (appears to) support indexeddb, use an indexeddb crypto store.\r\n\r\n\r\nif (indexedDB) {\r\n matrixcs.setCryptoStoreFactory(function () {\r\n return new matrixcs.IndexedDBCryptoStore(indexedDB, \"matrix-js-sdk:crypto\");\r\n });\r\n} // We export 3 things to make browserify happy as well as downstream projects.\r\n// It's awkward, but required.\r\n\r\n\r\nvar _default = matrixcs; // keep export for browserify package deps\r\n\r\nexports.default = _default;\r\nglobal.matrixcs = matrixcs;","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=332740e2&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=332740e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"332740e2\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.getDesktopCapturerSources = getDesktopCapturerSources;\r\nexports.setAudioOutput = setAudioOutput;\r\nexports.setAudioInput = setAudioInput;\r\nexports.setVideoInput = setVideoInput;\r\nexports.createNewMatrixCall = createNewMatrixCall;\r\nexports.MatrixCall = exports.CallError = exports.CallErrorCode = exports.CallEvent = exports.CallParty = exports.CallDirection = exports.CallType = exports.CallState = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _event = require(\"../@types/event\");\r\n\r\nvar _randomstring = require(\"../randomstring\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link createNewMatrixCall} for the public API.\r\n * @module webrtc/call\r\n */\r\nlet CallState;\r\nexports.CallState = CallState;\r\n\r\n(function (CallState) {\r\n CallState[\"Fledgling\"] = \"fledgling\";\r\n CallState[\"InviteSent\"] = \"invite_sent\";\r\n CallState[\"WaitLocalMedia\"] = \"wait_local_media\";\r\n CallState[\"CreateOffer\"] = \"create_offer\";\r\n CallState[\"CreateAnswer\"] = \"create_answer\";\r\n CallState[\"Connecting\"] = \"connecting\";\r\n CallState[\"Connected\"] = \"connected\";\r\n CallState[\"Ringing\"] = \"ringing\";\r\n CallState[\"Ended\"] = \"ended\";\r\n})(CallState || (exports.CallState = CallState = {}));\r\n\r\nlet CallType;\r\nexports.CallType = CallType;\r\n\r\n(function (CallType) {\r\n CallType[\"Voice\"] = \"voice\";\r\n CallType[\"Video\"] = \"video\";\r\n})(CallType || (exports.CallType = CallType = {}));\r\n\r\nlet CallDirection;\r\nexports.CallDirection = CallDirection;\r\n\r\n(function (CallDirection) {\r\n CallDirection[\"Inbound\"] = \"inbound\";\r\n CallDirection[\"Outbound\"] = \"outbound\";\r\n})(CallDirection || (exports.CallDirection = CallDirection = {}));\r\n\r\nlet CallParty;\r\nexports.CallParty = CallParty;\r\n\r\n(function (CallParty) {\r\n CallParty[\"Local\"] = \"local\";\r\n CallParty[\"Remote\"] = \"remote\";\r\n})(CallParty || (exports.CallParty = CallParty = {}));\r\n\r\nlet CallEvent;\r\nexports.CallEvent = CallEvent;\r\n\r\n(function (CallEvent) {\r\n CallEvent[\"Hangup\"] = \"hangup\";\r\n CallEvent[\"State\"] = \"state\";\r\n CallEvent[\"Error\"] = \"error\";\r\n CallEvent[\"Replaced\"] = \"replaced\";\r\n CallEvent[\"LocalHoldUnhold\"] = \"local_hold_unhold\";\r\n CallEvent[\"RemoteHoldUnhold\"] = \"remote_hold_unhold\";\r\n CallEvent[\"HoldUnhold\"] = \"hold_unhold\";\r\n})(CallEvent || (exports.CallEvent = CallEvent = {}));\r\n\r\nlet CallErrorCode;\r\nexports.CallErrorCode = CallErrorCode;\r\n\r\n(function (CallErrorCode) {\r\n CallErrorCode[\"UserHangup\"] = \"user_hangup\";\r\n CallErrorCode[\"LocalOfferFailed\"] = \"local_offer_failed\";\r\n CallErrorCode[\"NoUserMedia\"] = \"no_user_media\";\r\n CallErrorCode[\"UnknownDevices\"] = \"unknown_devices\";\r\n CallErrorCode[\"SendInvite\"] = \"send_invite\";\r\n CallErrorCode[\"CreateAnswer\"] = \"create_answer\";\r\n CallErrorCode[\"SendAnswer\"] = \"send_answer\";\r\n CallErrorCode[\"SetRemoteDescription\"] = \"set_remote_description\";\r\n CallErrorCode[\"SetLocalDescription\"] = \"set_local_description\";\r\n CallErrorCode[\"AnsweredElsewhere\"] = \"answered_elsewhere\";\r\n CallErrorCode[\"IceFailed\"] = \"ice_failed\";\r\n CallErrorCode[\"InviteTimeout\"] = \"invite_timeout\";\r\n CallErrorCode[\"Replaced\"] = \"replaced\";\r\n CallErrorCode[\"SignallingFailed\"] = \"signalling_timeout\";\r\n})(CallErrorCode || (exports.CallErrorCode = CallErrorCode = {}));\r\n\r\nvar ConstraintsType;\r\n/**\r\n * The version field that we set in m.call.* events\r\n */\r\n\r\n(function (ConstraintsType) {\r\n ConstraintsType[\"Audio\"] = \"audio\";\r\n ConstraintsType[\"Video\"] = \"video\";\r\n})(ConstraintsType || (ConstraintsType = {}));\r\n\r\nconst VOIP_PROTO_VERSION = 1;\r\n/** The fallback ICE server to use for STUN or TURN protocols. */\r\n\r\nconst FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';\r\n/** The length of time a call can be ringing for. */\r\n\r\nconst CALL_TIMEOUT_MS = 60000;\r\n/** Retrieves sources from desktopCapturer */\r\n\r\nfunction getDesktopCapturerSources() {\r\n const options = {\r\n thumbnailSize: {\r\n height: 176,\r\n width: 312\r\n },\r\n types: [\"screen\", \"window\"]\r\n };\r\n return window.electron.getDesktopCapturerSources(options);\r\n}\r\n\r\nclass CallError extends Error {\r\n constructor(code, msg, err) {\r\n // Stil ldon't think there's any way to have proper nested errors\r\n super(msg + \": \" + err);\r\n (0, _defineProperty2.default)(this, \"code\", void 0);\r\n this.code = code;\r\n }\r\n\r\n}\r\n\r\nexports.CallError = CallError;\r\n\r\nfunction genCallID() {\r\n return Date.now().toString() + (0, _randomstring.randomString)(16);\r\n}\r\n/**\r\n * Construct a new Matrix Call.\r\n * @constructor\r\n * @param {Object} opts Config options.\r\n * @param {string} opts.roomId The room ID for this call.\r\n * @param {Object} opts.webRtc The WebRTC globals from the browser.\r\n * @param {boolean} opts.forceTURN whether relay through TURN should be forced.\r\n * @param {Object} opts.URL The URL global.\r\n * @param {Array} opts.turnServers Optional. A list of TURN servers.\r\n * @param {MatrixClient} opts.client The Matrix Client instance to send events to.\r\n */\r\n\r\n\r\nclass MatrixCall extends _events.EventEmitter {\r\n // Fix when client is TSified\r\n // XXX: I don't know why this is called 'config'.\r\n // The party ID of the other side: undefined if we haven't chosen a partner\r\n // yet, null if we have but they didn't send a party ID.\r\n // in the browser it's 'number'\r\n // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold\r\n // This flag represents whether we want the other party to be on hold\r\n // and this one we set when we're transitioning out of the hold state because we\r\n // can't tell the difference between that and the other party holding us\r\n // the stats for the call at the point it ended. We can't get these after we\r\n // tear the call down, so we just grab a snapshot before we stop the call.\r\n // The typescript definitions have this type as 'any' :(\r\n // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example\r\n // If candidates arrive before we've picked an opponent (which, in particular,\r\n // will happen if the opponent sends candidates eagerly before the user answers\r\n // the call) we buffer them up here so we can then add the ones from the party we pick\r\n constructor(opts) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"roomId\", void 0);\r\n (0, _defineProperty2.default)(this, \"type\", void 0);\r\n (0, _defineProperty2.default)(this, \"callId\", void 0);\r\n (0, _defineProperty2.default)(this, \"state\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupParty\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupReason\", void 0);\r\n (0, _defineProperty2.default)(this, \"direction\", void 0);\r\n (0, _defineProperty2.default)(this, \"ourPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"client\", void 0);\r\n (0, _defineProperty2.default)(this, \"forceTURN\", void 0);\r\n (0, _defineProperty2.default)(this, \"turnServers\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendQueue\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendTries\", void 0);\r\n (0, _defineProperty2.default)(this, \"sentEndOfCandidates\", void 0);\r\n (0, _defineProperty2.default)(this, \"peerConn\", void 0);\r\n (0, _defineProperty2.default)(this, \"localVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteAudioElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"screenSharingStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"localAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteOrAnswerSent\", void 0);\r\n (0, _defineProperty2.default)(this, \"waitForLocalAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"config\", void 0);\r\n (0, _defineProperty2.default)(this, \"successor\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentMember\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentVersion\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentCaps\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteTimeout\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteOnHold\", void 0);\r\n (0, _defineProperty2.default)(this, \"unholdingRemote\", void 0);\r\n (0, _defineProperty2.default)(this, \"micMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"vidMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"callStatsAtEnd\", void 0);\r\n (0, _defineProperty2.default)(this, \"makingOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"ignoreOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteCandidateBuffer\", new Map());\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForInvite\", async stream => {\r\n if (this.successor) {\r\n this.successor.gotUserMediaForAnswer(stream);\r\n return;\r\n }\r\n\r\n if (this.callHasEnded()) {\r\n this.stopAllMedia();\r\n return;\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n this.setState(CallState.CreateOffer);\r\n\r\n _logger.logger.debug(\"gotUserMediaForInvite -> \" + this.type);\r\n\r\n const videoEl = this.getLocalVideoElement();\r\n\r\n if (videoEl && this.type === CallType.Video) {\r\n videoEl.autoplay = true;\r\n\r\n if (this.screenSharingStream) {\r\n _logger.logger.debug(\"Setting screen sharing stream to the local video element\");\r\n\r\n videoEl.srcObject = this.screenSharingStream;\r\n } else {\r\n videoEl.srcObject = stream;\r\n }\r\n\r\n videoEl.muted = true;\r\n\r\n try {\r\n await videoEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n } // why do we enable audio (and only audio) tracks here? -- matthew\r\n\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const audioTrack of stream.getAudioTracks()) {\r\n _logger.logger.info(\"Adding audio track with id \" + audioTrack.id);\r\n\r\n this.peerConn.addTrack(audioTrack, stream);\r\n }\r\n\r\n for (const videoTrack of (this.screenSharingStream || stream).getVideoTracks()) {\r\n _logger.logger.info(\"Adding video track with id \" + videoTrack.id);\r\n\r\n this.peerConn.addTrack(videoTrack, stream);\r\n } // Now we wait for the negotiationneeded event\r\n\r\n });\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForAnswer\", async stream => {\r\n if (this.callHasEnded()) {\r\n return;\r\n }\r\n\r\n const localVidEl = this.getLocalVideoElement();\r\n\r\n if (localVidEl && this.type === CallType.Video) {\r\n localVidEl.autoplay = true;\r\n localVidEl.srcObject = stream;\r\n localVidEl.muted = true;\r\n\r\n try {\r\n await localVidEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const track of stream.getTracks()) {\r\n this.peerConn.addTrack(track, stream);\r\n }\r\n\r\n this.setState(CallState.CreateAnswer);\r\n let myAnswer;\r\n\r\n try {\r\n myAnswer = await this.peerConn.createAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Failed to create answer: \", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.CreateAnswer, true);\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(myAnswer);\r\n this.setState(CallState.Connecting); // Allow a short time for initial candidates to be gathered\r\n\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n this.sendAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalIceCandidate\", event => {\r\n if (event.candidate) {\r\n _logger.logger.debug(\"Call \" + this.callId + \" got local ICE \" + event.candidate.sdpMid + \" candidate: \" + event.candidate.candidate);\r\n\r\n if (this.callHasEnded()) return; // As with the offer, note we need to make a copy of this object, not\r\n // pass the original: that broke in Chrome ~m43.\r\n\r\n if (event.candidate.candidate !== '' || !this.sentEndOfCandidates) {\r\n this.queueCandidate(event.candidate);\r\n if (event.candidate.candidate === '') this.sentEndOfCandidates = true;\r\n }\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceGatheringStateChange\", event => {\r\n _logger.logger.debug(\"ice gathering state changed to \" + this.peerConn.iceGatheringState);\r\n\r\n if (this.peerConn.iceGatheringState === 'complete' && !this.sentEndOfCandidates) {\r\n // If we didn't get an empty-string candidate to signal the end of candidates,\r\n // create one ourselves now gathering has finished.\r\n // We cast because the interface lists all the properties as required but we\r\n // only want to send 'candidate'\r\n // XXX: We probably want to send either sdpMid or sdpMLineIndex, as it's not strictly\r\n // correct to have a candidate that lacks both of these. We'd have to figure out what\r\n // previous candidates had been sent with and copy them.\r\n const c = {\r\n candidate: ''\r\n };\r\n this.queueCandidate(c);\r\n this.sentEndOfCandidates = true;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalOffer\", async description => {\r\n _logger.logger.debug(\"Created offer: \", description);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(\"Ignoring newly created offer on call ID \" + this.callId + \" because the call has ended\");\r\n\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(description);\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n\r\n if (this.peerConn.iceGatheringState === 'gathering') {\r\n // Allow a short time for initial candidates to be gathered\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n }\r\n\r\n if (this.callHasEnded()) return;\r\n const eventType = this.state === CallState.CreateOffer ? _event.EventType.CallInvite : _event.EventType.CallNegotiate;\r\n const content = {\r\n lifetime: CALL_TIMEOUT_MS\r\n }; // clunky because TypeScript can't folow the types through if we use an expression as the key\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n content.offer = this.peerConn.localDescription;\r\n } else {\r\n content.description = this.peerConn.localDescription;\r\n }\r\n\r\n if (this.client._supportsCallTransfer) {\r\n content.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // Get rid of any candidates waiting to be sent: they'll be included in the local\r\n // description we just got and will send in the offer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(eventType, content);\r\n } catch (error) {\r\n _logger.logger.error(\"Failed to send invite\", error);\r\n\r\n if (error.event) this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SignallingFailed;\r\n let message = \"Signalling failed\";\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n code = CallErrorCode.SendInvite;\r\n message = \"Failed to send invite\";\r\n }\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.terminate(CallParty.Local, code, false); // no need to carry on & send the candidate queue, but we also\r\n // don't want to rethrow the error\r\n\r\n return;\r\n }\r\n\r\n this.sendCandidateQueue();\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n this.inviteOrAnswerSent = true;\r\n this.setState(CallState.InviteSent);\r\n this.inviteTimeout = setTimeout(() => {\r\n this.inviteTimeout = null;\r\n\r\n if (this.state === CallState.InviteSent) {\r\n this.hangup(CallErrorCode.InviteTimeout, false);\r\n }\r\n }, CALL_TIMEOUT_MS);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"getLocalOfferFailed\", err => {\r\n _logger.logger.error(\"Failed to get local offer\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.LocalOfferFailed, \"Failed to get local offer!\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.LocalOfferFailed, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"getUserMediaFailed\", err => {\r\n if (this.successor) {\r\n this.successor.getUserMediaFailed(err);\r\n return;\r\n }\r\n\r\n _logger.logger.warn(\"Failed to get user media - ending call\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Couldn't start capturing media! Is your microphone set up and \" + \"does this app have permission?\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceConnectionStateChanged\", () => {\r\n if (this.callHasEnded()) {\r\n return; // because ICE can still complete as we're ending the call\r\n }\r\n\r\n _logger.logger.debug(\"Call ID \" + this.callId + \": ICE connection state changed to: \" + this.peerConn.iceConnectionState); // ideally we'd consider the call to be connected when we get media but\r\n // chrome doesn't implement any of the 'onstarted' events yet\r\n\r\n\r\n if (this.peerConn.iceConnectionState == 'connected') {\r\n this.setState(CallState.Connected);\r\n } else if (this.peerConn.iceConnectionState == 'failed') {\r\n this.hangup(CallErrorCode.IceFailed, false);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onSignallingStateChanged\", () => {\r\n _logger.logger.debug(\"call \" + this.callId + \": Signalling state changed to: \" + this.peerConn.signalingState);\r\n });\r\n (0, _defineProperty2.default)(this, \"onTrack\", ev => {\r\n if (ev.streams.length === 0) {\r\n _logger.logger.warn(`Streamless ${ev.track.kind} found: ignoring.`);\r\n\r\n return;\r\n } // If we already have a stream, check this track is from the same one\r\n\r\n\r\n if (this.remoteStream && ev.streams[0].id !== this.remoteStream.id) {\r\n _logger.logger.warn(`Ignoring new stream ID ${ev.streams[0].id}: we already have stream ID ${this.remoteStream.id}`);\r\n\r\n return;\r\n }\r\n\r\n if (!this.remoteStream) {\r\n _logger.logger.info(\"Got remote stream with id \" + ev.streams[0].id);\r\n } // Note that we check by ID above and always set the remote stream: Chrome appears\r\n // to make new stream objects when tranciever directionality is changed and the 'active'\r\n // status of streams change\r\n\r\n\r\n this.remoteStream = ev.streams[0];\r\n\r\n _logger.logger.debug(`Track id ${ev.track.id} of kind ${ev.track.kind} added`);\r\n\r\n if (ev.track.kind === 'video') {\r\n if (this.remoteVideoElement) {\r\n this.playRemoteVideo();\r\n }\r\n } else {\r\n if (this.remoteAudioElement) this.playRemoteAudio();\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onNegotiationNeeded\", async () => {\r\n _logger.logger.info(\"Negotation is needed!\");\r\n\r\n if (this.state !== CallState.CreateOffer && this.opponentVersion === 0) {\r\n _logger.logger.info(\"Opponent does not support renegotiation: ignoring negotiationneeded event\");\r\n\r\n return;\r\n }\r\n\r\n this.makingOffer = true;\r\n\r\n try {\r\n const myOffer = await this.peerConn.createOffer();\r\n await this.gotLocalOffer(myOffer);\r\n } catch (e) {\r\n this.getLocalOfferFailed(e);\r\n return;\r\n } finally {\r\n this.makingOffer = false;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onHangupReceived\", msg => {\r\n _logger.logger.debug(\"Hangup received for call ID \" + this.callId); // party ID must match (our chosen partner hanging up the call) or be undefined (we haven't chosen\r\n // a partner yet but we're treating the hangup as a reject as per VoIP v0)\r\n\r\n\r\n if (this.partyIdMatches(msg) || this.state === CallState.Ringing) {\r\n // default reason is user_hangup\r\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.info(`Ignoring message from party ID ${msg.party_id}: our partner is ${this.opponentPartyId}`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onRejectReceived\", msg => {\r\n _logger.logger.debug(\"Reject received for call ID \" + this.callId); // No need to check party_id for reject because if we'd received either\r\n // an answer or reject, we wouldn't be in state InviteSent\r\n\r\n\r\n const shouldTerminate = // reject events also end the call if it's ringing: it's another of\r\n // our devices rejecting the call.\r\n [CallState.InviteSent, CallState.Ringing].includes(this.state) || // also if we're in the init state and it's an inbound call, since\r\n // this means we just haven't entered the ringing state yet\r\n this.state === CallState.Fledgling && this.direction === CallDirection.Inbound;\r\n\r\n if (shouldTerminate) {\r\n this.terminate(CallParty.Remote, CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.debug(`Call is in state: ${this.state}: ignoring reject`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onAnsweredElsewhere\", msg => {\r\n _logger.logger.debug(\"Call ID \" + this.callId + \" answered elsewhere\");\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n });\r\n this.roomId = opts.roomId;\r\n this.client = opts.client;\r\n this.type = null;\r\n this.forceTURN = opts.forceTURN;\r\n this.ourPartyId = this.client.deviceId; // Array of Objects with urls, username, credential keys\r\n\r\n this.turnServers = opts.turnServers || [];\r\n\r\n if (this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed()) {\r\n this.turnServers.push({\r\n urls: [FALLBACK_ICE_SERVER]\r\n });\r\n }\r\n\r\n for (const server of this.turnServers) {\r\n utils.checkObjectHasKeys(server, [\"urls\"]);\r\n }\r\n\r\n this.callId = genCallID();\r\n this.state = CallState.Fledgling; // A queue for candidates waiting to go out.\r\n // We try to amalgamate candidates into a single candidate message where\r\n // possible\r\n\r\n this.candidateSendQueue = [];\r\n this.candidateSendTries = 0;\r\n this.sentEndOfCandidates = false;\r\n this.inviteOrAnswerSent = false;\r\n this.makingOffer = false;\r\n this.remoteOnHold = false;\r\n this.unholdingRemote = false;\r\n this.micMuted = false;\r\n this.vidMuted = false;\r\n }\r\n /**\r\n * Place a voice call to this room.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVoiceCall() {\r\n _logger.logger.debug(\"placeVoiceCall\");\r\n\r\n this.checkForErrorListener();\r\n const constraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.type = CallType.Voice;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a video call to this room.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVideoCall(remoteVideoElement, localVideoElement) {\r\n _logger.logger.debug(\"placeVideoCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n const constraints = getUserMediaContraints(ConstraintsType.Video);\r\n this.type = CallType.Video;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a screen-sharing call to this room. This includes audio.\r\n * This method is EXPERIMENTAL and subject to change without warning. It\r\n * only works in Google Chrome and Firefox >= 44.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeScreenSharingCall(remoteVideoElement, localVideoElement, selectDesktopCapturerSource) {\r\n _logger.logger.debug(\"placeScreenSharingCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n\r\n try {\r\n var _window$electron;\r\n\r\n const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);\r\n\r\n if (!screenshareConstraints) {\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n return;\r\n }\r\n\r\n if ((_window$electron = window.electron) !== null && _window$electron !== void 0 && _window$electron.getDesktopCapturerSources) {\r\n // We are using Electron\r\n _logger.logger.debug(\"Getting screen stream using getUserMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getUserMedia(screenshareConstraints);\r\n } else {\r\n // We are not using Electron\r\n _logger.logger.debug(\"Getting screen stream using getDisplayMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getDisplayMedia(screenshareConstraints);\r\n }\r\n\r\n _logger.logger.debug(\"Got screen stream, requesting audio stream...\");\r\n\r\n const audioConstraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.placeCallWithConstraints(audioConstraints);\r\n } catch (err) {\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n }\r\n\r\n this.type = CallType.Video;\r\n }\r\n\r\n getOpponentMember() {\r\n return this.opponentMember;\r\n }\r\n\r\n opponentCanBeTransferred() {\r\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.transferee\"]);\r\n }\r\n /**\r\n * Retrieve the local <video> DOM element.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getLocalVideoElement() {\r\n return this.localVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <video> DOM element\r\n * used for playing back video capable streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteVideoElement() {\r\n return this.remoteVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <audio> DOM element\r\n * used for playing back audio only streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteAudioElement() {\r\n return this.remoteAudioElement;\r\n }\r\n /**\r\n * Set the local <video> DOM element. If this call is active,\r\n * video will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setLocalVideoElement(element) {\r\n this.localVideoElement = element;\r\n\r\n if (element && this.localAVStream && this.type === CallType.Video) {\r\n element.autoplay = true;\r\n element.srcObject = this.localAVStream;\r\n element.muted = true;\r\n\r\n try {\r\n await element.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n }\r\n /**\r\n * Set the remote <video> DOM element. If this call is active,\r\n * the first received video-capable stream will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n setRemoteVideoElement(element) {\r\n if (element === this.remoteVideoElement) return;\r\n element.autoplay = true; // if we already have an audio element set, use that instead and mute the audio\r\n // on this video element.\r\n\r\n if (this.remoteAudioElement) element.muted = true;\r\n this.remoteVideoElement = element;\r\n\r\n if (this.remoteStream) {\r\n this.playRemoteVideo();\r\n }\r\n }\r\n /**\r\n * Set the remote <audio> DOM element. If this call is active,\r\n * the first received audio-only stream will be rendered to it immediately.\r\n * The audio will *not* be rendered from the remoteVideoElement.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setRemoteAudioElement(element) {\r\n if (element === this.remoteAudioElement) return;\r\n this.remoteAudioElement = element;\r\n if (this.remoteStream) this.playRemoteAudio();\r\n } // The typescript definitions have this type as 'any' :(\r\n\r\n\r\n async getCurrentCallStats() {\r\n if (this.callHasEnded()) {\r\n return this.callStatsAtEnd;\r\n }\r\n\r\n return this.collectCallStats();\r\n }\r\n\r\n async collectCallStats() {\r\n // This happens when the call fails before it starts.\r\n // For example when we fail to get capture sources\r\n if (!this.peerConn) return;\r\n const statsReport = await this.peerConn.getStats();\r\n const stats = [];\r\n\r\n for (const item of statsReport) {\r\n stats.push(item[1]);\r\n }\r\n\r\n return stats;\r\n }\r\n /**\r\n * Configure this call from an invite event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.invite event\r\n */\r\n\r\n\r\n async initWithInvite(event) {\r\n const invite = event.getContent();\r\n this.direction = CallDirection.Inbound; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n }\r\n\r\n this.peerConn = this.createPeerConnection(); // we must set the party ID before await-ing on anything: the call event\r\n // handler will start giving us more call events (eg. candidates) so if\r\n // we haven't set the party ID, we'll ignore them.\r\n\r\n this.chooseOpponent(event);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(invite.offer);\r\n await this.addBufferedIceCandidates();\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // According to previous comments in this file, firefox at some point did not\r\n // add streams until media started ariving on them. Testing latest firefox\r\n // (81 at time of writing), this is no longer a problem, so let's do it the correct way.\r\n\r\n\r\n if (!this.remoteStream || this.remoteStream.getTracks().length === 0) {\r\n _logger.logger.error(\"No remote stream or no tracks after setting remote description!\");\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n }\r\n\r\n this.type = this.remoteStream.getTracks().some(t => t.kind === 'video') ? CallType.Video : CallType.Voice;\r\n this.setState(CallState.Ringing);\r\n\r\n if (event.getLocalAge()) {\r\n setTimeout(() => {\r\n if (this.state == CallState.Ringing) {\r\n _logger.logger.debug(\"Call invite has expired. Hanging up.\");\r\n\r\n this.hangupParty = CallParty.Remote; // effectively\r\n\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn.signalingState != 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n this.emit(CallEvent.Hangup);\r\n }\r\n }, invite.lifetime - event.getLocalAge());\r\n }\r\n }\r\n /**\r\n * Configure this call from a hangup or reject event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.hangup event\r\n */\r\n\r\n\r\n initWithHangup(event) {\r\n // perverse as it may seem, sometimes we want to instantiate a call with a\r\n // hangup message (because when getting the state of the room on load, events\r\n // come in reverse order and we want to remember that a call has been hung up)\r\n this.setState(CallState.Ended);\r\n }\r\n /**\r\n * Answer a call.\r\n */\r\n\r\n\r\n async answer() {\r\n if (this.inviteOrAnswerSent) {\r\n return;\r\n }\r\n\r\n _logger.logger.debug(`Answering call ${this.callId} of type ${this.type}`);\r\n\r\n if (!this.localAVStream && !this.waitForLocalAVStream) {\r\n const constraints = getUserMediaContraints(this.type == CallType.Video ? ConstraintsType.Video : ConstraintsType.Audio);\r\n\r\n _logger.logger.log(\"Getting user media with constraints\", constraints);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.waitForLocalAVStream = true;\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.waitForLocalAVStream = false;\r\n this.gotUserMediaForAnswer(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n } else if (this.localAVStream) {\r\n this.gotUserMediaForAnswer(this.localAVStream);\r\n } else if (this.waitForLocalAVStream) {\r\n this.setState(CallState.WaitLocalMedia);\r\n }\r\n }\r\n /**\r\n * Replace this call with a new call, e.g. for glare resolution. Used by\r\n * MatrixClient.\r\n * @param {MatrixCall} newCall The new call.\r\n */\r\n\r\n\r\n replacedBy(newCall) {\r\n _logger.logger.debug(this.callId + \" being replaced by \" + newCall.callId);\r\n\r\n if (this.state === CallState.WaitLocalMedia) {\r\n _logger.logger.debug(\"Telling new call to wait for local media\");\r\n\r\n newCall.waitForLocalAVStream = true;\r\n } else if (this.state === CallState.CreateOffer) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n } else if (this.state === CallState.InviteSent) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n }\r\n\r\n newCall.localVideoElement = this.localVideoElement;\r\n newCall.remoteVideoElement = this.remoteVideoElement;\r\n newCall.remoteAudioElement = this.remoteAudioElement;\r\n this.successor = newCall;\r\n this.emit(CallEvent.Replaced, newCall);\r\n this.hangup(CallErrorCode.Replaced, true);\r\n }\r\n /**\r\n * Hangup a call.\r\n * @param {string} reason The reason why the call is being hung up.\r\n * @param {boolean} suppressEvent True to suppress emitting an event.\r\n */\r\n\r\n\r\n hangup(reason, suppressEvent) {\r\n if (this.callHasEnded()) return;\r\n\r\n _logger.logger.debug(\"Ending call \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, reason, !suppressEvent); // We don't want to send hangup here if we didn't even get to sending an invite\r\n\r\n if (this.state === CallState.WaitLocalMedia) return;\r\n const content = {}; // Continue to send no reason for user hangups temporarily, until\r\n // clients understand the user_hangup reason (voip v1)\r\n\r\n if (reason !== CallErrorCode.UserHangup) content['reason'] = reason;\r\n this.sendVoipEvent(_event.EventType.CallHangup, {});\r\n }\r\n /**\r\n * Reject a call\r\n * This used to be done by calling hangup, but is a separate method and protocol\r\n * event as of MSC2746.\r\n */\r\n\r\n\r\n reject() {\r\n if (this.state !== CallState.Ringing) {\r\n throw Error(\"Call must be in 'ringing' state to reject!\");\r\n }\r\n\r\n if (this.opponentVersion < 1) {\r\n _logger.logger.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`);\r\n\r\n this.hangup(CallErrorCode.UserHangup, true);\r\n return;\r\n }\r\n\r\n _logger.logger.debug(\"Rejecting call: \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.UserHangup, true);\r\n this.sendVoipEvent(_event.EventType.CallReject, {});\r\n }\r\n /**\r\n * Set whether our outbound video should be muted or not.\r\n * @param {boolean} muted True to mute the outbound video.\r\n */\r\n\r\n\r\n setLocalVideoMuted(muted) {\r\n this.vidMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if local video is muted.\r\n *\r\n * If there are multiple video tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no video tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the local preview video is muted, else false\r\n * (including if the call is not set up yet).\r\n */\r\n\r\n\r\n isLocalVideoMuted() {\r\n return this.vidMuted;\r\n }\r\n /**\r\n * Set whether the microphone should be muted or not.\r\n * @param {boolean} muted True to mute the mic.\r\n */\r\n\r\n\r\n setMicrophoneMuted(muted) {\r\n this.micMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if the microphone is muted.\r\n *\r\n * If there are multiple audio tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no audio tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the mic is muted, else false (including if the call\r\n * is not set up yet).\r\n */\r\n\r\n\r\n isMicrophoneMuted() {\r\n return this.micMuted;\r\n }\r\n /**\r\n * @returns true if we have put the party on the other side of the call on hold\r\n * (that is, we are signalling to them that we are not listening)\r\n */\r\n\r\n\r\n isRemoteOnHold() {\r\n return this.remoteOnHold;\r\n }\r\n\r\n setRemoteOnHold(onHold) {\r\n if (this.isRemoteOnHold() === onHold) return;\r\n this.remoteOnHold = onHold;\r\n if (!onHold) this.unholdingRemote = true;\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n // We set 'inactive' rather than 'sendonly' because we're not planning on\r\n // playing music etc. to the other side.\r\n tranceiver.direction = onHold ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n this.updateMuteStatus();\r\n\r\n if (!onHold) {\r\n this.playRemoteAudio();\r\n }\r\n\r\n this.emit(CallEvent.RemoteHoldUnhold, this.remoteOnHold);\r\n }\r\n /**\r\n * Indicates whether we are 'on hold' to the remote party (ie. if true,\r\n * they cannot hear us). Note that this will return true when we put the\r\n * remote on hold too due to the way hold is implemented (since we don't\r\n * wish to play hold music when we put a call on hold, we use 'inactive'\r\n * rather than 'sendonly')\r\n * @returns true if the other party has put us on hold\r\n */\r\n\r\n\r\n isLocalOnHold() {\r\n if (this.state !== CallState.Connected) return false;\r\n if (this.unholdingRemote) return false;\r\n let callOnHold = true; // We consider a call to be on hold only if *all* the tracks are on hold\r\n // (is this the right thing to do?)\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n const trackOnHold = ['inactive', 'recvonly'].includes(tranceiver.currentDirection);\r\n if (!trackOnHold) callOnHold = false;\r\n }\r\n\r\n return callOnHold;\r\n }\r\n /**\r\n * Sends a DTMF digit to the other party\r\n * @param digit The digit (nb. string - '#' and '*' are dtmf too)\r\n */\r\n\r\n\r\n sendDtmfDigit(digit) {\r\n for (const sender of this.peerConn.getSenders()) {\r\n if (sender.track.kind === 'audio' && sender.dtmf) {\r\n sender.dtmf.insertDTMF(digit);\r\n return;\r\n }\r\n }\r\n\r\n throw new Error(\"Unable to find a track to send DTMF on\");\r\n }\r\n\r\n updateMuteStatus() {\r\n if (!this.localAVStream) {\r\n return;\r\n }\r\n\r\n const micShouldBeMuted = this.micMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getAudioTracks(), !micShouldBeMuted);\r\n const vidShouldBeMuted = this.vidMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getVideoTracks(), !vidShouldBeMuted);\r\n\r\n if (this.remoteOnHold) {\r\n if (this.remoteAudioElement && this.remoteAudioElement.srcObject === this.remoteStream) {\r\n this.remoteAudioElement.muted = true;\r\n } else if (this.remoteVideoElement && this.remoteVideoElement.srcObject === this.remoteStream) {\r\n this.remoteVideoElement.muted = true;\r\n }\r\n } else {\r\n this.playRemoteAudio();\r\n }\r\n }\r\n /**\r\n * Internal\r\n * @param {Object} stream\r\n */\r\n\r\n\r\n async sendAnswer() {\r\n const answerContent = {\r\n answer: {\r\n sdp: this.peerConn.localDescription.sdp,\r\n // type is now deprecated as of Matrix VoIP v1, but\r\n // required to still be sent for backwards compat\r\n type: this.peerConn.localDescription.type\r\n }\r\n };\r\n\r\n if (this.client._supportsCallTransfer) {\r\n answerContent.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // We have just taken the local description from the peerconnection which will\r\n // contain all the local candidates added so far, so we can discard any candidates\r\n // we had queued up because they'll be in the answer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallAnswer, answerContent); // If this isn't the first time we've tried to send the answer,\r\n // we may have candidates queued up, so send them now.\r\n\r\n this.inviteOrAnswerSent = true;\r\n } catch (error) {\r\n // We've failed to answer: back to the ringing state\r\n this.setState(CallState.Ringing);\r\n this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SendAnswer;\r\n let message = \"Failed to send answer\";\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n throw error;\r\n } // error handler re-throws so this won't happen on error, but\r\n // we don't want the same error handling on the candidate queue\r\n\r\n\r\n this.sendCandidateQueue();\r\n }\r\n\r\n async onRemoteIceCandidatesReceived(ev) {\r\n if (this.callHasEnded()) {\r\n //debuglog(\"Ignoring remote ICE candidate because call has ended\");\r\n return;\r\n }\r\n\r\n const cands = ev.getContent().candidates;\r\n\r\n if (!cands) {\r\n _logger.logger.info(\"Ignoring candidates event with no candidates!\");\r\n\r\n return;\r\n }\r\n\r\n const fromPartyId = ev.getContent().version === 0 ? null : ev.getContent().party_id || null;\r\n\r\n if (this.opponentPartyId === undefined) {\r\n // we haven't picked an opponent yet so save the candidates\r\n _logger.logger.info(`Bufferring ${cands.length} candidates until we pick an opponent`);\r\n\r\n const bufferedCands = this.remoteCandidateBuffer.get(fromPartyId) || [];\r\n bufferedCands.push(...cands);\r\n this.remoteCandidateBuffer.set(fromPartyId, bufferedCands);\r\n return;\r\n }\r\n\r\n if (!this.partyIdMatches(ev.getContent())) {\r\n _logger.logger.info(`Ignoring candidates from party ID ${ev.getContent().party_id}: ` + `we have chosen party ID ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n await this.addIceCandidates(cands);\r\n }\r\n /**\r\n * Used by MatrixClient.\r\n * @param {Object} msg\r\n */\r\n\r\n\r\n async onAnswerReceived(event) {\r\n _logger.logger.debug(`Got answer for call ID ${this.callId} from party ID ${event.getContent().party_id}`);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);\r\n\r\n return;\r\n }\r\n\r\n if (this.opponentPartyId !== undefined) {\r\n _logger.logger.info(`Ignoring answer from party ID ${event.getContent().party_id}: ` + `we already have an answer/reject from ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n this.chooseOpponent(event);\r\n await this.addBufferedIceCandidates();\r\n this.setState(CallState.Connecting);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(event.getContent().answer);\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // If the answer we selected has a party_id, send a select_answer event\r\n // We do this after setting the remote description since otherwise we'd block\r\n // call setup on it\r\n\r\n\r\n if (this.opponentPartyId !== null) {\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallSelectAnswer, {\r\n selected_party_id: this.opponentPartyId\r\n });\r\n } catch (err) {\r\n // This isn't fatal, and will just mean that if another party has raced to answer\r\n // the call, they won't know they got rejected, so we carry on & don't retry.\r\n _logger.logger.warn(\"Failed to send select_answer event\", err);\r\n }\r\n }\r\n }\r\n\r\n async onSelectAnswerReceived(event) {\r\n if (this.direction !== CallDirection.Inbound) {\r\n _logger.logger.warn(\"Got select_answer for an outbound call: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n const selectedPartyId = event.getContent().selected_party_id;\r\n\r\n if (selectedPartyId === undefined || selectedPartyId === null) {\r\n _logger.logger.warn(\"Got nonsensical select_answer with null/undefined selected_party_id: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n if (selectedPartyId !== this.ourPartyId) {\r\n _logger.logger.info(`Got select_answer for party ID ${selectedPartyId}: we are party ID ${this.ourPartyId}.`); // The other party has picked somebody else's answer\r\n\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n }\r\n }\r\n\r\n async onNegotiateReceived(event) {\r\n const description = event.getContent().description;\r\n\r\n if (!description || !description.sdp || !description.type) {\r\n _logger.logger.info(\"Ignoring invalid m.call.negotiate event\");\r\n\r\n return;\r\n } // Politeness always follows the direction of the call: in a glare situation,\r\n // we pick either the inbound or outbound call, so one side will always be\r\n // inbound and one outbound\r\n\r\n\r\n const polite = this.direction === CallDirection.Inbound; // Here we follow the perfect negotiation logic from\r\n // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation\r\n\r\n const offerCollision = description.type === 'offer' && (this.makingOffer || this.peerConn.signalingState != 'stable');\r\n this.ignoreOffer = !polite && offerCollision;\r\n\r\n if (this.ignoreOffer) {\r\n _logger.logger.info(\"Ignoring colliding negotiate event because we're impolite\");\r\n\r\n return;\r\n }\r\n\r\n const prevLocalOnHold = this.isLocalOnHold();\r\n\r\n if (description.type === 'answer') {\r\n // whenever we get an answer back, clear the flag we set whilst trying to un-hold\r\n // the other party: the state of the channels now reflects reality\r\n this.unholdingRemote = false;\r\n }\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(description);\r\n\r\n if (description.type === 'offer') {\r\n // First we sent the direction of the tranciever to what we'd like it to be,\r\n // irresepective of whether the other side has us on hold - so just whether we\r\n // want the call to be on hold or not. This is necessary because in a few lines,\r\n // we'll adjust the direction and unless we do this too, we'll never come off hold.\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = this.isRemoteOnHold() ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n const localDescription = await this.peerConn.createAnswer();\r\n await this.peerConn.setLocalDescription(localDescription); // Now we've got our answer, set the direction to the outcome of the negotiation.\r\n // We need to do this otherwise Firefox will notice that the direction is not the\r\n // currentDirection and try to negotiate itself off hold again.\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = tranceiver.currentDirection;\r\n }\r\n\r\n this.sendVoipEvent(_event.EventType.CallNegotiate, {\r\n description: this.peerConn.localDescription\r\n });\r\n }\r\n } catch (err) {\r\n _logger.logger.warn(\"Failed to complete negotiation\", err);\r\n }\r\n\r\n const newLocalOnHold = this.isLocalOnHold();\r\n\r\n if (prevLocalOnHold !== newLocalOnHold) {\r\n this.emit(CallEvent.LocalHoldUnhold, newLocalOnHold); // also this one for backwards compat\r\n\r\n this.emit(CallEvent.HoldUnhold, newLocalOnHold);\r\n }\r\n }\r\n\r\n callHasEnded() {\r\n // This exists as workaround to typescript trying to be clever and erroring\r\n // when putting if (this.state === CallState.Ended) return; twice in the same\r\n // function, even though that function is async.\r\n return this.state === CallState.Ended;\r\n }\r\n\r\n async playRemoteAudio() {\r\n if (this.remoteVideoElement) this.remoteVideoElement.muted = true;\r\n this.remoteAudioElement.muted = false;\r\n this.remoteAudioElement.srcObject = this.remoteStream; // if audioOutput is non-default:\r\n\r\n try {\r\n if (audioOutput) {\r\n // This seems quite unreliable in Chrome, although I haven't yet managed to make a jsfiddle where\r\n // it fails.\r\n // It seems reliable if you set the sink ID after setting the srcObject and then set the sink ID\r\n // back to the default after the call is over\r\n _logger.logger.info(\"Setting audio sink to \" + audioOutput + \", was \" + this.remoteAudioElement.sinkId);\r\n\r\n await this.remoteAudioElement.setSinkId(audioOutput);\r\n }\r\n } catch (e) {\r\n _logger.logger.warn(\"Couldn't set requested audio output device: using default\", e);\r\n }\r\n\r\n try {\r\n await this.remoteAudioElement.play();\r\n } catch (e) {\r\n _logger.logger.error(\"Failed to play remote audio element\", e);\r\n }\r\n }\r\n\r\n async playRemoteVideo() {\r\n // A note on calling methods on media elements:\r\n // We used to have queues per media element to serialise all calls on those elements.\r\n // The reason given for this was that load() and play() were racing. However, we now\r\n // never call load() explicitly so this seems unnecessary. However, serialising every\r\n // operation was causing bugs where video would not resume because some play command\r\n // had got stuck and all media operations were queued up behind it. If necessary, we\r\n // should serialise the ones that need to be serialised but then be able to interrupt\r\n // them with another load() which will cancel the pending one, but since we don't call\r\n // load() explicitly, it shouldn't be a problem.\r\n this.remoteVideoElement.srcObject = this.remoteStream;\r\n\r\n _logger.logger.info(\"playing remote video. stream active? \" + this.remoteStream.active);\r\n\r\n try {\r\n await this.remoteVideoElement.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play remote video element\", e);\r\n }\r\n }\r\n\r\n setState(state) {\r\n const oldState = this.state;\r\n this.state = state;\r\n this.emit(CallEvent.State, state, oldState);\r\n }\r\n /**\r\n * Internal\r\n * @param {string} eventType\r\n * @param {Object} content\r\n * @return {Promise}\r\n */\r\n\r\n\r\n sendVoipEvent(eventType, content) {\r\n return this.client.sendEvent(this.roomId, eventType, Object.assign({}, content, {\r\n version: VOIP_PROTO_VERSION,\r\n call_id: this.callId,\r\n party_id: this.ourPartyId\r\n }));\r\n }\r\n\r\n queueCandidate(content) {\r\n // Sends candidates with are sent in a special way because we try to amalgamate\r\n // them into one message\r\n this.candidateSendQueue.push(content); // Don't send the ICE candidates yet if the call is in the ringing state: this\r\n // means we tried to pick (ie. started generating candidates) and then failed to\r\n // send the answer and went back to the ringing state. Queue up the candidates\r\n // to send if we sucessfully send the answer.\r\n // Equally don't send if we haven't yet sent the answer because we can send the\r\n // first batch of candidates along with the answer\r\n\r\n if (this.state === CallState.Ringing || !this.inviteOrAnswerSent) return; // MSC2746 reccomends these values (can be quite long when calling because the\r\n // callee will need a while to answer the call)\r\n\r\n const delay = this.direction === CallDirection.Inbound ? 500 : 2000;\r\n\r\n if (this.candidateSendTries === 0) {\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delay);\r\n }\r\n }\r\n /*\r\n * Transfers this call to another user\r\n */\r\n\r\n\r\n async transfer(targetUserId) {\r\n // Fetch the target user's global profile info: their room avatar / displayname\r\n // could be different in whatever room we shae with them.\r\n const profileInfo = await this.client.getProfileInfo(targetUserId);\r\n const replacementId = genCallID();\r\n const body = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: targetUserId,\r\n display_name: profileInfo.display_name,\r\n avatar_url: profileInfo.avatar_url\r\n },\r\n create_call: replacementId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, body);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n /*\r\n * Transfers this call to the target call, effectively 'joining' the\r\n * two calls (so the remote parties on each call are connected together).\r\n */\r\n\r\n\r\n async transferToCall(transferTargetCall) {\r\n const targetProfileInfo = await this.client.getProfileInfo(transferTargetCall.getOpponentMember().userId);\r\n const transfereeProfileInfo = await this.client.getProfileInfo(this.getOpponentMember().userId);\r\n const newCallId = genCallID();\r\n const bodyToTransferTarget = {\r\n // the replacements on each side have their own ID, and it's distinct from the\r\n // ID of the new call (but we can use the same function to generate it)\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: this.getOpponentMember().userId,\r\n display_name: transfereeProfileInfo.display_name,\r\n avatar_url: transfereeProfileInfo.avatar_url\r\n },\r\n await_call: newCallId\r\n };\r\n await transferTargetCall.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferTarget);\r\n const bodyToTransferee = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: transferTargetCall.getOpponentMember().userId,\r\n display_name: targetProfileInfo.display_name,\r\n avatar_url: targetProfileInfo.avatar_url\r\n },\r\n create_call: newCallId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferee);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n await transferTargetCall.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n\r\n async terminate(hangupParty, hangupReason, shouldEmit) {\r\n if (this.callHasEnded()) return;\r\n this.callStatsAtEnd = await this.collectCallStats();\r\n\r\n if (this.inviteTimeout) {\r\n clearTimeout(this.inviteTimeout);\r\n this.inviteTimeout = null;\r\n }\r\n\r\n const remoteVid = this.getRemoteVideoElement();\r\n const remoteAud = this.getRemoteAudioElement();\r\n const localVid = this.getLocalVideoElement();\r\n\r\n if (remoteVid) {\r\n remoteVid.pause();\r\n remoteVid.srcObject = null;\r\n }\r\n\r\n if (remoteAud) {\r\n remoteAud.pause();\r\n remoteAud.srcObject = null;\r\n\r\n try {\r\n // As per comment in playRemoteAudio, setting the sink ID back to the default\r\n // once the call is over makes setSinkId work reliably.\r\n await this.remoteAudioElement.setSinkId('');\r\n } catch (e) {\r\n _logger.logger.warn(\"Failed to set sink ID back to default\");\r\n }\r\n }\r\n\r\n if (localVid) {\r\n localVid.pause();\r\n localVid.srcObject = null;\r\n }\r\n\r\n this.hangupParty = hangupParty;\r\n this.hangupReason = hangupReason;\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn && this.peerConn.signalingState !== 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n if (shouldEmit) {\r\n this.emit(CallEvent.Hangup, this);\r\n }\r\n }\r\n\r\n stopAllMedia() {\r\n _logger.logger.debug(`stopAllMedia (stream=${this.localAVStream})`);\r\n\r\n if (this.localAVStream) {\r\n for (const track of this.localAVStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.screenSharingStream) {\r\n for (const track of this.screenSharingStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.remoteStream) {\r\n for (const track of this.remoteStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n }\r\n\r\n checkForErrorListener() {\r\n if (this.listeners(\"error\").length === 0) {\r\n throw new Error(\"You MUST attach an error listener using call.on('error', function() {})\");\r\n }\r\n }\r\n\r\n async sendCandidateQueue() {\r\n if (this.candidateSendQueue.length === 0) {\r\n return;\r\n }\r\n\r\n const cands = this.candidateSendQueue;\r\n this.candidateSendQueue = [];\r\n ++this.candidateSendTries;\r\n const content = {\r\n candidates: cands\r\n };\r\n\r\n _logger.logger.debug(\"Attempting to send \" + cands.length + \" candidates\");\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallCandidates, content);\r\n } catch (error) {\r\n // don't retry this event: we'll send another one later as we might\r\n // have more candidates by then.\r\n if (error.event) this.client.cancelPendingEvent(error.event); // put all the candidates we failed to send back in the queue\r\n\r\n this.candidateSendQueue.push(...cands);\r\n\r\n if (this.candidateSendTries > 5) {\r\n _logger.logger.debug(\"Failed to send candidates on attempt \" + this.candidateSendTries + \". Giving up on this call.\", error);\r\n\r\n const code = CallErrorCode.SignallingFailed;\r\n const message = \"Signalling failed\";\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.hangup(code, false);\r\n return;\r\n }\r\n\r\n const delayMs = 500 * Math.pow(2, this.candidateSendTries);\r\n ++this.candidateSendTries;\r\n\r\n _logger.logger.debug(\"Failed to send candidates. Retrying in \" + delayMs + \"ms\", error);\r\n\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delayMs);\r\n }\r\n }\r\n\r\n async placeCallWithConstraints(constraints) {\r\n _logger.logger.log(\"Getting user media with constraints\", constraints); // XXX Find a better way to do this\r\n\r\n\r\n this.client._callEventHandler.calls.set(this.callId, this);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.direction = CallDirection.Outbound;\r\n this.config = constraints; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n } // create the peer connection now so it can be gathering candidates while we get user\r\n // media (assuming a candidate pool size is configured)\r\n\r\n\r\n this.peerConn = this.createPeerConnection();\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.gotUserMediaForInvite(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n }\r\n\r\n createPeerConnection() {\r\n const pc = new window.RTCPeerConnection({\r\n iceTransportPolicy: this.forceTURN ? 'relay' : undefined,\r\n iceServers: this.turnServers,\r\n iceCandidatePoolSize: this.client._iceCandidatePoolSize\r\n }); // 'connectionstatechange' would be better, but firefox doesn't implement that.\r\n\r\n pc.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChanged);\r\n pc.addEventListener('signalingstatechange', this.onSignallingStateChanged);\r\n pc.addEventListener('icecandidate', this.gotLocalIceCandidate);\r\n pc.addEventListener('icegatheringstatechange', this.onIceGatheringStateChange);\r\n pc.addEventListener('track', this.onTrack);\r\n pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);\r\n return pc;\r\n }\r\n\r\n partyIdMatches(msg) {\r\n // They must either match or both be absent (in which case opponentPartyId will be null)\r\n // Also we ignore party IDs on the invite/offer if the version is 0, so we must do the same\r\n // here and use null if the version is 0 (woe betide any opponent sending messages in the\r\n // same call with different versions)\r\n const msgPartyId = msg.version === 0 ? null : msg.party_id || null;\r\n return msgPartyId === this.opponentPartyId;\r\n } // Commits to an opponent for the call\r\n // ev: An invite or answer event\r\n\r\n\r\n chooseOpponent(ev) {\r\n // I choo-choo-choose you\r\n const msg = ev.getContent();\r\n\r\n _logger.logger.debug(`Choosing party ID ${msg.party_id} for call ID ${this.callId}`);\r\n\r\n this.opponentVersion = msg.version;\r\n\r\n if (this.opponentVersion === 0) {\r\n // set to null to indicate that we've chosen an opponent, but because\r\n // they're v0 they have no party ID (even if they sent one, we're ignoring it)\r\n this.opponentPartyId = null;\r\n } else {\r\n // set to their party ID, or if they're naughty and didn't send one despite\r\n // not being v0, set it to null to indicate we picked an opponent with no\r\n // party ID\r\n this.opponentPartyId = msg.party_id || null;\r\n }\r\n\r\n this.opponentCaps = msg.capabilities || {};\r\n this.opponentMember = ev.sender;\r\n }\r\n\r\n async addBufferedIceCandidates() {\r\n const bufferedCands = this.remoteCandidateBuffer.get(this.opponentPartyId);\r\n\r\n if (bufferedCands) {\r\n _logger.logger.info(`Adding ${bufferedCands.length} buffered candidates for opponent ${this.opponentPartyId}`);\r\n\r\n await this.addIceCandidates(bufferedCands);\r\n }\r\n\r\n this.remoteCandidateBuffer = null;\r\n }\r\n\r\n async addIceCandidates(cands) {\r\n for (const cand of cands) {\r\n if ((cand.sdpMid === null || cand.sdpMid === undefined) && (cand.sdpMLineIndex === null || cand.sdpMLineIndex === undefined)) {\r\n _logger.logger.debug(\"Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex\");\r\n\r\n continue;\r\n }\r\n\r\n _logger.logger.debug(\"Call \" + this.callId + \" got remote ICE \" + cand.sdpMid + \" candidate: \" + cand.candidate);\r\n\r\n try {\r\n await this.peerConn.addIceCandidate(cand);\r\n } catch (err) {\r\n if (!this.ignoreOffer) {\r\n _logger.logger.info(\"Failed to add remote ICE candidate\", err);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.MatrixCall = MatrixCall;\r\n\r\nfunction setTracksEnabled(tracks, enabled) {\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].enabled = enabled;\r\n }\r\n}\r\n\r\nfunction getUserMediaContraints(type) {\r\n const isWebkit = !!navigator.webkitGetUserMedia;\r\n\r\n switch (type) {\r\n case ConstraintsType.Audio:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: false\r\n };\r\n }\r\n\r\n case ConstraintsType.Video:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: {\r\n deviceId: videoInput ? {\r\n ideal: videoInput\r\n } : undefined,\r\n\r\n /* We want 640x360. Chrome will give it only if we ask exactly,\r\n FF refuses entirely if we ask exactly, so have to ask for ideal\r\n instead\r\n XXX: Is this still true?\r\n */\r\n width: isWebkit ? {\r\n exact: 640\r\n } : {\r\n ideal: 640\r\n },\r\n height: isWebkit ? {\r\n exact: 360\r\n } : {\r\n ideal: 360\r\n }\r\n }\r\n };\r\n }\r\n }\r\n}\r\n\r\nasync function getScreenshareContraints(selectDesktopCapturerSource) {\r\n var _window$electron2;\r\n\r\n if ((_window$electron2 = window.electron) !== null && _window$electron2 !== void 0 && _window$electron2.getDesktopCapturerSources && selectDesktopCapturerSource) {\r\n // We have access to getDesktopCapturerSources()\r\n _logger.logger.debug(\"Electron getDesktopCapturerSources() is available...\");\r\n\r\n const selectedSource = await selectDesktopCapturerSource();\r\n if (!selectedSource) return null;\r\n return {\r\n audio: false,\r\n video: {\r\n mandatory: {\r\n chromeMediaSource: \"desktop\",\r\n chromeMediaSourceId: selectedSource.id\r\n }\r\n }\r\n };\r\n } else {\r\n // We do not have access to the Electron desktop capturer,\r\n // therefore we can assume we are on the web\r\n _logger.logger.debug(\"Electron desktopCapturer is not available...\");\r\n\r\n return {\r\n audio: false,\r\n video: true\r\n };\r\n }\r\n}\r\n\r\nlet audioOutput;\r\nlet audioInput;\r\nlet videoInput;\r\n/**\r\n * Set an audio output device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\nfunction setAudioOutput(deviceId) {\r\n audioOutput = deviceId;\r\n}\r\n/**\r\n * Set an audio input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setAudioInput(deviceId) {\r\n audioInput = deviceId;\r\n}\r\n/**\r\n * Set a video input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setVideoInput(deviceId) {\r\n videoInput = deviceId;\r\n}\r\n/**\r\n * Create a new Matrix call for the browser.\r\n * @param {MatrixClient} client The client instance to use.\r\n * @param {string} roomId The room the call is in.\r\n * @param {Object?} options DEPRECATED optional options map.\r\n * @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be\r\n * forced. This option is deprecated - use opts.forceTURN when creating the matrix client\r\n * since it's only possible to set this option on outbound calls.\r\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\r\n */\r\n\r\n\r\nfunction createNewMatrixCall(client, roomId, options) {\r\n // typeof prevents Node from erroring on an undefined reference\r\n if (typeof window === 'undefined' || typeof document === 'undefined') {\r\n // NB. We don't log here as apps try to create a call object as a test for\r\n // whether calls are supported, so we shouldn't fill the logs up.\r\n return null;\r\n } // Firefox throws on so little as accessing the RTCPeerConnection when operating in\r\n // a secure mode. There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616\r\n // though the concern is that the browser throwing a SecurityError will brick the\r\n // client creation process.\r\n\r\n\r\n try {\r\n const supported = Boolean(window.RTCPeerConnection || window.RTCSessionDescription || window.RTCIceCandidate || navigator.mediaDevices);\r\n\r\n if (!supported) {\r\n _logger.logger.error(\"WebRTC is not supported in this browser / environment\");\r\n\r\n return null;\r\n }\r\n } catch (e) {\r\n _logger.logger.error(\"Exception thrown when trying to access WebRTC\", e);\r\n\r\n return null;\r\n }\r\n\r\n const optionsForceTURN = options ? options.forceTURN : false;\r\n const opts = {\r\n client: client,\r\n roomId: roomId,\r\n turnServers: client.getTurnServers(),\r\n // call level options\r\n forceTURN: client._forceTURN || optionsForceTURN\r\n };\r\n const call = new MatrixCall(opts);\r\n client.reEmitter.reEmit(call, Object.values(CallEvent));\r\n return call;\r\n}","\r\nvar createHash = null\r\n\r\nvar f = {}\r\n\r\nf.sha224 = function(text){\r\n\r\n if(!createHash){\r\n createHash = require('create-hash')\r\n }\r\n\r\n var hash = createHash('sha224')\r\n hash.update(text)\r\n return hash.digest()\r\n\r\n}\r\n\r\n\r\nf.language = function () {\r\n\r\n var language;\r\n if (window.navigator.languages) {\r\n language = window.navigator.languages[0];\r\n } else {\r\n language = window.navigator.userLanguage || window.navigator.language;\r\n }\r\n\r\n return language\r\n}\r\nf.deep = function (obj, key) {\r\n var _key = _.isArray(key) ? key : key.split(\".\");\r\n\r\n var tkey = _key[0];\r\n\r\n if (typeof obj == 'undefined' || !obj) return undefined;\r\n\r\n if (typeof obj[tkey] != 'undefined') {\r\n _key.splice(0, 1);\r\n\r\n if (_key.length === 0) {\r\n return obj[tkey];\r\n }\r\n else {\r\n return f.deep(obj[tkey], _key)\r\n }\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n\r\nvar renderFrameEqualizer = function (canvas, ctx, analyser, stop, colornumbers, offset) {\r\n\r\n\r\n\r\n if (!colornumbers) {\r\n colornumbers = {\r\n r: 25,\r\n g: 250,\r\n b: 50\r\n }\r\n }\r\n\r\n if (!offset) {\r\n offset = {\r\n x: 25,\r\n offset: [0, 0]\r\n }\r\n }\r\n\r\n var WIDTH = canvas.width;\r\n var HEIGHT = canvas.height;\r\n\r\n var bufferLength = analyser.frequencyBinCount;\r\n var dataArray = new Uint8Array(bufferLength);\r\n\r\n var barWidth = (WIDTH / bufferLength) / 2.5;\r\n var barHeight;\r\n\r\n var x = offset.x // offset[0] -15;\r\n\r\n analyser.getByteFrequencyData(dataArray);\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n for (var i = 0; i < bufferLength; i++) {\r\n\r\n barHeight = dataArray[i];\r\n\r\n var r = barHeight + (colornumbers.r * (i / bufferLength));\r\n var g = colornumbers.g * (i / bufferLength);\r\n var b = colornumbers.b;\r\n\r\n var opacity = - Math.abs(i - bufferLength / 2) / bufferLength + 1 / 2\r\n\r\n\r\n if (i > offset.offset[0] && i < bufferLength - offset.offset[1]) {\r\n ctx.fillStyle = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + opacity * 2 + \")\";\r\n ctx.fillRect(x, HEIGHT / 2 - (barHeight * opacity), barWidth, barHeight * opacity * 2);\r\n }\r\n\r\n\r\n x += barWidth + 1;\r\n }\r\n\r\n requestAnimationFrame(function () {\r\n if (stop()) {\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n return\r\n }\r\n\r\n renderFrameEqualizer(canvas, ctx, analyser, stop, colornumbers, offset)\r\n });\r\n\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nf.permutations = function (array, k) {\r\n\r\n k || (k = 1)\r\n\r\n var m = [];\r\n var combinations = [];\r\n var indices = [];\r\n var len = array.length;\r\n function run(level) {\r\n for (var i = 0; i < len; i++) {\r\n if (!indices[i]) {\r\n indices[i] = true;\r\n combinations[level] = array[i];\r\n if (level < k - 1) {\r\n run(level + 1, i + 1);\r\n } else {\r\n m.push(([]).concat(combinations));\r\n }\r\n indices[i] = false;\r\n }\r\n }\r\n }\r\n run(0);\r\n return m;\r\n}\r\n\r\nvar copytext = function (text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // IE specific code path to prevent textarea being shown while dialog is visible.\r\n return clipboardData.setData(\"Text\", text);\r\n\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in MS Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return false;\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\r\nvar makeid = function (valid) {\r\n\r\n function s4() {\r\n return Math.floor((1 + Math.random()) * 0x10000)\r\n .toString(16)\r\n .substring(1);\r\n }\r\n\r\n if (!valid) {\r\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\r\n s4() + '-' + s4() + s4() + s4();\r\n }\r\n\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\r\n for (var i = 0; i < 16; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n return text;\r\n}\r\n// roomalias\r\n\r\nvar flball = function (str) {\r\n\r\n //return flbb(str)\r\n\r\n if (!str || !str.split) return str\r\n\r\n var exception = [\"2ndEdison, 3dCarbon\", \"A-Pmcs\"];\r\n var lower = [\"TO\", \"K\", \"X\", \"10X\", \"THE\", \"AN\", \"AND\", \"OR\", \"AT\", \"BUT\", \"BY\", \"FOR\", \"IN\", \"OF\", \"OFF\", \"ON\", \"OUT\", \"PER\", \"UP\", \"VIA\", \"AS\", \"FOR\"];\r\n var upper = [\"2MCBL\", \"USA\", \"TONS\", \"BHCC\", \"LLC\", \"LTD\", \"1BWK\", \"AGMA\", \"VIII\", \"XIII\", \"BHCC\"];\r\n var capital = [\"LAS\", \"LAW\", \"SON\", \"DEE\", \"ST\", \"PET\", \"BIG\", \"WAY\", \"AIR\", \"ALL\", \"TOP\", \"JOY\", \"CO\", \"INC\", \"INC.\", \"AVE\", \"PAY\", \"ST.\", \"FOX\", \"CAR\", \"TAX\", \"DAY\", \"MAN\", \"CO.\", \"NEW\"];\r\n var capitalReg = new RegExp(capital.join('|'));\r\n var upperReg = new RegExp(upper.join('|'));\r\n\r\n\r\n var nameArr = str.split(' ').map(function (word) {\r\n if (exception.some(function (w) { return w.toUpperCase() === word })) {\r\n\r\n return exception.find(function (w) { return w.toUpperCase() === word });\r\n }\r\n\r\n if (\r\n lower.some(function (w) {\r\n if (w === word) {\r\n return true;\r\n };\r\n var wArr = w.split(' ');\r\n for (var i = 0; i < wArr.length; i++) {\r\n if (/[0-9]/.test(wArr[i]) && /ST|ND|RD|TH|K/.test(wArr[i + 1] + wArr[i + 2])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n })\r\n ) {\r\n return word.toLowerCase();\r\n }\r\n\r\n if (capitalReg.test(word)) {\r\n return word[0] + word.slice(1).toLowerCase();\r\n }\r\n if (word.replace(/\\(|\\)/g, '').length <= 3 || upperReg.test(word)) {\r\n return word;\r\n }\r\n var wordCap = word.toLowerCase().replace(/[A-Za-z]/, function (l) { return l.toUpperCase() });\r\n var wordArr = [];\r\n wordArr.push(wordCap[0]);\r\n for (var i = 0; i < wordCap.length; i++) {\r\n if (wordCap[i + 1] && (/\\.|\\/|[0-9]|\\&|\\-|\\s/.test(wordCap[i]) || (wordCap[i - 1] + wordCap[i]).toLowerCase() === 'mc')) {\r\n wordArr.push(wordCap[i + 1].toUpperCase());\r\n } else if (wordCap[i + 1]) {\r\n wordArr.push(wordCap[i + 1])\r\n }\r\n };\r\n return wordArr.join('')\r\n })\r\n\r\n return flb(nameArr.join(' '))\r\n}\r\n\r\nvar flb = function (str) {\r\n return str[0].toUpperCase() + str.substr(1);\r\n}\r\n\r\nvar flbs = function (str) {\r\n\r\n return str[0].toUpperCase() + str.substr(1).toLowerCase();\r\n}\r\n\r\nvar flbb = function (str) {\r\n\r\n var s = str.split(' ');\r\n\r\n return _.map(s, function (s) {\r\n return flbs(s);\r\n }).join(' ')\r\n\r\n}\r\nvar group = function (array, _function) {\r\n var group = {};\r\n\r\n _.each(array, function (el, i) {\r\n\r\n var index = _function(el, i);\r\n\r\n if (!index) return;\r\n\r\n if (!group[index])\r\n group[index] = [];\r\n\r\n group[index].push(el);\r\n\r\n })\r\n\r\n return group;\r\n}\r\n\r\nvar _scrollTop = function (scrollTop, el, time) {\r\n\r\n if (!el) el = $(\"body,html\");\r\n\r\n if (!time) time = 200;\r\n\r\n el.animate({ scrollTop: scrollTop }, time);\r\n}\r\n\r\nvar _scrollTo = function (to, el, time) {\r\n\r\n if (!to) to = $(this);\r\n\r\n var ofssetObj = to.offset();\r\n\r\n var offset = (to.height() - $(window).height()) / 2;\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTop = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.offset();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTopP = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.position();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar stringEq = function (s1, s2) {\r\n\r\n if (!s1) s1 = ''\r\n if (!s2) s2 = ''\r\n\r\n var bw = function (s) {\r\n return s.split(/[ \\t\\v\\r\\n\\f,.]+/)\r\n }\r\n\r\n var hash = function (s) {\r\n\r\n var ps = bw(s).join(' ')\r\n\r\n return ps.toLowerCase().replace(/[^a-zа-я0-9&]*/g, '');\r\n }\r\n\r\n\r\n\r\n var makeTr = function (w) {\r\n var trs = {};\r\n\r\n var takeC = function (index) {\r\n var c;\r\n\r\n if (index < 0 || index >= w.length) c = \"_\";\r\n\r\n else c = w[index];\r\n\r\n return c;\r\n }\r\n\r\n for (var i = -1; i <= w.length; i++) {\r\n\r\n var tr = \"\";\r\n\r\n for (var j = i - 1; j <= i + 1; j++) {\r\n tr = tr + takeC(j);\r\n }\r\n\r\n\r\n trs[tr] = 1;\r\n }\r\n\r\n return trs;\r\n }\r\n\r\n\r\n var t1 = makeTr(hash(s1)),\r\n t2 = makeTr(hash(s2));\r\n\r\n\r\n var c = 0,\r\n m = Math.max(_.toArray(t1).length, _.toArray(t2).length)\r\n\r\n _.each(t1, function (t, index) {\r\n\r\n if (t2[index]) c++;\r\n\r\n })\r\n\r\n return c / m;\r\n\r\n\r\n}\r\n\r\nvar pretry = function (_function, time, totaltime) {\r\n\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n retry(_function, resolve, time, totaltime)\r\n\r\n })\r\n}\r\n\r\nvar retry = function (_function, clbk, time, totaltime) {\r\n\r\n if (_function()){\r\n\r\n \r\n\r\n if (clbk) clbk();\r\n\r\n return\r\n }\r\n\r\n if (!time) time = 20;\r\n\r\n var totalTimeCounter = 0\r\n\r\n var interval = setInterval(function () {\r\n\r\n if (_function() || (totaltime && totaltime <= totalTimeCounter)) {\r\n\r\n\r\n clearInterval(interval);\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n totalTimeCounter += time\r\n\r\n }, time);\r\n}\r\n\r\nvar md5 = function (d) {\r\n var result = M(V(Y(X(d), 8 * d.length))); return result.toLowerCase()\r\n}; function M(d) { for (var _, m = \"0123456789ABCDEF\", f = \"\", r = 0; r < d.length; r++)_ = d.charCodeAt(r), f += m.charAt(_ >>> 4 & 15) + m.charAt(15 & _); return f } function X(d) { for (var _ = Array(d.length >> 2), m = 0; m < _.length; m++)_[m] = 0; for (m = 0; m < 8 * d.length; m += 8)_[m >> 5] |= (255 & d.charCodeAt(m / 8)) << m % 32; return _ } function V(d) { for (var _ = \"\", m = 0; m < 32 * d.length; m += 8)_ += String.fromCharCode(d[m >> 5] >>> m % 32 & 255); return _ } function Y(d, _) { d[_ >> 5] |= 128 << _ % 32, d[14 + (_ + 64 >>> 9 << 4)] = _; for (var m = 1732584193, f = -271733879, r = -1732584194, i = 271733878, n = 0; n < d.length; n += 16) { var h = m, t = f, g = r, e = i; f = md5_ii(f = md5_ii(f = md5_ii(f = md5_ii(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_ff(f = md5_ff(f = md5_ff(f = md5_ff(f, r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = safe_add(m, h), f = safe_add(f, t), r = safe_add(r, g), i = safe_add(i, e) } return Array(m, f, r, i) } function md5_cmn(d, _, m, f, r, i) { return safe_add(bit_rol(safe_add(safe_add(_, d), safe_add(f, i)), r), m) } function md5_ff(d, _, m, f, r, i, n) { return md5_cmn(_ & m | ~_ & f, d, _, r, i, n) } function md5_gg(d, _, m, f, r, i, n) { return md5_cmn(_ & f | m & ~f, d, _, r, i, n) } function md5_hh(d, _, m, f, r, i, n) { return md5_cmn(_ ^ m ^ f, d, _, r, i, n) } function md5_ii(d, _, m, f, r, i, n) { return md5_cmn(m ^ (_ | ~f), d, _, r, i, n) } function safe_add(d, _) { var m = (65535 & d) + (65535 & _); return (d >> 16) + (_ >> 16) + (m >> 16) << 16 | 65535 & m } function bit_rol(d, _) { return d << _ | d >>> 32 - _ }\r\n\r\nvar retryLazy = function (_function, clbk, time) {\r\n if (!time) time = 200;\r\n\r\n var f = function () {\r\n _function(function (result) {\r\n\r\n if (result) {\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n else {\r\n setTimeout(f, time)\r\n }\r\n\r\n })\r\n }\r\n\r\n f();\r\n}\r\n\r\nvar isAndroid = function () {\r\n var ua = navigator.userAgent.toLowerCase();\r\n var isAndroid = ua.indexOf(\"android\") > -1;\r\n\r\n if (isAndroid) {\r\n return true\r\n }\r\n}\r\n\r\nvar isMobile = function () {\r\n return $('html').hasClass('mobile');\r\n}\r\n\r\nvar isTablet = function () {\r\n return $('html').hasClass('mobile') || $('html').hasClass('tablet');\r\n}\r\n\r\nvar slowMade = function (_function, timer, time) {\r\n\r\n if (!time) time = 20\r\n\r\n if (timer)\r\n clearTimeout(timer);\r\n\r\n timer = setTimeout(_function, time);\r\n\r\n return timer;\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nvar trim = function (s) {\r\n return rtrim(ltrim(s));\r\n}\r\n\r\nvar ltrim = function (s) {\r\n return (s || \"\").replace(/^\\s+/, '');\r\n}\r\n\r\nvar rtrim = function (s) {\r\n return (s || \"\").replace(/\\s+$/, '');\r\n}\r\n\r\nvar ltrimrn = function (s) {\r\n return (s || \"\").replace(/^[\\r\\n\\t ]+/, '');\r\n}\r\n\r\nvar rtrimrn = function (s) {\r\n return (s || \"\").replace(/[\\r\\n\\t ]+$/, '');\r\n}\r\n\r\nvar trimrn = function (s) {\r\n return rtrimrn(ltrimrn(s));\r\n}\r\n\r\nvar hexEncode = function (text) {\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 0; i < text.length; i++) {\r\n ch = text.charCodeAt(i);\r\n if (ch > 0xFF) ch -= 0x350;\r\n ch = ch.toString(16);\r\n while (ch.length < 2) ch = \"0\" + ch;\r\n result += ch;\r\n }\r\n return result;\r\n}\r\n\r\nvar stringify = function(e){\r\n\r\n if(!e) return null\r\n\r\n if(e.toString) {\r\n\r\n var s = e.toString()\r\n\r\n if (s != '[object Object]')\r\n return s\r\n }\r\n\r\n if(_.isObject(e)) return JSON.stringify(e)\r\n\r\n return e\r\n}\r\n\r\nvar hexstorage = {}\r\n\r\n\r\nvar hexDecode = function (hex) {\r\n\r\n if (hexstorage[hex]) return hexstorage[hex]\r\n\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 2; i <= hex.length; i += 2) {\r\n ch = parseInt(hex.substring(i - 2, i), 16);\r\n if (ch >= 128) ch += 0x350;\r\n ch = String.fromCharCode(\"0x\" + ch.toString(16));\r\n result += ch;\r\n }\r\n\r\n hexstorage[hex] = result\r\n\r\n return result;\r\n}\r\nvar imgDimensions = function (data) {\r\n let img = new Image()\r\n img.src = data.base64\r\n data.width = img.width\r\n data.height = img.height\r\n return data\r\n}\r\n\r\nvar knsites = ['bastyon.com', 'pocketnet.app', 'zoom.us', 'youtube', 'facebook', 'instagram', 'vk.com', 'twitter', 'pinterest', 'vimeo', 'ask.fm', 'change.org', 'wikipedia', 'livejournal', 'linkedin', 'myspace', 'reddit', 'tumblr', 'ok.ru', 'flickr', 'google', 'yandex', 'yahoo', 'bing', 'gmail', 'mail']\r\n\r\nvar knsite = function (url) {\r\n return _.find(knsites, function (u) {\r\n return url.indexOf(u) > -1\r\n })\r\n}\r\n\r\nvar getUrl = function (data) {\r\n\r\n /*if(!linkify){\r\n linkify = require('linkifyjs');\r\n linkify.registerCustomProtocol('pocketnet')\r\n linkify.registerCustomProtocol('bastyon')\r\n }*/\r\n\r\n var links = linkify.find(data)\r\n\r\n if (links.length) {\r\n return links[0].href\r\n }\r\n}\r\nvar getTxt = function (data) {\r\n return data.replace(/\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/g, '')\r\n}\r\nvar getmatrixid = function (str) {\r\n return str.split(\":\")[0].replace(\"@\", '')\r\n}\r\nvar getMatrixIdFull = function (id, domain) {\r\n id || (id = '')\r\n\r\n if (id.indexOf(\"@\") == 0) return id\r\n return '@' + id + ':' + domain\r\n}\r\nvar ObjDiff = function (x, y) {\r\n var target = {};\r\n var diffProps = Object.keys(x).filter(function (i) {\r\n return x[i] !== y[i];\r\n\r\n }).map(function (j) {\r\n var obj = {};\r\n obj[j] = x[j];\r\n target = Object.assign(target, obj)\r\n });\r\n return target;\r\n}\r\nvar filterByUserId = function (arr, data) {\r\n var a = arr.map(function (e) {\r\n return e.id;\r\n });\r\n var d = data.map(function (e) {\r\n return e.id;\r\n });\r\n\r\n var x = [];\r\n a.forEach(function (e) {\r\n x.push(data[d.indexOf(e)]);\r\n });\r\n\r\n return x;\r\n}\r\nvar formatBytes = function (bytes, decimals = 2) {\r\n if (bytes === 0) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\r\n}\r\n\r\nvar poketnetUrlParser = function (url) {\r\n var newURL = new URL(url)\r\n return {\r\n post: newURL.searchParams.get('s'),\r\n user: newURL.pathname.replace('/', ''),\r\n }\r\n}\r\n\r\n// Takes a url and returns another one that fits into iframe\r\nvar videoUrlParser = function (url) {\r\n var youtube_host = ['www.youtube.com', 'youtube.com', 'youtu.be']\r\n var vimeo_host = ['www.vimeo.com', 'vimeo.com']\r\n var peertube_host = ['peer.tube', 'peertube.social']\r\n\r\n var newURL = new URL(url)\r\n\r\n if (youtube_host.indexOf(newURL.hostname) > -1) return `https://www.youtube.com/embed/${newURL.searchParams.get('v')}`\r\n if (vimeo_host.indexOf(newURL.hostname) > -1) return `https://player.vimeo.com/video${newURL.pathname}`\r\n if (peertube_host.indexOf(newURL.hostname) > -1) return `https://pocketnetpeertube1.nohost.me/${newURL.pathname.replace('watch', 'embed')}`\r\n}\r\n\r\n// Cuts string if its length longer than 'lenght'\r\nvar textFormatter = function (text, length) {\r\n return text.slice(0, length) + `...`\r\n}\r\n\r\n// takes a text and returns it without url in it\r\nvar urlSeparator = function (text) {\r\n var url = getUrl(text)\r\n return text.replace(url, \"\")\r\n}\r\n\r\n// takes a timestamp and turns it into a string like `Dec 25, 2000 at 2:15 PM`\r\nvar dateParser = function (data) {\r\n var parsedDate = new Date(data * 1000)\r\n\r\n var year = parsedDate.getFullYear()\r\n var month = parsedDate.getMonth()\r\n var day = parsedDate.getDate()\r\n\r\n var meridian = parsedDate.getHours() > 13 ? `PM` : `AM`\r\n var hour = parsedDate.getHours() > 13 ? parsedDate.getHours() - 12 : parsedDate.getHours()\r\n var minutes = parsedDate.getMinutes() < 10 ? `0${parsedDate.getMinutes()}` : parsedDate.getMinutes()\r\n\r\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\r\n\r\n return `${months[month]} ${day}, ${year} at ${hour}:${minutes} ${meridian}`\r\n}\r\n\r\n// calculates rating and returns star icons\r\nvar setRating = function (total_score, votes) {\r\n\r\n var average_score = total_score / votes\r\n\r\n var full_star = ``\r\n var half_star = ``\r\n var emply_star = ``\r\n\r\n var rating = [``, ``, ``, ``, ``]\r\n\r\n if (total_score === 0) {\r\n return rating.map(item => item = emply_star)\r\n }\r\n\r\n return rating.map(item => {\r\n if (average_score >= 1) {\r\n average_score--\r\n return item = full_star\r\n }\r\n if (average_score < 1 && average_score >= 0.5) {\r\n average_score--\r\n return item = half_star\r\n }\r\n if (average_score < 0.5) {\r\n average_score--\r\n return item = emply_star\r\n }\r\n })\r\n}\r\n\r\n// Indicates whether an object is on at least 80% within viewport or not\r\nvar isVisible = function (element) {\r\n var topY = element.getBoundingClientRect().top\r\n var bottomY = element.getBoundingClientRect().bottom\r\n var window_height = document.documentElement.clientHeight\r\n var elem_height = bottomY - topY\r\n\r\n var isVisibleOnTop = bottomY >= elem_height * 0.8\r\n var isVisibleOnbottom = bottomY <= window_height + elem_height * 0.2\r\n\r\n if (isVisibleOnTop && isVisibleOnbottom) return true\r\n else return false\r\n}\r\nvar _arrayBufferToBase64 = function (buffer) {\r\n var binary = '';\r\n var bytes = new Uint8Array(buffer);\r\n var len = bytes.byteLength;\r\n for (var i = 0; i < len; i++) {\r\n binary += String.fromCharCode(bytes[i]);\r\n }\r\n return window.btoa(binary);\r\n}\r\n\r\nvar _base64ToArrayBuffer = function (base64) {\r\n var binary_string = window.atob(base64);\r\n var len = binary_string.length;\r\n var bytes = new Uint8Array(len);\r\n for (var i = 0; i < len; i++) {\r\n bytes[i] = binary_string.charCodeAt(i);\r\n }\r\n return bytes.buffer;\r\n}\r\n\r\nvar Base64 = {\r\n // private property\r\n _keyStr: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\r\n\r\n // public method for encoding\r\n encode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = Base64._utf8_encode(input);\r\n\r\n while (i < input.length) {\r\n\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output +\r\n Base64._keyStr.charAt(enc1) + Base64._keyStr.charAt(enc2) +\r\n Base64._keyStr.charAt(enc3) + Base64._keyStr.charAt(enc4);\r\n\r\n }\r\n\r\n return output;\r\n },\r\n\r\n // public method for decoding\r\n decode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3;\r\n var enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\r\n\r\n while (i < input.length) {\r\n\r\n enc1 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc2 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc3 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc4 = Base64._keyStr.indexOf(input.charAt(i++));\r\n\r\n chr1 = (enc1 << 2) | (enc2 >> 4);\r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\r\n chr3 = ((enc3 & 3) << 6) | enc4;\r\n\r\n output = output + String.fromCharCode(chr1);\r\n\r\n if (enc3 != 64) {\r\n output = output + String.fromCharCode(chr2);\r\n }\r\n if (enc4 != 64) {\r\n output = output + String.fromCharCode(chr3);\r\n }\r\n\r\n }\r\n\r\n output = Base64._utf8_decode(output);\r\n\r\n return output;\r\n\r\n },\r\n\r\n // private method for UTF-8 encoding\r\n _utf8_encode: function (string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < string.length; n++) {\r\n\r\n var c = string.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n\r\n }\r\n\r\n return utftext;\r\n },\r\n\r\n // private method for UTF-8 decoding\r\n _utf8_decode: function (utftext) {\r\n var string = \"\";\r\n var i = 0;\r\n var c = 0, c1 = 0, c2 = 0;\r\n\r\n while (i < utftext.length) {\r\n\r\n c = utftext.charCodeAt(i);\r\n\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n }\r\n else if ((c > 191) && (c < 224)) {\r\n c2 = utftext.charCodeAt(i + 1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n }\r\n else {\r\n c2 = utftext.charCodeAt(i + 1);\r\n c3 = utftext.charCodeAt(i + 2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n\r\n }\r\n return string;\r\n },\r\n\r\n fromFile: file => new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n\r\n reader.readAsDataURL(file);\r\n reader.onloadend = () => resolve(reader.result);\r\n reader.onerror = error => reject(error);\r\n }),\r\n\r\n toFileFetch: function (base64) {\r\n return fetch(base64).then(res => {\r\n return res.blob()\r\n }).then(blob => {\r\n return new (window.wFile || window.File)([blob], \"File name\", { type: \"image/png\" })\r\n })\r\n },\r\n\r\n toFile: function (base64) {\r\n\r\n try {\r\n var arr = base64.split(','),\r\n mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]),\r\n n = bstr.length,\r\n u8arr = new Uint8Array(n);\r\n\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n var file = new (window.wFile || window.File)([u8arr], \"Filename\", { type: mime });\r\n\r\n return Promise.resolve(file)\r\n }\r\n catch (e) {\r\n return Promise.reject(e)\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nf.copyArrayBuffer = function(src){\r\n var dst = new ArrayBuffer(src.byteLength);\r\n new Uint8Array(dst).set(new Uint8Array(src));\r\n return dst;\r\n}\r\n\r\nf.readFile = function (file) {\r\n\r\n let reader = new FileReader();\r\n\r\n reader.readAsArrayBuffer(file);\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n reader.onload = function () {\r\n resolve(reader.result);\r\n };\r\n\r\n reader.onerror = function () {\r\n reject(reader.error);\r\n };\r\n })\r\n}\r\n\r\nf.fetchLocal = function (url) {\r\n\r\n\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest\r\n\r\n xhr.onload = function () {\r\n\r\n var type = xhr.getResponseHeader('content-type')\r\n\r\n\r\n resolve({\r\n data: new Blob([xhr.response], { type: type, name: 'file' })\r\n })\r\n\r\n // resolve()\r\n }\r\n\r\n xhr.onerror = function (e) {\r\n console.error(e, url)\r\n reject(new TypeError('Local request failed'))\r\n }\r\n\r\n xhr.open('GET', url)\r\n xhr.responseType = \"arraybuffer\";\r\n xhr.send(null)\r\n })\r\n};\r\n\r\n\r\n\r\nf.saveFileCordova = function(file, name, clbk, todownloads){\r\n\r\n var storageLocation = \"\";\r\n\r\n switch (device.platform) {\r\n case \"Android\":\r\n storageLocation = 'file:///storage/emulated/0/'; //LocalFileSystem.PERSISTENT\r\n break;\r\n case \"iOS\":\r\n storageLocation = cordova.file.cacheDirectory;\r\n break;\r\n }\r\n\r\n\r\n var onsuccess = function (fileSystem) {\r\n\r\n fileSystem.getDirectory('Download', { exclusive: false }, function (directory) {\r\n\r\n directory.getFile(name, { create: true, exclusive: false }, function (entry) {\r\n // After you save the file, you can access it with this URL\r\n var myFileUrl = entry.toURL();\r\n\r\n\r\n entry.createWriter(function (writer) {\r\n\r\n writer.onwriteend = function (evt) {\r\n //sitemessage(\"File \" + name + \" successfully downloaded\");\r\n\r\n if (window.galleryRefresh){\r\n\r\n window.galleryRefresh.refresh(myFileUrl, function (msg) {\r\n\r\n }, function (err) {\r\n\r\n\r\n })\r\n\r\n }\r\n\r\n if (clbk)\r\n clbk({\r\n name,\r\n url : myFileUrl\r\n })\r\n };\r\n\r\n writer.onerror = function (e) {\r\n\r\n if (clbk)\r\n clbk(null, e)\r\n\r\n };\r\n\r\n // Write to the file\r\n writer.seek(0);\r\n\r\n writer.write(file);\r\n\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file writer, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n\r\n })\r\n }\r\n\r\n var onerror = function (evt) {\r\n if(clbk) clbk(null, evt)\r\n }\r\n \r\n if(todownloads){\r\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){\r\n\r\n\r\n onsuccess(fileSystem.root)\r\n }, onerror)\r\n }\r\n else{\r\n window.resolveLocalFileSystemURL(storageLocation, onsuccess, onerror)\r\n }\r\n\r\n}\r\n\r\nfunction iOS() {\r\n return [\r\n 'iPad Simulator',\r\n 'iPhone Simulator',\r\n 'iPod Simulator',\r\n 'iPad',\r\n 'iPhone',\r\n 'iPod'\r\n ].includes(navigator.platform)\r\n // iPad on iOS 13 detection\r\n || (navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document)\r\n}\r\n\r\nf.isios = function () {\r\n return (window.cordova && window.device && deep(window, 'device.platform') == 'iOS') || iOS()\r\n}\r\n\r\nf.now = function (date) {\r\n var now = date || (new Date);\r\n var UTCseconds = (now.getTime() + now.getTimezoneOffset() * 60 * 1000);\r\n var d = new Date(UTCseconds);\r\n d.toString();\r\n\r\n return d\r\n}\r\n\r\nf.date = {\r\n addseconds: function (now, seconds) {\r\n if (!now) now = new Date\r\n\r\n var ntime = now.getTime() + seconds * 1000\r\n var d = new Date(ntime);\r\n\r\n return d\r\n }\r\n}\r\n\r\nf.getservers = function(arr, mult, address) {\r\n\r\n if(!arr.length) return []\r\n\r\n mult || (mult = 1)\r\n\r\n if(mult > arr.length) mult = arr.length\r\n\r\n var mutations = f.permutations(arr, mult);\r\n\r\n var index = f.helpers.base58.decode(address) % mutations.length;\r\n\r\n return mutations[index]\r\n}\r\n\r\nf.helpers = {\r\n base58: {\r\n ALPHABET: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',\r\n ALPHABET_MAP: {},\r\n i: 0,\r\n\r\n encode(buffer) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var carry, digits, j;\r\n if (buffer.length === 0) {\r\n return '';\r\n }\r\n i = void 0;\r\n j = void 0;\r\n digits = [0];\r\n i = 0;\r\n while (i < buffer.length) {\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] <<= 8;\r\n j++;\r\n }\r\n digits[0] += buffer[i];\r\n carry = 0;\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] += carry;\r\n carry = (digits[j] / 58) | 0;\r\n digits[j] %= 58;\r\n ++j;\r\n }\r\n while (carry) {\r\n digits.push(carry % 58);\r\n carry = (carry / 58) | 0;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (buffer[i] === 0 && i < buffer.length - 1) {\r\n digits.push(0);\r\n i++;\r\n }\r\n return digits\r\n .reverse()\r\n .map(function (digit) {\r\n return ALPHABET[digit];\r\n })\r\n .join('');\r\n },\r\n\r\n decode(string) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var bytes, c, carry, j;\r\n if (string.length === 0) {\r\n return new (\r\n typeof Uint8Array !== 'undefined' && Uint8Array !== null\r\n ? Uint8Array\r\n : Buffer\r\n )(0);\r\n }\r\n i = void 0;\r\n j = void 0;\r\n bytes = [0];\r\n i = 0;\r\n while (i < string.length) {\r\n c = string[i];\r\n if (!(c in ALPHABET_MAP)) {\r\n throw (\r\n \"Base58.decode received unacceptable input. Character '\" +\r\n c +\r\n \"' is not in the Base58 alphabet.\"\r\n );\r\n }\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] *= 58;\r\n j++;\r\n }\r\n bytes[0] += ALPHABET_MAP[c];\r\n carry = 0;\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] += carry;\r\n carry = bytes[j] >> 8;\r\n bytes[j] &= 0xff;\r\n ++j;\r\n }\r\n while (carry) {\r\n bytes.push(carry & 0xff);\r\n carry >>= 8;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (string[i] === '1' && i < string.length - 1) {\r\n bytes.push(0);\r\n i++;\r\n }\r\n\r\n const outputArray = new Uint8Array(bytes.reverse());\r\n\r\n let buffer = Buffer.from(outputArray);\r\n return buffer.readUIntBE(0, outputArray.length);\r\n },\r\n },\r\n};\r\n\r\nf.getCaretPosition = function(ctrl){\r\n // IE < 9 Support \r\n if (document.selection) {\r\n ctrl.focus();\r\n var range = document.selection.createRange();\r\n var rangelen = range.text.length;\r\n range.moveStart('character', -ctrl.value.length);\r\n var start = range.text.length - rangelen;\r\n return {\r\n 'start': start,\r\n 'end': start + rangelen\r\n };\r\n } // IE >=9 and other browsers\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\r\n return {\r\n 'start': ctrl.selectionStart,\r\n 'end': ctrl.selectionEnd\r\n };\r\n } else {\r\n return {\r\n 'start': 0,\r\n 'end': 0\r\n };\r\n }\r\n}\r\n\r\nf.setCaretPosition = function(ctrl, start, end) {\r\n // IE >= 9 and other browsers\r\n if (ctrl.setSelectionRange) {\r\n ctrl.focus();\r\n ctrl.setSelectionRange(start, end);\r\n }\r\n // IE < 9 \r\n else if (ctrl.createTextRange) {\r\n var range = ctrl.createTextRange();\r\n range.collapse(true);\r\n range.moveEnd('character', end);\r\n range.moveStart('character', start);\r\n range.select();\r\n }\r\n}\r\n\r\nf.ObjDiff = ObjDiff\r\nf._arrayBufferToBase64 = _arrayBufferToBase64\r\nf._base64ToArrayBuffer = _base64ToArrayBuffer\r\nf.Base64 = Base64\r\nf.getmatrixid = getmatrixid\r\nf.getMatrixIdFull = getMatrixIdFull\r\nf.formatBytes = formatBytes\r\nf.filterByUserId = filterByUserId\r\nf.trim = trim\r\nf.isAndroid = isAndroid\r\nf.isMobile = isMobile\r\nf.isTablet = isTablet\r\nf.rand = rand\r\nf.group = group\r\nf.flball = flball\r\nf.flb = flb\r\nf.flbs = flbs\r\nf.flbb = flbb\r\nf.makeid = makeid\r\nf.scrollTo = _scrollTo\r\nf.stringEq = stringEq\r\nf.pretry = pretry\r\nf.retry = retry\r\nf.retryLazy = retryLazy\r\nf.slowMade = slowMade\r\nf.renderFrameEqualizer = renderFrameEqualizer\r\nf.hexEncode = hexEncode\r\nf.hexDecode = hexDecode\r\nf.imgDimensions = imgDimensions\r\nf.getUrl = getUrl\r\nf.getTxt = getTxt\r\nf.poketnetUrlParser = poketnetUrlParser\r\nf.textFormatter = textFormatter\r\nf.urlSeparator = urlSeparator\r\nf.dateParser = dateParser\r\nf.setRating = setRating\r\nf.videoUrlParser = videoUrlParser\r\nf.isVisible = isVisible\r\nf.copytext = copytext\r\nf.md5 = md5\r\nf.knsite = knsite\r\nf.stringify = stringify\r\nexport default f","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","import listToStyles from './listToStyles'\n\nexport default function addStylesToShadowDOM (parentId, list, shadowRoot) {\n var styles = listToStyles(parentId, list)\n addStyles(styles, shadowRoot)\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nfunction addStyles (styles /* Array */, shadowRoot) {\n const injectedStyles =\n shadowRoot._injectedStyles ||\n (shadowRoot._injectedStyles = {})\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i]\n var style = injectedStyles[item.id]\n if (!style) {\n for (var j = 0; j < item.parts.length; j++) {\n addStyle(item.parts[j], shadowRoot)\n }\n injectedStyles[item.id] = true\n }\n }\n}\n\nfunction createStyleElement (shadowRoot) {\n var styleElement = document.createElement('style')\n styleElement.type = 'text/css'\n shadowRoot.appendChild(styleElement)\n return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */, shadowRoot) {\n var styleElement = createStyleElement(shadowRoot)\n var css = obj.css\n var media = obj.media\n var sourceMap = obj.sourceMap\n\n if (media) {\n styleElement.setAttribute('media', media)\n }\n\n if (sourceMap) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n }\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild)\n }\n styleElement.appendChild(document.createTextNode(css))\n }\n}\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.AutoDiscovery = void 0;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _url = require(\"url\");\r\n\r\n/*\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/** @module auto-discovery */\r\n// Dev note: Auto discovery is part of the spec.\r\n// See: https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery\r\n\r\n/**\r\n * Description for what an automatically discovered client configuration\r\n * would look like. Although this is a class, it is recommended that it\r\n * be treated as an interface definition rather than as a class.\r\n *\r\n * Additional properties than those defined here may be present, and\r\n * should follow the Java package naming convention.\r\n */\r\nclass DiscoveredClientConfig {\r\n // eslint-disable-line no-unused-vars\r\n // Dev note: this is basically a copy/paste of the .well-known response\r\n // object as defined in the spec. It does have additional information,\r\n // however. Overall, this exists to serve as a place for documentation\r\n // and not functionality.\r\n // See https://matrix.org/docs/spec/client_server/r0.4.0.html#get-well-known-matrix-client\r\n constructor() {\r\n /**\r\n * The homeserver configuration the client should use. This will\r\n * always be present on the object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n this[\"m.homeserver\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey. Additionally,\r\n * if this is not AutoDiscovery.SUCCESS then the client should\r\n * assume the other properties in the client config (such as\r\n * the identity server configuration) are not valid.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * If the state is AutoDiscovery.FAIL_ERROR or .FAIL_PROMPT\r\n * then this will contain a human-readable (English) message\r\n * for what went wrong. If the state is none of those previously\r\n * mentioned, this will be falsey.\r\n */\r\n error: \"Something went wrong\",\r\n\r\n /**\r\n * The base URL clients should use to talk to the homeserver,\r\n * particularly for the login process. May be falsey if the\r\n * state is not AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://matrix.org\"\r\n };\r\n /**\r\n * The identity server configuration the client should use. This\r\n * will always be present on teh object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n\r\n this[\"m.identity_server\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * The base URL clients should use for interacting with the\r\n * identity server. May be falsey if the state is not\r\n * AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://vector.im\"\r\n };\r\n }\r\n\r\n}\r\n/**\r\n * Utilities for automatically discovery resources, such as homeservers\r\n * for users to log in to.\r\n */\r\n\r\n\r\nclass AutoDiscovery {\r\n // Dev note: the constants defined here are related to but not\r\n // exactly the same as those in the spec. This is to hopefully\r\n // translate the meaning of the states in the spec, but also\r\n // support our own if needed.\r\n static get ERROR_INVALID() {\r\n return \"Invalid homeserver discovery response\";\r\n }\r\n\r\n static get ERROR_GENERIC_FAILURE() {\r\n return \"Failed to get autodiscovery configuration from server\";\r\n }\r\n\r\n static get ERROR_INVALID_HS_BASE_URL() {\r\n return \"Invalid base_url for m.homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_HOMESERVER() {\r\n return \"Homeserver URL does not appear to be a valid Matrix homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_IS_BASE_URL() {\r\n return \"Invalid base_url for m.identity_server\";\r\n }\r\n\r\n static get ERROR_INVALID_IDENTITY_SERVER() {\r\n return \"Identity server URL does not appear to be a valid identity server\";\r\n }\r\n\r\n static get ERROR_INVALID_IS() {\r\n return \"Invalid identity server discovery response\";\r\n }\r\n\r\n static get ERROR_MISSING_WELLKNOWN() {\r\n return \"No .well-known JSON file found\";\r\n }\r\n\r\n static get ERROR_INVALID_JSON() {\r\n return \"Invalid JSON\";\r\n }\r\n\r\n static get ALL_ERRORS() {\r\n return [AutoDiscovery.ERROR_INVALID, AutoDiscovery.ERROR_GENERIC_FAILURE, AutoDiscovery.ERROR_INVALID_HS_BASE_URL, AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IS_BASE_URL, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, AutoDiscovery.ERROR_INVALID_IS, AutoDiscovery.ERROR_MISSING_WELLKNOWN, AutoDiscovery.ERROR_INVALID_JSON];\r\n }\r\n /**\r\n * The auto discovery failed. The client is expected to communicate\r\n * the error to the user and refuse logging in.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_ERROR() {\r\n return \"FAIL_ERROR\";\r\n }\r\n /**\r\n * The auto discovery failed, however the client may still recover\r\n * from the problem. The client is recommended to that the same\r\n * action it would for PROMPT while also warning the user about\r\n * what went wrong. The client may also treat this the same as\r\n * a FAIL_ERROR state.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_PROMPT() {\r\n return \"FAIL_PROMPT\";\r\n }\r\n /**\r\n * The auto discovery didn't fail but did not find anything of\r\n * interest. The client is expected to prompt the user for more\r\n * information, or fail if it prefers.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get PROMPT() {\r\n return \"PROMPT\";\r\n }\r\n /**\r\n * The auto discovery was successful.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get SUCCESS() {\r\n return \"SUCCESS\";\r\n }\r\n /**\r\n * Validates and verifies client configuration information for purposes\r\n * of logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be included, and will be transparently brought into the\r\n * response object unaltered.\r\n * @param {string} wellknown The configuration object itself, as returned\r\n * by the .well-known auto-discovery endpoint.\r\n * @return {Promise} Resolves to the verified\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when verification fails.\r\n */\r\n\r\n\r\n static async fromDiscoveryConfig(wellknown) {\r\n // Step 1 is to get the config, which is provided to us here.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n };\r\n\r\n if (!wellknown || !wellknown[\"m.homeserver\"]) {\r\n _logger.logger.error(\"No m.homeserver key in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n return Promise.resolve(clientConfig);\r\n }\r\n\r\n if (!wellknown[\"m.homeserver\"][\"base_url\"]) {\r\n _logger.logger.error(\"No m.homeserver base_url in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Make sure the homeserver URL is valid *looking*. We'll make\r\n // sure it points to a homeserver in Step 3.\r\n\r\n\r\n const hsUrl = this._sanitizeWellKnownUrl(wellknown[\"m.homeserver\"][\"base_url\"]);\r\n\r\n if (!hsUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.homeserver\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 3: Make sure the homeserver URL points to a homeserver.\r\n\r\n\r\n const hsVersions = await this._fetchWellKnownObject(`${hsUrl}/_matrix/client/versions`);\r\n\r\n if (!hsVersions || !hsVersions.raw[\"versions\"]) {\r\n _logger.logger.error(\"Invalid /versions response\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER; // Supply the base_url to the caller because they may be ignoring liveliness\r\n // errors, like this one.\r\n\r\n clientConfig[\"m.homeserver\"].base_url = hsUrl;\r\n return Promise.resolve(clientConfig);\r\n } // Step 4: Now that the homeserver looks valid, update our client config.\r\n\r\n\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: hsUrl\r\n }; // Step 5: Try to pull out the identity server configuration\r\n\r\n let isUrl = \"\";\r\n\r\n if (wellknown[\"m.identity_server\"]) {\r\n // We prepare a failing identity server response to save lines later\r\n // in this branch.\r\n const failingClientConfig = {\r\n \"m.homeserver\": clientConfig[\"m.homeserver\"],\r\n \"m.identity_server\": {\r\n state: AutoDiscovery.FAIL_PROMPT,\r\n error: AutoDiscovery.ERROR_INVALID_IS,\r\n base_url: null\r\n }\r\n }; // Step 5a: Make sure the URL is valid *looking*. We'll make sure it\r\n // points to an identity server in Step 5b.\r\n\r\n isUrl = this._sanitizeWellKnownUrl(wellknown[\"m.identity_server\"][\"base_url\"]);\r\n\r\n if (!isUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.identity_server\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IS_BASE_URL;\r\n return Promise.resolve(failingClientConfig);\r\n } // Step 5b: Verify there is an identity server listening on the provided\r\n // URL.\r\n\r\n\r\n const isResponse = await this._fetchWellKnownObject(`${isUrl}/_matrix/identity/api/v1`);\r\n\r\n if (!isResponse || !isResponse.raw || isResponse.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"Invalid /api/v1 response\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER; // Supply the base_url to the caller because they may be ignoring\r\n // liveliness errors, like this one.\r\n\r\n failingClientConfig[\"m.identity_server\"].base_url = isUrl;\r\n return Promise.resolve(failingClientConfig);\r\n }\r\n } // Step 6: Now that the identity server is valid, or never existed,\r\n // populate the IS section.\r\n\r\n\r\n if (isUrl && isUrl.length > 0) {\r\n clientConfig[\"m.identity_server\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: isUrl\r\n };\r\n } // Step 7: Copy any other keys directly into the clientConfig. This is for\r\n // things like custom configuration of services.\r\n\r\n\r\n Object.keys(wellknown).map(k => {\r\n if (k === \"m.homeserver\" || k === \"m.identity_server\") {\r\n // Only copy selected parts of the config to avoid overwriting\r\n // properties computed by the validation logic above.\r\n const notProps = [\"error\", \"state\", \"base_url\"];\r\n\r\n for (const prop of Object.keys(wellknown[k])) {\r\n if (notProps.includes(prop)) continue;\r\n clientConfig[k][prop] = wellknown[k][prop];\r\n }\r\n } else {\r\n // Just copy the whole thing over otherwise\r\n clientConfig[k] = wellknown[k];\r\n }\r\n }); // Step 8: Give the config to the caller (finally)\r\n\r\n return Promise.resolve(clientConfig);\r\n }\r\n /**\r\n * Attempts to automatically discover client configuration information\r\n * prior to logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be discovered, and will be transparently included in the\r\n * response object unaltered.\r\n * @param {string} domain The homeserver domain to perform discovery\r\n * on. For example, \"matrix.org\".\r\n * @return {Promise} Resolves to the discovered\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when discovery fails.\r\n */\r\n\r\n\r\n static async findClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n } // We use a .well-known lookup for all cases. According to the spec, we\r\n // can do other discovery mechanisms if we want such as custom lookups\r\n // however we won't bother with that here (mostly because the spec only\r\n // supports .well-known right now).\r\n //\r\n // By using .well-known, we need to ensure we at least pull out a URL\r\n // for the homeserver. We don't really need an identity server configuration\r\n // but will return one anyways (with state PROMPT) to make development\r\n // easier for clients. If we can't get a homeserver URL, all bets are\r\n // off on the rest of the config and we'll assume it is invalid too.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n\r\n\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n }; // Step 1: Actually request the .well-known JSON file and make sure it\r\n // at least has a homeserver definition.\r\n\r\n const wellknown = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n\r\n if (!wellknown || wellknown.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"No response or error when parsing .well-known\");\r\n\r\n if (wellknown.reason) _logger.logger.error(wellknown.reason);\r\n\r\n if (wellknown.action === \"IGNORE\") {\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n };\r\n } else {\r\n // this can only ever be FAIL_PROMPT at this point.\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n }\r\n\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Validate and parse the config\r\n\r\n\r\n return AutoDiscovery.fromDiscoveryConfig(wellknown.raw);\r\n }\r\n /**\r\n * Gets the raw discovery client configuration for the given domain name.\r\n * Should only be used if there's no validation to be done on the resulting\r\n * object, otherwise use findClientConfig().\r\n * @param {string} domain The domain to get the client config for.\r\n * @returns {Promise} Resolves to the domain's client config. Can\r\n * be an empty object.\r\n */\r\n\r\n\r\n static async getRawClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n }\r\n\r\n const response = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n if (!response) return {};\r\n return response.raw || {};\r\n }\r\n /**\r\n * Sanitizes a given URL to ensure it is either an HTTP or HTTP URL and\r\n * is suitable for the requirements laid out by .well-known auto discovery.\r\n * If valid, the URL will also be stripped of any trailing slashes.\r\n * @param {string} url The potentially invalid URL to sanitize.\r\n * @return {string|boolean} The sanitized URL or a falsey value if the URL is invalid.\r\n * @private\r\n */\r\n\r\n\r\n static _sanitizeWellKnownUrl(url) {\r\n if (!url) return false;\r\n\r\n try {\r\n // We have to try and parse the URL using the NodeJS URL\r\n // library if we're on NodeJS and use the browser's URL\r\n // library when we're in a browser. To accomplish this, we\r\n // try the NodeJS version first and fall back to the browser.\r\n let parsed = null;\r\n\r\n try {\r\n if (_url.URL) parsed = new _url.URL(url);else parsed = new URL(url);\r\n } catch (e) {\r\n parsed = new URL(url);\r\n }\r\n\r\n if (!parsed || !parsed.hostname) return false;\r\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return false;\r\n const port = parsed.port ? `:${parsed.port}` : \"\";\r\n const path = parsed.pathname ? parsed.pathname : \"\";\r\n let saferUrl = `${parsed.protocol}//${parsed.hostname}${port}${path}`;\r\n\r\n if (saferUrl.endsWith(\"/\")) {\r\n saferUrl = saferUrl.substring(0, saferUrl.length - 1);\r\n }\r\n\r\n return saferUrl;\r\n } catch (e) {\r\n _logger.logger.error(e);\r\n\r\n return false;\r\n }\r\n }\r\n /**\r\n * Fetches a JSON object from a given URL, as expected by all .well-known\r\n * related lookups. If the server gives a 404 then the `action` will be\r\n * IGNORE. If the server returns something that isn't JSON, the `action`\r\n * will be FAIL_PROMPT. For any other failure the `action` will be FAIL_PROMPT.\r\n *\r\n * The returned object will be a result of the call in object form with\r\n * the following properties:\r\n * raw: The JSON object returned by the server.\r\n * action: One of SUCCESS, IGNORE, or FAIL_PROMPT.\r\n * reason: Relatively human readable description of what went wrong.\r\n * error: The actual Error, if one exists.\r\n * @param {string} url The URL to fetch a JSON object from.\r\n * @return {Promise} Resolves to the returned state.\r\n * @private\r\n */\r\n\r\n\r\n static async _fetchWellKnownObject(url) {\r\n return new Promise(function (resolve, reject) {\r\n const request = require(\"./matrix\").getRequest();\r\n\r\n if (!request) throw new Error(\"No request library available\");\r\n request({\r\n method: \"GET\",\r\n uri: url,\r\n timeout: 5000\r\n }, (err, response, body) => {\r\n if (err || response && (response.statusCode < 200 || response.statusCode >= 300)) {\r\n let action = \"FAIL_PROMPT\";\r\n let reason = (err ? err.message : null) || \"General failure\";\r\n\r\n if (response && response.statusCode === 404) {\r\n action = \"IGNORE\";\r\n reason = AutoDiscovery.ERROR_MISSING_WELLKNOWN;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: action,\r\n reason: reason,\r\n error: err\r\n });\r\n return;\r\n }\r\n\r\n try {\r\n resolve({\r\n raw: JSON.parse(body),\r\n action: \"SUCCESS\"\r\n });\r\n } catch (e) {\r\n let reason = AutoDiscovery.ERROR_INVALID;\r\n\r\n if (e.name === \"SyntaxError\") {\r\n reason = AutoDiscovery.ERROR_INVALID_JSON;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: \"FAIL_PROMPT\",\r\n reason: reason,\r\n error: e\r\n });\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.AutoDiscovery = AutoDiscovery;","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"label[data-v-6b3704ba]{display:inline}.likelink[data-v-6b3704ba]{text-decoration:underline;cursor:pointer}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.setNow = setNow;\r\nexports.setTimeout = setTimeout;\r\nexports.clearTimeout = clearTimeout;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* A re-implementation of the javascript callback functions (setTimeout,\r\n * clearTimeout; setInterval and clearInterval are not yet implemented) which\r\n * try to improve handling of large clock jumps (as seen when\r\n * suspending/resuming the system).\r\n *\r\n * In particular, if a timeout would have fired while the system was suspended,\r\n * it will instead fire as soon as possible after resume.\r\n */\r\n// we schedule a callback at least this often, to check if we've missed out on\r\n// some wall-clock time due to being suspended.\r\nconst TIMER_CHECK_PERIOD_MS = 1000; // counter, for making up ids to return from setTimeout\r\n\r\nlet _count = 0; // the key for our callback with the real global.setTimeout\r\n\r\nlet _realCallbackKey; // a sorted list of the callbacks to be run.\r\n// each is an object with keys [runAt, func, params, key].\r\n\r\n\r\nconst _callbackList = []; // var debuglog = logger.log.bind(logger);\r\n\r\nconst debuglog = function () {};\r\n/**\r\n * Replace the function used by this module to get the current time.\r\n *\r\n * Intended for use by the unit tests.\r\n *\r\n * @param {function} [f] function which should return a millisecond counter\r\n *\r\n * @internal\r\n */\r\n\r\n\r\nfunction setNow(f) {\r\n _now = f || Date.now;\r\n}\r\n\r\nlet _now = Date.now;\r\n/**\r\n * reimplementation of window.setTimeout, which will call the callback if\r\n * the wallclock time goes past the deadline.\r\n *\r\n * @param {function} func callback to be called after a delay\r\n * @param {Number} delayMs number of milliseconds to delay by\r\n *\r\n * @return {Number} an identifier for this callback, which may be passed into\r\n * clearTimeout later.\r\n */\r\n\r\nfunction setTimeout(func, delayMs) {\r\n delayMs = delayMs || 0;\r\n\r\n if (delayMs < 0) {\r\n delayMs = 0;\r\n }\r\n\r\n const params = Array.prototype.slice.call(arguments, 2);\r\n const runAt = _now() + delayMs;\r\n const key = _count++;\r\n debuglog(\"setTimeout: scheduling cb\", key, \"at\", runAt, \"(delay\", delayMs, \")\");\r\n const data = {\r\n runAt: runAt,\r\n func: func,\r\n params: params,\r\n key: key\r\n }; // figure out where it goes in the list\r\n\r\n const idx = binarySearch(_callbackList, function (el) {\r\n return el.runAt - runAt;\r\n });\r\n\r\n _callbackList.splice(idx, 0, data);\r\n\r\n _scheduleRealCallback();\r\n\r\n return key;\r\n}\r\n/**\r\n * reimplementation of window.clearTimeout, which mirrors setTimeout\r\n *\r\n * @param {Number} key result from an earlier setTimeout call\r\n */\r\n\r\n\r\nfunction clearTimeout(key) {\r\n if (_callbackList.length === 0) {\r\n return;\r\n } // remove the element from the list\r\n\r\n\r\n let i;\r\n\r\n for (i = 0; i < _callbackList.length; i++) {\r\n const cb = _callbackList[i];\r\n\r\n if (cb.key == key) {\r\n _callbackList.splice(i, 1);\r\n\r\n break;\r\n }\r\n } // iff it was the first one in the list, reschedule our callback.\r\n\r\n\r\n if (i === 0) {\r\n _scheduleRealCallback();\r\n }\r\n} // use the real global.setTimeout to schedule a callback to _runCallbacks.\r\n\r\n\r\nfunction _scheduleRealCallback() {\r\n if (_realCallbackKey) {\r\n global.clearTimeout(_realCallbackKey);\r\n }\r\n\r\n const first = _callbackList[0];\r\n\r\n if (!first) {\r\n debuglog(\"_scheduleRealCallback: no more callbacks, not rescheduling\");\r\n return;\r\n }\r\n\r\n const now = _now();\r\n\r\n const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);\r\n debuglog(\"_scheduleRealCallback: now:\", now, \"delay:\", delayMs);\r\n _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);\r\n}\r\n\r\nfunction _runCallbacks() {\r\n let cb;\r\n\r\n const now = _now();\r\n\r\n debuglog(\"_runCallbacks: now:\", now); // get the list of things to call\r\n\r\n const callbacksToRun = [];\r\n\r\n while (true) {\r\n const first = _callbackList[0];\r\n\r\n if (!first || first.runAt > now) {\r\n break;\r\n }\r\n\r\n cb = _callbackList.shift();\r\n debuglog(\"_runCallbacks: popping\", cb.key);\r\n callbacksToRun.push(cb);\r\n } // reschedule the real callback before running our functions, to\r\n // keep the codepaths the same whether or not our functions\r\n // register their own setTimeouts.\r\n\r\n\r\n _scheduleRealCallback();\r\n\r\n for (let i = 0; i < callbacksToRun.length; i++) {\r\n cb = callbacksToRun[i];\r\n\r\n try {\r\n cb.func.apply(global, cb.params);\r\n } catch (e) {\r\n _logger.logger.error(\"Uncaught exception in callback function\", e.stack || e);\r\n }\r\n }\r\n}\r\n/* search in a sorted array.\r\n *\r\n * returns the index of the last element for which func returns\r\n * greater than zero, or array.length if no such element exists.\r\n */\r\n\r\n\r\nfunction binarySearch(array, func) {\r\n // min is inclusive, max exclusive.\r\n let min = 0;\r\n let max = array.length;\r\n\r\n while (min < max) {\r\n const mid = min + max >> 1;\r\n const res = func(array[mid]);\r\n\r\n if (res > 0) {\r\n // the element at 'mid' is too big; set it as the new max.\r\n max = mid;\r\n } else {\r\n // the element at 'mid' is too small. 'min' is inclusive, so +1.\r\n min = mid + 1;\r\n }\r\n } // presumably, min==max now.\r\n\r\n\r\n return min;\r\n}","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {\r\n request: true,\r\n getRequest: true,\r\n wrapRequest: true,\r\n setCryptoStoreFactory: true,\r\n createClient: true,\r\n ContentHelpers: true,\r\n createNewMatrixCall: true,\r\n setMatrixCallAudioOutput: true,\r\n setMatrixCallAudioInput: true,\r\n setMatrixCallVideoInput: true\r\n};\r\nexports.request = request;\r\nexports.getRequest = getRequest;\r\nexports.wrapRequest = wrapRequest;\r\nexports.setCryptoStoreFactory = setCryptoStoreFactory;\r\nexports.createClient = createClient;\r\nObject.defineProperty(exports, \"createNewMatrixCall\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.createNewMatrixCall;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioOutput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioOutput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioInput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallVideoInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setVideoInput;\r\n }\r\n});\r\nexports.ContentHelpers = void 0;\r\n\r\nvar _memoryCryptoStore = require(\"./crypto/store/memory-crypto-store\");\r\n\r\nObject.keys(_memoryCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memoryCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memoryCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _memory = require(\"./store/memory\");\r\n\r\nObject.keys(_memory).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memory[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memory[key];\r\n }\r\n });\r\n});\r\n\r\nvar _scheduler = require(\"./scheduler\");\r\n\r\nObject.keys(_scheduler).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _scheduler[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _scheduler[key];\r\n }\r\n });\r\n});\r\n\r\nvar _client = require(\"./client\");\r\n\r\nObject.keys(_client).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _client[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _client[key];\r\n }\r\n });\r\n});\r\n\r\nvar _httpApi = require(\"./http-api\");\r\n\r\nObject.keys(_httpApi).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _httpApi[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _httpApi[key];\r\n }\r\n });\r\n});\r\n\r\nvar _autodiscovery = require(\"./autodiscovery\");\r\n\r\nObject.keys(_autodiscovery).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _autodiscovery[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _autodiscovery[key];\r\n }\r\n });\r\n});\r\n\r\nvar _syncAccumulator = require(\"./sync-accumulator\");\r\n\r\nObject.keys(_syncAccumulator).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _syncAccumulator[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _syncAccumulator[key];\r\n }\r\n });\r\n});\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\nObject.keys(_errors).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _errors[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _errors[key];\r\n }\r\n });\r\n});\r\n\r\nvar _event = require(\"./models/event\");\r\n\r\nObject.keys(_event).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _event[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _event[key];\r\n }\r\n });\r\n});\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nObject.keys(_room).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _room[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _room[key];\r\n }\r\n });\r\n});\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nObject.keys(_group).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _group[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _group[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nObject.keys(_eventTimeline).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimeline[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimeline[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimelineSet = require(\"./models/event-timeline-set\");\r\n\r\nObject.keys(_eventTimelineSet).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimelineSet[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimelineSet[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomMember = require(\"./models/room-member\");\r\n\r\nObject.keys(_roomMember).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomMember[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomMember[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomState = require(\"./models/room-state\");\r\n\r\nObject.keys(_roomState).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomState[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomState[key];\r\n }\r\n });\r\n});\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nObject.keys(_user).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _user[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _user[key];\r\n }\r\n });\r\n});\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nObject.keys(_filter).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _filter[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _filter[key];\r\n }\r\n });\r\n});\r\n\r\nvar _timelineWindow = require(\"./timeline-window\");\r\n\r\nObject.keys(_timelineWindow).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _timelineWindow[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _timelineWindow[key];\r\n }\r\n });\r\n});\r\n\r\nvar _interactiveAuth = require(\"./interactive-auth\");\r\n\r\nObject.keys(_interactiveAuth).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _interactiveAuth[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _interactiveAuth[key];\r\n }\r\n });\r\n});\r\n\r\nvar _serviceTypes = require(\"./service-types\");\r\n\r\nObject.keys(_serviceTypes).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _serviceTypes[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _serviceTypes[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddb = require(\"./store/indexeddb\");\r\n\r\nObject.keys(_indexeddb).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddb[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddb[key];\r\n }\r\n });\r\n});\r\n\r\nvar _webstorage = require(\"./store/session/webstorage\");\r\n\r\nObject.keys(_webstorage).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _webstorage[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _webstorage[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddbCryptoStore = require(\"./crypto/store/indexeddb-crypto-store\");\r\n\r\nObject.keys(_indexeddbCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddbCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddbCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _contentRepo = require(\"./content-repo\");\r\n\r\nObject.keys(_contentRepo).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _contentRepo[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _contentRepo[key];\r\n }\r\n });\r\n});\r\n\r\nvar _ContentHelpers = _interopRequireWildcard(require(\"./content-helpers\"));\r\n\r\nexports.ContentHelpers = _ContentHelpers;\r\n\r\nvar _call = require(\"./webrtc/call\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n// expose the underlying request object so different environments can use\r\n// different request libs (e.g. request or browser-request)\r\nlet requestInstance;\r\n/**\r\n * The function used to perform HTTP requests. Only use this if you want to\r\n * use a different HTTP library, e.g. Angular's $http. This should\r\n * be set prior to calling {@link createClient}.\r\n * @param {requestFunction} r The request function to use.\r\n */\r\n\r\nfunction request(r) {\r\n requestInstance = r;\r\n}\r\n/**\r\n * Return the currently-set request function.\r\n * @return {requestFunction} The current request function.\r\n */\r\n\r\n\r\nfunction getRequest() {\r\n return requestInstance;\r\n}\r\n/**\r\n * Apply wrapping code around the request function. The wrapper function is\r\n * installed as the new request handler, and when invoked it is passed the\r\n * previous value, along with the options and callback arguments.\r\n * @param {requestWrapperFunction} wrapper The wrapping function.\r\n */\r\n\r\n\r\nfunction wrapRequest(wrapper) {\r\n const origRequest = requestInstance;\r\n\r\n requestInstance = function (options, callback) {\r\n return wrapper(origRequest, options, callback);\r\n };\r\n}\r\n\r\nlet cryptoStoreFactory = () => new _memoryCryptoStore.MemoryCryptoStore();\r\n/**\r\n * Configure a different factory to be used for creating crypto stores\r\n *\r\n * @param {Function} fac a function which will return a new\r\n * {@link module:crypto.store.base~CryptoStore}.\r\n */\r\n\r\n\r\nfunction setCryptoStoreFactory(fac) {\r\n cryptoStoreFactory = fac;\r\n}\r\n\r\n/**\r\n * Construct a Matrix Client. Similar to {@link module:client.MatrixClient}\r\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\r\n * @param {(Object|string)} opts The configuration options for this client. If\r\n * this is a string, it is assumed to be the base URL. These configuration\r\n * options will be passed directly to {@link module:client.MatrixClient}.\r\n * @param {Object} opts.store If not set, defaults to\r\n * {@link module:store/memory.MemoryStore}.\r\n * @param {Object} opts.scheduler If not set, defaults to\r\n * {@link module:scheduler~MatrixScheduler}.\r\n * @param {requestFunction} opts.request If not set, defaults to the function\r\n * supplied to {@link request} which defaults to the request module from NPM.\r\n *\r\n * @param {module:crypto.store.base~CryptoStore=} opts.cryptoStore\r\n * crypto store implementation. Calls the factory supplied to\r\n * {@link setCryptoStoreFactory} if unspecified; or if no factory has been\r\n * specified, uses a default implementation (indexeddb in the browser,\r\n * in-memory otherwise).\r\n *\r\n * @return {MatrixClient} A new matrix client.\r\n * @see {@link module:client.MatrixClient} for the full list of options for\r\n * opts.\r\n */\r\nfunction createClient(opts) {\r\n if (typeof opts === \"string\") {\r\n opts = {\r\n \"baseUrl\": opts\r\n };\r\n }\r\n\r\n opts.request = opts.request || requestInstance;\r\n opts.store = opts.store || new _memory.MemoryStore({\r\n localStorage: global.localStorage\r\n });\r\n opts.scheduler = opts.scheduler || new _scheduler.MatrixScheduler();\r\n opts.cryptoStore = opts.cryptoStore || cryptoStoreFactory();\r\n return new _client.MatrixClient(opts);\r\n}\r\n/**\r\n * The request function interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will attempt to call this function in order to\r\n * perform an HTTP request.\r\n * @callback requestFunction\r\n * @param {Object} opts The options for this HTTP request.\r\n * @param {string} opts.uri The complete URI.\r\n * @param {string} opts.method The HTTP method.\r\n * @param {Object} opts.qs The query parameters to append to the URI.\r\n * @param {Object} opts.body The JSON-serializable object.\r\n * @param {boolean} opts.json True if this is a JSON request.\r\n * @param {Object} opts._matrix_opts The underlying options set for\r\n * {@link MatrixHttpApi}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * A wrapper for the request function interface.\r\n * @callback requestWrapperFunction\r\n * @param {requestFunction} origRequest The underlying request function being\r\n * wrapped\r\n * @param {Object} opts The options for this HTTP request, given in the same\r\n * form as {@link requestFunction}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * The request callback interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will implement a callback which meets this\r\n * interface in order to handle the HTTP response.\r\n * @callback requestCallback\r\n * @param {Error} err The error if one occurred, else falsey.\r\n * @param {Object} response The HTTP response which consists of\r\n * {statusCode: {Number}, headers: {Object}}\r\n * @param {Object} body The parsed HTTP response body.\r\n */","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.encodeParams = encodeParams;\r\nexports.encodeUri = encodeUri;\r\nexports.map = map;\r\nexports.filter = filter;\r\nexports.keys = keys;\r\nexports.values = values;\r\nexports.forEach = forEach;\r\nexports.findElement = findElement;\r\nexports.removeElement = removeElement;\r\nexports.isFunction = isFunction;\r\nexports.isArray = isArray;\r\nexports.checkObjectHasKeys = checkObjectHasKeys;\r\nexports.checkObjectHasNoAdditionalKeys = checkObjectHasNoAdditionalKeys;\r\nexports.deepCopy = deepCopy;\r\nexports.deepCompare = deepCompare;\r\nexports.extend = extend;\r\nexports.runPolyfills = runPolyfills;\r\nexports.inherits = inherits;\r\nexports.polyfillSuper = polyfillSuper;\r\nexports.isNumber = isNumber;\r\nexports.removeHiddenChars = removeHiddenChars;\r\nexports.escapeRegExp = escapeRegExp;\r\nexports.globToRegexp = globToRegexp;\r\nexports.ensureNoTrailingSlash = ensureNoTrailingSlash;\r\nexports.sleep = sleep;\r\nexports.isNullOrUndefined = isNullOrUndefined;\r\nexports.defer = defer;\r\nexports.promiseMapSeries = promiseMapSeries;\r\nexports.promiseTry = promiseTry;\r\nexports.chunkPromises = chunkPromises;\r\nexports.setCrypto = setCrypto;\r\nexports.getCrypto = getCrypto;\r\n\r\nvar _unhomoglyph = _interopRequireDefault(require(\"unhomoglyph\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module.\r\n * @module utils\r\n */\r\n\r\n/**\r\n * Encode a dictionary of query parameters.\r\n * @param {Object} params A dict of key/values to encode e.g.\r\n * {\"foo\": \"bar\", \"baz\": \"taz\"}\r\n * @return {string} The encoded string e.g. foo=bar&baz=taz\r\n */\r\nfunction encodeParams(params) {\r\n let qs = \"\";\r\n\r\n for (const key in params) {\r\n if (!params.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n qs += \"&\" + encodeURIComponent(key) + \"=\" + encodeURIComponent(params[key]);\r\n }\r\n\r\n return qs.substring(1);\r\n}\r\n/**\r\n * Encodes a URI according to a set of template variables. Variables will be\r\n * passed through encodeURIComponent.\r\n * @param {string} pathTemplate The path with template variables e.g. '/foo/$bar'.\r\n * @param {Object} variables The key/value pairs to replace the template\r\n * variables with. E.g. { \"$bar\": \"baz\" }.\r\n * @return {string} The result of replacing all template variables e.g. '/foo/baz'.\r\n */\r\n\r\n\r\nfunction encodeUri(pathTemplate, variables) {\r\n for (const key in variables) {\r\n if (!variables.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n pathTemplate = pathTemplate.replace(key, encodeURIComponent(variables[key]));\r\n }\r\n\r\n return pathTemplate;\r\n}\r\n/**\r\n * Applies a map function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array with the signature fn(element){...}\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction map(array, fn) {\r\n const results = new Array(array.length);\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n results[i] = fn(array[i]);\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Applies a filter function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array. It should return true to keep the element. The function signature\r\n * looks like fn(element, index, array){...}.\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction filter(array, fn) {\r\n const results = [];\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n results.push(array[i]);\r\n }\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Get the keys for an object. Same as Object.keys().\r\n * @param {Object} obj The object to get the keys for.\r\n * @return {string[]} The keys of the object.\r\n */\r\n\r\n\r\nfunction keys(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(key);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Get the values for an object.\r\n * @param {Object} obj The object to get the values for.\r\n * @return {Array<*>} The values of the object.\r\n */\r\n\r\n\r\nfunction values(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(obj[key]);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Invoke a function for each item in the array.\r\n * @param {Array} array The array.\r\n * @param {Function} fn The function to invoke for each element. Has the\r\n * function signature fn(element, index).\r\n */\r\n\r\n\r\nfunction forEach(array, fn) {\r\n for (let i = 0; i < array.length; i++) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * The findElement() method returns a value in the array, if an element in the array\r\n * satisfies (returns true) the provided testing function. Otherwise undefined\r\n * is returned.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array)\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {*} The first value in the array which returns true for\r\n * the given function.\r\n */\r\n\r\n\r\nfunction findElement(array, fn, reverse) {\r\n let i;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * The removeElement() method removes the first element in the array that\r\n * satisfies (returns true) the provided testing function.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array). Return true to\r\n * remove this element and break.\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {boolean} True if an element was removed.\r\n */\r\n\r\n\r\nfunction removeElement(array, fn, reverse) {\r\n let i;\r\n let removed;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n/**\r\n * Checks if the given thing is a function.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is a function.\r\n */\r\n\r\n\r\nfunction isFunction(value) {\r\n return Object.prototype.toString.call(value) === \"[object Function]\";\r\n}\r\n/**\r\n * Checks if the given thing is an array.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is an array.\r\n */\r\n\r\n\r\nfunction isArray(value) {\r\n return Array.isArray ? Array.isArray(value) : Boolean(value && value.constructor === Array);\r\n}\r\n/**\r\n * Checks that the given object has the specified keys.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} keys The list of keys that 'obj' must have.\r\n * @throws If the object is missing keys.\r\n */\r\n// note using 'keys' here would shadow the 'keys' function defined above\r\n\r\n\r\nfunction checkObjectHasKeys(obj, keys_) {\r\n for (let i = 0; i < keys_.length; i++) {\r\n if (!obj.hasOwnProperty(keys_[i])) {\r\n throw new Error(\"Missing required key: \" + keys_[i]);\r\n }\r\n }\r\n}\r\n/**\r\n * Checks that the given object has no extra keys other than the specified ones.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} allowedKeys The list of allowed key names.\r\n * @throws If there are extra keys.\r\n */\r\n\r\n\r\nfunction checkObjectHasNoAdditionalKeys(obj, allowedKeys) {\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n if (allowedKeys.indexOf(key) === -1) {\r\n throw new Error(\"Unknown key: \" + key);\r\n }\r\n }\r\n}\r\n/**\r\n * Deep copy the given object. The object MUST NOT have circular references and\r\n * MUST NOT have functions.\r\n * @param {Object} obj The object to deep copy.\r\n * @return {Object} A copy of the object without any references to the original.\r\n */\r\n\r\n\r\nfunction deepCopy(obj) {\r\n return JSON.parse(JSON.stringify(obj));\r\n}\r\n/**\r\n * Compare two objects for equality. The objects MUST NOT have circular references.\r\n *\r\n * @param {Object} x The first object to compare.\r\n * @param {Object} y The second object to compare.\r\n *\r\n * @return {boolean} true if the two objects are equal\r\n */\r\n\r\n\r\nfunction deepCompare(x, y) {\r\n // Inspired by\r\n // http://stackoverflow.com/questions/1068834/object-comparison-in-javascript#1144249\r\n // Compare primitives and functions.\r\n // Also check if both arguments link to the same object.\r\n if (x === y) {\r\n return true;\r\n }\r\n\r\n if (typeof x !== typeof y) {\r\n return false;\r\n } // special-case NaN (since NaN !== NaN)\r\n\r\n\r\n if (typeof x === 'number' && isNaN(x) && isNaN(y)) {\r\n return true;\r\n } // special-case null (since typeof null == 'object', but null.constructor\r\n // throws)\r\n\r\n\r\n if (x === null || y === null) {\r\n return x === y;\r\n } // everything else is either an unequal primitive, or an object\r\n\r\n\r\n if (!(x instanceof Object)) {\r\n return false;\r\n } // check they are the same type of object\r\n\r\n\r\n if (x.constructor !== y.constructor || x.prototype !== y.prototype) {\r\n return false;\r\n } // special-casing for some special types of object\r\n\r\n\r\n if (x instanceof RegExp || x instanceof Date) {\r\n return x.toString() === y.toString();\r\n } // the object algorithm works for Array, but it's sub-optimal.\r\n\r\n\r\n if (x instanceof Array) {\r\n if (x.length !== y.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < x.length; i++) {\r\n if (!deepCompare(x[i], y[i])) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n // disable jshint \"The body of a for in should be wrapped in an if\r\n // statement\"\r\n\r\n /* jshint -W089 */\r\n // check that all of y's direct keys are in x\r\n let p;\r\n\r\n for (p in y) {\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n } // finally, compare each of x's keys with y\r\n\r\n\r\n for (p in y) {\r\n // eslint-disable-line guard-for-in\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n\r\n if (!deepCompare(x[p], y[p])) {\r\n return false;\r\n }\r\n }\r\n }\r\n /* jshint +W089 */\r\n\r\n\r\n return true;\r\n}\r\n/**\r\n * Copy properties from one object to another.\r\n *\r\n * All enumerable properties, included inherited ones, are copied.\r\n *\r\n * This is approximately equivalent to ES6's Object.assign, except\r\n * that the latter doesn't copy inherited properties.\r\n *\r\n * @param {Object} target The object that will receive new properties\r\n * @param {...Object} source Objects from which to copy properties\r\n *\r\n * @return {Object} target\r\n */\r\n\r\n\r\nfunction extend(...restParams) {\r\n const target = restParams[0] || {};\r\n\r\n for (let i = 1; i < restParams.length; i++) {\r\n const source = restParams[i];\r\n if (!source) continue;\r\n\r\n for (const propName in source) {\r\n // eslint-disable-line guard-for-in\r\n target[propName] = source[propName];\r\n }\r\n }\r\n\r\n return target;\r\n}\r\n/**\r\n * Run polyfills to add Array.map and Array.filter if they are missing.\r\n */\r\n\r\n\r\nfunction runPolyfills() {\r\n // Array.prototype.filter\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\r\n if (!Array.prototype.filter) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.filter = function (fun,\r\n /*, thisArg*/\r\n ...restProps) {\r\n if (this === void 0 || this === null) {\r\n throw new TypeError();\r\n }\r\n\r\n const t = Object(this);\r\n const len = t.length >>> 0;\r\n\r\n if (typeof fun !== 'function') {\r\n throw new TypeError();\r\n }\r\n\r\n const res = [];\r\n const thisArg = restProps ? restProps[0] : void 0;\r\n\r\n for (let i = 0; i < len; i++) {\r\n if (i in t) {\r\n const val = t[i]; // NOTE: Technically this should Object.defineProperty at\r\n // the next index, as push can be affected by\r\n // properties on Object.prototype and Array.prototype.\r\n // But that method's new, and collisions should be\r\n // rare, so use the more-compatible alternative.\r\n\r\n if (fun.call(thisArg, val, i, t)) {\r\n res.push(val);\r\n }\r\n }\r\n }\r\n\r\n return res;\r\n };\r\n } // Array.prototype.map\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.19\r\n // Reference: http://es5.github.io/#x15.4.4.19\r\n\r\n\r\n if (!Array.prototype.map) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.map = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this|\r\n // value as the argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal\r\n // method of O with the argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== 'function') {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let A be a new array created as if by the expression new Array(len)\r\n // where Array is the standard built-in constructor with that name and\r\n // len is the value of len.\r\n\r\n\r\n const A = new Array(len); // 7. Let k be 0\r\n\r\n k = 0; // 8. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue;\r\n let mappedValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal\r\n // method of O with argument Pk.\r\n kValue = O[k]; // ii. Let mappedValue be the result of calling the Call internal\r\n // method of callback with T as the this value and argument\r\n // list containing kValue, k, and O.\r\n\r\n mappedValue = callback.call(T, kValue, k, O); // iii. Call the DefineOwnProperty internal method of A with arguments\r\n // Pk, Property Descriptor\r\n // { Value: mappedValue,\r\n // Writable: true,\r\n // Enumerable: true,\r\n // Configurable: true },\r\n // and false.\r\n // In browsers that support Object.defineProperty, use the following:\r\n // Object.defineProperty(A, k, {\r\n // value: mappedValue,\r\n // writable: true,\r\n // enumerable: true,\r\n // configurable: true\r\n // });\r\n // For best browser support, use the following:\r\n\r\n A[k] = mappedValue;\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 9. return A\r\n\r\n\r\n return A;\r\n };\r\n } // Array.prototype.forEach\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.18\r\n // Reference: http://es5.github.io/#x15.4.4.18\r\n\r\n\r\n if (!Array.prototype.forEach) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.forEach = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this| value as the\r\n // argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal method of O with the\r\n // argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== \"function\") {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let k be 0\r\n\r\n\r\n k = 0; // 7. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with\r\n // argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal method of O with\r\n // argument Pk\r\n kValue = O[k]; // ii. Call the Call internal method of callback with T as the this value and\r\n // argument list containing kValue, k, and O.\r\n\r\n callback.call(T, kValue, k, O);\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 8. return undefined\r\n\r\n };\r\n }\r\n}\r\n/**\r\n * Inherit the prototype methods from one constructor into another. This is a\r\n * port of the Node.js implementation with an Object.create polyfill.\r\n *\r\n * @param {function} ctor Constructor function which needs to inherit the\r\n * prototype.\r\n * @param {function} superCtor Constructor function to inherit prototype from.\r\n */\r\n\r\n\r\nfunction inherits(ctor, superCtor) {\r\n // Add util.inherits from Node.js\r\n // Source:\r\n // https://github.com/joyent/node/blob/master/lib/util.js\r\n // Copyright Joyent, Inc. and other Node contributors.\r\n //\r\n // Permission is hereby granted, free of charge, to any person obtaining a\r\n // copy of this software and associated documentation files (the\r\n // \"Software\"), to deal in the Software without restriction, including\r\n // without limitation the rights to use, copy, modify, merge, publish,\r\n // distribute, sublicense, and/or sell copies of the Software, and to permit\r\n // persons to whom the Software is furnished to do so, subject to the\r\n // following conditions:\r\n //\r\n // The above copyright notice and this permission notice shall be included\r\n // in all copies or substantial portions of the Software.\r\n //\r\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n ctor.super_ = superCtor;\r\n ctor.prototype = Object.create(superCtor.prototype, {\r\n constructor: {\r\n value: ctor,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true\r\n }\r\n });\r\n}\r\n/**\r\n * Polyfills inheritance for prototypes by allowing different kinds of\r\n * super types. Typically prototypes would use `SuperType.call(this, params)`\r\n * though this doesn't always work in some environments - this function\r\n * falls back to using `Object.assign()` to clone a constructed copy\r\n * of the super type onto `thisArg`.\r\n * @param {any} thisArg The child instance. Modified in place.\r\n * @param {any} SuperType The type to act as a super instance\r\n * @param {any} params Arguments to supply to the super type's constructor\r\n */\r\n\r\n\r\nfunction polyfillSuper(thisArg, SuperType, ...params) {\r\n try {\r\n SuperType.call(thisArg, ...params);\r\n } catch (e) {\r\n // fall back to Object.assign to just clone the thing\r\n const fakeSuper = new SuperType(...params);\r\n Object.assign(thisArg, fakeSuper);\r\n }\r\n}\r\n/**\r\n * Returns whether the given value is a finite number without type-coercion\r\n *\r\n * @param {*} value the value to test\r\n * @return {boolean} whether or not value is a finite number without type-coercion\r\n */\r\n\r\n\r\nfunction isNumber(value) {\r\n return typeof value === 'number' && isFinite(value);\r\n}\r\n/**\r\n * Removes zero width chars, diacritics and whitespace from the string\r\n * Also applies an unhomoglyph on the string, to prevent similar looking chars\r\n * @param {string} str the string to remove hidden characters from\r\n * @return {string} a string with the hidden characters removed\r\n */\r\n\r\n\r\nfunction removeHiddenChars(str) {\r\n if (typeof str === \"string\") {\r\n return (0, _unhomoglyph.default)(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));\r\n }\r\n\r\n return \"\";\r\n} // Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.\r\n// Includes:\r\n// various width spaces U+2000 - U+200D\r\n// LTR and RTL marks U+200E and U+200F\r\n// LTR/RTL and other directional formatting marks U+202A - U+202F\r\n// Combining characters U+0300 - U+036F\r\n// Zero width no-break space (BOM) U+FEFF\r\n// eslint-disable-next-line no-misleading-character-class\r\n\r\n\r\nconst removeHiddenCharsRegex = /[\\u2000-\\u200F\\u202A-\\u202F\\u0300-\\u036f\\uFEFF\\s]/g;\r\n\r\nfunction escapeRegExp(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n}\r\n\r\nfunction globToRegexp(glob, extended) {\r\n extended = typeof extended === 'boolean' ? extended : true; // From\r\n // https://github.com/matrix-org/synapse/blob/abbee6b29be80a77e05730707602f3bbfc3f38cb/synapse/push/__init__.py#L132\r\n // Because micromatch is about 130KB with dependencies,\r\n // and minimatch is not much better.\r\n\r\n let pat = escapeRegExp(glob);\r\n pat = pat.replace(/\\\\\\*/g, '.*');\r\n pat = pat.replace(/\\?/g, '.');\r\n\r\n if (extended) {\r\n pat = pat.replace(/\\\\\\[(!|)(.*)\\\\]/g, function (match, p1, p2, offset, string) {\r\n const first = p1 && '^' || '';\r\n const second = p2.replace(/\\\\-/, '-');\r\n return '[' + first + second + ']';\r\n });\r\n }\r\n\r\n return pat;\r\n}\r\n\r\nfunction ensureNoTrailingSlash(url) {\r\n if (url && url.endsWith(\"/\")) {\r\n return url.substr(0, url.length - 1);\r\n } else {\r\n return url;\r\n }\r\n} // Returns a promise which resolves with a given value after the given number of ms\r\n\r\n\r\nfunction sleep(ms, value) {\r\n return new Promise(resolve => {\r\n setTimeout(resolve, ms, value);\r\n });\r\n}\r\n\r\nfunction isNullOrUndefined(val) {\r\n return val === null || val === undefined;\r\n} // Returns a Deferred\r\n\r\n\r\nfunction defer() {\r\n let resolve;\r\n let reject;\r\n const promise = new Promise((_resolve, _reject) => {\r\n resolve = _resolve;\r\n reject = _reject;\r\n });\r\n return {\r\n resolve,\r\n reject,\r\n promise\r\n };\r\n}\r\n\r\nasync function promiseMapSeries(promises, fn) {\r\n for (const o of await promises) {\r\n await fn(await o);\r\n }\r\n}\r\n\r\nfunction promiseTry(fn) {\r\n return new Promise(resolve => resolve(fn()));\r\n} // Creates and awaits all promises, running no more than `chunkSize` at the same time\r\n\r\n\r\nasync function chunkPromises(fns, chunkSize) {\r\n const results = [];\r\n\r\n for (let i = 0; i < fns.length; i += chunkSize) {\r\n results.push(...(await Promise.all(fns.slice(i, i + chunkSize).map(fn => fn()))));\r\n }\r\n\r\n return results;\r\n} // We need to be able to access the Node.js crypto library from within the\r\n// Matrix SDK without needing to `require(\"crypto\")`, which will fail in\r\n// browsers. So `index.ts` will call `setCrypto` to store it, and when we need\r\n// it, we can call `getCrypto`.\r\n\r\n\r\nlet crypto;\r\n\r\nfunction setCrypto(c) {\r\n crypto = c;\r\n}\r\n\r\nfunction getCrypto() {\r\n return crypto;\r\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"body[data-v-0635047f]{--sweetalert-icons-animation-background:transparent}.sa[data-v-0635047f]{width:140px;height:140px;padding:26px;margin:auto}.sa-loading[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);left:-4px;top:-4px;z-index:2;border-top:4px solid var(--icon-color);-webkit-animation:animateLoadingSpin-data-v-0635047f .75s infinite;animation:animateLoadingSpin-data-v-0635047f .75s infinite}.sa-error[data-v-0635047f],.sa-loading[data-v-0635047f]{box-sizing:content-box;height:80px;position:relative;width:80px}.sa-error[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);padding:0;-webkit-animation:animateErrorIcon-data-v-0635047f .5s;animation:animateErrorIcon-data-v-0635047f .5s}.sa-error[data-v-0635047f]:after,.sa-error[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-error[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-error[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-error-x[data-v-0635047f]{display:block;position:relative;z-index:2}.sa-error-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-error-fix[data-v-0635047f]{height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-error-left[data-v-0635047f],.sa-error-right[data-v-0635047f]{border-radius:2px;display:block;height:5px;position:absolute;z-index:2;background-color:var(--icon-color);top:37px;width:47px}.sa-error-left[data-v-0635047f]{left:17px;transform:rotate(45deg);-webkit-animation:animateXLeft-data-v-0635047f .75s;animation:animateXLeft-data-v-0635047f .75s}.sa-error-right[data-v-0635047f]{right:16px;transform:rotate(-45deg);-webkit-animation:animateXRight-data-v-0635047f .75s;animation:animateXRight-data-v-0635047f .75s}.sa-warning[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleWarning-data-v-0635047f .75s infinite alternate;animation:scaleWarning-data-v-0635047f .75s infinite alternate}.sa-warning[data-v-0635047f]:after,.sa-warning[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-warning[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseWarning-data-v-0635047f 2s linear infinite;animation:pulseWarning-data-v-0635047f 2s linear infinite}.sa-warning[data-v-0635047f]:after{display:block;z-index:1}.sa-warning-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-warning-body[data-v-0635047f],.sa-warning-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseWarningIns-data-v-0635047f .75s infinite alternate;animation:pulseWarningIns-data-v-0635047f .75s infinite alternate}.sa-warning-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-info[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleInfo-data-v-0635047f .75s infinite alternate;animation:scaleInfo-data-v-0635047f .75s infinite alternate}.sa-info[data-v-0635047f]:after,.sa-info[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-info[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseInfo-data-v-0635047f 2s linear infinite;animation:pulseInfo-data-v-0635047f 2s linear infinite}.sa-info[data-v-0635047f]:after{display:block;z-index:1}.sa-info-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-info-body[data-v-0635047f],.sa-info-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseInfoIns-data-v-0635047f .75s infinite alternate;animation:pulseInfoIns-data-v-0635047f .75s infinite alternate}.sa-info-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-success[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px}.sa-success[data-v-0635047f],.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{background-color:var(--sweetalert-icons-animation-background)}.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-success[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-success[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-success-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-success-fix[data-v-0635047f]{background-color:var(--sweetalert-icons-animation-background);height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-success-long[data-v-0635047f],.sa-success-tip[data-v-0635047f]{background-color:var(--icon-color);border-radius:2px;height:5px;position:absolute;z-index:2}.sa-success-tip[data-v-0635047f]{left:14px;top:46px;transform:rotate(45deg);width:25px;-webkit-animation:animateSuccessTip-data-v-0635047f .75s;animation:animateSuccessTip-data-v-0635047f .75s}.sa-success-long[data-v-0635047f]{right:8px;top:38px;transform:rotate(-45deg);width:47px;-webkit-animation:animateSuccessLong-data-v-0635047f .75s;animation:animateSuccessLong-data-v-0635047f .75s}@-webkit-keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@-webkit-keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@-webkit-keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@-webkit-keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@-webkit-keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@-webkit-keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@-webkit-keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@-webkit-keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}@keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.upgradeDatabase = upgradeDatabase;\r\nexports.Backend = exports.VERSION = void 0;\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nconst VERSION = 10;\r\nexports.VERSION = VERSION;\r\nconst PROFILE_TRANSACTIONS = false;\r\n/**\r\n * Implementation of a CryptoStore which is backed by an existing\r\n * IndexedDB connection. Generally you want IndexedDBCryptoStore\r\n * which connects to the database and defers to one of these.\r\n *\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\n\r\nclass Backend {\r\n /**\r\n * @param {IDBDatabase} db\r\n */\r\n constructor(db) {\r\n this._db = db;\r\n this._nextTxnId = 0; // make sure we close the db on `onversionchange` - otherwise\r\n // attempts to delete the database will block (and subsequent\r\n // attempts to re-create it will also block).\r\n\r\n db.onversionchange = ev => {\r\n _logger.logger.log(`versionchange for indexeddb ${this._dbName}: closing`);\r\n\r\n db.close();\r\n };\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n txn.onerror = reject; // first see if we already have an entry for this request.\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n resolve(existing);\r\n return;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n txn.oncomplete = () => {\r\n resolve(request);\r\n };\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n store.add(request);\r\n });\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n resolve(existing);\r\n });\r\n });\r\n }\r\n /**\r\n * look for an existing room key request in the db\r\n *\r\n * @private\r\n * @param {IDBTransaction} txn database transaction\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n * @param {Function} callback function to call with the results of the\r\n * search. Either passed a matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found.\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(txn, requestBody, callback) {\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const idx = store.index(\"session\");\r\n const cursorReq = idx.openCursor([requestBody.room_id, requestBody.session_id]);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n // no match found\r\n callback(null);\r\n return;\r\n }\r\n\r\n const existing = cursor.value;\r\n\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n // got a match\r\n callback(existing);\r\n return;\r\n } // look at the next entry in the index\r\n\r\n\r\n cursor.continue();\r\n };\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states. If there are multiple\r\n * requests in those states, an arbitrary one is chosen.\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n if (wantedStates.length === 0) {\r\n return Promise.resolve(null);\r\n } // this is a bit tortuous because we need to make sure we do the lookup\r\n // in a single transaction, to avoid having a race with the insertion\r\n // code.\r\n // index into the wantedStates array\r\n\r\n\r\n let stateIndex = 0;\r\n let result;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n // got a match\r\n result = cursor.value;\r\n return;\r\n } // try the next state in the list\r\n\r\n\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All elements in a given state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const index = store.index(\"state\");\r\n const request = index.getAll(wantedState);\r\n\r\n request.onsuccess = ev => resolve(ev.target.result);\r\n\r\n request.onerror = ev => reject(ev.target.error);\r\n });\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n let stateIndex = 0;\r\n const results = [];\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n const keyReq = cursor.value;\r\n\r\n if (keyReq.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(keyReq);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n // try the next state in the list\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n let result = null;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${data.state}`);\r\n\r\n return;\r\n }\r\n\r\n Object.assign(data, updates);\r\n cursor.update(data);\r\n result = data;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${data.state} ` + `(expected ${expectedState})`);\r\n\r\n return;\r\n }\r\n\r\n cursor.delete();\r\n };\r\n\r\n return promiseifyTxn(txn);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(newData, \"-\");\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"crossSigningKeys\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(`ssss_cache:${type}`);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(keys, \"crossSigningKeys\");\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(key, `ssss_cache:${type}`);\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const countReq = objectStore.count();\r\n\r\n countReq.onsuccess = function () {\r\n try {\r\n func(countReq.result);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const idx = objectStore.index(\"deviceKey\");\r\n const getReq = idx.openCursor(deviceKey);\r\n const results = {};\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n results[cursor.value.sessionId] = {\r\n session: cursor.value.session,\r\n lastReceivedMessageTs: cursor.value.lastReceivedMessageTs\r\n };\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(results);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.get([deviceKey, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n func({\r\n session: getReq.result.session,\r\n lastReceivedMessageTs: getReq.result.lastReceivedMessageTs\r\n });\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n func(cursor.value);\r\n cursor.continue();\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n objectStore.put({\r\n deviceKey,\r\n sessionId,\r\n session: sessionInfo.session,\r\n lastReceivedMessageTs: sessionInfo.lastReceivedMessageTs\r\n });\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n objectStore.put({\r\n deviceKey,\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n return promiseifyTxn(txn);\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n let result;\r\n\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n const index = objectStore.index(\"deviceKey\");\r\n const req = index.getAll(deviceKey);\r\n\r\n req.onsuccess = event => {\r\n const problems = req.result;\r\n\r\n if (!problems.length) {\r\n result = null;\r\n return;\r\n }\r\n\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n result = Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n return;\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n result = null;\r\n } else {\r\n result = lastProblem;\r\n }\r\n };\r\n\r\n await promiseifyTxn(txn);\r\n return result;\r\n } // FIXME: we should probably prune this when devices get deleted\r\n\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const txn = this._db.transaction(\"notified_error_devices\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"notified_error_devices\");\r\n const ret = [];\r\n await Promise.all(devices.map(device => {\r\n return new Promise(resolve => {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n const getReq = objectStore.get([userId, deviceInfo.deviceId]);\r\n\r\n getReq.onsuccess = function () {\r\n if (!getReq.result) {\r\n objectStore.put({\r\n userId,\r\n deviceId: deviceInfo.deviceId\r\n });\r\n ret.push(device);\r\n }\r\n\r\n resolve();\r\n };\r\n });\r\n }));\r\n return ret;\r\n } // Inbound group sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n let session = false;\r\n let withheld = false;\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n session = getReq.result.session;\r\n } else {\r\n session = null;\r\n }\r\n\r\n if (withheld !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n\r\n const withheldObjectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n const withheldGetReq = withheldObjectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n withheldGetReq.onsuccess = function () {\r\n try {\r\n if (withheldGetReq.result) {\r\n withheld = withheldGetReq.result.session;\r\n } else {\r\n withheld = null;\r\n }\r\n\r\n if (session !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n try {\r\n func({\r\n senderKey: cursor.value.senderCurve25519Key,\r\n sessionId: cursor.value.sessionId,\r\n sessionData: cursor.value.session\r\n });\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const addReq = objectStore.add({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n\r\n addReq.onerror = ev => {\r\n if (addReq.error.name === 'ConstraintError') {\r\n // This stops the error from triggering the txn's onerror\r\n ev.stopPropagation(); // ...and this stops it from aborting the transaction\r\n\r\n ev.preventDefault();\r\n\r\n _logger.logger.log(\"Ignoring duplicate inbound group session: \" + senderCurve25519Key + \" / \" + sessionId);\r\n } else {\r\n abortWithException(txn, new Error(\"Failed to add inbound group session: \" + addReq.error));\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n objectStore.put(deviceData, \"-\");\r\n }\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n const objectStore = txn.objectStore(\"rooms\");\r\n objectStore.put(roomInfo, roomId);\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n const rooms = {};\r\n const objectStore = txn.objectStore(\"rooms\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n rooms[cursor.key] = cursor.value;\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(rooms);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n } // session backups\r\n\r\n\r\n getSessionsNeedingBackup(limit) {\r\n return new Promise((resolve, reject) => {\r\n const sessions = [];\r\n\r\n const txn = this._db.transaction([\"sessions_needing_backup\", \"inbound_group_sessions\"], \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n txn.oncomplete = function () {\r\n resolve(sessions);\r\n };\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n const sessionStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n const sessionGetReq = sessionStore.get(cursor.key);\r\n\r\n sessionGetReq.onsuccess = function () {\r\n sessions.push({\r\n senderKey: sessionGetReq.result.senderCurve25519Key,\r\n sessionId: sessionGetReq.result.sessionId,\r\n sessionData: sessionGetReq.result.session\r\n });\r\n };\r\n\r\n if (!limit || sessions.length < limit) {\r\n cursor.continue();\r\n }\r\n }\r\n };\r\n });\r\n }\r\n\r\n countSessionsNeedingBackup(txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.count();\r\n req.onerror = reject;\r\n\r\n req.onsuccess = () => resolve(req.result);\r\n });\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.delete([session.senderKey, session.sessionId]);\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n markSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.put({\r\n senderCurve25519Key: session.senderKey,\r\n sessionId: session.sessionId\r\n });\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n sessions.push([senderKey, sessionId]);\r\n objectStore.put({\r\n roomId,\r\n sessions\r\n });\r\n };\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n return new Promise((resolve, reject) => {\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n resolve(sessions);\r\n };\r\n\r\n req.onerror = reject;\r\n });\r\n }\r\n\r\n doTxn(mode, stores, func, log = _logger.logger) {\r\n let startTime;\r\n let description;\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n const txnId = this._nextTxnId++;\r\n startTime = Date.now();\r\n description = `${mode} crypto store transaction ${txnId} in ${stores}`;\r\n log.debug(`Starting ${description}`);\r\n }\r\n\r\n const txn = this._db.transaction(stores, mode);\r\n\r\n const promise = promiseifyTxn(txn);\r\n const result = func(txn);\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n promise.then(() => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.debug(`Finished ${description}, took ${elapsedTime} ms`);\r\n }, () => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.error(`Failed ${description}, took ${elapsedTime} ms`);\r\n });\r\n }\r\n\r\n return promise.then(() => {\r\n return result;\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.Backend = Backend;\r\n\r\nfunction upgradeDatabase(db, oldVersion) {\r\n _logger.logger.log(`Upgrading IndexedDBCryptoStore from version ${oldVersion}` + ` to ${VERSION}`);\r\n\r\n if (oldVersion < 1) {\r\n // The database did not previously exist.\r\n createDatabase(db);\r\n }\r\n\r\n if (oldVersion < 2) {\r\n db.createObjectStore(\"account\");\r\n }\r\n\r\n if (oldVersion < 3) {\r\n const sessionsStore = db.createObjectStore(\"sessions\", {\r\n keyPath: [\"deviceKey\", \"sessionId\"]\r\n });\r\n sessionsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n }\r\n\r\n if (oldVersion < 4) {\r\n db.createObjectStore(\"inbound_group_sessions\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 5) {\r\n db.createObjectStore(\"device_data\");\r\n }\r\n\r\n if (oldVersion < 6) {\r\n db.createObjectStore(\"rooms\");\r\n }\r\n\r\n if (oldVersion < 7) {\r\n db.createObjectStore(\"sessions_needing_backup\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 8) {\r\n db.createObjectStore(\"inbound_group_sessions_withheld\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 9) {\r\n const problemsStore = db.createObjectStore(\"session_problems\", {\r\n keyPath: [\"deviceKey\", \"time\"]\r\n });\r\n problemsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n db.createObjectStore(\"notified_error_devices\", {\r\n keyPath: [\"userId\", \"deviceId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 10) {\r\n db.createObjectStore(\"shared_history_inbound_group_sessions\", {\r\n keyPath: [\"roomId\"]\r\n });\r\n } // Expand as needed.\r\n\r\n}\r\n\r\nfunction createDatabase(db) {\r\n const outgoingRoomKeyRequestsStore = db.createObjectStore(\"outgoingRoomKeyRequests\", {\r\n keyPath: \"requestId\"\r\n }); // we assume that the RoomKeyRequestBody will have room_id and session_id\r\n // properties, to make the index efficient.\r\n\r\n outgoingRoomKeyRequestsStore.createIndex(\"session\", [\"requestBody.room_id\", \"requestBody.session_id\"]);\r\n outgoingRoomKeyRequestsStore.createIndex(\"state\", \"state\");\r\n}\r\n/*\r\n * Aborts a transaction with a given exception\r\n * The transaction promise will be rejected with this exception.\r\n */\r\n\r\n\r\nfunction abortWithException(txn, e) {\r\n // We cheekily stick our exception onto the transaction object here\r\n // We could alternatively make the thing we pass back to the app\r\n // an object containing the transaction and exception.\r\n txn._mx_abortexception = e;\r\n\r\n try {\r\n txn.abort();\r\n } catch (e) {// sometimes we won't be able to abort the transaction\r\n // (ie. if it's aborted or completed)\r\n }\r\n}\r\n\r\nfunction promiseifyTxn(txn) {\r\n return new Promise((resolve, reject) => {\r\n txn.oncomplete = () => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n }\r\n\r\n resolve();\r\n };\r\n\r\n txn.onerror = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n\r\n txn.onabort = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n });\r\n}","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#linepreloader[data-v-bcf20e38]{display:inline-block;font-size:0;padding:0}#linepreloader span[data-v-bcf20e38]{vertical-align:middle;border-radius:50%;background:rgb(var(--neutral-grad-2));display:inline-block;width:6px;height:6px;margin:3px 2px;-webkit-animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate;animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate}#linepreloader span[data-v-bcf20e38]:first-child{-webkit-animation-delay:-.8;animation-delay:-.8s}#linepreloader span[data-v-bcf20e38]:nth-child(2){-webkit-animation-delay:-.53333s;animation-delay:-.53333s}#linepreloader span[data-v-bcf20e38]:nth-child(3){-webkit-animation-delay:-.26666s;animation-delay:-.26666s}@keyframes linepreloader-data-v-bcf20e38{0%{transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes linepreloader-data-v-bcf20e38{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.ReEmitter = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nclass ReEmitter {\r\n constructor(target) {\r\n (0, _defineProperty2.default)(this, \"target\", void 0);\r\n this.target = target;\r\n }\r\n\r\n reEmit(source, eventNames) {\r\n for (const eventName of eventNames) {\r\n // We include the source as the last argument for event handlers which may need it,\r\n // such as read receipt listeners on the client class which won't have the context\r\n // of the room.\r\n const forSource = (...args) => {\r\n // EventEmitter special cases 'error' to make the emit function throw if no\r\n // handler is attached, which sort of makes sense for making sure that something\r\n // handles an error, but for re-emitting, there could be a listener on the original\r\n // source object so the test doesn't really work. We *could* try to replicate the\r\n // same logic and throw if there is no listener on either the source or the target,\r\n // but this behaviour is fairly undesireable for us anyway: the main place we throw\r\n // 'error' events is for calls, where error events are usually emitted some time\r\n // later by a different part of the code where 'emit' throwing because the app hasn't\r\n // added an error handler isn't terribly helpful. (A better fix in retrospect may\r\n // have been to just avoid using the event name 'error', but backwards compat...)\r\n if (eventName === 'error' && this.target.listenerCount('error') === 0) return;\r\n this.target.emit(eventName, ...args, source);\r\n };\r\n\r\n source.on(eventName, forSource);\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.ReEmitter = ReEmitter;","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Exceptions */\n__export(require(\"./exceptions\"));\n/** Symmetric encryption APIs */\nvar aead_1 = require(\"./aead\");\nexports.AEAD = aead_1.AEAD;\nvar siv_1 = require(\"./siv\");\nexports.SIV = siv_1.SIV;\n/** STREAM streaming encryption */\nvar stream_1 = require(\"./stream\");\nexports.StreamEncryptor = stream_1.StreamEncryptor;\nexports.StreamDecryptor = stream_1.StreamDecryptor;\n/** MAC functions */\nvar cmac_1 = require(\"./mac/cmac\");\nexports.CMAC = cmac_1.CMAC;\nvar pmac_1 = require(\"./mac/pmac\");\nexports.PMAC = pmac_1.PMAC;\n/** Crypto providers */\nvar polyfill_1 = require(\"./providers/polyfill\");\nexports.PolyfillCryptoProvider = polyfill_1.PolyfillCryptoProvider;\nvar webcrypto_1 = require(\"./providers/webcrypto\");\nexports.WebCryptoProvider = webcrypto_1.WebCryptoProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Number of trailing zeros in a given byte value */\nconst CTZ_TABLE = new Uint8Array([\n 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n]);\n/** Count the number of trailing zeroes in a given number */\nfunction ctz(value) {\n return CTZ_TABLE[value];\n}\nexports.ctz = ctz;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".footer-chat[data-v-517e1e1f]{bottom:0;left:0;right:0;background:rgb(var(--background-total-theme));border-top:1px solid rgb(var(--background-secondary-theme));position:absolute;height:90px;padding-bottom:30px}.footer-chat.bout[data-v-517e1e1f]{position:fixed;will-change:transform}.footer-chat .work[data-v-517e1e1f]{height:100%;padding:0!important}.footer-chat.bin[data-v-517e1e1f]{border-top:0;position:static}.footer-chat.fix[data-v-517e1e1f]{position:absolute;height:auto}.footer-chat.fix.minimized[data-v-517e1e1f]{background:transparent;padding-bottom:0}.footer-chat.fix.minimized .menuItems[data-v-517e1e1f]{display:block;transition:.3s;padding-top:.5em}.footer-chat.fix.minimized .menuItems a[data-v-517e1e1f]{padding:0}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]{width:44px;height:44px;background:rgba(var(--neutral-grad-3),.4);color:rgba(var(--neutral-grad-3),.8);border-radius:50%;border:1px solid transparent;margin-bottom:.25em;line-height:40px;transition:.3s}.footer-chat.fix.minimized .menuItems .menuItem .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem .label[data-v-517e1e1f]{display:none}.footer-chat.fix.minimized .menuItems .menuItem i[data-v-517e1e1f]{vertical-align:middle;font-size:.8em}.footer-chat.fix.minimized .menuItems .menuItem.active[data-v-517e1e1f]{text-shadow:0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright));background:rgba(var(--color-bg-ac-bright),.9);border:1px solid rgba(var(--color-bg-ac-bright),.9);color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]:hover:not(.active){background:rgba(var(--color-bg-ac-bright),.95);color:#fff;text-shadow:0 0 10px rgb(var(--color-bg-ac-bright)),0 0 15px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 25px rgb(var(--color-bg-ac-bright)),0 0 30px #02061a,0 0 35px rgb(var(--color-bg-ac-bright)),0 0 40px #02061a}.footer-chat.fix.minimized.active .menuItems[data-v-517e1e1f]{border-top:0}.menuItems[data-v-517e1e1f]{display:flex;justify-content:space-around;align-items:center;height:100%}.menuItems a[data-v-517e1e1f]{display:block;flex-grow:1;text-align:center;padding:1em;color:#213850}.menuItems .icon[data-v-517e1e1f]{font-size:.9em;color:rgba(var(--color-txt-gray-dark),.7)}.menuItems .label[data-v-517e1e1f]{font-size:.7em;position:absolute;bottom:0;left:0;right:0;line-height:1em;text-align:center;opacity:.7}.menuItems .menuItem[data-v-517e1e1f]{position:relative;text-align:center;cursor:pointer;width:64px;height:44px;line-height:44px}.menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--color-txt-ac))}.menuItems .menuItem .unseen[data-v-517e1e1f]{position:absolute;width:22px;height:22px;right:-10%;bottom:-10%;background:rgba(var(--color-txt-ac),.9);line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em;color:rgb(var(--text-on-bg-ac-color))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.Relations = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2019 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * A container for relation events that supports easy access to common ways of\r\n * aggregating such events. Each instance holds events that of a single relation\r\n * type and event type. All of the events also relate to the same original event.\r\n *\r\n * The typical way to get one of these containers is via\r\n * EventTimelineSet#getRelationsForEvent.\r\n */\r\nclass Relations extends _events.EventEmitter {\r\n /**\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\",\r\n * \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @param {?Room} room\r\n * Room for this container. May be null for non-room cases, such as the\r\n * notification timeline.\r\n */\r\n constructor(relationType, eventType, room) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"_onEventStatus\", (event, status) => {\r\n if (!event.isSending()) {\r\n // Sending is done, so we don't need to listen anymore\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n return;\r\n }\r\n\r\n if (status !== _event.EventStatus.CANCELLED) {\r\n return;\r\n } // Event was cancelled, remove from the collection\r\n\r\n\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n\r\n this._removeEvent(event);\r\n });\r\n (0, _defineProperty2.default)(this, \"_onBeforeRedaction\", redactedEvent => {\r\n if (!this._relations.has(redactedEvent)) {\r\n return;\r\n }\r\n\r\n this._relations.delete(redactedEvent);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n // Remove the redacted annotation from aggregation by key\r\n this._removeAnnotationFromAggregation(redactedEvent);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n redactedEvent.removeListener(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.redaction\", redactedEvent);\r\n });\r\n this.relationType = relationType;\r\n this.eventType = eventType;\r\n this._relations = new Set();\r\n this._annotationsByKey = {};\r\n this._annotationsBySender = {};\r\n this._sortedAnnotationsByKey = [];\r\n this._targetEvent = null;\r\n }\r\n /**\r\n * Add relation events to this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be added.\r\n */\r\n\r\n\r\n addEvent(event) {\r\n if (this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n } // If the event is in the process of being sent, listen for cancellation\r\n // so we can remove the event from the collection.\r\n\r\n\r\n if (event.isSending()) {\r\n event.on(\"Event.status\", this._onEventStatus);\r\n }\r\n\r\n this._relations.add(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._addAnnotationToAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n event.on(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.add\", event);\r\n }\r\n /**\r\n * Remove relation event from this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The relation event to remove.\r\n */\r\n\r\n\r\n _removeEvent(event) {\r\n if (!this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n }\r\n\r\n this._relations.delete(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._removeAnnotationFromAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n this.emit(\"Relations.remove\", event);\r\n }\r\n /**\r\n * Listens for event status changes to remove cancelled events.\r\n *\r\n * @param {MatrixEvent} event The event whose status has changed\r\n * @param {EventStatus} status The new status\r\n */\r\n\r\n\r\n /**\r\n * Get all relation events in this collection.\r\n *\r\n * These are currently in the order of insertion to this collection, which\r\n * won't match timeline order in the case of scrollback.\r\n * TODO: Tweak `addEvent` to insert correctly for scrollback.\r\n *\r\n * @return {Array}\r\n * Relation events in insertion order.\r\n */\r\n getRelations() {\r\n return [...this._relations];\r\n }\r\n\r\n _addAnnotationToAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n let eventsForKey = this._annotationsByKey[key];\r\n\r\n if (!eventsForKey) {\r\n eventsForKey = this._annotationsByKey[key] = new Set();\r\n\r\n this._sortedAnnotationsByKey.push([key, eventsForKey]);\r\n } // Add the new event to the set for this key\r\n\r\n\r\n eventsForKey.add(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n\r\n const sender = event.getSender();\r\n let eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (!eventsFromSender) {\r\n eventsFromSender = this._annotationsBySender[sender] = new Set();\r\n } // Add the new event to the set for this sender\r\n\r\n\r\n eventsFromSender.add(event);\r\n }\r\n\r\n _removeAnnotationFromAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n const eventsForKey = this._annotationsByKey[key];\r\n\r\n if (eventsForKey) {\r\n eventsForKey.delete(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n }\r\n\r\n const sender = event.getSender();\r\n const eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (eventsFromSender) {\r\n eventsFromSender.delete(event);\r\n }\r\n }\r\n /**\r\n * For relations that have been redacted, we want to remove them from\r\n * aggregation data sets and emit an update event.\r\n *\r\n * To do so, we listen for `Event.beforeRedaction`, which happens:\r\n * - after the server accepted the redaction and remote echoed back to us\r\n * - before the original event has been marked redacted in the client\r\n *\r\n * @param {MatrixEvent} redactedEvent\r\n * The original relation event that is about to be redacted.\r\n */\r\n\r\n\r\n /**\r\n * Get all events in this collection grouped by key and sorted by descending\r\n * event count in each group.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Array}\r\n * An array of [key, events] pairs sorted by descending event count.\r\n * The events are stored in a Set (which preserves insertion order).\r\n */\r\n getSortedAnnotationsByKey() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._sortedAnnotationsByKey;\r\n }\r\n /**\r\n * Get all events in this collection grouped by sender.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Object}\r\n * An object with each relation sender as a key and the matching Set of\r\n * events for that sender as a value.\r\n */\r\n\r\n\r\n getAnnotationsBySender() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._annotationsBySender;\r\n }\r\n /**\r\n * Returns the most recent (and allowed) m.replace relation, if any.\r\n *\r\n * This is currently only supported for the m.replace relation type,\r\n * once the target event is known, see `addEvent`.\r\n *\r\n * @return {MatrixEvent?}\r\n */\r\n\r\n\r\n getLastReplacement() {\r\n if (this.relationType !== \"m.replace\") {\r\n // Aggregating on last only makes sense for this relation type\r\n return null;\r\n }\r\n\r\n if (!this._targetEvent) {\r\n // Don't know which replacements to accept yet.\r\n // This method shouldn't be called before the original\r\n // event is known anyway.\r\n return null;\r\n } // the all-knowning server tells us that the event at some point had\r\n // this timestamp for its replacement, so any following replacement should definitely not be less\r\n\r\n\r\n const replaceRelation = this._targetEvent.getServerAggregatedRelation(\"m.replace\");\r\n\r\n const minTs = replaceRelation && replaceRelation.origin_server_ts;\r\n return this.getRelations().reduce((last, event) => {\r\n if (event.getSender() !== this._targetEvent.getSender()) {\r\n return last;\r\n }\r\n\r\n if (minTs && minTs > event.getTs()) {\r\n return last;\r\n }\r\n\r\n if (last && last.getTs() > event.getTs()) {\r\n return last;\r\n }\r\n\r\n return event;\r\n }, null);\r\n }\r\n /*\r\n * @param {MatrixEvent} targetEvent the event the relations are related to.\r\n */\r\n\r\n\r\n setTargetEvent(event) {\r\n if (this._targetEvent) {\r\n return;\r\n }\r\n\r\n this._targetEvent = event;\r\n\r\n if (this.relationType === \"m.replace\") {\r\n const replacement = this.getLastReplacement(); // this is the initial update, so only call it if we already have something\r\n // to not emit Event.replaced needlessly\r\n\r\n if (replacement) {\r\n this._targetEvent.makeReplaced(replacement);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.Relations = Relations;","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\"","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/* (ignored) */","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=951b8314&scoped=true&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".nameofchat[data-v-72a9c575]{white-space:nowrap}.nameline[data-v-72a9c575]{display:flex;align-items:flex-end;justify-content:center}.iconGroup[data-v-72a9c575]{font-size:.4em;width:16px;text-align:center;height:16px;line-height:16px;border-radius:8px;background:rgb(var(--neutral-grad-2));margin-right:.5em;margin-block:.25em}.iconGroup i[data-v-72a9c575]{color:rgb(var(--neutral-grad-1))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./VuePageTransition.vue?vue&type=template&id=108c57b8&scoped=true&\"\nimport script from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nexport * from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./VuePageTransition.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./VuePageTransition.vue?vue&type=style&index=1&id=108c57b8&lang=scss&scoped=true&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"108c57b8\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root{--overlay-bg:#1867c0;--transition-duration:.35s}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"\", \"\"]);\n// Exports\nmodule.exports = exports;\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=06594ccd&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * AES-CTR using a WebCrypto (or similar) API\n */\nclass WebCryptoAesCtr {\n constructor(key, crypto) {\n this.key = key;\n this.crypto = crypto;\n }\n static importKey(crypto, keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n // Only AES-128 and AES-256 supported. AES-192 is not.\n if (keyData.length !== 16 && keyData.length !== 32) {\n throw new Error(`Miscreant: invalid key length: ${keyData.length} (expected 16 or 32 bytes)`);\n }\n const key = yield crypto.subtle.importKey(\"raw\", keyData, \"AES-CTR\", false, [\"encrypt\"]);\n return new WebCryptoAesCtr(key, crypto);\n });\n }\n encryptCtr(iv, plaintext) {\n return __awaiter(this, void 0, void 0, function* () {\n const ciphertext = yield this.crypto.subtle.encrypt({ name: \"AES-CTR\", counter: iv, length: 16 }, this.key, plaintext);\n return new Uint8Array(ciphertext);\n });\n }\n clear() {\n // TODO: actually clear something. Do we need to?\n return this;\n }\n}\nexports.default = WebCryptoAesCtr;\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryCryptoStore = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\r\n\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\r\n\r\n/**\r\n * Internal module. in-memory storage for e2e.\r\n *\r\n * @module\r\n */\r\n\r\n/**\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\nclass MemoryCryptoStore {\r\n constructor() {\r\n this._outgoingRoomKeyRequests = [];\r\n this._account = null;\r\n this._crossSigningKeys = null;\r\n this._privateKeys = {};\r\n this._backupKeys = {}; // Map of {devicekey -> {sessionId -> session pickle}}\r\n\r\n this._sessions = {}; // Map of {devicekey -> array of problems}\r\n\r\n this._sessionProblems = {}; // Map of {userId -> deviceId -> true}\r\n\r\n this._notifiedErrorDevices = {}; // Map of {senderCurve25519Key+'/'+sessionId -> session data object}\r\n\r\n this._inboundGroupSessions = {};\r\n this._inboundGroupSessionsWithheld = {}; // Opaque device data object\r\n\r\n this._deviceData = null; // roomId -> Opaque roomInfo object\r\n\r\n this._rooms = {}; // Set of {senderCurve25519Key+'/'+sessionId}\r\n\r\n this._sessionsNeedingBackup = {}; // roomId -> array of [senderKey, sessionId]\r\n\r\n this._sharedHistoryInboundGroupSessions = {};\r\n }\r\n /**\r\n * Ensure the database exists and is up-to-date.\r\n *\r\n * This must be called before the store can be used.\r\n *\r\n * @return {Promise} resolves to the store.\r\n */\r\n\r\n\r\n async startup() {\r\n // No startup work to do for the memory store.\r\n return this;\r\n }\r\n /**\r\n * Delete all data from this store.\r\n *\r\n * @returns {Promise} Promise which resolves when the store has been cleared.\r\n */\r\n\r\n\r\n deleteAllData() {\r\n return Promise.resolve();\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return utils.promiseTry(() => {\r\n // first see if we already have an entry for this request.\r\n const existing = this._getOutgoingRoomKeyRequest(requestBody);\r\n\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n return existing;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n this._outgoingRoomKeyRequests.push(request);\r\n\r\n return request;\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return Promise.resolve(this._getOutgoingRoomKeyRequest(requestBody));\r\n }\r\n /**\r\n * Looks for existing room key request, and returns the result synchronously.\r\n *\r\n * @internal\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {module:crypto/store/base~OutgoingRoomKeyRequest?}\r\n * the matching request, or null if not found\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(requestBody) {\r\n for (const existing of this._outgoingRoomKeyRequests) {\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n return existing;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state) {\r\n return Promise.resolve(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All OutgoingRoomKeyRequests in state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return Promise.resolve(this._outgoingRoomKeyRequests.filter(r => r.state == wantedState));\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n const results = [];\r\n\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state && req.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${req.state}`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n Object.assign(req, updates);\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n for (let i = 0; i < this._outgoingRoomKeyRequests.length; i++) {\r\n const req = this._outgoingRoomKeyRequests[i];\r\n\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${req.state} ` + `(expected ${expectedState})`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n this._outgoingRoomKeyRequests.splice(i, 1);\r\n\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n func(this._account);\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n this._account = newData;\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n func(this._crossSigningKeys);\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const result = this._privateKeys[type];\r\n return func(result || null);\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n this._crossSigningKeys = keys;\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n this._privateKeys[type] = key;\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n return Object.keys(this._sessions).length;\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const deviceSessions = this._sessions[deviceKey] || {};\r\n func(deviceSessions[sessionId] || null);\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n func(this._sessions[deviceKey] || {});\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n Object.entries(this._sessions).forEach(([deviceKey, deviceSessions]) => {\r\n Object.entries(deviceSessions).forEach(([sessionId, session]) => {\r\n func(_objectSpread(_objectSpread({}, session), {}, {\r\n deviceKey,\r\n sessionId\r\n }));\r\n });\r\n });\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n let deviceSessions = this._sessions[deviceKey];\r\n\r\n if (deviceSessions === undefined) {\r\n deviceSessions = {};\r\n this._sessions[deviceKey] = deviceSessions;\r\n }\r\n\r\n deviceSessions[sessionId] = sessionInfo;\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const problems = this._sessionProblems[deviceKey] = this._sessionProblems[deviceKey] || [];\r\n problems.push({\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n const problems = this._sessionProblems[deviceKey] || [];\r\n\r\n if (!problems.length) {\r\n return null;\r\n }\r\n\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n return Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n return null;\r\n } else {\r\n return lastProblem;\r\n }\r\n }\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const notifiedErrorDevices = this._notifiedErrorDevices;\r\n const ret = [];\r\n\r\n for (const device of devices) {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n\r\n if (userId in notifiedErrorDevices) {\r\n if (!(deviceInfo.deviceId in notifiedErrorDevices[userId])) {\r\n ret.push(device);\r\n notifiedErrorDevices[userId][deviceInfo.deviceId] = true;\r\n }\r\n } else {\r\n ret.push(device);\r\n notifiedErrorDevices[userId] = {\r\n [deviceInfo.deviceId]: true\r\n };\r\n }\r\n }\r\n\r\n return ret;\r\n } // Inbound Group Sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n func(this._inboundGroupSessions[k] || null, this._inboundGroupSessionsWithheld[k] || null);\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n for (const key of Object.keys(this._inboundGroupSessions)) {\r\n // we can't use split, as the components we are trying to split out\r\n // might themselves contain '/' characters. We rely on the\r\n // senderKey being a (32-byte) curve25519 key, base64-encoded\r\n // (hence 43 characters long).\r\n func({\r\n senderKey: key.substr(0, 43),\r\n sessionId: key.substr(44),\r\n sessionData: this._inboundGroupSessions[key]\r\n });\r\n }\r\n\r\n func(null);\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n\r\n if (this._inboundGroupSessions[k] === undefined) {\r\n this._inboundGroupSessions[k] = sessionData;\r\n }\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n this._inboundGroupSessions[senderCurve25519Key + '/' + sessionId] = sessionData;\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n this._inboundGroupSessionsWithheld[k] = sessionData;\r\n } // Device Data\r\n\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n func(this._deviceData);\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n this._deviceData = deviceData;\r\n } // E2E rooms\r\n\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n this._rooms[roomId] = roomInfo;\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n func(this._rooms);\r\n }\r\n\r\n getSessionsNeedingBackup(limit) {\r\n const sessions = [];\r\n\r\n for (const session in this._sessionsNeedingBackup) {\r\n if (this._inboundGroupSessions[session]) {\r\n sessions.push({\r\n senderKey: session.substr(0, 43),\r\n sessionId: session.substr(44),\r\n sessionData: this._inboundGroupSessions[session]\r\n });\r\n\r\n if (limit && session.length >= limit) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(sessions);\r\n }\r\n\r\n countSessionsNeedingBackup() {\r\n return Promise.resolve(Object.keys(this._sessionsNeedingBackup).length);\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n delete this._sessionsNeedingBackup[sessionKey];\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n markSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n this._sessionsNeedingBackup[sessionKey] = true;\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId) {\r\n const sessions = this._sharedHistoryInboundGroupSessions[roomId] || [];\r\n sessions.push([senderKey, sessionId]);\r\n this._sharedHistoryInboundGroupSessions[roomId] = sessions;\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId) {\r\n return Promise.resolve(this._sharedHistoryInboundGroupSessions[roomId] || []);\r\n } // Session key backups\r\n\r\n\r\n doTxn(mode, stores, func) {\r\n return Promise.resolve(func(null));\r\n }\r\n\r\n}\r\n\r\nexports.MemoryCryptoStore = MemoryCryptoStore;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.FilterComponent = FilterComponent;\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module filter-component\r\n */\r\n\r\n/**\r\n * Checks if a value matches a given field value, which may be a * terminated\r\n * wildcard pattern.\r\n * @param {String} actual_value The value to be compared\r\n * @param {String} filter_value The filter pattern to be compared\r\n * @return {bool} true if the actual_value matches the filter_value\r\n */\r\nfunction _matches_wildcard(actual_value, filter_value) {\r\n if (filter_value.endsWith(\"*\")) {\r\n const type_prefix = filter_value.slice(0, -1);\r\n return actual_value.substr(0, type_prefix.length) === type_prefix;\r\n } else {\r\n return actual_value === filter_value;\r\n }\r\n}\r\n/**\r\n * FilterComponent is a section of a Filter definition which defines the\r\n * types, rooms, senders filters etc to be applied to a particular type of resource.\r\n * This is all ported over from synapse's Filter object.\r\n *\r\n * N.B. that synapse refers to these as 'Filters', and what js-sdk refers to as\r\n * 'Filters' are referred to as 'FilterCollections'.\r\n *\r\n * @constructor\r\n * @param {Object} filter_json the definition of this filter JSON, e.g. { 'contains_url': true }\r\n */\r\n\r\n\r\nfunction FilterComponent(filter_json) {\r\n this.filter_json = filter_json;\r\n this.types = filter_json.types || null;\r\n this.not_types = filter_json.not_types || [];\r\n this.rooms = filter_json.rooms || null;\r\n this.not_rooms = filter_json.not_rooms || [];\r\n this.senders = filter_json.senders || null;\r\n this.not_senders = filter_json.not_senders || [];\r\n this.contains_url = filter_json.contains_url || null;\r\n}\r\n/**\r\n * Checks with the filter component matches the given event\r\n * @param {MatrixEvent} event event to be checked against the filter\r\n * @return {bool} true if the event matches the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype.check = function (event) {\r\n return this._checkFields(event.getRoomId(), event.getSender(), event.getType(), event.getContent() ? event.getContent().url !== undefined : false);\r\n};\r\n/**\r\n * Checks whether the filter component matches the given event fields.\r\n * @param {String} room_id the room_id for the event being checked\r\n * @param {String} sender the sender of the event being checked\r\n * @param {String} event_type the type of the event being checked\r\n * @param {String} contains_url whether the event contains a content.url field\r\n * @return {bool} true if the event fields match the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype._checkFields = function (room_id, sender, event_type, contains_url) {\r\n const literal_keys = {\r\n \"rooms\": function (v) {\r\n return room_id === v;\r\n },\r\n \"senders\": function (v) {\r\n return sender === v;\r\n },\r\n \"types\": function (v) {\r\n return _matches_wildcard(event_type, v);\r\n }\r\n };\r\n const self = this;\r\n\r\n for (let n = 0; n < Object.keys(literal_keys).length; n++) {\r\n const name = Object.keys(literal_keys)[n];\r\n const match_func = literal_keys[name];\r\n const not_name = \"not_\" + name;\r\n const disallowed_values = self[not_name];\r\n\r\n if (disallowed_values.filter(match_func).length > 0) {\r\n return false;\r\n }\r\n\r\n const allowed_values = self[name];\r\n\r\n if (allowed_values && allowed_values.length > 0) {\r\n const anyMatch = allowed_values.some(match_func);\r\n\r\n if (!anyMatch) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n const contains_url_filter = this.filter_json.contains_url;\r\n\r\n if (contains_url_filter !== undefined) {\r\n if (contains_url_filter !== contains_url) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n/**\r\n * Filters a list of events down to those which match this filter component\r\n * @param {MatrixEvent[]} events Events to be checked againt the filter component\r\n * @return {MatrixEvent[]} events which matched the filter component\r\n */\r\n\r\n\r\nFilterComponent.prototype.filter = function (events) {\r\n return events.filter(this.check, this);\r\n};\r\n/**\r\n * Returns the limit field for a given filter component, providing a default of\r\n * 10 if none is otherwise specified. Cargo-culted from Synapse.\r\n * @return {Number} the limit for this filter component.\r\n */\r\n\r\n\r\nFilterComponent.prototype.limit = function () {\r\n return this.filter_json.limit !== undefined ? this.filter_json.limit : 10;\r\n};","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","import f from \"../functions.js\";\r\nclass User {\r\n constructor(core, p){\r\n if(!p) p = {}\r\n\r\n this.core = core\r\n this.state = 0\r\n this.keysupdatetimeout = null\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n \r\n }\r\n\r\n destroy (){\r\n if(this.keysupdatetimeout){\r\n clearTimeout(this.keysupdatetimeout)\r\n }\r\n\r\n this.keysupdatetimeout = null\r\n this.state = 0\r\n\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n\r\n }\r\n\r\n setCredentials (credentials){\r\n if (credentials)\r\n this.credentials = credentials\r\n }\r\n\r\n setUsersInfo (usersinfo, reload){\r\n _.each(usersinfo || [], v => {\r\n\r\n this.core.store.commit('SET_USERINFO', {\r\n info : v,\r\n reload : reload\r\n })\r\n })\r\n }\r\n\r\n setContacts (usersinfo){\r\n \r\n //this.core.store.commit('SET_CONTACTS', usersinfo)\r\n \r\n }\r\n\r\n myMatrixId(){\r\n return this.matrixId(this.userinfo.id)\r\n }\r\n\r\n matrixId(id, domain){\r\n \r\n id || (id = '')\r\n\r\n if(id.indexOf(\"@\") == 0) return id\r\n\r\n return '@' + id + ':' + (domain || this.core.domain)\r\n }\r\n\r\n fromMatrixId(matrixid){\r\n return f.getmatrixid(matrixid)\r\n }\r\n}\r\n\r\nexport default User","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","/* (ignored) */","var EXIF = require('exif-js');\r\n\r\nimport f from '@/application/functions'\r\n\r\nvar Images = function(){\r\n var self = this;\r\n\r\n self.orientation = function(image, exif){\r\n\r\n return new Promise((resolve, reject) => {\r\n if(!exif.orientation){\r\n return resolve(image)\r\n }\r\n\r\n var img = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d');\r\n \r\n img.src = srcData;\r\n\r\n img.onload = function(){\r\n\r\n var width = img.width,\r\n height = img.height;\r\n \r\n // set proper canvas dimensions before transform & export\r\n if ($.inArray(exif.orientation, [5, 6, 7, 8]) > -1) {\r\n canvas.width = height;\r\n canvas.height = width;\r\n } else {\r\n canvas.width = width;\r\n canvas.height = height;\r\n }\r\n \r\n // transform context before drawing image\r\n switch (exif.orientation) {\r\n case 1:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 2:\r\n // flip horizontal\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 3:\r\n // rotate 180\r\n ctx.translate(width, height);\r\n ctx.rotate(Math.PI);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 4:\r\n // flip vertical\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 5:\r\n // flip vertical, rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 6:\r\n // rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(0, -height);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 7:\r\n // flip horizontal, rotate 90 counter clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(width, -height);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 8:\r\n // rotate 90 counter clockwise\r\n ctx.rotate(-Math.PI / 2);\r\n ctx.translate(-width, 0);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n default:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n return;\r\n }\r\n \r\n // Draw img into canvas\r\n // ctx.drawImage(img, 0, 0, width, height);\r\n\r\n var url = canvas.toDataURL(\"image/jpeg\", 0.95);\r\n\r\n $(canvas).remove();\r\n\r\n resolve(url)\r\n\r\n }\r\n })\r\n }\r\n\r\n self.autorotation = function(file, base64){\r\n return new Promise((resolve, reject) => {\r\n\r\n if (file && !f.isios()) {\r\n EXIF.getData(file, function() {\r\n \r\n var exif = EXIF.getAllTags(this)\r\n \r\n self.orientation(base64, exif).then(res => {\r\n return resolve(res)\r\n })\r\n \r\n })\r\n } else {\r\n return resolve(base64)\r\n }\r\n }) \r\n\r\n }\r\n\r\n self.srcToData = function(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function() {\r\n var reader = new FileReader();\r\n reader.onloadend = function() {\r\n callback(reader.result);\r\n }\r\n reader.readAsDataURL(xhr.response);\r\n };\r\n \r\n xhr.onerror = function(){}\r\n \r\n xhr.open('GET', url);\r\n xhr.responseType = 'blob';\r\n xhr.send();\r\n }\r\n\r\n self.resize = {\r\n fit : function(srcData, width, height, format, quality) {\r\n\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\";\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n\r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n var c = Math.max(((newHeight - height) / newHeight), ((newWidth - width) / newWidth))\r\n \r\n if(c > 0){\r\n newHeight = newHeight * (c + 1)\r\n newWidth = newWidth * (c + 1)\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n\r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n }) \r\n \r\n },\r\n\r\n def : function(srcData, width, height, format, quality) {\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\"\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n \r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n \r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n \r\n })\r\n \r\n \r\n }\r\n }\r\n \r\n \r\n self.grayscaleImage = function (srcData, clbk){\r\n\r\n var image = new Image();\r\n\r\n image.src = srcData;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n image.onload = function(){\r\n\r\n var myCanvas = document.createElement(\"canvas\");\r\n var myCanvasContext = myCanvas.getContext(\"2d\");\r\n\r\n var imgWidth = image.width;\r\n var imgHeight = image.height;\r\n \r\n myCanvas.width = imgWidth;\r\n myCanvas.height = imgHeight;\r\n\r\n myCanvasContext.drawImage(image, 0, 0);\r\n\r\n var imageData = myCanvasContext.getImageData(0,0, imgWidth, imgHeight);\r\n\r\n var j = 0, i = 0;\r\n\r\n for (i = 0; i < imageData.height; i++)\r\n {\r\n for (j = 0; j < imageData.width; j++)\r\n {\r\n var index=(i*4)*imageData.width+(j*4);\r\n var red=imageData.data[index];\r\n var green=imageData.data[index+1];\r\n var blue=imageData.data[index+2];\r\n var alpha=imageData.data[index+3];\r\n var average = (3 * red + green + blue)/3;\r\n\r\n imageData.data[index] = average;\r\n imageData.data[index+1]= average;\r\n imageData.data[index+2]= average;\r\n imageData.data[index+3]= alpha;\r\n }\r\n }\r\n\r\n myCanvasContext.putImageData(imageData, 0, 0, 0, 0, imageData.width, imageData.height);\r\n \r\n resolve(myCanvas.toDataURL());\r\n\r\n }\r\n\r\n })\r\n }\r\n\r\n self.wh = function(base64){\r\n const img = new Image();\r\n var imgInfo = {};\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n img.onload = function () {\r\n imgInfo.w = this.width\r\n imgInfo.h = this.height\r\n resolve(imgInfo)\r\n }\r\n\r\n img.onerror = function (e) {\r\n reject(e)\r\n }\r\n\r\n img.src = base64\r\n //this.info = imgInfo\r\n\r\n })\r\n \r\n }\r\n\r\n return self;\r\n}\r\n\r\nexport default Images","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","module.exports = require('./readable').PassThrough\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=16157ecb&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=16157ecb&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"16157ecb\",\n null\n ,true\n)\n\nexport default component.exports","import Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport f from '@/application/functions.js'\r\n\r\n\r\nVue.use(Vuex);\r\n\r\nvar themes = {\r\n\twhite: \"White\",\r\n\tblack: \"Dark\",\r\n\tclassic: \"Classic\"\r\n}\r\n\r\nvar mex = {\r\n\ttheme: function (state, value) {\r\n\r\n\t\tif (themes[value]) {\r\n\t\t\tstate.theme = value\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar activetimeout = null\r\n\r\nvar store = new Vuex.Store({\r\n\tstate: {\r\n\t\tcontacts: {},\r\n\t\tcontactsFromMatrix: {},\r\n\t\tcontactsMap: {},\r\n\t\tchats: [],\r\n\t\tprechats: [],\r\n\t\tchatsMap: {},\r\n\t\tevents: {},\r\n\t\tusers: {},\r\n\t\ttyping: {},\r\n\t\ticon: null,\r\n\t\tloading: false,\r\n\t\tonline: true,\r\n\t\tunauthorized: false,\r\n\t\ttheme: 'white',\r\n\t\tthemes: themes,\r\n\t\tsignedUpUsers: [],\r\n\t\tpocketnet: '',\r\n\t\tmobile: '',\r\n\t\tvoiceMessagesEnabled: '',\r\n\t\tcurrentPlayingVoiceMessage: null,\r\n\t\tcurrent_user: {},\r\n\t\tminimized: true,\r\n\t\tactive: false,\r\n\t\tactiveBlock: {},\r\n\t\tglobalpreloader: false,\r\n\t\tallnotifications: 0,\r\n\t\tpocketteammessages: [],\r\n\t\treadedteammessages: {},\r\n\t\tchatsready: false,\r\n\t\tautohide: false,\r\n\t\titeraction: false,\r\n\t\troomMembes: [],\r\n\t\tgallery: null,\r\n\t\tshare: null,\r\n\t\tcontact: null,\r\n\t\tconnect: null,\r\n\t\tjoinroom: null,\r\n\t\tchatusers: {},\r\n\t\tforce: {},\r\n\t\twasunhidden: false,\r\n\t\thiddenInParent: false,\r\n\t\thideOptimization: false,\r\n\t\tmodalShowed: null,\r\n\t\tmenu: null,\r\n\t\tpinchat: false,\r\n\t\tlastroom: null,\r\n\t\tdontreadreceipts: false,\r\n\t\tvoicerecording : false,\r\n\t\tdeletedrooms: {},\r\n\t\tpkoindisabled : false\r\n\t\t//share : {url : 'https://yandex.ru/'} //null\r\n\t},\r\n\tgetters: {\r\n\t\tgetUser: state => {\r\n\t\t\treturn state.user\r\n\t\t},\r\n\t\tgetConnection: state => {\r\n\t\t\treturn state.localMatrixStore\r\n\t\t},\r\n\r\n\t\tgetSignedUpUsers: state => {\r\n\t\t\treturn state.signedUpUsers\r\n\t\t},\r\n\t},\r\n\tmutations: {\r\n\t\tSET_CURRENT_PLAYING_VOICE_MESSAGE(state, message) {\r\n\t\t\tstate.currentPlayingVoiceMessage = message\r\n\t\t},\r\n\t\tsetUser(state, userData) {\r\n\t\t\tstate.current_user = userData || {}\r\n\t\t},\r\n\r\n\t\tclearall(state) {\r\n\r\n\t\t\tstate.contacts = {}\r\n\t\t\tstate.contactsFromMatrix = {}\r\n\t\t\tstate.contactsMap = {}\r\n\t\t\tstate.chats = []\r\n\t\t\tstate.prechats = []\r\n\t\t\tstate.chatsMap = {}\r\n\t\t\tstate.events = {}\r\n\t\t\tstate.users = {}\r\n\t\t\tstate.typing = {}\r\n\t\t\tstate.icon = null\r\n\t\t\tstate.loading = false\r\n\t\t\tstate.online = true\r\n\t\t\tstate.unauthorized = false\r\n\t\t\tstate.signedUpUsers = []\r\n\t\t\t/*state.pocketnet = ''*/\r\n\t\t\tstate.current_user = {}\r\n\t\t\tstate.minimized = false\r\n\t\t\tstate.active = false\r\n\t\t\tstate.activeBlock = {}\r\n\t\t\tstate.globalpreloader = false\r\n\t\t\tstate.allnotifications = 0\r\n\t\t\tstate.pocketteammessages = []\r\n\t\t\tstate.readedteammessages = {}\r\n\t\t\tstate.chatsready = false\r\n\t\t\tstate.autohide = false\r\n\t\t\tstate.gallery = null\r\n\t\t\tstate.modalShowed = null\r\n\t\t\tstate.menu = null\r\n\t\t\tstate.pinchat = false\r\n\t\t\tstate.dontreadreceipts = false\r\n\t\t\tstate.lastroom = null\r\n\t\t\tstate.voicerecording = false\r\n\r\n\t\t\t// state.share = null\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t} else state.minimized = true\r\n\r\n\t\t\tif (activetimeout) {\r\n\t\t\t\tclearTimeout(activetimeout)\r\n\t\t\t\tactivetimeout = null\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tblockactive(state, a) {\r\n\t\t\tif (a.value)\r\n\t\t\t\tVue.set(state.activeBlock, a.item, a.value)\r\n\t\t\telse\r\n\t\t\t\tVue.delete(state.activeBlock, a.item, a.value)\r\n\r\n\t\t},\r\n\r\n\t\tglobalpreloader: function (state, value) {\r\n\t\t\tstate.globalpreloader = value\r\n\t\t},\r\n\r\n\t\ticon(state, value) {\r\n\r\n\t\t\tstate.icon = value\r\n\r\n\t\t\tvar mv = f.deep(window, 'window.POCKETNETINSTANCE.mobile.vibration')\r\n\r\n\t\t\tif (mv) {\r\n\t\t\t\tmv.small()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tpkoindisabled(state, value){\r\n\t\t\tstate.pkoindisabled = value && value == 'true' ? true : false\r\n\t\t},\r\n\r\n\t\twasunhidden(state, value) {\r\n\t\t\tstate.wasunhidden = true\r\n\t\t},\r\n\r\n\t\thiddenInParent(state, value) {\r\n\t\t\tstate.hiddenInParent = value\r\n\t\t},\r\n\r\n\t\thideOptimization(state, value) {\r\n\t\t\tstate.hideOptimization = value\r\n\t\t},\r\n\r\n\t\tpinchat(state, value) {\r\n\t\t\tstate.pinchat = value\r\n\t\t\tlocalStorage['pinchat'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tdontreadreceipts(state, value) {\r\n\t\t\tstate.dontreadreceipts = value\r\n\r\n\t\t\tlocalStorage['dontreadreceipts'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tSET_LAST_ROOM(state, value) {\r\n\r\n\t\t\tif (!value) state.lastroom = null\r\n\r\n\t\t\telse\r\n\t\t\t\tstate.lastroom = {\r\n\t\t\t\t\tid: value,\r\n\t\t\t\t\ttime: new Date()\r\n\t\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tactive(state, value) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tvar time = 50;\r\n\r\n\t\t\tif (!value) time = 1000\r\n\r\n\t\t\tactivetimeout = f.slowMade(() => {\r\n\r\n\t\t\t\tif (!value) {\r\n\t\t\t\t\tif (!_.isEmpty(state.activeBlock)) {\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstate.iteraction = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstate.active = value\r\n\r\n\t\t\t\tif (!state.active) {\r\n\t\t\t\t\tstate.share = null\r\n\t\t\t\t\tdelete state.activeBlock.share\r\n\t\t\t\t}\r\n\r\n\t\t\t}, activetimeout, time)\r\n\t\t},\r\n\r\n\t\tsetiteraction(state, value) {\r\n\t\t\tstate.iteraction = value\r\n\t\t},\r\n\r\n\t\tmaximize(state, route) {\r\n\t\t\tstate.minimized = false\r\n\t\t},\r\n\r\n\t\tminimize(state, v) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif (state.minimized) {\r\n\t\t\t\tstate.activeBlock = {}\r\n\t\t\t\tstate.active = false\r\n\t\t\t}\r\n\r\n\t\t\tstate.minimized = true\r\n\t\t},\r\n\r\n\t\tsetmodal(state, v) {\r\n\t\t\tstate.modalShowed = v;\r\n\t\t},\r\n\r\n\t\tsetPocketnet(state, pocketnet) {\r\n\t\t\tstate.pocketnet = pocketnet;\r\n\t\t},\r\n\t\tsetMobile(state, mobile) {\r\n\t\t\tstate.mobile = mobile;\r\n\t\t},\r\n\r\n\t\tsetVoiceMessagesEnabled(state, voiceMessagesEnabled) {\r\n\t\t\tstate.voiceMessagesEnabled = voiceMessagesEnabled;\r\n\t\t},\r\n\r\n\t\tls(state) {\r\n\t\t\tif (typeof localStorage.getItem('pinchat') != 'undefined')\r\n\t\t\t\tstate.pinchat = localStorage.getItem('pinchat') ? true : false\r\n\r\n\t\t\tif (typeof localStorage.getItem('dontreadreceipts') != 'undefined')\r\n\t\t\t\tstate.dontreadreceipts = localStorage.getItem('dontreadreceipts') ? true : false\r\n\t\t},\r\n\r\n\t\tinit(state) {\r\n\t\t\tmex.theme(state, localStorage.getItem('theme') || 'white')\r\n\r\n\r\n\r\n\t\t},\r\n\r\n\t\tALL_NOTIFICATIONS_COUNT(state, rooms) {\r\n\r\n\t\t\tvar n = new Date()\r\n\r\n\t\t\tvar count = _.filter(rooms, room => {\r\n\r\n\t\t\t\tif (room._selfMembership === 'invite') {\r\n\t\t\t\t\tvar users = store._vm.core.mtrx.anotherChatUsers(room)\r\n\r\n\t\t\t\t\tif (users.length == 1 && store._vm.core.mtrx.blockeduser(users[0].userId)) {\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (f.date.addseconds(new Date(room.summary.lastModified), 86400) > n) return true\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tstate.allnotifications = _.reduce(rooms, (s, chat) => {\r\n\r\n\t\t\t\treturn s + (chat.getUnreadNotificationCount() || 0)\r\n\r\n\t\t\t}, 0) + count.length\r\n\r\n\r\n\t\t\tif (state.chats.length <= 3) {\r\n\t\t\t\t// Count notifications from pocketnet team room\r\n\t\t\t\tvar pocketMessages = _.filter(state.pocketteammessages, function (m) {\r\n\t\t\t\t\treturn !state.readedteammessages[m.id];\r\n\t\t\t\t}).length;\r\n\t\t\t\tstate.allnotifications += pocketMessages\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar external = f.deep(store, '_vm.core.external.clbks.ALL_NOTIFICATIONS_COUNT') || {}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(state.allnotifications)\r\n\t\t\t})\r\n\r\n\t\t\treturn state.allnotifications\r\n\t\t},\r\n\r\n\t\tSET_CHATS_READY(state, v) {\r\n\t\t\tstate.chatsready = v\r\n\t\t},\r\n\r\n\t\tSET_PRECHATS_TO_STORE(state, chats) {\r\n\t\t\tstate.prechats = chats;\r\n\t\t},\r\n\r\n\t\tSET_CHAT_TO_FORCE(state, id) {\r\n\r\n\r\n\t\t\tVue.set(state.force, id, true)\r\n\r\n\t\t},\r\n\r\n\t\tSET_CHATS_TO_STORE(state, chats) {\r\n\r\n\t\t\tstate.chats = chats;\r\n\r\n\t\t\tvar chatsMap = {}\r\n\r\n\t\t\t_.each(chats, (chat) => {\r\n\r\n\t\t\t\tvar aid = chat.info.title.replace(\"#\", '')\r\n\r\n\t\t\t\tif (!state.chatsMap[chat.roomId] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, chat.roomId, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!state.chatsMap[aid] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, aid, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchatsMap[chat.roomId] = chat\r\n\t\t\t\tchatsMap[chat.info.title.replace(\"#\", '')] = chat\r\n\r\n\t\t\t\tVue.delete(state.force, chat.roomId)\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.chatsMap, function (c, id) {\r\n\t\t\t\tif (!chatsMap[id]) Vue.delete(state.chatsMap, id)\r\n\t\t\t})\r\n\r\n\t\t\t//state.chatsMap = chatsMap;\r\n\r\n\t\t},\r\n\t\tSET_EVENTS_TO_STORE(state, events) {\r\n\t\t\t//state.events = events\r\n\t\t\t\r\n\t\t\t_.each(events, function(ev, k){\r\n\t\t\t\tvar timeline = []\r\n\r\n\t\t\t\t_.each(ev.timeline, function(__e){\r\n\t\t\t\t\tvar e = __e.event\r\n\r\n\t\t\t\t\tvar _e = {\r\n\r\n\t\t\t\t\t\tevent : {\r\n\t\t\t\t\t\t\tcontent : _.clone(e.content),\r\n\t\t\t\t\t\t\tevent_id: e.event_id,\r\n\t\t\t\t\t\t\torigin_server_ts: e.origin_server_ts,\r\n\t\t\t\t\t\t\troom_id: e.room_id,\r\n\t\t\t\t\t\t\tsender: e.sender,\r\n\t\t\t\t\t\t\tstate_key: e.state_key,\r\n\t\t\t\t\t\t\ttype: e.type\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\tget : () => __e\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttimeline.push(_e)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\tVue.set(state.events, k, {timeline})\r\n\t\t\t});\r\n\r\n\t\t},\r\n\r\n\t\tSET_TYPING_TO_STORE(state, data) {\r\n\t\t\tstate.typing[data.room] || (state.typing[data.room] = {})\r\n\t\t\tstate.typing[data.room][data.name] = data.typing\r\n\r\n\t\t\tfunction allTrue(data) {\r\n\t\t\t\tfor (var o in data)\r\n\t\t\t\t\tif (!data[o]) return false;\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tallTrue(data.typing)\r\n\r\n\t\t},\r\n\t\tDELETE_ROOM(state, roomid) {\r\n\r\n\t\t\tVue.set(state.deletedrooms, roomid, true)\r\n\r\n\r\n\r\n\t\t},\r\n\t\tSET_CONTACTS(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tmp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contacts = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CHATS_USERS(state, v) {\r\n\r\n\t\t\t_.each(v || {}, function (u, i) {\r\n\t\t\t\tif (!state.chatusers[i] || !_.isEqual(state.chatusers[i], u)) {\r\n\t\t\t\t\tVue.set(state.chatusers, i, u)\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\r\n\t\t\t//state.chatusers = v || {}\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_FROM_MATRIX(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tif (f.getmatrixid(c.id) != (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)) mp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsFromMatrix = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_MAP(state) {\r\n\r\n\t\t\tvar contactsMap = {}\r\n\r\n\t\t\t_.each(state.contacts, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.contactsFromMatrix, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsMap = contactsMap;\r\n\t\t},\r\n\r\n\t\tSET_UNAUTHORIZED(state, v) {\r\n\t\t\tstate.unauthorized = v\r\n\t\t},\r\n\r\n\t\tSET_USERINFO(state, v) {\r\n\r\n\t\t\tif (!v.info) return\r\n\r\n\t\t\tif (v.reload || !state.users[v.info.id]) Vue.set(state.users, v.info.id, v.info)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tSET_CURRENT_ROOM(state, v) {\r\n\r\n\t\t\tstate.currentRoom = v\r\n\t\t},\r\n\r\n\t\tCLEAR_USERSINFO(state, v) {\r\n\t\t\tstate.users = {}\r\n\t\t},\r\n\r\n\t\tGALLERY(state, v) {\r\n\r\n\t\t\tstate.gallery = v || null\r\n\r\n\t\t\tvar fu = null\r\n\r\n\t\t\tif(v){\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.gallerybackground')\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.background')\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif (fu) {\r\n\t\t\t\tfu()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tSHARE(state, v) {\r\n\t\t\tstate.share = v || null\r\n\r\n\t\t\tif (!state.mobile) {\r\n\t\t\t\tstate.activeBlock.share = true\r\n\t\t\t\tstate.active = true;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tCONNECT(state, v) {\r\n\t\t\tstate.connect = v\r\n\t\t},\r\n\r\n\t\tJOINROOM(state, v) {\r\n\t\t\tstate.joinroom = v\r\n\t\t},\r\n\r\n\t\tCONTACT(state, v) {\r\n\t\t\tstate.contact = v || null\r\n\t\t},\r\n\r\n\t\ttheme(state, value) {\r\n\t\t\tmex.theme(state, value)\r\n\t\t},\r\n\r\n\t\tSET_POCKETTEAMMESSAGES(state, v) {\r\n\t\t\tstate.pocketteammessages = v;\r\n\t\t\t// Check local storage\r\n\t\t\tvar readedMessagesStr = localStorage.getItem('readedpocketteammessages');\r\n\t\t\tif (readedMessagesStr) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar readedMessages = JSON.parse(readedMessagesStr);\r\n\t\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tlocalStorage.removeItem('readedpocketteammessages');\r\n\t\t\t\t\tstate.readedteammessages = {};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_READEDTEAMMESSAGES(state, v) {\r\n\t\t\tif (v && v.length > 0) {\r\n\t\t\t\tvar readedMessages = {};\r\n\t\t\t\t_.each(v, function (m) {\r\n\t\t\t\t\treadedMessages[m.id] = true;\r\n\t\t\t\t});\r\n\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t// Update local storage\r\n\t\t\t\tlocalStorage.setItem('readedpocketteammessages', JSON.stringify(readedMessages));\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_MENU(state, v) {\r\n\t\t\tstate.menu = v\r\n\r\n\t\t},\r\n\r\n\t\tSET_VOICERECORDING(state, v){\r\n\t\t\tstate.voicerecording = v\r\n\t\t}\r\n\r\n\t},\r\n\tactions: {\r\n\t\tSET_CHAT_MEMBERS({ commit }, chat) {\r\n\r\n\t\t},\r\n\t\tTYPING_EVENT({ commit }, member) {\r\n\t\t\tlet room = member.roomId\r\n\t\t\tlet name = member.name\r\n\t\t\tlet data = { room, name, typing: member.typing }\r\n\t\t\tcommit('SET_TYPING_TO_STORE', data)\r\n\t\t},\r\n\t\tCHAT_MEMBERS({ commit }) {\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY_FROMEVENTS({ commit, dispatch }, { events, event }) {\r\n\r\n\t\t\tvar images = [], index = 0\r\n\r\n\t\t\tvar encrypted = function (event) {\r\n\t\t\t\treturn f.deep(event, 'event.content.info.secrets') ? true : false\r\n\t\t\t}\r\n\r\n\t\t\t_.each(events, event => {\r\n\r\n\t\t\t\tif (event.event.content.msgtype === 'm.image') {\r\n\r\n\t\t\t\t\tvar url = event.event.content.url\r\n\r\n\t\t\t\t\tif (encrypted(event)) {\r\n\t\t\t\t\t\turl = event.event.decryptedImage\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\timages.push({\r\n\t\t\t\t\t\tsrc: url,\r\n\t\t\t\t\t\tw: event.event.content.info.w || 500,\r\n\t\t\t\t\t\th: event.event.content.info.h || 500,\r\n\t\t\t\t\t\teventId: event.event.event_id\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\t\t\timages = _.filter(images, function (i) {\r\n\t\t\t\treturn i.src\r\n\t\t\t})\r\n\r\n\t\t\tindex = images.map(function (e) {\r\n\t\t\t\treturn e.eventId\r\n\t\t\t}).indexOf(event.event.event_id)\r\n\r\n\t\t\tdispatch('SHOW_GALLERY', { images, index })\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY({ commit }, { images, index }) {\r\n\r\n\t\t\tif (!index) index = 0\r\n\r\n\t\t\tif (!images) images = []\r\n\r\n\t\t\tif (images.length) {\r\n\r\n\t\t\t\tcommit('GALLERY', {\r\n\t\t\t\t\timages: images,\r\n\t\t\t\t\tindex: index\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcommit('GALLERY', null)\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tRELOAD_CHAT_USERS({ commit }, m_chats) {\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats, true).then(i => {\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tFETCH_CHATS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar id = store._vm.core.user.myMatrixId()\r\n\r\n\t\t\tvar chats = _.map(m_chats, function (r) {\r\n\t\t\t\tif (r.getLastActiveTimestamp() === -9007199254740991) {\r\n\r\n\t\t\t\t\tif (r.getMember(id)) {\r\n\t\t\t\t\t\tr.summary.lastModified = r.getMember(id).events.member.event.origin_server_ts\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tr.summary.lastModified = r.getLastActiveTimestamp()\r\n\t\t\t\t}\r\n\t\t\t\treturn r.summary\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_PRECHATS_TO_STORE', chats)\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.allchatmembers(m_chats).then(r => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_TO_STORE', chats)\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\r\n\t\t\t\treturn store._vm.core.mtrx.kit.fillContacts(m_chats)\r\n\r\n\t\t\t})\r\n\r\n\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats).then(i => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\tcommit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n\t\t\t\t\treturn m.id !== (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)\r\n\t\t\t\t}))\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\r\n\t\tFETCH_EVENTS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar events = {}\r\n\r\n\t\t\t_.each(m_chats, function (chat) {\r\n\r\n\t\t\t\tevents[chat.roomId] = {}\r\n\r\n\t\t\t\tvar timeline = [].concat(chat.timeline, chat.currentState.getStateEvents('m.room.member'))\r\n\r\n\t\t\t\tevents[chat.roomId].timeline = timeline\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(events, function (e) {\r\n\r\n\t\t\t\te.timeline = _.sortBy(e.timeline, function (event) {\r\n\t\t\t\t\treturn event.getDate()\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_EVENTS_TO_STORE', events)\r\n\r\n\t\t\t//store._vm.core.mtrx.kit.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n\t\t\t//})\r\n\r\n\t\t},\r\n\t}\r\n})\r\n\r\n\r\nexport default store;","/*!\n * vue-router v3.5.3\n * (c) 2021 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (!condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b, onlyPath) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query))\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n (onlyPath || (\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params))\n )\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/+/g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar warnedCustomSlot;\nvar warnedTagProp;\nvar warnedEventProp;\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n custom: Boolean,\n exact: Boolean,\n exactPath: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);\n classes[activeClass] = this.exact || this.exactPath\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (process.env.NODE_ENV !== 'production' && !this.custom) {\n !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\\n\\n');\n warnedCustomSlot = true;\n }\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\" with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ('tag' in this.$options.propsData && !warnedTagProp) {\n warn(\n false,\n \"'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedTagProp = true;\n }\n if ('event' in this.$options.propsData && !warnedEventProp) {\n warn(\n false,\n \"'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedEventProp = true;\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap,\n parentRoute\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n alias: route.alias\n ? typeof route.alias === 'string'\n ? [route.alias]\n : route.alias\n : [],\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function addRoute (parentOrRoute, route) {\n var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;\n // $flow-disable-line\n createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);\n\n // add aliases of parent\n if (parent && parent.alias.length) {\n createRouteMap(\n // $flow-disable-line route is defined if parent is\n parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),\n pathList,\n pathMap,\n nameMap,\n parent\n );\n }\n }\n\n function getRoutes () {\n return pathList.map(function (path) { return pathMap[path]; })\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoute: addRoute,\n getRoutes: getRoutes,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1.ensureURL();\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1.ready) {\n this$1.ready = true;\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1.ready = true;\n this$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1.errorCbs.length) {\n this$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'uncaught error during route navigation:');\n }\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n if (route.hash) {\n handleScroll(this.router, current, route, false);\n }\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1.replace(to);\n } else {\n this$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1.pending = null;\n onComplete(route);\n if (this$1.router.app) {\n this$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1.base);\n if (this$1.current === START && location === this$1._startLocation) {\n return\n }\n\n this$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n var pathLowerCase = path.toLowerCase();\n var baseLowerCase = base.toLowerCase();\n // base=\"/a\" shouldn't turn path=\"/app\" into \"/a/pp\"\n // https://github.com/vuejs/vue-router/issues/3555\n // so we ensure the trailing slash in the base\n if (base && ((pathLowerCase === baseLowerCase) ||\n (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n this$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1.current;\n this$1.index = targetIndex;\n this$1.updateRoute(route);\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n if (process.env.NODE_ENV !== 'production') {\n warn(this instanceof VueRouter, \"Router must be called with the new operator.\");\n }\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1.apps.indexOf(app);\n if (index > -1) { this$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }\n\n if (!this$1.app) { this$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.getRoutes = function getRoutes () {\n return this.matcher.getRoutes()\n};\n\nVueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {\n this.matcher.addRoute(parentOrRoute, route);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');\n }\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.5.3';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\nVueRouter.START_LOCATION = START;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nexport default VueRouter;\n","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\n\r\nVue.use(Router);\r\n\r\n\r\nconst router = new Router({\r\n routes: [\r\n \r\n {\r\n path: '/contacts',\r\n name: 'contacts',\r\n component: () => import ('@/views/contacts')\r\n },\r\n {\r\n path: '/contact',\r\n name: 'contact',\r\n component: () => import ('@/views/contact') \r\n },\r\n {\r\n path: '/chats',\r\n name: 'chats',\r\n component: () => import ('@/views/chats')\r\n },\r\n {\r\n path: '/chat',\r\n name: 'chat',\r\n component: () => import ('@/views/chat')\r\n },\r\n {\r\n path: '/publicPreview',\r\n name: 'publicPreview',\r\n component: () => import ('@/views/publicPreview')\r\n },\r\n {\r\n path: '/chatSettings',\r\n name: 'chatSettings',\r\n component: () => import ('@/views/chatSettings')\r\n },\r\n {\r\n path: '/chatInfo',\r\n name: 'chatInfo',\r\n component: () => import ('@/views/chatinfo')\r\n },\r\n {\r\n path: '/teamRoom',\r\n name: 'teamRoom',\r\n component: () => import ('@/views/teamroom')\r\n },\r\n {\r\n path: '/settings',\r\n name: 'settings',\r\n component: () => import ('@/views/settings')\r\n },\r\n\r\n {\r\n path: '/invite',\r\n name: 'invite',\r\n component: () => import ('@/views/invite')\r\n },\r\n\r\n \r\n ],\r\n \r\n mode: document.getElementById('automomous') ? 'history' : 'abstract',\r\n \r\n})\r\n\r\n\r\nexport default router","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},attrs:{\"id\":\"modal\"}},[_c('div',{staticClass:\"modal-backdrop\",on:{\"click\":_vm.close}}),_c('div',{staticClass:\"modal-wrapper\"},[_c('div',{staticClass:\"modal\",attrs:{\"role\":\"dialog\",\"aria-labelledby\":\"modalTitle\",\"aria-describedby\":\"modalDescription\"}},[_c('div',{staticClass:\"modal-header\"},[_vm._t(\"header\",function(){return [_vm._v(\" \"+_vm._s(_vm.$t(\"caption.header\"))+\" \")]})],2),_c('div',{staticClass:\"modal-body\",attrs:{\"id\":\"modalDescription\"}},[_vm._t(\"body\")],2),(_vm.displayFooter)?_c('div',{staticClass:\"modal-footer\"}):_vm._e(),_c('div',{staticClass:\"modal-close\",on:{\"click\":_vm.close}},[_c('i',{staticClass:\"fas fa-times\"})])])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'modal',\r\n props: {\r\n displayFooter : {\r\n default : true,\r\n type : Boolean\r\n },\r\n cantclose : Boolean\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'modal'})\r\n },\r\n \r\n destroyed() {\r\n this.$store.commit('blockactive', {value : false, item : 'modal'})\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n \r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active: state => state.active,\r\n mobile: state => state.mobile,\r\n }),\r\n\r\n methods : {\r\n close : function(){\r\n this.$emit('close')\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f016832&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pmenu\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile}},[(_vm.menu)?_c('div',{staticClass:\"menubgwrapper\"},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menu.items},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"items\"},[_c('transition-group',{attrs:{\"name\":\"menulis2t\",\"tag\":\"div\"}},_vm._l((_vm.filteredItems),function(item){return _c('div',{key:item.click,staticClass:\"item\"},[_vm._t(\"default\",function(){return [_c('router-link',{attrs:{\"to\":'/' + item.route}},[_c('div',{staticClass:\"iwr\"},[(item.icon)?_c('i',{class:item.icon}):_vm._e(),_c('span',[_vm._v(_vm._s(item.name && typeof item.name === 'string' ? item.name : 'undefined'))])])])]},{\"item\":item})],2)}),0)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./simpleMenu.vue?vue&type=template&id=79bb4e47&scoped=true&\"\nimport script from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nexport * from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"79bb4e47\",\n null\n ,true\n)\n\nexport default component.exports","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'pmenu',\r\n props: {\r\n \r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n return {\r\n last : null\r\n }\r\n },\r\n\r\n watch: {\r\n \r\n },\r\n\r\n computed: {\r\n\r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent,\r\n\r\n menu : state => state.menu\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n if (this.menu){\r\n\r\n this.last = this.menu\r\n\r\n\r\n this.menu.handler(item, this.menu.item, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n })\r\n\r\n // this.$emit('itemClicked', item, this.menu.item, );\r\n }\r\n \r\n },\r\n\r\n showPopup : function(){\r\n if (this.last){\r\n this.$store.commit('SET_MENU', this.last);\r\n this.last = null\r\n }\r\n },\r\n \r\n hidePopup() {\r\n this.$store.commit('SET_MENU', null);\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=6078dda8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=6078dda8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6078dda8\",\n null\n ,true\n)\n\nexport default component.exports","/*!\n * vue-textarea-autosize v1.1.1 \n * (c) 2019 Saymon\n * Released under the MIT License.\n */\n//\n//\n//\n//\n//\n//\n//\nvar script = {\n name: 'TextareaAutosize',\n props: {\n value: {\n type: [String, Number],\n default: ''\n },\n autosize: {\n type: Boolean,\n default: true\n },\n minHeight: {\n type: [Number],\n 'default': null\n },\n maxHeight: {\n type: [Number],\n 'default': null\n },\n\n /*\n * Force !important for style properties\n */\n important: {\n type: [Boolean, Array],\n default: false\n }\n },\n data: function data() {\n return {\n // data property for v-model binding with real textarea tag\n val: null,\n // works when content height becomes more then value of the maxHeight property\n maxHeightScroll: false,\n height: 'auto'\n };\n },\n computed: {\n computedStyles: function computedStyles() {\n if (!this.autosize) return {};\n return {\n resize: !this.isResizeImportant ? 'none' : 'none !important',\n height: this.height,\n overflow: this.maxHeightScroll ? 'auto' : !this.isOverflowImportant ? 'hidden' : 'hidden !important'\n };\n },\n isResizeImportant: function isResizeImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('resize');\n },\n isOverflowImportant: function isOverflowImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('overflow');\n },\n isHeightImportant: function isHeightImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('height');\n }\n },\n watch: {\n value: function value(val) {\n this.val = val;\n },\n val: function val(_val) {\n this.$nextTick(this.resize);\n this.$emit('input', _val);\n },\n minHeight: function minHeight() {\n this.$nextTick(this.resize);\n },\n maxHeight: function maxHeight() {\n this.$nextTick(this.resize);\n },\n autosize: function autosize(val) {\n if (val) this.resize();\n }\n },\n methods: {\n resize: function resize() {\n var _this = this;\n\n var important = this.isHeightImportant ? 'important' : '';\n this.height = \"auto\".concat(important ? ' !important' : '');\n this.$nextTick(function () {\n var contentHeight = _this.$el.scrollHeight + 1;\n\n if (_this.minHeight) {\n contentHeight = contentHeight < _this.minHeight ? _this.minHeight : contentHeight;\n }\n\n if (_this.maxHeight) {\n if (contentHeight > _this.maxHeight) {\n contentHeight = _this.maxHeight;\n _this.maxHeightScroll = true;\n } else {\n _this.maxHeightScroll = false;\n }\n }\n\n var heightVal = contentHeight + 'px';\n _this.height = \"\".concat(heightVal).concat(important ? ' !important' : '');\n });\n return this;\n }\n },\n created: function created() {\n this.val = this.value;\n },\n mounted: function mounted() {\n this.resize();\n }\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\n/* server only */\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n } // Vue.extend constructor export interop.\n\n\n var options = typeof script === 'function' ? script.options : script; // render functions\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true; // functional template\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n } // scopedId\n\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n var hook;\n\n if (moduleIdentifier) {\n // server build\n hook = function hook(context) {\n // 2.3 injection\n context = context || // cached call\n this.$vnode && this.$vnode.ssrContext || // stateful\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\n // 2.2 with runInNewContext: true\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n } // inject component styles\n\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n } // register component module identifier for async chunk inference\n\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n }; // used by ssr in case component is cached and beforeCreate\n // never gets called\n\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function () {\n style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n // register for functional component in vue file\n var originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\nvar normalizeComponent_1 = normalizeComponent;\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.val),expression:\"val\"}],style:(_vm.computedStyles),domProps:{\"value\":(_vm.val)},on:{\"focus\":_vm.resize,\"input\":function($event){if($event.target.composing){ return; }_vm.val=$event.target.value;}}})};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n\n \n var TextareaAutosize = normalizeComponent_1(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n undefined,\n undefined\n );\n\nvar version = '1.1.1';\n\nvar install = function install(Vue) {\n Vue.component('TextareaAutosize', TextareaAutosize);\n};\n\nvar plugin = {\n install: install,\n version: version\n};\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(plugin);\n}\n\nexport default plugin;\n","/*!\n * vue-i18n v8.27.0 \n * (c) 2022 kazuya kawaguchi\n * Released under the MIT License.\n */\n/* */\n\n/**\n * constants\n */\n\nvar numberFormatKeys = [\n 'compactDisplay',\n 'currency',\n 'currencyDisplay',\n 'currencySign',\n 'localeMatcher',\n 'notation',\n 'numberingSystem',\n 'signDisplay',\n 'style',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits'\n];\n\n/**\n * utilities\n */\n\nfunction warn (msg, err) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.warn(err.stack);\n }\n }\n}\n\nfunction error (msg, err) {\n if (typeof console !== 'undefined') {\n console.error('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.error(err.stack);\n }\n }\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isBoolean (val) {\n return typeof val === 'boolean'\n}\n\nfunction isString (val) {\n return typeof val === 'string'\n}\n\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n return toString.call(obj) === OBJECT_STRING\n}\n\nfunction isNull (val) {\n return val === null || val === undefined\n}\n\nfunction isFunction (val) {\n return typeof val === 'function'\n}\n\nfunction parseArgs () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var locale = null;\n var params = null;\n if (args.length === 1) {\n if (isObject(args[0]) || isArray(args[0])) {\n params = args[0];\n } else if (typeof args[0] === 'string') {\n locale = args[0];\n }\n } else if (args.length === 2) {\n if (typeof args[0] === 'string') {\n locale = args[0];\n }\n /* istanbul ignore if */\n if (isObject(args[1]) || isArray(args[1])) {\n params = args[1];\n }\n }\n\n return { locale: locale, params: params }\n}\n\nfunction looseClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction remove (arr, item) {\n if (arr.delete(item)) {\n return arr\n }\n}\n\nfunction arrayFrom (arr) {\n var ret = [];\n arr.forEach(function (a) { return ret.push(a); });\n return ret\n}\n\nfunction includes (arr, item) {\n return !!~arr.indexOf(item)\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\nfunction merge (target) {\n var arguments$1 = arguments;\n\n var output = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments$1[i];\n if (source !== undefined && source !== null) {\n var key = (void 0);\n for (key in source) {\n if (hasOwn(source, key)) {\n if (isObject(source[key])) {\n output[key] = merge(output[key], source[key]);\n } else {\n output[key] = source[key];\n }\n }\n }\n }\n }\n return output\n}\n\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = isArray(a);\n var isArrayB = isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.\n * @param rawText The raw input from the user that should be escaped.\n */\nfunction escapeHtml(rawText) {\n return rawText\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\n/**\n * Escapes html tags and special symbols from all provided params which were returned from parseArgs().params.\n * This method performs an in-place operation on the params object.\n *\n * @param {any} params Parameters as provided from `parseArgs().params`.\n * May be either an array of strings or a string->any map.\n *\n * @returns The manipulated `params` object.\n */\nfunction escapeParams(params) {\n if(params != null) {\n Object.keys(params).forEach(function (key) {\n if(typeof(params[key]) == 'string') {\n params[key] = escapeHtml(params[key]);\n }\n });\n }\n return params\n}\n\n/* */\n\nfunction extend (Vue) {\n if (!Vue.prototype.hasOwnProperty('$i18n')) {\n // $FlowFixMe\n Object.defineProperty(Vue.prototype, '$i18n', {\n get: function get () { return this._i18n }\n });\n }\n\n Vue.prototype.$t = function (key) {\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n\n var i18n = this.$i18n;\n return i18n._t.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this ].concat( values ))\n };\n\n Vue.prototype.$tc = function (key, choice) {\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n\n var i18n = this.$i18n;\n return i18n._tc.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this, choice ].concat( values ))\n };\n\n Vue.prototype.$te = function (key, locale) {\n var i18n = this.$i18n;\n return i18n._te(key, i18n.locale, i18n._getMessages(), locale)\n };\n\n Vue.prototype.$d = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).d.apply(ref, [ value ].concat( args ))\n };\n\n Vue.prototype.$n = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).n.apply(ref, [ value ].concat( args ))\n };\n}\n\n/* */\n\n/**\n * Mixin\n * \n * If `bridge` mode, empty mixin is returned,\n * else regulary mixin implementation is returned.\n */\nfunction defineMixin (bridge) {\n if ( bridge === void 0 ) bridge = false;\n\n function mounted () {\n if (this !== this.$root && this.$options.__INTLIFY_META__ && this.$el) {\n this.$el.setAttribute('data-intlify', this.$options.__INTLIFY_META__);\n }\n }\n\n return bridge\n ? { mounted: mounted } // delegate `vue-i18n-bridge` mixin implementation\n : { // regulary \n beforeCreate: function beforeCreate () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n = options.__i18nBridge || options.__i18n;\n _i18n.forEach(function (resource) {\n localeMessages = merge(localeMessages, JSON.parse(resource));\n });\n Object.keys(localeMessages).forEach(function (locale) {\n options.i18n.mergeLocaleMessage(locale, localeMessages[locale]);\n });\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n this._i18n = options.i18n;\n this._i18nWatcher = this._i18n.watchI18nData();\n } else if (isPlainObject(options.i18n)) {\n var rootI18n = this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n\n ? this.$root.$i18n\n : null;\n // component local i18n\n if (rootI18n) {\n options.i18n.root = this.$root;\n options.i18n.formatter = rootI18n.formatter;\n options.i18n.fallbackLocale = rootI18n.fallbackLocale;\n options.i18n.formatFallbackMessages = rootI18n.formatFallbackMessages;\n options.i18n.silentTranslationWarn = rootI18n.silentTranslationWarn;\n options.i18n.silentFallbackWarn = rootI18n.silentFallbackWarn;\n options.i18n.pluralizationRules = rootI18n.pluralizationRules;\n options.i18n.preserveDirectiveContent = rootI18n.preserveDirectiveContent;\n }\n\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages$1 = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n$1 = options.__i18nBridge || options.__i18n;\n _i18n$1.forEach(function (resource) {\n localeMessages$1 = merge(localeMessages$1, JSON.parse(resource));\n });\n options.i18n.messages = localeMessages$1;\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n\n var ref = options.i18n;\n var sharedMessages = ref.sharedMessages;\n if (sharedMessages && isPlainObject(sharedMessages)) {\n options.i18n.messages = merge(options.i18n.messages, sharedMessages);\n }\n\n this._i18n = new VueI18n(options.i18n);\n this._i18nWatcher = this._i18n.watchI18nData();\n\n if (options.i18n.sync === undefined || !!options.i18n.sync) {\n this._localeWatcher = this.$i18n.watchLocale();\n }\n\n if (rootI18n) {\n rootI18n.onComponentInstanceCreated(this._i18n);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n // root i18n\n this._i18n = this.$root.$i18n;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n // parent i18n\n this._i18n = options.parent.$i18n;\n }\n },\n\n beforeMount: function beforeMount () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (isPlainObject(options.i18n)) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n }\n },\n\n mounted: mounted,\n\n beforeDestroy: function beforeDestroy () {\n if (!this._i18n) { return }\n\n var self = this;\n this.$nextTick(function () {\n if (self._subscribing) {\n self._i18n.unsubscribeDataChanging(self);\n delete self._subscribing;\n }\n\n if (self._i18nWatcher) {\n self._i18nWatcher();\n self._i18n.destroyVM();\n delete self._i18nWatcher;\n }\n\n if (self._localeWatcher) {\n self._localeWatcher();\n delete self._localeWatcher;\n }\n });\n }\n }\n}\n\n/* */\n\nvar interpolationComponent = {\n name: 'i18n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n path: {\n type: String,\n required: true\n },\n locale: {\n type: String\n },\n places: {\n type: [Array, Object]\n }\n },\n render: function render (h, ref) {\n var data = ref.data;\n var parent = ref.parent;\n var props = ref.props;\n var slots = ref.slots;\n\n var $i18n = parent.$i18n;\n if (!$i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return\n }\n\n var path = props.path;\n var locale = props.locale;\n var places = props.places;\n var params = slots();\n var children = $i18n.i(\n path,\n locale,\n onlyHasDefaultPlace(params) || places\n ? useLegacyPlaces(params.default, places)\n : params\n );\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag ? h(tag, data, children) : children\n }\n};\n\nfunction onlyHasDefaultPlace (params) {\n var prop;\n for (prop in params) {\n if (prop !== 'default') { return false }\n }\n return Boolean(prop)\n}\n\nfunction useLegacyPlaces (children, places) {\n var params = places ? createParamsFromPlaces(places) : {};\n\n if (!children) { return params }\n\n // Filter empty text nodes\n children = children.filter(function (child) {\n return child.tag || child.text.trim() !== ''\n });\n\n var everyPlace = children.every(vnodeHasPlaceAttribute);\n if (process.env.NODE_ENV !== 'production' && everyPlace) {\n warn('`place` attribute is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return children.reduce(\n everyPlace ? assignChildPlace : assignChildIndex,\n params\n )\n}\n\nfunction createParamsFromPlaces (places) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`places` prop is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return Array.isArray(places)\n ? places.reduce(assignChildIndex, {})\n : Object.assign({}, places)\n}\n\nfunction assignChildPlace (params, child) {\n if (child.data && child.data.attrs && child.data.attrs.place) {\n params[child.data.attrs.place] = child;\n }\n return params\n}\n\nfunction assignChildIndex (params, child, index) {\n params[index] = child;\n return params\n}\n\nfunction vnodeHasPlaceAttribute (vnode) {\n return Boolean(vnode.data && vnode.data.attrs && vnode.data.attrs.place)\n}\n\n/* */\n\nvar numberComponent = {\n name: 'i18n-n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n value: {\n type: Number,\n required: true\n },\n format: {\n type: [String, Object]\n },\n locale: {\n type: String\n }\n },\n render: function render (h, ref) {\n var props = ref.props;\n var parent = ref.parent;\n var data = ref.data;\n\n var i18n = parent.$i18n;\n\n if (!i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return null\n }\n\n var key = null;\n var options = null;\n\n if (isString(props.format)) {\n key = props.format;\n } else if (isObject(props.format)) {\n if (props.format.key) {\n key = props.format.key;\n }\n\n // Filter out number format options only\n options = Object.keys(props.format).reduce(function (acc, prop) {\n var obj;\n\n if (includes(numberFormatKeys, prop)) {\n return Object.assign({}, acc, ( obj = {}, obj[prop] = props.format[prop], obj ))\n }\n return acc\n }, null);\n }\n\n var locale = props.locale || i18n.locale;\n var parts = i18n._ntp(props.value, locale, key, options);\n\n var values = parts.map(function (part, index) {\n var obj;\n\n var slot = data.scopedSlots && data.scopedSlots[part.type];\n return slot ? slot(( obj = {}, obj[part.type] = part.value, obj.index = index, obj.parts = parts, obj )) : part.value\n });\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag\n ? h(tag, {\n attrs: data.attrs,\n 'class': data['class'],\n staticClass: data.staticClass\n }, values)\n : values\n }\n};\n\n/* */\n\nfunction bind (el, binding, vnode) {\n if (!assert(el, vnode)) { return }\n\n t(el, binding, vnode);\n}\n\nfunction update (el, binding, vnode, oldVNode) {\n if (!assert(el, vnode)) { return }\n\n var i18n = vnode.context.$i18n;\n if (localeEqual(el, vnode) &&\n (looseEqual(binding.value, binding.oldValue) &&\n looseEqual(el._localeMessage, i18n.getLocaleMessage(i18n.locale)))) { return }\n\n t(el, binding, vnode);\n}\n\nfunction unbind (el, binding, vnode, oldVNode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return\n }\n\n var i18n = vnode.context.$i18n || {};\n if (!binding.modifiers.preserve && !i18n.preserveDirectiveContent) {\n el.textContent = '';\n }\n el._vt = undefined;\n delete el['_vt'];\n el._locale = undefined;\n delete el['_locale'];\n el._localeMessage = undefined;\n delete el['_localeMessage'];\n}\n\nfunction assert (el, vnode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return false\n }\n\n if (!vm.$i18n) {\n warn('VueI18n instance does not exists in Vue instance');\n return false\n }\n\n return true\n}\n\nfunction localeEqual (el, vnode) {\n var vm = vnode.context;\n return el._locale === vm.$i18n.locale\n}\n\nfunction t (el, binding, vnode) {\n var ref$1, ref$2;\n\n var value = binding.value;\n\n var ref = parseValue(value);\n var path = ref.path;\n var locale = ref.locale;\n var args = ref.args;\n var choice = ref.choice;\n if (!path && !locale && !args) {\n warn('value type not supported');\n return\n }\n\n if (!path) {\n warn('`path` is required in v-t directive');\n return\n }\n\n var vm = vnode.context;\n if (choice != null) {\n el._vt = el.textContent = (ref$1 = vm.$i18n).tc.apply(ref$1, [ path, choice ].concat( makeParams(locale, args) ));\n } else {\n el._vt = el.textContent = (ref$2 = vm.$i18n).t.apply(ref$2, [ path ].concat( makeParams(locale, args) ));\n }\n el._locale = vm.$i18n.locale;\n el._localeMessage = vm.$i18n.getLocaleMessage(vm.$i18n.locale);\n}\n\nfunction parseValue (value) {\n var path;\n var locale;\n var args;\n var choice;\n\n if (isString(value)) {\n path = value;\n } else if (isPlainObject(value)) {\n path = value.path;\n locale = value.locale;\n args = value.args;\n choice = value.choice;\n }\n\n return { path: path, locale: locale, args: args, choice: choice }\n}\n\nfunction makeParams (locale, args) {\n var params = [];\n\n locale && params.push(locale);\n if (args && (Array.isArray(args) || isPlainObject(args))) {\n params.push(args);\n }\n\n return params\n}\n\nvar Vue;\n\nfunction install (_Vue, options) {\n if ( options === void 0 ) options = { bridge: false };\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && install.installed && _Vue === Vue) {\n warn('already installed.');\n return\n }\n install.installed = true;\n\n Vue = _Vue;\n\n var version = (Vue.version && Number(Vue.version.split('.')[0])) || -1;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && version < 2) {\n warn((\"vue-i18n (\" + (install.version) + \") need to use Vue 2.0 or later (Vue: \" + (Vue.version) + \").\"));\n return\n }\n\n extend(Vue);\n Vue.mixin(defineMixin(options.bridge));\n Vue.directive('t', { bind: bind, update: update, unbind: unbind });\n Vue.component(interpolationComponent.name, interpolationComponent);\n Vue.component(numberComponent.name, numberComponent);\n\n // use simple mergeStrategies to prevent i18n instance lose '__proto__'\n var strats = Vue.config.optionMergeStrategies;\n strats.i18n = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n };\n}\n\n/* */\n\nvar BaseFormatter = function BaseFormatter () {\n this._caches = Object.create(null);\n};\n\nBaseFormatter.prototype.interpolate = function interpolate (message, values) {\n if (!values) {\n return [message]\n }\n var tokens = this._caches[message];\n if (!tokens) {\n tokens = parse(message);\n this._caches[message] = tokens;\n }\n return compile(tokens, values)\n};\n\n\n\nvar RE_TOKEN_LIST_VALUE = /^(?:\\d)+/;\nvar RE_TOKEN_NAMED_VALUE = /^(?:\\w)+/;\n\nfunction parse (format) {\n var tokens = [];\n var position = 0;\n\n var text = '';\n while (position < format.length) {\n var char = format[position++];\n if (char === '{') {\n if (text) {\n tokens.push({ type: 'text', value: text });\n }\n\n text = '';\n var sub = '';\n char = format[position++];\n while (char !== undefined && char !== '}') {\n sub += char;\n char = format[position++];\n }\n var isClosed = char === '}';\n\n var type = RE_TOKEN_LIST_VALUE.test(sub)\n ? 'list'\n : isClosed && RE_TOKEN_NAMED_VALUE.test(sub)\n ? 'named'\n : 'unknown';\n tokens.push({ value: sub, type: type });\n } else if (char === '%') {\n // when found rails i18n syntax, skip text capture\n if (format[(position)] !== '{') {\n text += char;\n }\n } else {\n text += char;\n }\n }\n\n text && tokens.push({ type: 'text', value: text });\n\n return tokens\n}\n\nfunction compile (tokens, values) {\n var compiled = [];\n var index = 0;\n\n var mode = Array.isArray(values)\n ? 'list'\n : isObject(values)\n ? 'named'\n : 'unknown';\n if (mode === 'unknown') { return compiled }\n\n while (index < tokens.length) {\n var token = tokens[index];\n switch (token.type) {\n case 'text':\n compiled.push(token.value);\n break\n case 'list':\n compiled.push(values[parseInt(token.value, 10)]);\n break\n case 'named':\n if (mode === 'named') {\n compiled.push((values)[token.value]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Type of token '\" + (token.type) + \"' and format of value '\" + mode + \"' don't match!\"));\n }\n }\n break\n case 'unknown':\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Detect 'unknown' type of token!\");\n }\n break\n }\n index++;\n }\n\n return compiled\n}\n\n/* */\n\n/**\n * Path parser\n * - Inspired:\n * Vue.js Path parser\n */\n\n// actions\nvar APPEND = 0;\nvar PUSH = 1;\nvar INC_SUB_PATH_DEPTH = 2;\nvar PUSH_SUB_PATH = 3;\n\n// states\nvar BEFORE_PATH = 0;\nvar IN_PATH = 1;\nvar BEFORE_IDENT = 2;\nvar IN_IDENT = 3;\nvar IN_SUB_PATH = 4;\nvar IN_SINGLE_QUOTE = 5;\nvar IN_DOUBLE_QUOTE = 6;\nvar AFTER_PATH = 7;\nvar ERROR = 8;\n\nvar pathStateMachine = [];\n\npathStateMachine[BEFORE_PATH] = {\n 'ws': [BEFORE_PATH],\n 'ident': [IN_IDENT, APPEND],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[IN_PATH] = {\n 'ws': [IN_PATH],\n '.': [BEFORE_IDENT],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[BEFORE_IDENT] = {\n 'ws': [BEFORE_IDENT],\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND]\n};\n\npathStateMachine[IN_IDENT] = {\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND],\n 'ws': [IN_PATH, PUSH],\n '.': [BEFORE_IDENT, PUSH],\n '[': [IN_SUB_PATH, PUSH],\n 'eof': [AFTER_PATH, PUSH]\n};\n\npathStateMachine[IN_SUB_PATH] = {\n \"'\": [IN_SINGLE_QUOTE, APPEND],\n '\"': [IN_DOUBLE_QUOTE, APPEND],\n '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],\n ']': [IN_PATH, PUSH_SUB_PATH],\n 'eof': ERROR,\n 'else': [IN_SUB_PATH, APPEND]\n};\n\npathStateMachine[IN_SINGLE_QUOTE] = {\n \"'\": [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_SINGLE_QUOTE, APPEND]\n};\n\npathStateMachine[IN_DOUBLE_QUOTE] = {\n '\"': [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_DOUBLE_QUOTE, APPEND]\n};\n\n/**\n * Check if an expression is a literal value.\n */\n\nvar literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\nfunction isLiteral (exp) {\n return literalValueRE.test(exp)\n}\n\n/**\n * Strip quotes from a string\n */\n\nfunction stripQuotes (str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27)\n ? str.slice(1, -1)\n : str\n}\n\n/**\n * Determine the type of a character in a keypath.\n */\n\nfunction getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}\n\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n */\n\nfunction formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}\n\n/**\n * Parse a string path into an array of segments\n */\n\nfunction parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\n\n\n\n\nvar I18nPath = function I18nPath () {\n this._cache = Object.create(null);\n};\n\n/**\n * External parse that check for a cache hit first\n */\nI18nPath.prototype.parsePath = function parsePath (path) {\n var hit = this._cache[path];\n if (!hit) {\n hit = parse$1(path);\n if (hit) {\n this._cache[path] = hit;\n }\n }\n return hit || []\n};\n\n/**\n * Get path value from path string\n */\nI18nPath.prototype.getPathValue = function getPathValue (obj, path) {\n if (!isObject(obj)) { return null }\n\n var paths = this.parsePath(path);\n if (paths.length === 0) {\n return null\n } else {\n var length = paths.length;\n var last = obj;\n var i = 0;\n while (i < length) {\n var value = last[paths[i]];\n if (value === undefined || value === null) {\n return null\n }\n last = value;\n i++;\n }\n\n return last\n }\n};\n\n/* */\n\n\n\nvar htmlTagMatcher = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\nvar linkKeyMatcher = /(?:@(?:\\.[a-z]+)?:(?:[\\w\\-_|./]+|\\([\\w\\-_|./]+\\)))/g;\nvar linkKeyPrefixMatcher = /^@(?:\\.([a-z]+))?:/;\nvar bracketsMatcher = /[()]/g;\nvar defaultModifiers = {\n 'upper': function (str) { return str.toLocaleUpperCase(); },\n 'lower': function (str) { return str.toLocaleLowerCase(); },\n 'capitalize': function (str) { return (\"\" + (str.charAt(0).toLocaleUpperCase()) + (str.substr(1))); }\n};\n\nvar defaultFormatter = new BaseFormatter();\n\nvar VueI18n = function VueI18n (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #290\n /* istanbul ignore if */\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n var locale = options.locale || 'en-US';\n var fallbackLocale = options.fallbackLocale === false\n ? false\n : options.fallbackLocale || 'en-US';\n var messages = options.messages || {};\n var dateTimeFormats = options.dateTimeFormats || options.datetimeFormats || {};\n var numberFormats = options.numberFormats || {};\n\n this._vm = null;\n this._formatter = options.formatter || defaultFormatter;\n this._modifiers = options.modifiers || {};\n this._missing = options.missing || null;\n this._root = options.root || null;\n this._sync = options.sync === undefined ? true : !!options.sync;\n this._fallbackRoot = options.fallbackRoot === undefined\n ? true\n : !!options.fallbackRoot;\n this._fallbackRootWithEmptyString = options.fallbackRootWithEmptyString === undefined\n ? true\n : !!options.fallbackRootWithEmptyString;\n this._formatFallbackMessages = options.formatFallbackMessages === undefined\n ? false\n : !!options.formatFallbackMessages;\n this._silentTranslationWarn = options.silentTranslationWarn === undefined\n ? false\n : options.silentTranslationWarn;\n this._silentFallbackWarn = options.silentFallbackWarn === undefined\n ? false\n : !!options.silentFallbackWarn;\n this._dateTimeFormatters = {};\n this._numberFormatters = {};\n this._path = new I18nPath();\n this._dataListeners = new Set();\n this._componentInstanceCreatedListener = options.componentInstanceCreatedListener || null;\n this._preserveDirectiveContent = options.preserveDirectiveContent === undefined\n ? false\n : !!options.preserveDirectiveContent;\n this.pluralizationRules = options.pluralizationRules || {};\n this._warnHtmlInMessage = options.warnHtmlInMessage || 'off';\n this._postTranslation = options.postTranslation || null;\n this._escapeParameterHtml = options.escapeParameterHtml || false;\n\n if ('__VUE_I18N_BRIDGE__' in options) {\n this.__VUE_I18N_BRIDGE__ = options.__VUE_I18N_BRIDGE__;\n }\n\n /**\n * @param choice {number} a choice index given by the input to $tc: `$tc('path.to.rule', choiceIndex)`\n * @param choicesLength {number} an overall amount of available choices\n * @returns a final choice index\n */\n this.getChoiceIndex = function (choice, choicesLength) {\n var thisPrototype = Object.getPrototypeOf(this$1);\n if (thisPrototype && thisPrototype.getChoiceIndex) {\n var prototypeGetChoiceIndex = (thisPrototype.getChoiceIndex);\n return (prototypeGetChoiceIndex).call(this$1, choice, choicesLength)\n }\n\n // Default (old) getChoiceIndex implementation - english-compatible\n var defaultImpl = function (_choice, _choicesLength) {\n _choice = Math.abs(_choice);\n\n if (_choicesLength === 2) {\n return _choice\n ? _choice > 1\n ? 1\n : 0\n : 1\n }\n\n return _choice ? Math.min(_choice, 2) : 0\n };\n\n if (this$1.locale in this$1.pluralizationRules) {\n return this$1.pluralizationRules[this$1.locale].apply(this$1, [choice, choicesLength])\n } else {\n return defaultImpl(choice, choicesLength)\n }\n };\n\n\n this._exist = function (message, key) {\n if (!message || !key) { return false }\n if (!isNull(this$1._path.getPathValue(message, key))) { return true }\n // fallback for flat key\n if (message[key]) { return true }\n return false\n };\n\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n\n this._initVM({\n locale: locale,\n fallbackLocale: fallbackLocale,\n messages: messages,\n dateTimeFormats: dateTimeFormats,\n numberFormats: numberFormats\n });\n};\n\nvar prototypeAccessors = { vm: { configurable: true },messages: { configurable: true },dateTimeFormats: { configurable: true },numberFormats: { configurable: true },availableLocales: { configurable: true },locale: { configurable: true },fallbackLocale: { configurable: true },formatFallbackMessages: { configurable: true },missing: { configurable: true },formatter: { configurable: true },silentTranslationWarn: { configurable: true },silentFallbackWarn: { configurable: true },preserveDirectiveContent: { configurable: true },warnHtmlInMessage: { configurable: true },postTranslation: { configurable: true },sync: { configurable: true } };\n\nVueI18n.prototype._checkLocaleMessage = function _checkLocaleMessage (locale, level, message) {\n var paths = [];\n\n var fn = function (level, locale, message, paths) {\n if (isPlainObject(message)) {\n Object.keys(message).forEach(function (key) {\n var val = message[key];\n if (isPlainObject(val)) {\n paths.push(key);\n paths.push('.');\n fn(level, locale, val, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push(key);\n fn(level, locale, val, paths);\n paths.pop();\n }\n });\n } else if (isArray(message)) {\n message.forEach(function (item, index) {\n if (isPlainObject(item)) {\n paths.push((\"[\" + index + \"]\"));\n paths.push('.');\n fn(level, locale, item, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push((\"[\" + index + \"]\"));\n fn(level, locale, item, paths);\n paths.pop();\n }\n });\n } else if (isString(message)) {\n var ret = htmlTagMatcher.test(message);\n if (ret) {\n var msg = \"Detected HTML in message '\" + message + \"' of keypath '\" + (paths.join('')) + \"' at '\" + locale + \"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp\";\n if (level === 'warn') {\n warn(msg);\n } else if (level === 'error') {\n error(msg);\n }\n }\n }\n };\n\n fn(level, locale, message, paths);\n};\n\nVueI18n.prototype._initVM = function _initVM (data) {\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n this._vm = new Vue({ data: data, __VUE18N__INSTANCE__: true });\n Vue.config.silent = silent;\n};\n\nVueI18n.prototype.destroyVM = function destroyVM () {\n this._vm.$destroy();\n};\n\nVueI18n.prototype.subscribeDataChanging = function subscribeDataChanging (vm) {\n this._dataListeners.add(vm);\n};\n\nVueI18n.prototype.unsubscribeDataChanging = function unsubscribeDataChanging (vm) {\n remove(this._dataListeners, vm);\n};\n\nVueI18n.prototype.watchI18nData = function watchI18nData () {\n var this$1 = this;\n return this._vm.$watch('$data', function () {\n var listeners = arrayFrom(this$1._dataListeners);\n var i = listeners.length;\n while(i--) {\n Vue.nextTick(function () {\n listeners[i] && listeners[i].$forceUpdate();\n });\n }\n }, { deep: true })\n};\n\nVueI18n.prototype.watchLocale = function watchLocale (composer) {\n if (!composer) {\n /* istanbul ignore if */\n if (!this._sync || !this._root) { return null }\n var target = this._vm;\n return this._root.$i18n.vm.$watch('locale', function (val) {\n target.$set(target, 'locale', val);\n target.$forceUpdate();\n }, { immediate: true })\n } else {\n // deal with vue-i18n-bridge\n if (!this.__VUE_I18N_BRIDGE__) { return null }\n var self = this;\n var target$1 = this._vm;\n return this.vm.$watch('locale', function (val) {\n target$1.$set(target$1, 'locale', val);\n if (self.__VUE_I18N_BRIDGE__ && composer) {\n composer.locale.value = val;\n }\n target$1.$forceUpdate();\n }, { immediate: true })\n }\n};\n\nVueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {\n if (this._componentInstanceCreatedListener) {\n this._componentInstanceCreatedListener(newI18n, this);\n }\n};\n\nprototypeAccessors.vm.get = function () { return this._vm };\n\nprototypeAccessors.messages.get = function () { return looseClone(this._getMessages()) };\nprototypeAccessors.dateTimeFormats.get = function () { return looseClone(this._getDateTimeFormats()) };\nprototypeAccessors.numberFormats.get = function () { return looseClone(this._getNumberFormats()) };\nprototypeAccessors.availableLocales.get = function () { return Object.keys(this.messages).sort() };\n\nprototypeAccessors.locale.get = function () { return this._vm.locale };\nprototypeAccessors.locale.set = function (locale) {\n this._vm.$set(this._vm, 'locale', locale);\n};\n\nprototypeAccessors.fallbackLocale.get = function () { return this._vm.fallbackLocale };\nprototypeAccessors.fallbackLocale.set = function (locale) {\n this._localeChainCache = {};\n this._vm.$set(this._vm, 'fallbackLocale', locale);\n};\n\nprototypeAccessors.formatFallbackMessages.get = function () { return this._formatFallbackMessages };\nprototypeAccessors.formatFallbackMessages.set = function (fallback) { this._formatFallbackMessages = fallback; };\n\nprototypeAccessors.missing.get = function () { return this._missing };\nprototypeAccessors.missing.set = function (handler) { this._missing = handler; };\n\nprototypeAccessors.formatter.get = function () { return this._formatter };\nprototypeAccessors.formatter.set = function (formatter) { this._formatter = formatter; };\n\nprototypeAccessors.silentTranslationWarn.get = function () { return this._silentTranslationWarn };\nprototypeAccessors.silentTranslationWarn.set = function (silent) { this._silentTranslationWarn = silent; };\n\nprototypeAccessors.silentFallbackWarn.get = function () { return this._silentFallbackWarn };\nprototypeAccessors.silentFallbackWarn.set = function (silent) { this._silentFallbackWarn = silent; };\n\nprototypeAccessors.preserveDirectiveContent.get = function () { return this._preserveDirectiveContent };\nprototypeAccessors.preserveDirectiveContent.set = function (preserve) { this._preserveDirectiveContent = preserve; };\n\nprototypeAccessors.warnHtmlInMessage.get = function () { return this._warnHtmlInMessage };\nprototypeAccessors.warnHtmlInMessage.set = function (level) {\n var this$1 = this;\n\n var orgLevel = this._warnHtmlInMessage;\n this._warnHtmlInMessage = level;\n if (orgLevel !== level && (level === 'warn' || level === 'error')) {\n var messages = this._getMessages();\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n};\n\nprototypeAccessors.postTranslation.get = function () { return this._postTranslation };\nprototypeAccessors.postTranslation.set = function (handler) { this._postTranslation = handler; };\n\nprototypeAccessors.sync.get = function () { return this._sync };\nprototypeAccessors.sync.set = function (val) { this._sync = val; };\n\nVueI18n.prototype._getMessages = function _getMessages () { return this._vm.messages };\nVueI18n.prototype._getDateTimeFormats = function _getDateTimeFormats () { return this._vm.dateTimeFormats };\nVueI18n.prototype._getNumberFormats = function _getNumberFormats () { return this._vm.numberFormats };\n\nVueI18n.prototype._warnDefault = function _warnDefault (locale, key, result, vm, values, interpolateMode) {\n if (!isNull(result)) { return result }\n if (this._missing) {\n var missingRet = this._missing.apply(null, [locale, key, vm, values]);\n if (isString(missingRet)) {\n return missingRet\n }\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn(\n \"Cannot translate the value of keypath '\" + key + \"'. \" +\n 'Use the value of keypath as default.'\n );\n }\n }\n\n if (this._formatFallbackMessages) {\n var parsedArgs = parseArgs.apply(void 0, values);\n return this._render(key, interpolateMode, parsedArgs.params, key)\n } else {\n return key\n }\n};\n\nVueI18n.prototype._isFallbackRoot = function _isFallbackRoot (val) {\n return (this._fallbackRootWithEmptyString? !val : isNull(val)) && !isNull(this._root) && this._fallbackRoot\n};\n\nVueI18n.prototype._isSilentFallbackWarn = function _isSilentFallbackWarn (key) {\n return this._silentFallbackWarn instanceof RegExp\n ? this._silentFallbackWarn.test(key)\n : this._silentFallbackWarn\n};\n\nVueI18n.prototype._isSilentFallback = function _isSilentFallback (locale, key) {\n return this._isSilentFallbackWarn(key) && (this._isFallbackRoot() || locale !== this.fallbackLocale)\n};\n\nVueI18n.prototype._isSilentTranslationWarn = function _isSilentTranslationWarn (key) {\n return this._silentTranslationWarn instanceof RegExp\n ? this._silentTranslationWarn.test(key)\n : this._silentTranslationWarn\n};\n\nVueI18n.prototype._interpolate = function _interpolate (\n locale,\n message,\n key,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n if (!message) { return null }\n\n var pathRet = this._path.getPathValue(message, key);\n if (isArray(pathRet) || isPlainObject(pathRet)) { return pathRet }\n\n var ret;\n if (isNull(pathRet)) {\n /* istanbul ignore else */\n if (isPlainObject(message)) {\n ret = message[key];\n if (!(isString(ret) || isFunction(ret))) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function !\"));\n }\n return null\n }\n } else {\n return null\n }\n } else {\n /* istanbul ignore else */\n if (isString(pathRet) || isFunction(pathRet)) {\n ret = pathRet;\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function!\"));\n }\n return null\n }\n }\n\n // Check for the existence of links within the translated string\n if (isString(ret) && (ret.indexOf('@:') >= 0 || ret.indexOf('@.') >= 0)) {\n ret = this._link(locale, message, ret, host, 'raw', values, visitedLinkStack);\n }\n\n return this._render(ret, interpolateMode, values, key)\n};\n\nVueI18n.prototype._link = function _link (\n locale,\n message,\n str,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n var ret = str;\n\n // Match all the links within the local\n // We are going to replace each of\n // them with its translation\n var matches = ret.match(linkKeyMatcher);\n\n // eslint-disable-next-line no-autofix/prefer-const\n for (var idx in matches) {\n // ie compatible: filter custom array\n // prototype method\n if (!matches.hasOwnProperty(idx)) {\n continue\n }\n var link = matches[idx];\n var linkKeyPrefixMatches = link.match(linkKeyPrefixMatcher);\n var linkPrefix = linkKeyPrefixMatches[0];\n var formatterName = linkKeyPrefixMatches[1];\n\n // Remove the leading @:, @.case: and the brackets\n var linkPlaceholder = link.replace(linkPrefix, '').replace(bracketsMatcher, '');\n\n if (includes(visitedLinkStack, linkPlaceholder)) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Circular reference found. \\\"\" + link + \"\\\" is already visited in the chain of \" + (visitedLinkStack.reverse().join(' <- '))));\n }\n return ret\n }\n visitedLinkStack.push(linkPlaceholder);\n\n // Translate the link\n var translated = this._interpolate(\n locale, message, linkPlaceholder, host,\n interpolateMode === 'raw' ? 'string' : interpolateMode,\n interpolateMode === 'raw' ? undefined : values,\n visitedLinkStack\n );\n\n if (this._isFallbackRoot(translated)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(linkPlaceholder)) {\n warn((\"Fall back to translate the link placeholder '\" + linkPlaceholder + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n var root = this._root.$i18n;\n translated = root._translate(\n root._getMessages(), root.locale, root.fallbackLocale,\n linkPlaceholder, host, interpolateMode, values\n );\n }\n translated = this._warnDefault(\n locale, linkPlaceholder, translated, host,\n isArray(values) ? values : [values],\n interpolateMode\n );\n\n if (this._modifiers.hasOwnProperty(formatterName)) {\n translated = this._modifiers[formatterName](translated);\n } else if (defaultModifiers.hasOwnProperty(formatterName)) {\n translated = defaultModifiers[formatterName](translated);\n }\n\n visitedLinkStack.pop();\n\n // Replace the link with the translated\n ret = !translated ? ret : ret.replace(link, translated);\n }\n\n return ret\n};\n\nVueI18n.prototype._createMessageContext = function _createMessageContext (values, formatter, path, interpolateMode) {\n var this$1 = this;\n\n var _list = isArray(values) ? values : [];\n var _named = isObject(values) ? values : {};\n var list = function (index) { return _list[index]; };\n var named = function (key) { return _named[key]; };\n var messages = this._getMessages();\n var locale = this.locale;\n\n return {\n list: list,\n named: named,\n values: values,\n formatter: formatter,\n path: path,\n messages: messages,\n locale: locale,\n linked: function (linkedKey) { return this$1._interpolate(locale, messages[locale] || {}, linkedKey, null, interpolateMode, undefined, [linkedKey]); }\n }\n};\n\nVueI18n.prototype._render = function _render (message, interpolateMode, values, path) {\n if (isFunction(message)) {\n return message(\n this._createMessageContext(values, this._formatter || defaultFormatter, path, interpolateMode)\n )\n }\n\n var ret = this._formatter.interpolate(message, values, path);\n\n // If the custom formatter refuses to work - apply the default one\n if (!ret) {\n ret = defaultFormatter.interpolate(message, values, path);\n }\n\n // if interpolateMode is **not** 'string' ('row'),\n // return the compiled data (e.g. ['foo', VNode, 'bar']) with formatter\n return interpolateMode === 'string' && !isString(ret) ? ret.join('') : ret\n};\n\nVueI18n.prototype._appendItemToChain = function _appendItemToChain (chain, item, blocks) {\n var follow = false;\n if (!includes(chain, item)) {\n follow = true;\n if (item) {\n follow = item[item.length - 1] !== '!';\n item = item.replace(/!/g, '');\n chain.push(item);\n if (blocks && blocks[item]) {\n follow = blocks[item];\n }\n }\n }\n return follow\n};\n\nVueI18n.prototype._appendLocaleToChain = function _appendLocaleToChain (chain, locale, blocks) {\n var follow;\n var tokens = locale.split('-');\n do {\n var item = tokens.join('-');\n follow = this._appendItemToChain(chain, item, blocks);\n tokens.splice(-1, 1);\n } while (tokens.length && (follow === true))\n return follow\n};\n\nVueI18n.prototype._appendBlockToChain = function _appendBlockToChain (chain, block, blocks) {\n var follow = true;\n for (var i = 0; (i < block.length) && (isBoolean(follow)); i++) {\n var locale = block[i];\n if (isString(locale)) {\n follow = this._appendLocaleToChain(chain, locale, blocks);\n }\n }\n return follow\n};\n\nVueI18n.prototype._getLocaleChain = function _getLocaleChain (start, fallbackLocale) {\n if (start === '') { return [] }\n\n if (!this._localeChainCache) {\n this._localeChainCache = {};\n }\n\n var chain = this._localeChainCache[start];\n if (!chain) {\n if (!fallbackLocale) {\n fallbackLocale = this.fallbackLocale;\n }\n chain = [];\n\n // first block defined by start\n var block = [start];\n\n // while any intervening block found\n while (isArray(block)) {\n block = this._appendBlockToChain(\n chain,\n block,\n fallbackLocale\n );\n }\n\n // last block defined by default\n var defaults;\n if (isArray(fallbackLocale)) {\n defaults = fallbackLocale;\n } else if (isObject(fallbackLocale)) {\n /* $FlowFixMe */\n if (fallbackLocale['default']) {\n defaults = fallbackLocale['default'];\n } else {\n defaults = null;\n }\n } else {\n defaults = fallbackLocale;\n }\n\n // convert defaults to array\n if (isString(defaults)) {\n block = [defaults];\n } else {\n block = defaults;\n }\n if (block) {\n this._appendBlockToChain(\n chain,\n block,\n null\n );\n }\n this._localeChainCache[start] = chain;\n }\n return chain\n};\n\nVueI18n.prototype._translate = function _translate (\n messages,\n locale,\n fallback,\n key,\n host,\n interpolateMode,\n args\n) {\n var chain = this._getLocaleChain(locale, fallback);\n var res;\n for (var i = 0; i < chain.length; i++) {\n var step = chain[i];\n res =\n this._interpolate(step, messages[step], key, host, interpolateMode, args, [key]);\n if (!isNull(res)) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with '\" + step + \"' locale.\"));\n }\n return res\n }\n }\n return null\n};\n\nVueI18n.prototype._t = function _t (key, _locale, messages, host) {\n var ref;\n\n var values = [], len = arguments.length - 4;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 4 ];\n if (!key) { return '' }\n\n var parsedArgs = parseArgs.apply(void 0, values);\n if(this._escapeParameterHtml) {\n parsedArgs.params = escapeParams(parsedArgs.params);\n }\n\n var locale = parsedArgs.locale || _locale;\n\n var ret = this._translate(\n messages, locale, this.fallbackLocale, key,\n host, 'string', parsedArgs.params\n );\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return (ref = this._root).$t.apply(ref, [ key ].concat( values ))\n } else {\n ret = this._warnDefault(locale, key, ret, host, values, 'string');\n if (this._postTranslation && ret !== null && ret !== undefined) {\n ret = this._postTranslation(ret, key);\n }\n return ret\n }\n};\n\nVueI18n.prototype.t = function t (key) {\n var ref;\n\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n return (ref = this)._t.apply(ref, [ key, this.locale, this._getMessages(), null ].concat( values ))\n};\n\nVueI18n.prototype._i = function _i (key, locale, messages, host, values) {\n var ret =\n this._translate(messages, locale, this.fallbackLocale, key, host, 'raw', values);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to interpolate the keypath '\" + key + \"' with root locale.\"));\n }\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.i(key, locale, values)\n } else {\n return this._warnDefault(locale, key, ret, host, [values], 'raw')\n }\n};\n\nVueI18n.prototype.i = function i (key, locale, values) {\n /* istanbul ignore if */\n if (!key) { return '' }\n\n if (!isString(locale)) {\n locale = this.locale;\n }\n\n return this._i(key, locale, this._getMessages(), null, values)\n};\n\nVueI18n.prototype._tc = function _tc (\n key,\n _locale,\n messages,\n host,\n choice\n) {\n var ref;\n\n var values = [], len = arguments.length - 5;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 5 ];\n if (!key) { return '' }\n if (choice === undefined) {\n choice = 1;\n }\n\n var predefined = { 'count': choice, 'n': choice };\n var parsedArgs = parseArgs.apply(void 0, values);\n parsedArgs.params = Object.assign(predefined, parsedArgs.params);\n values = parsedArgs.locale === null ? [parsedArgs.params] : [parsedArgs.locale, parsedArgs.params];\n return this.fetchChoice((ref = this)._t.apply(ref, [ key, _locale, messages, host ].concat( values )), choice)\n};\n\nVueI18n.prototype.fetchChoice = function fetchChoice (message, choice) {\n /* istanbul ignore if */\n if (!message || !isString(message)) { return null }\n var choices = message.split('|');\n\n choice = this.getChoiceIndex(choice, choices.length);\n if (!choices[choice]) { return message }\n return choices[choice].trim()\n};\n\nVueI18n.prototype.tc = function tc (key, choice) {\n var ref;\n\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n return (ref = this)._tc.apply(ref, [ key, this.locale, this._getMessages(), null, choice ].concat( values ))\n};\n\nVueI18n.prototype._te = function _te (key, locale, messages) {\n var args = [], len = arguments.length - 3;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ];\n\n var _locale = parseArgs.apply(void 0, args).locale || locale;\n return this._exist(messages[_locale], key)\n};\n\nVueI18n.prototype.te = function te (key, locale) {\n return this._te(key, this.locale, this._getMessages(), locale)\n};\n\nVueI18n.prototype.getLocaleMessage = function getLocaleMessage (locale) {\n return looseClone(this._vm.messages[locale] || {})\n};\n\nVueI18n.prototype.setLocaleMessage = function setLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, message);\n};\n\nVueI18n.prototype.mergeLocaleMessage = function mergeLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, merge(\n typeof this._vm.messages[locale] !== 'undefined' && Object.keys(this._vm.messages[locale]).length\n ? Object.assign({}, this._vm.messages[locale])\n : {},\n message\n ));\n};\n\nVueI18n.prototype.getDateTimeFormat = function getDateTimeFormat (locale) {\n return looseClone(this._vm.dateTimeFormats[locale] || {})\n};\n\nVueI18n.prototype.setDateTimeFormat = function setDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, format);\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype.mergeDateTimeFormat = function mergeDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, merge(this._vm.dateTimeFormats[locale] || {}, format));\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype._clearDateTimeFormat = function _clearDateTimeFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._dateTimeFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._dateTimeFormatters[id];\n }\n};\n\nVueI18n.prototype._localizeDateTime = function _localizeDateTime (\n value,\n locale,\n fallback,\n dateTimeFormats,\n key\n) {\n var _locale = locale;\n var formats = dateTimeFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = dateTimeFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' datetime formats from '\" + current + \"' datetime formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n var id = _locale + \"__\" + key;\n var formatter = this._dateTimeFormatters[id];\n if (!formatter) {\n formatter = this._dateTimeFormatters[id] = new Intl.DateTimeFormat(_locale, format);\n }\n return formatter.format(value)\n }\n};\n\nVueI18n.prototype._d = function _d (value, locale, key) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && !VueI18n.availabilities.dateTimeFormat) {\n warn('Cannot format a Date value due to not supported Intl.DateTimeFormat.');\n return ''\n }\n\n if (!key) {\n return new Intl.DateTimeFormat(locale).format(value)\n }\n\n var ret =\n this._localizeDateTime(value, locale, this.fallbackLocale, this._getDateTimeFormats(), key);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to datetime localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.d(value, key, locale)\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.d = function d (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._d(value, locale, key)\n};\n\nVueI18n.prototype.getNumberFormat = function getNumberFormat (locale) {\n return looseClone(this._vm.numberFormats[locale] || {})\n};\n\nVueI18n.prototype.setNumberFormat = function setNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, format);\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype.mergeNumberFormat = function mergeNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, merge(this._vm.numberFormats[locale] || {}, format));\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype._clearNumberFormat = function _clearNumberFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._numberFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._numberFormatters[id];\n }\n};\n\nVueI18n.prototype._getNumberFormatter = function _getNumberFormatter (\n value,\n locale,\n fallback,\n numberFormats,\n key,\n options\n) {\n var _locale = locale;\n var formats = numberFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = numberFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' number formats from '\" + current + \"' number formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n\n var formatter;\n if (options) {\n // If options specified - create one time number formatter\n formatter = new Intl.NumberFormat(_locale, Object.assign({}, format, options));\n } else {\n var id = _locale + \"__\" + key;\n formatter = this._numberFormatters[id];\n if (!formatter) {\n formatter = this._numberFormatters[id] = new Intl.NumberFormat(_locale, format);\n }\n }\n return formatter\n }\n};\n\nVueI18n.prototype._n = function _n (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format a Number value due to not supported Intl.NumberFormat.');\n }\n return ''\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.format(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.format(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to number localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.n(value, Object.assign({}, { key: key, locale: locale }, options))\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.n = function n (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n var options = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n\n // Filter out number format options only\n options = Object.keys(args[0]).reduce(function (acc, key) {\n var obj;\n\n if (includes(numberFormatKeys, key)) {\n return Object.assign({}, acc, ( obj = {}, obj[key] = args[0][key], obj ))\n }\n return acc\n }, null);\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._n(value, locale, key, options)\n};\n\nVueI18n.prototype._ntp = function _ntp (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format to parts a Number value due to not supported Intl.NumberFormat.');\n }\n return []\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.formatToParts(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.formatToParts(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to format number to parts of root: key '\" + key + \"' .\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n._ntp(value, locale, key, options)\n } else {\n return ret || []\n }\n};\n\nObject.defineProperties( VueI18n.prototype, prototypeAccessors );\n\nvar availabilities;\n// $FlowFixMe\nObject.defineProperty(VueI18n, 'availabilities', {\n get: function get () {\n if (!availabilities) {\n var intlDefined = typeof Intl !== 'undefined';\n availabilities = {\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\n };\n }\n\n return availabilities\n }\n});\n\nVueI18n.install = install;\nVueI18n.version = '8.27.0';\n\nexport default VueI18n;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"m-message-fade\",\"mode\":\"in-out\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.show),expression:\"show\"}],staticClass:\"m-message-wrapper\",class:_vm.wrapperClassName,style:({\r\n width: _vm.width\r\n })},[_c('mmessage',{class:[_vm.type && 'm-message--' + _vm.type, _vm.className],attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"closable\":_vm.showClose,\"is-collapsed\":_vm.isCollapsed,\"close-handler\":_vm.close,\"click-handler\":_vm.click,\"title\":_vm.title,\"supportHTML\":_vm.supportHTML},nativeOn:{\"mouseenter\":function($event){return _vm.clearTimer.apply(null, arguments)},\"mouseleave\":function($event){return _vm.startTimer.apply(null, arguments)}}},[_c('template',{slot:\"icon\"},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg}}):(_vm.type)?_c('icon',{staticClass:\"m-message--icon\",attrs:{\"name\":_vm.type}}):_vm._e()],1)],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.visible),expression:\"visible\"}],staticClass:\"m-message\"},[(_vm.iconImg || _vm.$slots.icon)?_c('div',{staticClass:\"m-message-icons\",on:{\"click\":_vm.handleClick}},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg,\"alt\":\"Img\"}}):_vm._t(\"icon\")],2):_vm._e(),_c('div',{staticClass:\"m-message-content\",on:{\"click\":_vm.handleClick}},[(_vm.title || _vm.$slots.title)?_c('div',{staticClass:\"m-message--title\"},[_vm._t(\"title\",function(){return [_vm._v(\" \"+_vm._s(_vm.title)+\" \")]})],2):_vm._e(),(_vm.event && _vm.chat)?_c('event',{attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"preview\":true}}):_c('div',{staticClass:\"m-message--body\"},[_vm._t(\"message\")],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./mmessage.vue?vue&type=template&id=03371e2c&\"\nimport script from \"./mmessage.vue?vue&type=script&lang=js&\"\nexport * from \"./mmessage.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","'use strict'\r\nconst icons = {}\r\n\r\nexport const addIcon = function (name, options) {\r\n icons[name] = options\r\n}\r\n\r\nconst Icon = {\r\n name: 'Icon',\r\n props: {\r\n name: String,\r\n color: String\r\n },\r\n computed: {\r\n svg () {\r\n return icons[this.name]\r\n }\r\n },\r\n // eslint-disable-next-line\r\n render (h) {\r\n const svg = this.svg\r\n\r\n if (!svg) {\r\n // eslint-disable-next-line\r\n console.warn(`The name of '${this.name}' could not be found.`)\r\n return ``\r\n }\r\n\r\n const style = {\r\n color: this.color ? this.color : (svg.fill ? svg.fill : null)\r\n }\r\n\r\n return (\r\n `\r\n \r\n { svg.defs && }\r\n { svg.path && }\r\n { svg.html && }\r\n {this.$slots.default}\r\n \r\n `\r\n )\r\n }\r\n}\r\n\r\nIcon.add = addIcon\r\n\r\nexport default Icon\r\n","export default {\r\n name: 'info',\r\n fill: '#1CADF2',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z'\r\n}\r\n","export default {\r\n name: 'success',\r\n fill: '#17B77E',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z'\r\n}\r\n","export default {\r\n name: 'error',\r\n fill: '#F56C6C',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z'\r\n}\r\n","export default {\r\n name: 'warning',\r\n fill: '#FFC603',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z'\r\n}\r\n","export default {\r\n name: 'loading',\r\n viewBox: '0 0 50 50',\r\n class: 'm-loading-icon m-loading-wipe',\r\n defs: ``,\r\n html: ''\r\n}\r\n","import Icon from './icon'\r\nimport InfoIcon from './svgs/info'\r\nimport SuccessIcon from './svgs/success'\r\nimport ErrorIcon from './svgs/error'\r\nimport WarningIcon from './svgs/warning'\r\nimport LoadingIcon from './svgs/loading'\r\n\r\nIcon.add(InfoIcon.name, InfoIcon)\r\nIcon.add(SuccessIcon.name, SuccessIcon)\r\nIcon.add(ErrorIcon.name, ErrorIcon)\r\nIcon.add(WarningIcon.name, WarningIcon)\r\nIcon.add(LoadingIcon.name, LoadingIcon)\r\n\r\nexport default Icon\r\n","\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./message-template.vue?vue&type=template&id=7da7e992&\"\nimport script from \"./message-template.vue?vue&type=script&lang=js&\"\nexport * from \"./message-template.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","import MessageTemplate from './message-template'\r\nimport Vue from 'vue'\r\nconst MessageConstructor = Vue.extend(MessageTemplate)\r\n\r\nconst instances = []\r\nlet count = 1\r\nconst containers = {}\r\n\r\nconst Message = function (options) {\r\n let userOnClose = options.onClose\r\n let userOnClick = options.onClick\r\n const position = options.position || 'top-center'\r\n const hasMask = options.hasMask || false\r\n const containerKey = position + (hasMask ? '-mask' : '')\r\n let containerEl = containers[containerKey]\r\n\r\n if (!containerEl) {\r\n containerEl = containers[containerKey] = document.createElement('div')\r\n containerEl.className = [\r\n 'm-message-container',\r\n 'is-' + position,\r\n hasMask ? 'has-mask' : ''\r\n ].filter(function (e) { return !!e }).join(' ')\r\n document.body.appendChild(containerEl)\r\n }\r\n\r\n if (options.zIndex) {\r\n containerEl.style.zIndex = options.zIndex\r\n }\r\n\r\n const id = count++\r\n options.onClose = function () {\r\n Message.close(id, userOnClose)\r\n }\r\n\r\n options.onClick = function () {\r\n Message.click(id, userOnClick, userOnClose)\r\n }\r\n\r\n const instance = new MessageConstructor({\r\n el: document.createElement('div'),\r\n data: options\r\n })\r\n\r\n instance.id = id\r\n instance.containerKey = containerKey\r\n\r\n // for position of bottom-*\r\n if (position.indexOf('bottom') === 0 && containerEl.firstChild) {\r\n containerEl.insertBefore(instance.$el, containerEl.firstChild)\r\n } else {\r\n containerEl.appendChild(instance.$el)\r\n }\r\n // 挂载后再设置显示才有过渡效果\r\n instance.show = true\r\n\r\n instances.push(instance)\r\n\r\n return instance\r\n}\r\n\r\nMessage.click = function (id, userOnClick, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClick === 'function') {\r\n userOnClick(instances[i])\r\n }\r\n \r\n }\r\n }\r\n\r\n Message.close(id, userOnClose)\r\n}\r\n\r\nMessage.close = function (id, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClose === 'function') {\r\n userOnClose(instances[i])\r\n }\r\n instances[i] = null\r\n instances.splice(i, 1)\r\n\r\n const index = instances.findIndex(function (e) {\r\n return e.containerKey === containerKey\r\n })\r\n // 如果开启遮罩,300ms 后移除容器(不移除白屏时间太长)\r\n if (hasMask && index === -1) {\r\n setTimeout(function () {\r\n containers[containerKey].remove()\r\n containers[containerKey] = null\r\n }, 300)\r\n }\r\n break\r\n }\r\n }\r\n\r\n setTimeout(function () {\r\n // 当前没有消息后,移除容器\r\n if (instances.length === 0) {\r\n for (let type in containers) {\r\n if (containers[type]) {\r\n containers[type].remove()\r\n containers[type] = null\r\n }\r\n }\r\n }\r\n }, 300)\r\n}\r\n\r\nMessage.closeAll = function () {\r\n for (let i = instances.length - 1; i >= 0; i--) {\r\n instances[i].close()\r\n }\r\n}\r\n\r\nconst types = [ 'info', 'success', 'error', 'warning', 'loading' ]\r\n\r\ntypes.forEach(type => {\r\n Message[type] = function (options) {\r\n options = typeof options === 'string' ? { message: options } : options\r\n return Message({ ...options, type })\r\n }\r\n})\r\n\r\nexport default Message\r\n","import Message from './message.js'\r\nimport MessageComponent from './mmessage.vue'\r\nimport './asd.css'\r\n\r\nMessage.install = function (Vue, options) {\r\n if (options && options.name) {\r\n Vue.prototype[`$${options.name}`] = Message\r\n } else {\r\n Vue.prototype.$message = Message\r\n }\r\n}\r\n\r\nexport const MMessage = MessageComponent\r\nexport default Message\r\n","import f from \"@/application/functions\";\r\n\r\nvar cachestorage = {}\r\n\r\nclass MTRXKIT {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n }\r\n\r\n tetatetchat(m_chat){\r\n if(!m_chat) return false\r\n \r\n if(typeof m_chat.tetatet != 'undefined') return m_chat.tetatet\r\n\r\n var users = this.core.mtrx.chatUsersInfo(m_chat.roomId)\r\n var tt = false\r\n\r\n if(users.length == 2){\r\n tt = m_chat.name == '#' + this.tetatetid(users[0], users[1])\r\n }\r\n if(users.length > 1) m_chat.tetatet = tt\r\n\r\n return tt\r\n }\r\n\r\n tetatetid(user1, user2) {\r\n\r\n var seed = 2;\r\n\r\n if(user1.id == user2.id) return null\r\n\r\n var id = parseInt(user1.id, 16) * parseInt(user2.id, 16) * seed\r\n\r\n if(cachestorage[id]) return cachestorage[id]\r\n\r\n var hash = f.sha224(id.toString()).toString('hex')\r\n\r\n cachestorage[id] = hash\r\n\r\n return hash\r\n }\r\n\r\n unknowngroupusers(m_chat){\r\n return m_chat && m_chat._selfMembership === 'invite' && !m_chat.summary.members && !this.tetatetchat(this.m_chat)\r\n }\r\n\r\n usersFromChats(m_chats){\r\n var users = {}\r\n \r\n _.each(m_chats, (chat) => {\r\n\r\n users[chat.roomId] = _.map(_.uniq([].concat(_.toArray(chat.currentState.members), chat.summary.members || []), (r) => {\r\n return r.userId\r\n\r\n }), function(r){\r\n\r\n return {\r\n userId : f.getmatrixid(r.userId),\r\n membership : r.membership,\r\n powerLevel : r.powerLevel\r\n }\r\n\r\n }) \r\n })\r\n\r\n\r\n\r\n return users\r\n }\r\n\r\n prepareChat(m_chat){\r\n\t\treturn this.usersInfoForChatsStore([m_chat]).then(() => {\r\n return this.core.pcrypto.addroom(m_chat)\r\n })\r\n\t}\r\n\r\n fillContacts(m_chats){\r\n\r\n m_chats = _.filter(m_chats, (ch) => {\r\n return ch._selfMembership == 'join' && ch.name.length == 57\r\n })\r\n\r\n return this.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n this.core.store.commit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n return !this.core.user.userinfo || m.id !== this.core.user.userinfo.id\r\n }))\r\n\r\n })\r\n }\r\n\r\n usersInfoForChatsStore(m_chats, reload){\r\n\r\n return this.usersInfoForChats(m_chats, reload).then(i => {\r\n\r\n this.core.store.commit('SET_CHATS_USERS', this.usersFromChats(m_chats))\r\n\r\n return Promise.resolve(i)\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n allchatmembers(m_chats, reload, withinvite){\r\n var members = []\r\n var promises = []\r\n\r\n\r\n if(withinvite){\r\n var promises = _.map(m_chats, (chat) => {\r\n\r\n\r\n if(chat._selfMembership === 'invite' && (!chat.summary.members || reload) && !chat.summary.membersloading){\r\n \r\n chat.summary.membersloading = true\r\n \r\n return chat._loadMembersFromServer().then(r => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n chat.summary.members = _.map(r, (user) => {\r\n \r\n return {\r\n name: f.getmatrixid(user.state_key),\r\n membership: user.content.membership,\r\n user: user,\r\n userId : user.state_key,\r\n powerLevel : user.content.powerLevel || 0\r\n }\r\n \r\n })\r\n \r\n if(chat._selfMembership === 'invite' && this.core.user.userinfo){\r\n \r\n if(!_.find(chat.summary.members, (m) => {\r\n return m.userId == this.core.user.matrixId(this.core.user.userinfo.id)\r\n } )){\r\n \r\n chat.summary.members.push({\r\n name: this.core.user.userinfo.id,\r\n membership: 'invite',\r\n user: this.core.user.userinfo,\r\n userId : this.core.user.matrixId(this.core.user.userinfo.id),\r\n powerLevel : 0\r\n })\r\n \r\n }\r\n \r\n }\r\n \r\n return Promise.resolve()\r\n \r\n }).catch(e => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n return Promise.resolve()\r\n })\r\n }\r\n \r\n return Promise.resolve()\r\n \r\n })\r\n }\r\n\r\n return Promise.all(promises).then(r => {\r\n\r\n _.each(m_chats, (chat) => {\r\n members = members.concat(_.toArray(chat.currentState.members), chat.summary.members || [])\r\n })\r\n\r\n members = _.uniq(members, function(m){\r\n return m.userId\r\n })\r\n\r\n return Promise.resolve(members)\r\n })\r\n }\r\n\r\n usersInfoForChats(m_chats, reload) {\r\n\r\n /// TODO FILTER CONTACTS\r\n\r\n return this.allchatmembers(m_chats, reload).then(members => {\r\n\r\n return this.usersInfo(members, reload)\r\n })\r\n \r\n }\r\n\r\n usersInfoById(id) {\r\n\r\n var ids = [f.getmatrixid(id)]\r\n\r\n return this.core.user.usersInfo(ids, false).then( r => {\r\n return Promise.resolve(r[0])\r\n })\r\n }\r\n\r\n usersInfo(members, reload) {\r\n\r\n var ids = _.map(members, function (m) {\r\n return f.getmatrixid(m.userId)\r\n })\r\n\r\n ids = _.uniq(ids)\r\n\r\n return this.core.user.usersInfo(ids, false, reload)\r\n }\r\n\r\n groupId(users) {\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n users.forEach( (user) => {\r\n idForInviting.push( this.core.user.matrixId(user.id) )\r\n })\r\n\r\n users.forEach(function (user) {\r\n let idsForHash = parseInt(user.id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n\r\n return {hash: hash, idForInviting: idForInviting}\r\n\r\n }\r\n\r\n groupIdLight(ids) {\r\n\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n var domains = [null]\r\n\r\n if (window.chatinvitedomains) domains = [].concat(domains, window.chatinvitedomains)\r\n\r\n _.each(domains, (domain) => {\r\n\r\n _.each(ids, (id) => {\r\n idForInviting.push( this.core.user.matrixId(id, domain) )\r\n })\r\n\r\n })\r\n\r\n \r\n _.each(ids, (_id) => {\r\n let idsForHash = parseInt(_id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n return {hash: hash, idForInviting: idForInviting}\r\n }\r\n\r\n chatIsPublic(chat){\r\n var join_rules = chat.currentState.getStateEvents(\"m.room.join_rules\")\r\n\r\n return _.find(join_rules, (v) => {\r\n return f.deep(v, 'event.content.join_rule') == 'public'\r\n }) ? true : false\r\n }\r\n\r\n \r\n}\r\n\r\nexport default MTRXKIT","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * FingerprintJS v3.3.2 - Copyright (c) FingerprintJS, Inc, 2021 (https://fingerprintjs.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArrays } from 'tslib';\n\nvar version = \"3.3.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction forEachWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\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\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\" + selector + \"'\";\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var isFinalResultLoaded = function (loadResult) {\n return typeof loadResult !== 'function';\n };\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n var sourceGetters = Array(includedSources.length);\n // Using `forEachWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n forEachWithBreaks(includedSources, function (sourceKey, index) {\n sourceGetters[index] = loadSource(sources[sourceKey], sourceOptions);\n });\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var components, _i, includedSources_1, sourceKey, componentPromises, _loop_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n components = {};\n for (_i = 0, includedSources_1 = includedSources; _i < includedSources_1.length; _i++) {\n sourceKey = includedSources_1[_i];\n components[sourceKey] = undefined;\n }\n componentPromises = Array(includedSources.length);\n _loop_1 = function () {\n var hasAllComponentPromises;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n hasAllComponentPromises = true;\n return [4 /*yield*/, forEachWithBreaks(includedSources, function (sourceKey, index) {\n if (!componentPromises[index]) {\n // `sourceGetters` may be incomplete at this point of execution because `forEachWithBreaks` is asynchronous\n if (sourceGetters[index]) {\n componentPromises[index] = sourceGetters[index]().then(function (component) { return (components[sourceKey] = component); });\n }\n else {\n hasAllComponentPromises = false;\n }\n }\n })];\n case 1:\n _a.sent();\n if (hasAllComponentPromises) {\n return [2 /*return*/, \"break\"];\n }\n return [4 /*yield*/, wait(1)]; // Lets the source load loop continue\n case 2:\n _a.sent(); // Lets the source load loop continue\n return [2 /*return*/];\n }\n });\n };\n _a.label = 1;\n case 1: return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (state_1 === \"break\")\n return [3 /*break*/, 4];\n _a.label = 3;\n case 3: return [3 /*break*/, 1];\n case 4: return [4 /*yield*/, Promise.all(componentPromises)];\n case 5:\n _a.sent();\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprintjs.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* Timeout */ || error.name === \"suspended\" /* Suspended */) {\n return -3 /* Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n fingerprintPromise.catch(function () { return undefined; });\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n context.startRendering();\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n element.setAttribute(name_1, attributes[name_1].join(' '));\n }\n return element;\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\" + fontToDetect + \"',\" + baseFont);\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n return { winding: false, geometry: '', text: '' };\n }\n return {\n winding: doesSupportWinding(context),\n geometry: makeGeometryImage(canvas, context),\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n text: makeTextImage(canvas, context),\n };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction makeTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \" + String.fromCharCode(55357, 56835) /* 😃 */;\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n return save(canvas);\n}\nfunction makeGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n return save(canvas);\n}\nfunction save(canvas) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArrays(screenFrameBackup)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\" + (offset >= 0 ? '+' : '') + Math.abs(offset);\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * See docs/content_blockers.md to learn how to make the list\n */\nvar filters = {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n 'a[title=\"7naga poker\" i]',\n '[title=\"ALIENBOLA\" i]',\n ],\n abpvn: [\n '#quangcaomb',\n '.iosAdsiosAds-layout',\n '.quangcao',\n '[href^=\"https://r88.vn/\"]',\n '[href^=\"https://zbet.vn/\"]',\n ],\n adBlockFinland: [\n '.mainostila',\n '.sponsorit',\n '.ylamainos',\n 'a[href*=\"/clickthrgh.asp?\"]',\n 'a[href^=\"https://app.readpeak.com/ads\"]',\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n 'a[href^=\"http://g1.v.fwmrm.net/ad/\"]',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n ],\n adBlockWarningRemoval: ['#adblock-honeypot', '.adblocker-root', '.wp_adblock_detect'],\n adGuardAnnoyances: ['amp-embed[type=\"zen\"]', '.hs-sosyal', '#cookieconsentdiv', 'div[class^=\"app_gdpr\"]', '.as-oil'],\n adGuardBase: ['#ad-after', '#ad-p3', '.BetterJsPopOverlay', '#ad_300X250', '#bannerfloat22'],\n adGuardChinese: [\n '#piao_div_0[style*=\"width:140px;\"]',\n 'a[href*=\".ttz5.cn\"]',\n 'a[href*=\".yabovip2027.com/\"]',\n '.tm3all2h4b',\n '.cc5278_banner_ad',\n ],\n adGuardFrench: [\n '.zonepub',\n '[class*=\"_adLeaderboard\"]',\n '[id^=\"block-xiti_oas-\"]',\n 'a[href^=\"http://ptapjmp.com/\"]',\n 'a[href^=\"https://go.alvexo.com/\"]',\n ],\n adGuardGerman: [\n '.banneritemwerbung_head_1',\n '.boxstartwerbung',\n '.werbung3',\n 'a[href^=\"http://www.eis.de/index.phtml?refid=\"]',\n 'a[href^=\"https://www.tipico.com/?affiliateId=\"]',\n ],\n adGuardJapanese: [\n '#kauli_yad_1',\n '#ad-giftext',\n '#adsSPRBlock',\n 'a[href^=\"http://ad2.trafficgate.net/\"]',\n 'a[href^=\"http://www.rssad.jp/\"]',\n ],\n adGuardMobile: ['amp-auto-ads', '#mgid_iframe', '.amp_ad', 'amp-embed[type=\"24smi\"]', '#mgid_iframe1'],\n adGuardRussian: [\n 'a[href^=\"https://ya-distrib.ru/r/\"]',\n 'a[href^=\"https://ad.letmeads.com/\"]',\n '.reclama',\n 'div[id^=\"smi2adblock\"]',\n 'div[id^=\"AdFox_banner_\"]',\n ],\n adGuardSocial: [\n 'a[href^=\"//www.stumbleupon.com/submit?url=\"]',\n 'a[href^=\"//telegram.me/share/url?\"]',\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: [\n '#barraPublicidade',\n '#Publicidade',\n '#publiEspecial',\n '#queTooltip',\n '[href^=\"http://ads.glispa.com/\"]',\n ],\n adGuardTrackingProtection: [\n 'amp-embed[type=\"taboola\"]',\n '#qoo-counter',\n 'a[href^=\"http://click.hotlog.ru/\"]',\n 'a[href^=\"http://hitcounter.ru/top/stat.php\"]',\n 'a[href^=\"http://top.mail.ru/jump\"]',\n ],\n adGuardTurkish: [\n '#backkapat',\n '#reklami',\n 'a[href^=\"http://adserv.ontek.com.tr/\"]',\n 'a[href^=\"http://izlenzi.com/campaign/\"]',\n 'a[href^=\"http://www.installads.net/\"]',\n ],\n bulgarian: ['td#freenet_table_ads', '#adbody', '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: ['#AD_banner_bottom', '#Ads_google_02', '#N-ad-article-rightRail-1', '#ad-fullbanner2', '#ad-zone-2'],\n easyListChina: [\n 'a[href*=\".wensixuetang.com/\"]',\n 'A[href*=\"/hth107.com/\"]',\n '.appguide-wrap[onclick*=\"bcebos.com\"]',\n '.frontpageAdvM',\n '#taotaole',\n ],\n easyListCookie: ['#adtoniq-msg-bar', '#CoockiesPage', '#CookieModal_cookiemodal', '#DO_CC_PANEL', '#ShowCookie'],\n easyListCzechSlovak: ['#onlajny-stickers', '#reklamni-box', '.reklama-megaboard', '.sklik', '[id^=\"sklikReklama\"]'],\n easyListDutch: [\n '#advertentie',\n '#vipAdmarktBannerBlock',\n '.adstekst',\n 'a[href^=\"https://xltube.nl/click/\"]',\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n 'a[href^=\"http://www.hw-area.com/?dp=\"]',\n 'a[href^=\"https://ads.sunmaker.com/tracking.php?\"]',\n '.werbung-skyscraper2',\n '.bannergroup_werbung',\n '.ads_rechts',\n ],\n easyListItaly: [\n '.box_adv_annunci',\n '.sb-box-pubbliredazionale',\n 'a[href^=\"http://affiliazioniads.snai.it/\"]',\n 'a[href^=\"https://adserver.html.it/\"]',\n 'a[href^=\"https://affiliazioniads.snai.it/\"]',\n ],\n easyListLithuania: [\n '.reklamos_tarpas',\n '.reklamos_nuorodos',\n 'img[alt=\"Reklaminis skydelis\"]',\n 'img[alt=\"Dedikuoti.lt serveriai\"]',\n 'img[alt=\"Hostingas Serveriai.lt\"]',\n ],\n estonian: ['A[href*=\"http://pay4results24.eu\"]'],\n fanboyAnnoyances: [\n '#feedback-tab',\n '#taboola-below-article',\n '.feedburnerFeedBlock',\n '.widget-feedburner-counter',\n '[title=\"Subscribe to our blog\"]',\n ],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: [\n '.td-tags-and-social-wrapper-box',\n '.twitterContainer',\n '.youtube-social',\n 'a[title^=\"Like us on Facebook\"]',\n 'img[alt^=\"Share on Digg\"]',\n ],\n frellwitSwedish: [\n 'a[href*=\"casinopro.se\"][target=\"_blank\"]',\n 'a[href*=\"doktor-se.onelink.me\"]',\n 'article.category-samarbete',\n 'div.holidAds',\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n 'A[href*=\"adman.otenet.gr/click?\"]',\n 'A[href*=\"http://axiabanners.exodus.gr/\"]',\n 'A[href*=\"http://interactive.forthnet.gr/click?\"]',\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n 'A[href*=\"ad.eval.hu\"]',\n 'A[href*=\"ad.netmedia.hu\"]',\n 'A[href*=\"daserver.ultraweb.hu\"]',\n '#cemp_doboz',\n '.optimonk-iframe-container',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '.cookie-msg-info-container',\n '#cookies-policy-sticky',\n ],\n icelandicAbp: ['A[href^=\"/framework/resources/forms/ads.aspx\"]'],\n latvian: [\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 120px; height: 40px; overflow: hidden; position: relative;\"]',\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 88px; height: 31px; overflow: hidden; position: relative;\"]',\n ],\n listKr: [\n 'a[href*=\"//kingtoon.slnk.kr\"]',\n 'a[href*=\"//playdsb.com/kr\"]',\n 'div.logly-lift-adz',\n 'div[data-widget_id=\"ml6EJ074\"]',\n 'ins.daum_ddn_area',\n ],\n listeAr: [\n '.geminiLB1Ad',\n '.right-and-left-sponsers',\n 'a[href*=\".aflam.info\"]',\n 'a[href*=\"booraq.org\"]',\n 'a[href*=\"dubizzle.com/ar/?utm_source=\"]',\n ],\n listeFr: [\n 'a[href^=\"http://promo.vador.com/\"]',\n '#adcontainer_recherche',\n 'a[href*=\"weborama.fr/fcgi-bin/\"]',\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n '[href^=\"https://aff.sendhub.pl/\"]',\n 'a[href^=\"http://advmanager.techfun.pl/redirect/\"]',\n 'a[href^=\"http://www.trizer.pl/?utm_source\"]',\n 'div#skapiec_ad',\n ],\n ro: [\n 'a[href^=\"//afftrk.altex.ro/Counter/Click\"]',\n 'a[href^=\"/magazin/\"]',\n 'a[href^=\"https://blackfridaysales.ro/trk/shop/\"]',\n 'a[href^=\"https://event.2performant.com/events/click\"]',\n 'a[href^=\"https://l.profitshare.ro/\"]',\n ],\n ruAd: [\n 'a[href*=\"//febrare.ru/\"]',\n 'a[href*=\"//utimg.ru/\"]',\n 'a[href*=\"://chikidiki.ru\"]',\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: ['a[href*=macau-uta-popup]', '#ads-google-middle_rectangle-group', '.ads300s', '.bumq', '.img-kosana'],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n '.ctpl-fullbanner',\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n};\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var debug = (_a === void 0 ? {} : _a).debug;\n return __awaiter(this, void 0, void 0, function () {\n var filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filterNames = Object.keys(filters);\n allSelectors = (_b = []).concat.apply(_b, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _c.sent();\n if (debug) {\n printDebug(blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\" + filterName + \":\";\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \" + selector + \" \" + (blockedSelectors[selector] ? '🚫' : '➡️');\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(message + \"\\n```\");\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \" + gamut + \")\").matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch('inverted')) {\n return true;\n }\n if (doesMatch('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(inverted-colors: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$1('active')) {\n return true;\n }\n if (doesMatch$1('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(forced-colors: \" + value + \")\").matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \" + i + \")\").matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$3('reduce')) {\n return true;\n }\n if (doesMatch$3('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(prefers-reduced-motion: \" + value + \")\").matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch$4('high')) {\n return true;\n }\n if (doesMatch$4('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(dynamic-range: \" + value + \")\").matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = containerWidthPx + \"px\";\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\" + 1 / iframeWindow.devicePixelRatio;\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArrays(Array((containerWidthPx / 20) << 0)).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\" + proConfidenceScore) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\" + (result ? '|' : '') + componentKey.replace(/([:|\\\\])/g, '\\\\$1') + \":\" + value;\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \" + result.version + \"\\nuserAgent: \" + navigator.userAgent + \"\\ntimeBetweenLoadAndGet: \" + (startTime - creationTime) + \"\\nvisitorId: \" + result.visitorId + \"\\ncomponents: \" + componentsToDebugString(components) + \"\\n```\");\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.01) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://openfpcdn.io/fingerprintjs/v\" + version + \"/npm-monitoring\", true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport default index;\nexport { componentsToDebugString, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources };\n","const sdk = require('@/matrix-js-sdk');\r\n\r\nimport MTRXKIT from \"./mtrxkit\";\r\nimport f from \"./functions\";\r\nimport images from \"./utils/images\";\r\nimport FingerprintJS from '@fingerprintjs/fingerprintjs';\r\n\r\nimport qs from 'qs';\r\nimport fileSaver from 'file-saver';\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar axios = require('axios');\r\n\r\n\r\nclass MTRX {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n this.baseUrl = p.baseUrl\r\n this.ready = false\r\n this.error = false\r\n this.kit = new MTRXKIT(this.core, p)\r\n this.sdk = sdk\r\n this.sync = ''\r\n this.nd = false\r\n this.version = 4\r\n this.dversion = '2'\r\n this.backup = {}\r\n this.db = null\r\n\r\n this.customrequest = true\r\n\r\n this.devicekey = 'm8_device'\r\n }\r\n\r\n\r\n async setCredentials() {\r\n return this.core.user.matrixCredentials().then(credentials => {\r\n this.credentials = credentials\r\n return Promise.resolve(credentials)\r\n })\r\n\r\n }\r\n\r\n getDevices() {\r\n var devices = localStorage[this.devicekey] || ''\r\n\r\n if (devices) {\r\n try {\r\n var d = JSON.parse(devices)\r\n\r\n return d\r\n } catch (e) {\r\n }\r\n }\r\n\r\n return {}\r\n }\r\n\r\n setDevice(device, userkey) {\r\n\r\n var devices = this.getDevices()\r\n\r\n devices[userkey] = device\r\n\r\n localStorage[this.devicekey] = JSON.stringify(devices)\r\n localStorage.device_ = JSON.stringify(device)\r\n\r\n }\r\n\r\n getDevice(userkey) {\r\n // return localStorage.m8_device;\r\n // var devices = this.getDevices()\r\n // return devices[userkey] || null\r\n }\r\n\r\n request(opts, clbk) {\r\n\r\n var response = null;\r\n\r\n var error = null\r\n\r\n const cancelTokenSource = axios.CancelToken.source();\r\n\r\n var aopts = {\r\n url: opts.uri,\r\n params: opts.qs,\r\n data: JSON.parse(opts.body || \"{}\"),\r\n timeout: opts.timeout,\r\n headers: opts.headers,\r\n json: opts.json,\r\n method: opts.method,\r\n withCredentials: opts.withCredentials,\r\n _matrix_opts: opts,\r\n cancelToken: cancelTokenSource.token,\r\n\r\n paramsSerializer: function (params) {\r\n return qs.stringify(params, opts.qsStringifyOptions)\r\n },\r\n }\r\n\r\n var req = axios(aopts).then(response => {\r\n\r\n\r\n return Promise.resolve(response)\r\n }).catch(e => {\r\n\r\n error = e\r\n response = e.response\r\n\r\n return Promise.resolve(response)\r\n\r\n }).then(response => {\r\n\r\n var parsederror = error\r\n\r\n if (error) {\r\n\r\n try {\r\n parsederror = JSON.parse(f.deep(response, 'request.responseText'))\r\n\r\n error = new sdk.MatrixError(parsederror)\r\n\r\n } catch (e) {\r\n }\r\n\r\n //error.error = parsederror\r\n\r\n }\r\n\r\n clbk(error, response, f.deep(response, 'request.responseText') || '')\r\n\r\n /*if (error)\r\n return Promise.reject(parsederror)*/\r\n })\r\n\r\n req.abort = function () {\r\n cancelTokenSource.cancel();\r\n }\r\n\r\n return req\r\n\r\n /*\r\n uri\tstring\tThe complete URI.\r\n method\tstring\tThe HTTP method.\r\n qs\tObject\tThe query parameters to append to the URI.\r\n body\tObject\tThe JSON-serializable object.\r\n json\tboolean\tTrue if this is a JSON request.\r\n _matrix_opts\r\n */\r\n\r\n\r\n }\r\n\r\n async getFingerprint() {\r\n var fp = await FingerprintJS.load()\r\n var result = await fp.get()\r\n return result.visitorId + this.dversion\r\n }\r\n\r\n createMtrxClient(opts) {\r\n\r\n var client = sdk.createClient(opts);\r\n\r\n client.getProfileInfo = function () {\r\n return Promise.resolve({\r\n avatar_url: '',\r\n displayname: 'test'\r\n })\r\n }\r\n\r\n return client\r\n }\r\n\r\n async getClient() {\r\n\r\n await this.setCredentials();\r\n\r\n var userClientData = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n var opts = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n if (this.customrequest)\r\n opts.request = this.request\r\n\r\n var client = this.createMtrxClient(opts);\r\n\r\n\r\n try {\r\n var userData = await client.login('m.login.password', {\r\n user: this.credentials.username,\r\n password: this.credentials.password,\r\n })\r\n\r\n } catch (e) {\r\n\r\n if(e && e.indexOf && e.indexOf('M_USER_DEACTIVATED') > -1){\r\n this.error = 'M_USER_DEACTIVATED'\r\n return null\r\n }\r\n\r\n if (await client.isUsernameAvailable(this.credentials.username)) {\r\n\r\n userData = await client.register(\r\n this.credentials.username,\r\n this.credentials.password,\r\n null,\r\n {\r\n type: 'm.login.dummy',\r\n //signature : this.core.user.signature('matrix')\r\n }\r\n )\r\n\r\n } else {\r\n throw 'Signup error, username is not available: ' + e\r\n }\r\n }\r\n\r\n localStorage.accessToken = userData.access_token\r\n var store = new sdk.IndexedDBStore({\r\n indexedDB: window.indexedDB,\r\n dbName: 'matrix-js-sdk:' + this.credentials.username\r\n })\r\n await store.startup()\r\n\r\n Object.assign(userClientData, {\r\n userId: userData.user_id,\r\n accessToken: userData.access_token,\r\n unstableClientRelationAggregation: true,\r\n timelineSupport: true,\r\n store: store,\r\n\r\n // deviceId: userData.device_id,\r\n })\r\n\r\n if (this.customrequest)\r\n userClientData.request = this.request\r\n\r\n\r\n var userClient = this.createMtrxClient(userClientData)\r\n window.client = userClient\r\n window.core = this.core\r\n\r\n await userClient.startClient({\r\n pollTimeout: 60000,\r\n resolveInvitesToProfiles: true\r\n });\r\n\r\n\r\n this.access = userClientData\r\n\r\n this.client = userClient\r\n\r\n return userClient;\r\n }\r\n\r\n clearstorage(key) {\r\n var keys = Object.keys(localStorage), i = keys.length;\r\n\r\n while (i--) {\r\n if (keys[i] && keys[i].indexOf(key) == 0) {\r\n localStorage.removeItem(keys[i]);\r\n }\r\n }\r\n }\r\n\r\n clearstore() {\r\n\r\n var version = Number(localStorage.matrixversion || '0')\r\n\r\n if (version < this.version) {\r\n\r\n this.clearstorage('crypto.')\r\n this.clearstorage('session.')\r\n\r\n var keys = ['', '2', '3', '4', '5', '6', '8']\r\n\r\n _.each(keys, function (key) {\r\n delete localStorage['m' + key + '_device']\r\n })\r\n\r\n }\r\n\r\n localStorage.matrixversion = this.version\r\n }\r\n\r\n async createClient() {\r\n try {\r\n this.client = await this.getClient()\r\n this.store = this.client.store\r\n this.ready = true\r\n\r\n } catch (e) {\r\n this.error = e\r\n }\r\n\r\n\r\n return true\r\n }\r\n\r\n wait() {\r\n return f.pretry(() => {\r\n return this.ready\r\n }).then(() => {\r\n\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n waitchats() {\r\n\r\n return f.pretry(() => {\r\n\r\n return this.chatsready\r\n\r\n }).then(() => {\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n me(id) {\r\n return f.getmatrixid(id) == this.core.user.userinfo?.id\r\n }\r\n\r\n reciepts(event) {\r\n var room = null;\r\n\r\n return f.pretry(() => {\r\n\r\n var rooms = this.core.mtrx.store.rooms\r\n\r\n room = rooms[event.getRoomId()]\r\n\r\n return room\r\n\r\n }).then(() => {\r\n\r\n return room.getReceiptsForEvent(event)\r\n\r\n })\r\n }\r\n\r\n storeFileLocal(url, file){\r\n\r\n return file.arrayBuffer().then((arrayBuffer) => {\r\n const blob = new Blob([new Uint8Array(arrayBuffer)], {type: file.type });\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n return window.POCKETNETINSTANCE.storage.saveFile(url, blob);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n return this.db.set(url, blob)\r\n }\r\n }\r\n \r\n });\r\n \r\n \r\n }\r\n\r\n download(url) {\r\n\r\n // Function to download the file\r\n var dlFile = () => {\r\n return f.fetchLocal(url).then(response => {\r\n // Update the storage before returning\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n window.POCKETNETINSTANCE.storage.saveFile(url, response.data);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n this.db.set(url, response.data)\r\n }\r\n }\r\n\r\n return Promise.resolve(response.data);\r\n })\r\n }\r\n\r\n\r\n // Check if file is saved in the storage\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova) {\r\n return window.POCKETNETINSTANCE.storage.loadFile(url).then((file) => {\r\n return Promise.resolve(file);\r\n }, (e) => {\r\n\r\n // Nothing in storage, download file\r\n return dlFile();\r\n });\r\n } else {\r\n\r\n if(this.db){\r\n\r\n return this.db.get(url).then((file) => {\r\n\r\n return Promise.resolve(file);\r\n\r\n }).catch(() => {\r\n return dlFile();\r\n })\r\n \r\n }\r\n\r\n return dlFile();\r\n\r\n }\r\n \r\n \r\n }\r\n\r\n customRoomType(roomId) {\r\n var room = this.core.mtrx.client.getRoom(roomId)\r\n\r\n if (!room) return null\r\n\r\n var ev = room.currentState.getStateEvents(\"m.room.custom\", \"\") || {};\r\n\r\n return ev.event?.content.type\r\n\r\n }\r\n\r\n isReaded(event, me) {\r\n\r\n return this.reciepts(event).then(reciepts => {\r\n return Promise.resolve(\r\n _.find(reciepts, reciept => {\r\n var m = this.me(reciept.userId)\r\n\r\n\r\n return reciept.type == 'm.read' && ((me && m) || (!m && !me))\r\n })\r\n )\r\n })\r\n\r\n\r\n }\r\n\r\n initEvents() {\r\n\r\n let self = this\r\n\r\n let userId = this.core.mtrx.client.credentials.userId\r\n\r\n this.client.on(\"RoomMember.membership\", (event, member) => {\r\n\r\n\r\n if (!this.chatsready) return\r\n\r\n\r\n if ((member.membership === \"invite\" || member.membership === \"join\") && event.getSender() !== userId) {\r\n this.core.notifier.event(event)\r\n }\r\n\r\n });\r\n\r\n this.client.on(\"Room.timeline\", (message, member) => {\r\n\r\n if (!this.chatsready) return\r\n\r\n if (!message.event.content) return\r\n\r\n if (message.event.content.msgtype === 'm.file') {\r\n message.event.content.pbody = JSON.parse(message.event.content.body)\r\n }\r\n\r\n\r\n if (message.getSender() !== userId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(message.event.room_id)\r\n\r\n if (message.event.content['m.relates_to'] && message.event.content['m.relates_to'][\"rel_type\"] == 'm.replace') return false\r\n\r\n if (m_chat && this.core.pcrypto.rooms[message.event.room_id]) this.core.notifier.event(message, m_chat)\r\n\r\n }\r\n\r\n\r\n });\r\n\r\n this.client.on(\"RoomMember.typing\", (event, member) => {\r\n this.core.store.dispatch('TYPING_EVENT', member)\r\n });\r\n\r\n\r\n this.client.on('sync', (state, prevState, res) => {\r\n\r\n if (state === 'PREPARED') {\r\n this.setready()\r\n }\r\n\r\n this.core.store.dispatch('FETCH_CHATS').then(r => {\r\n this.core.store.dispatch('FETCH_EVENTS')\r\n this.core.store.commit('ALL_NOTIFICATIONS_COUNT', this.client.getRooms())\r\n })\r\n\r\n\r\n });\r\n\r\n }\r\n\r\n setready() {\r\n\r\n if (!this.chatsready) {\r\n this.chatsready = true\r\n this.core.store.commit('SET_CHATS_READY', true)\r\n }\r\n\r\n }\r\n\r\n initdb(){\r\n return ChatStorage('files', 1).then((db) => {\r\n this.db = db\r\n return Promise.resolve()\r\n }).catch(() => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n init() {\r\n return this.createClient().then(() => {\r\n\r\n if(this.error){\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return this.initdb()\r\n \r\n }).then(() => {\r\n\r\n this.initEvents()\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n deactivateAccount(){\r\n\r\n if (this.client) {\r\n return this.client.deactivateAccount(this.credentials, true)\r\n }\r\n\r\n return Promise.reject('noclient')\r\n }\r\n\r\n destroy() {\r\n if (this.client) {\r\n // Before client is stopped, delete the pusher if needed\r\n if (window.cordova) {\r\n this.deletePusher();\r\n }\r\n\r\n this.client.stopClient()\r\n }\r\n\r\n this.chatsready = false\r\n this.ready = false\r\n this.error = false\r\n }\r\n\r\n // Try to delete the current pusher if needed\r\n deletePusher() {\r\n // Try to get a saved token\r\n\r\n if (!window.cordova) return\r\n\r\n var savedToken;\r\n if (localStorage)\r\n savedToken = localStorage.getItem('fcmtoken5');\r\n if (savedToken && this.client.setPusher) {\r\n var appName = 'pocketnet';\r\n var pusherData = {\r\n app_display_name: appName,\r\n app_id: appName + window.cordova.platformId,\r\n\r\n data: {\r\n url: this.core.mtrx.baseUrl + '/_matrix/push/v1/notify',\r\n default_payload: {\r\n aps: {\r\n \"sound\": \"default\",\r\n \"content-available\": 1\r\n }\r\n }\r\n },\r\n\r\n device_display_name: window.device.manufacturer + \" \" + window.device.model,\r\n kind: null,\t// Set to null to delete the pusher\r\n lang: localStorage.getItem('loc') || 'en',\r\n pushkey: savedToken\r\n\r\n };\r\n\r\n this.core.mtrx.client.setPusher(pusherData).then(() => {\r\n localStorage.removeItem('fcmtoken5');\r\n }, (err) => {\r\n console.log(err);\r\n });\r\n }\r\n }\r\n\r\n uploadContent(file, save) {\r\n return this.client.uploadContent(file).then(src => {\r\n return Promise.resolve(this.core.mtrx.client.mxcUrlToHttp(src))\r\n }).then(url => {\r\n\r\n if(save){\r\n return this.storeFileLocal(url, file).then(() => {\r\n return Promise.resolve(url)\r\n }).catch(e => {\r\n return Promise.resolve(url)\r\n })\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n /*transaction(roomId, txId){\r\n this.client.sendEvent(roomId, \"m.room.message\", {\r\n\r\n txId: roomId,\r\n msgtype: \"m.notice\"\r\n\r\n }, \"\");\r\n }*/\r\n\r\n\r\n originalEvent(id, timeline) {\r\n var rtr = timeline._timelineSet.getRelationsForEvent(e.event.event_id, 'm.reference', 'm.room.message')\r\n\r\n if (rtr) {\r\n var events = rtr.getRelations()\r\n return events[0]\r\n }\r\n }\r\n\r\n clearEventId(event) {\r\n var previd = null\r\n\r\n if (\r\n event.event.content['m.relates_to'] &&\r\n event.event.content['m.relates_to']['rel_type'] == 'm.replace') previd = event.event.content['m.relates_to']['event_id']\r\n\r\n\r\n return previd || event.getId()\r\n\r\n }\r\n\r\n textEvent(chat, text) {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return chat.pcrypto.encryptEvent(text)\r\n }\r\n\r\n return Promise.resolve(this.sdk.ContentHelpers.makeTextMessage(text))\r\n }\r\n\r\n sendtext(chat, text, {relation, from}) {\r\n\r\n return this.textEvent(chat, text).then(r => {\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return this.client.sendEvent(chat.roomId, 'm.room.message', r)\r\n } else\r\n return this.client.sendMessage(chat.roomId, r)\r\n })\r\n\r\n\r\n }\r\n\r\n sendFile(chat, file, meta, {relation, from}, notenc) {\r\n\r\n if (!meta) meta = {}\r\n\r\n var fileInfo = {}\r\n fileInfo.name = file.name\r\n fileInfo.size = file.size\r\n\r\n var encpromise = (() => Promise.resolve(file))()\r\n var promise = null\r\n\r\n if (chat.pcrypto.canBeEncrypt() && !notenc) {\r\n\r\n encpromise = chat.pcrypto.encryptFile(file).then(r => {\r\n\r\n fileInfo.secrets = r.secrets\r\n\r\n return Promise.resolve(r.file)\r\n\r\n })\r\n\r\n }\r\n\r\n return encpromise.then(file => {\r\n\r\n promise = this.client.uploadContent(file)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n\r\n }).then(src => {\r\n\r\n if (meta.aborted)\r\n return Promise.reject('aborted')\r\n\r\n return Promise.resolve(this.client.mxcUrlToHttp(src))\r\n\r\n }).then((url) => {\r\n\r\n fileInfo.url = url\r\n\r\n let body = JSON.stringify(fileInfo)\r\n\r\n var r = {\r\n body: body,\r\n msgtype: 'm.file'\r\n }\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n return this.client.sendMessage(chat.roomId, r)\r\n\r\n })\r\n\r\n }\r\n\r\n sendImageBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendImage(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendAudioBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendAudio(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendImage(chat, base64, file, meta, {relation, from} = {}) {\r\n if (!file) return this.sendImageBase64(chat, base64, meta)\r\n\r\n var i = new images()\r\n var info = {}\r\n\r\n if (!meta) meta = {}\r\n\r\n return i.wh(base64).then(_info => {\r\n info = _info\r\n\r\n if (from)\r\n info.from = from\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return Promise.resolve(r.file)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve(file)\r\n\r\n\r\n }).then(file => {\r\n var promise = this.core.mtrx.uploadContent(file, true)\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((image) => {\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendImageMessage(chat.roomId, image, info, 'Image')\r\n })\r\n }\r\n\r\n sendAudio(chat, base64, file, meta, {relation, from} = {}) {\r\n\r\n\r\n if (!file) return this.sendAudioBase64(chat, base64, meta)\r\n\r\n \r\n let info = {}\r\n\r\n info.from = from\r\n\r\n return new Promise(resolve => {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return resolve(r.file)\r\n })\r\n }\r\n\r\n resolve(file) \r\n\r\n }).then(file => {\r\n\r\n let promise = this.core.mtrx.uploadContent(file, true)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((audio) => {\r\n\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendAudioMessage(chat.roomId, audio, info, 'Audio')\r\n })\r\n\r\n }\r\n\r\n async getFile(chat, event) {\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n\r\n return this.download(event.event.content.pbody.url).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return Promise.resolve({\r\n file: r,\r\n name: event.event.content.pbody.name\r\n });\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n async downloadFile(chat, event) {\r\n\r\n return this.getFile(chat, event).then(r => {\r\n\r\n if (window.cordova && f.saveFileCordova) {\r\n return new Promise((resolve, reject) => {\r\n\r\n f.saveFileCordova(r.file, r.name, function (i, e) {\r\n\r\n if (e) {\r\n console.error(e)\r\n }\r\n\r\n if (!e) resolve()\r\n\r\n else reject('unable')\r\n })\r\n })\r\n }\r\n\r\n return fileSaver.saveAs(r.file, r.name);\r\n\r\n }).catch(e => {\r\n console.error(e)\r\n return Promise.reject(e)\r\n })\r\n\r\n\r\n }\r\n\r\n async getAudioUnencrypt(chat, event){\r\n\r\n if(event.event.content.audioData){\r\n return Promise.resolve(event.event.content.audioData)\r\n }\r\n\r\n return this.download(event.event.content.url, true).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.content.audioData = arraybuffer\r\n\r\n return Promise.resolve(arraybuffer)\r\n })\r\n\r\n }\r\n\r\n async getAudio(chat, event) {\r\n\r\n if (event.event.decryptedAudio) {\r\n return Promise.resolve(event.event.decryptedAudio)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.decryptedAudio = arraybuffer\r\n\r\n return Promise.resolve(event.event.decryptedAudio)\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n }\r\n }\r\n\r\n async getImage(chat, event) {\r\n\r\n if (event.event.decryptedImage) {\r\n return Promise.resolve(event.event.decryptedImage)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n return f.Base64.fromFile(r)\r\n }).then(url => {\r\n\r\n event.event.decryptedImage = url.replace('data:file;', 'data:image/jpeg;')\r\n return Promise.resolve(event.event.decryptedImage)\r\n\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n }\r\n\r\n\r\n shareInChat(id, share) {\r\n var m_chat = this.client.getRoom(id)\r\n\r\n\r\n //// share.openwithItems []\r\n\r\n //// https://github.com/j3k0/cordova-plugin-openwith (item.type ---> resize)\r\n\r\n return this.core.mtrx.kit.prepareChat(m_chat).then(r => {\r\n\r\n var promises = []\r\n\r\n //// todo resize images.resize.fit\r\n _.each(share.images, (base64) => {\r\n\r\n var promise = this.sendImageBase64(m_chat, base64, {}, {from: share.from})\r\n\r\n promises.push(promise)\r\n\r\n })\r\n\r\n _.each(share.files, (file) => {\r\n\r\n promises.push(this.sendFile(m_chat, file, {}, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.urls, (url) => {\r\n\r\n promises.push(this.sendtext(m_chat, url, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.messages, (text) => {\r\n\r\n promises.push(this.sendtext(m_chat, text, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.audio, (arraybuffer) => {\r\n\r\n var base64 = 'data:audio/mpeg;base64,' + f._arrayBufferToBase64(arraybuffer)\r\n\r\n promises.push(this.sendAudioBase64(m_chat, base64,{}, {from: share.from}))\r\n\r\n })\r\n\r\n return Promise.all(promises)\r\n\r\n })\r\n }\r\n\r\n opencontact(contact) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: contact.name,\r\n type: 'contact',\r\n data: {\r\n contact: contact\r\n }\r\n })\r\n }\r\n\r\n complain(caption, p) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: caption,\r\n type: 'complain',\r\n data: p\r\n })\r\n }\r\n\r\n blockeduser(id) {\r\n\r\n if (!this.core.mtrx.client) return\r\n\r\n return this.core.mtrx.client.isUserIgnored(this.core.user.matrixId(id))\r\n }\r\n\r\n blockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList.push(userId)\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n fastsync = function () {\r\n\r\n var state = this.client.getSyncState()\r\n\r\n if (state === \"PREPARED\" || state === \"SYNCING\") {\r\n\r\n } else {\r\n return this.client.retryImmediately().catch(e => {\r\n console.log('fastsyncerror', e)\r\n })\r\n }\r\n\r\n\r\n }\r\n\r\n unblockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (!this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList = _.filter(blackList, function (_id) {\r\n return userId != _id\r\n })\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n chatUsersInfo(roomId, m) {\r\n\r\n if (!m) m = 'chatUsers'\r\n\r\n var _users = this.core.store.state.users\r\n\r\n return _.filter(_.map(this[m](roomId), (user) => {\r\n return _users[user.userId]\r\n }), function (u) {\r\n return u\r\n })\r\n\r\n }\r\n\r\n chatUsers(roomId) {\r\n return this.core.store.state.chatusers[roomId] || []\r\n }\r\n\r\n\r\n anotherChatUsers(roomId) {\r\n return _.filter(this.chatUsers(roomId), (user) => {\r\n return user.userId != this.core.user.userinfo.id\r\n })\r\n }\r\n}\r\n\r\nexport default MTRX\r\n","//require('ion-sound')\r\nimport f from \"./functions\";\r\n//const { Howl, Howler } = require('howler');\r\n\r\nclass Notifier {\r\n\r\n\tconstructor(core, p) {\r\n\t\tif (!p) p = {}\r\n\r\n\t\tthis.core = core\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\r\n\t\tthis.ion = null\r\n\r\n\t\tif (typeof ion != 'undefined') this.ion = ion\r\n\r\n\t\t/*ion.sound({\r\n\t\t sounds: [\r\n\t\t\t{\r\n\t\t\t name: \"glass\"\r\n\t\t\t}\r\n\t\t ],\r\n\t\t path: \"sounds/\",\r\n\t\t preload: true\r\n\t\t});*/\r\n\t}\r\n\r\n\tkey = 'showednotifications'\r\n\tshowed = {}\r\n\r\n\taddshowed(id) {\r\n\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\t\tthis.showed[id] = true\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\r\n\t}\r\n\r\n\tclearshowed() {\r\n\t\tthis.showed = {}\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\t}\r\n\r\n\tplaysound() {\r\n\t\t// If cordova is available, use the media plugin to play a sound\r\n\t\tif (window.Media && window.cordova && window.cordova.file && window.cordova.file.applicationDirectory) {\r\n\r\n\t\t\tvar soundSrc = window.cordova.file.applicationDirectory + 'www/sounds/glass.mp3';\r\n\t\t\tif (soundSrc.startsWith('file://'))\r\n\t\t\t\tsoundSrc = soundSrc.substring(7);\r\n\t\t\tvar notificationSound = new Media(soundSrc);\r\n\t\t\t// Play audio\r\n\t\t\tnotificationSound.play();\r\n\t\t}\r\n\r\n\t\t// Else, try to use the Howler sound plugin\r\n\t\telse if (window.ion) {\r\n\r\n\t\t\tion.sound.play('glass')\r\n\r\n\t\t\t/*var notificationSound = new Howl({\r\n\t\t\t\tsrc: ['sounds/glass.mp3'],\r\n\t\t\t\thtml5: true\r\n\t\t\t});\r\n\t\t\tnotificationSound.play();*/\r\n\t\t}\r\n\t}\r\n\r\n\tnotifySoundOrAction() {\r\n\r\n\t\tvar lastsounddate = localStorage['lastsounddate'] || null\r\n\r\n\t\tif (lastsounddate) {\r\n\t\t\tlastsounddate = new Date(lastsounddate)\r\n\r\n\t\t\tif (f.date.addseconds(lastsounddate, 10) > (new Date())) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlocalStorage['lastsounddate'] = (new Date())\r\n\r\n\t\tif (window.cordova && window.POCKETNETINSTANCE) {\r\n\t\t\twindow.POCKETNETINSTANCE.mobile.vibration.small()\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.playsound()\r\n\t\t}\r\n\t}\r\n\r\n\tdecrypt(event, chat) {\r\n\r\n\t\treturn this.core.mtrx.kit.prepareChat(chat).then(r => {\r\n\r\n\t\t\t\r\n\t\t\tif (event.event.decrypted) {\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}\r\n\r\n\t\t\treturn chat.pcrypto.decryptEvent(event.event)\r\n\t\t\t \r\n\t\t}).catch(e => {\r\n\t\t\treturn Promise.resolve()\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tmessage(event, user, chat) {\r\n\r\n\t\tvar state = this.core.vm.$store.state\r\n\r\n\r\n\t\tif (this.showed[event.event.event_id]) return\r\n\r\n\t\tthis.addshowed(event.event.event_id)\r\n\r\n\t\tvar external = f.deep(this, 'core.external.clbks.NOTIFICATION') || {}\r\n\t\tvar ctype = ''\r\n\r\n\t\tvar t = f.deep(event, 'event.type')\r\n\r\n\t\tif (['m.room.member'].indexOf(t) > -1) ctype = 'invite'\r\n\t\tif (['m.room.message'].indexOf(t) > -1) ctype = 'message'\r\n\t\tif (['m.room.name'].indexOf(t) > -1) ctype = ''\r\n\t\tif (['m.room.power_levels'].indexOf(t) > -1) ctype = 'moder'\r\n\t\tif (['m.room.redaction'].indexOf(t) > -1) ctype = 'redaction'\r\n\t\tif (f.deep(event, 'event.content.msgtype') == 'm.encrypted') ctype = 'encrypted'\r\n\r\n\t\tvar c = () => {\r\n\r\n\t\t\t\r\n\t\t\tvar msg = {\r\n\t\t\t\ttitle: user.name,\r\n\t\t\t\tevent: event,\r\n\t\t\t\tmessage: event.event.content.type == 'm.encrypted' ? \"***\" : event.event.content.body, // event.content.body,\r\n\t\t\t\troomId: event.event.room_id,\r\n\t\t\t\ticon: user.image,\r\n\t\t\t\tchat: chat,\r\n\t\t\t\tctype: ctype\r\n\t\t\t}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(msg)\r\n\t\t\t})\r\n\r\n\t\t\tif (state.currentRoom === event.event.room_id && !this.core.hiddenInParent) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.notifySoundOrAction()\r\n\t\t\tthis.show(msg, '/chat?id=' + event.event.room_id)\r\n\t\t}\r\n\r\n\t\tif (ctype == 'encrypted') {\r\n\t\t\tthis.decrypt(event, chat).then(c)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tc()\r\n\t\t}\r\n\r\n\r\n\t}\r\n\r\n\tevent(event, chat) {\r\n\t\tlet pushAction = this.core.mtrx.client.getPushActionsForEvent(event)\r\n\r\n\r\n\t\tif (!pushAction.notify) return\r\n\r\n\t\t//let timeFromNow = moment(moment.utc(event.event.origin_server_ts).toDate()).local().fromNow()\r\n\r\n\t\tvar date = moment(moment.utc(event.event.origin_server_ts).toDate()).local().toDate()\r\n\t\tvar iftime = f.date.addseconds(date, 10) > moment().toDate()\r\n\r\n\r\n\t\tif (!iftime) return\r\n\r\n\t\tthis.core.mtrx.isReaded(event, true).then(r => {\r\n\r\n\t\t\tif (r) return\r\n\r\n\t\t\tif (!this.core.mtrx.me(event.getSender()) && event.getSender() && event.getSender() !== this.core.mtrx.client.credentials.userId) {\r\n\r\n\r\n\t\t\t\tthis.core.user.usersInfo([f.getmatrixid(event.getSender())]).then(info => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tinfo && info[0]\r\n\t\t\t\t\t) {\r\n\r\n\r\n\t\t\t\t\t\tthis.message(event, info[0], chat)\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tshow = function (info, click) {\r\n\t\tif (typeof click != 'function') {\r\n\t\t\tvar route = click\r\n\t\t\tclick = () => {\r\n\t\t\t\tthis.core.vm.$router.push(route).catch(e => {})\r\n\r\n\t\t\t\tif (this.core.apptochat) this.core.apptochat()\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar position = \"bottom-right\";\r\n\r\n\t\tif (this.core.vm.$store.state.mobile) {\r\n\t\t\tposition = 'top-left'\r\n\t\t}\r\n\r\n\t\tthis.core.vm.$message({\r\n\t\t\tevent: info.event,\r\n\t\t\ttitle: info.title,\r\n\t\t\tmessage: info.message,\r\n\t\t\troomId: info.roomId,\r\n\t\t\ticonImg: info.icon || null,\r\n\t\t\tonClick: click,\r\n\t\t\tzIndex: 999,\r\n\t\t\tsupportHTML: true,\r\n\t\t\twrapperClassName: \"notificationWrapper\",\r\n\t\t\tposition: position,\r\n\t\t\ttype: 'info',\r\n\t\t\tchat: info.chat,\r\n\t\t\tduration: 5000\r\n\t\t})\r\n\t}\r\n}\r\n\r\nexport default Notifier","var Axios = require('axios');\r\nimport axiosRequest from '@nelsonomuto/axios-request-timeout';\r\nvar { error, byError } = require('./error')\r\n\r\nimport f from '@/application/functions'\r\nimport qs from 'qs';\r\n\r\nvar Axios = function(){\r\n\r\n var datakeys = [\r\n 'data.result'\r\n ]\r\n\r\n var errorkeys = [\r\n 'data.error'\r\n ]\r\n\r\n async function axios ({\r\n to : to,\r\n data : data\r\n }){\r\n\r\n data || (data = {})\r\n\r\n _.each(data, (v, i) => {\r\n if(_.isArray(v) || _.isObject(v)){\r\n data[i] = JSON.stringify(v)\r\n }\r\n }) \r\n\r\n var response = null;\r\n\r\n try{\r\n response = await axiosRequest({\r\n method: 'post',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n url: to,\r\n data: qs.stringify(data),\r\n timeout: 35000\r\n })\r\n\r\n }\r\n catch(e){\r\n response = e.response\r\n }\r\n \r\n\r\n if(!response){\r\n return Promise.reject('noresponse')\r\n }\r\n\r\n ////errors\r\n \r\n var ke = _.find(errorkeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (ke){\r\n return Promise.reject(byError(f.deep(response.data, ke)))\r\n }\r\n\r\n ////result\r\n\r\n var k = _.find(datakeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (k){\r\n return Promise.resolve(f.deep(response.data, k))\r\n }\r\n\r\n ////result\r\n \r\n return Promise.reject('error')\r\n \r\n\r\n }\r\n\r\n return {\r\n axios\r\n }\r\n\r\n}\r\n\r\nexport default Axios","import f from './functions'\r\nimport Axios from './axios'\r\nvar { error } = require('./error')\r\n\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar ApiWrapper = function (core) {\r\n\r\n\tvar self = this;\r\n\tvar a = new Axios();\r\n\r\n\tvar cache = {}\r\n\tvar loading = {}\r\n\tvar storages = {}\r\n\r\n\tvar apis = {\r\n\t\tpocketnet : null\r\n\t}\r\n\r\n\tvar ep = function(){\r\n\t\treturn Promise.resolve()\r\n\t}\r\n\r\n\tvar getstorage = function(p){\r\n\r\n\t\tif(!storages[p.storage]){\r\n\t\t\treturn ChatStorage(p.storage, p.version || 1, p.time).then(storage => {\r\n\r\n\t\t\t\tstorages[p.storage] = storage\r\n\r\n\t\t\t\treturn Promise.resolve(storage)\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve(storages[p.storage])\r\n\t}\r\n\r\n\t\r\n\tvar scasheAct = function (ids, key, resultsKey, reload, storageparameters) {\r\n\r\n\t\tif (!_.isArray(ids)) ids = [ids]\r\n\r\n\t\tvar waitLoading = {}\r\n\r\n\t\tif(!resultsKey) \r\n\t\t\tresultsKey = key\r\n\r\n\t\tif(!cache[key]) {\r\n\t\t\tcache[key] = {}\r\n\t\t}\r\n\r\n\t\tif(!loading[key]) {\r\n\t\t\tloading[key] = {}\r\n\t\t}\r\n\r\n\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\r\n\t\t\tif (storage){\r\n\r\n\t\t\t\treturn Promise.all(_.map(ids, (id) => {\r\n\r\n\t\t\t\t\tif (cache[key][id]){\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn storage.get(id).then((stored) => {\r\n\t\t\t\t\t\tcache[key][stored[resultsKey]] = stored\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}))\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\r\n\t\t}).then(r => {\r\n\r\n\t\t\tvar idtoloadPrev = _.uniq(_.filter(ids, function (id) {\r\n\t\t\t\treturn reload || !cache[key][id] || cache[key][id].nocache\r\n\t\t\t}))\r\n\t\r\n\t\t\tvar idtoload = _.filter(idtoloadPrev, function (id) {\r\n\t\r\n\t\t\t\tif(!loading[key][id]) {\r\n\t\t\t\t\tloading[key][id] = true\r\n\t\t\t\t\treturn true\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\twaitLoading[id] = true\r\n\t\t\t})\r\n\t\r\n\t\t\tvar handleResults = function (result, _ids) {\r\n\r\n\t\t\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(storage){\r\n\t\t\t\t\t\treturn Promise.all(_.map(result, (row) => {\r\n\r\n\t\t\t\t\t\t\tif(!row[resultsKey]){\r\n\t\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn storage.set(row[resultsKey], row)\r\n\r\n\t\t\t\t\t\t}))\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(() => {\r\n\r\n\t\t\t\t\t_.each(result, function (row) {\r\n\r\n\t\t\t\t\t\tif (row[resultsKey]) {\r\n\t\t\t\t\t\t\tcache[key][row[resultsKey]] = row\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t_.each(_ids, function(id){\r\n\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\r\n\t\t\t\t\t\tif(!cache[key][id])\r\n\t\t\t\t\t\t\tcache[key][id] = 'error'\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\tvar nresult = {};\r\n\t\t\r\n\t\t\t\t\treturn f.pretry(() => {\r\n\t\t\r\n\t\t\t\t\t\t_.each(ids, function (id) {\r\n\t\t\r\n\t\t\t\t\t\t\tif (cache[key][id]) {\r\n\t\t\r\n\t\t\t\t\t\t\t\tif (cache[key][id] != 'error')\r\n\t\t\r\n\t\t\t\t\t\t\t\t\tnresult[id] = (cache[key][id])\r\n\t\t\r\n\t\t\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t\treturn _.toArray(waitLoading).length == 0\r\n\t\t\r\n\t\t\t\t\t}).then(() => {\r\n\t\t\t\t\t\treturn Promise.resolve(nresult)\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t})\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.resolve({\r\n\t\t\t\tid: idtoload,\r\n\t\t\t\thandle: handleResults\r\n\t\t\t})\r\n\t\t})\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t}\r\n\r\n\tvar waitonline = function () {\r\n\r\n\t\tif (!core || !core.waitonline) {\r\n\t\t\treturn Promise.resolve()\r\n\t\t}\r\n\r\n\t\treturn core.waitonline()\r\n\r\n\t}\r\n\r\n\tvar crequest = function (ids, key, rkey, reload, storageparameters) {\r\n\r\n\t\treturn scasheAct(ids, key, rkey, reload, storageparameters).then(sh => {\r\n\r\n\t\t\tif (!sh.id.length) {\r\n\t\t\t\treturn sh.handle([])\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.reject(sh)\r\n\r\n\t\t})\r\n\r\n\t\t\r\n\t}\r\n\r\n\tvar request = function (data, to) {\r\n\r\n\t\treturn waitonline().then(() => {\r\n\r\n\t\t\tdata || (data = {})\r\n\r\n\t\t\treturn a.axios({\r\n\t\t\t\tto,\r\n\t\t\t\tdata,\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\t\t\t\t.catch(e => {\r\n\r\n\t\t\t\t\tif (e == 'noresponse') {\r\n\r\n\t\t\t\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\trequest(data, to).then(r => {\r\n\r\n\r\n\t\t\t\t\t\t\t\t\treturn resolve(r)\r\n\r\n\t\t\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\t\t\treturn reject(e)\r\n\r\n\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t\t}, 3000)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\r\n\t\t})\r\n\r\n\r\n\t}\r\n\r\n\tself.clearCache = function (key) {\r\n\r\n\t\tif (!key) {\r\n\t\t\tcache = {}\r\n\t\t} else {\r\n\t\t\tdelete cache[key]\r\n\t\t}\r\n\t}\r\n\r\n\tself.pocketnet = {\r\n\r\n\t\tcommon: (data, method) => {\r\n\r\n\t\t\tif(!data) data = {}\r\n\r\n\t\t\tif(!apis.pocketnet)\r\n\t\t\t\tapis.pocketnet = f.deep(window, 'POCKETNETINSTANCE.api')\r\n\t\t\t\t\r\n\t\t\tif(!apis.pocketnet && typeof Api != 'undefined'){\r\n\t\t\t\tapis.pocketnet = new Api(core)\r\n\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\tif (apis.pocketnet) {\r\n\r\n\t\t\t\treturn apis.pocketnet.initIf().then(() => {\r\n\t\t\t\t\treturn apis.pocketnet.wait.ready('use', 3000)\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\treturn apis.pocketnet.rpc(method, data.parameters)\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\terror : e\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t})\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tdata.method = method\r\n\t\t\tdata.node = '185.148.147.15'\r\n\t\t\tdata.parameters = f.hexEncode(JSON.stringify(data.parameters || \"\"))\r\n\r\n\t\t\treturn request(data, servers.pocketnet + '/rpc-' + (method || \"common\"))\r\n\r\n\t\t},\r\n\t\t\r\n\t\tuserState: (addresses) => {\r\n\r\n\t\t\tif (!_.isArray(addresses)) addresses = [addresses]\r\n\r\n\t\t\tvar parameters = [addresses.join(',')];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserstate')\r\n\t\t},\r\n\r\n\t\tuserStateMe: (address) => {\r\n\r\n\t\t\tvar cacheresult = f.deep(window, 'POCKETNETINSTANCE.platform.sdk.ustate.storage.' + address)\r\n\r\n\t\t\tif(cacheresult){\r\n\t\t\t\treturn Promise.resolve(cacheresult)\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userState(address)\r\n\t\t},\r\n\r\n\t\tuserInfoCached: (addresses, reload) => {\r\n\r\n\t\t\tvar rescached = []\r\n\r\n\t\t\tif(!reload){\r\n\r\n\t\t\t\trescached = _.filter(_.map(addresses, (address) => {\r\n\t\t\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.sdk.userscl.storage.' + address) || null\r\n\t\t\t\t}), (u) => {return u})\r\n\r\n\t\t\t\taddresses = _.filter(addresses, (a) => {\r\n\t\t\t\t\treturn !_.find(rescached, (r) => {\r\n\t\t\t\t\t\treturn r.address == a\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userInfo(addresses, reload).then(rs => {\r\n\r\n\t\t\t\t\r\n\t\t\t\trs = _.toArray(rs)\r\n\r\n\t\t\t\t_.each(rescached, (c) => {\r\n\t\t\t\t\trs.push(c)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\treturn Promise.resolve(rs)\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tsearch: (text) => {\r\n\r\n\t\t\tvar parameters = [text, 'users'];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'searchusers').then(data => {\r\n\t\t\t\treturn Promise.resolve(data || [])\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tuserInfo: (addresses, reload) => {\r\n\r\n\t\t\tif(!addresses.length){\r\n\t\t\t\treturn Promise.resolve([])\r\n\t\t\t}\r\n\r\n\t\t\treturn crequest(addresses, 'pocketnet_userInfo', 'address', reload, {\r\n\t\t\t\tstorage : 'userInfo',\r\n\t\t\t\ttime : 60 * 60 * 24 \r\n\t\t\t}).catch(sh => {\r\n\r\n\t\t\t\tif(!sh || !sh.id) {\r\n\t\t\t\t\treturn Promise.reject(sh)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar parameters = [sh.id, '1'];\r\n\r\n\t\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\t\treturn sh.handle(results, sh.id)\r\n\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpostInfo: (params) => {\r\n\r\n\t\t\tvar parameters = [[params.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getrawtransactionwithmessagebyid').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileAddress: (profile_name) => {\r\n\r\n\t\t\tvar parameters = [[profile_name.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuseraddress').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileInfo: (profile_address) => {\r\n\r\n\t\t\tvar parameters = [[profile_address.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\r\n\t}\r\n\r\n\treturn self;\r\n}\r\n\r\nexport default ApiWrapper\r\n\r\n","import f from './functions';\r\n\r\nvar Media = function () {\r\n var self = this\r\n\r\n self.gettingmedia = false\r\n\r\n var permissions = {\r\n\r\n ios : {\r\n audio : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n window.audioinput.checkMicrophonePermission(function(hasPermission) {\r\n if (hasPermission) {\r\n \r\n resolve();\r\n } \r\n else {\t \r\n // Ask the user for permission to access the microphone\r\n window.audioinput.getMicrophonePermission(function(hasPermission, message) {\r\n if (hasPermission) {\r\n resolve()\r\n } else {\r\n reject('permissions')\r\n }\r\n });\r\n }\r\n });\r\n\r\n })\r\n \r\n },\r\n\r\n video : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n \r\n var needMic = true;\r\n var needCamera = true;\r\n\r\n cordova.plugins.iosrtc.requestPermission(needMic, needCamera, function (permissionApproved) {\r\n // permissionApproved will be true if user accepted permission otherwise will be false.\r\n if(permissionApproved) resolve()\r\n else reject('permissions')\r\n\r\n })\r\n\r\n })\r\n \r\n } \r\n },\r\n\r\n audio : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n var request = function(){\r\n permissions.requestPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n reject('permissions')\r\n\r\n });\r\n }\r\n\r\n permissions.checkPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else {\r\n request()\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n request()\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n },\r\n\r\n video : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n permissions.hasPermission(permissions.CAMERA, (status) => {\r\n\r\n if (status.hasPermission) {\r\n\r\n resolve()\r\n\r\n }\r\n else {\r\n\r\n permissions.requestPermission(permissions.CAMERA, () => {\r\n\r\n resolve()\r\n\r\n }, () => {\r\n\r\n reject('permissions')\r\n\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n }\r\n \r\n }\r\n\r\n var initPermissions = function(mediasettings){\r\n\r\n var callperm = function(f, setting){\r\n if (setting){\r\n return f()\r\n }\r\n else{\r\n return Promise.resolve()\r\n }\r\n }\r\n\r\n if(window.cordova && window.device){\r\n\r\n var ios = f.isios()\r\n\r\n return callperm(ios ? permissions.ios.audio : permissions.audio, mediasettings.audio).then(() => {\r\n return callperm(ios ? permissions.ios.video : permissions.video, mediasettings.video)\r\n }).catch(e => {\r\n console.error(\"E\", e)\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }\r\n\r\n var initMedia = function(mediasettings){\r\n\r\n return new Promise((resolve, reject)=> {\r\n\r\n\r\n initPermissions(mediasettings).then(() => {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n navigator.mediaDevices.getUserMedia(mediasettings).then(resolve).catch(reject);\r\n } else {\r\n (\r\n navigator.getUserMedia ||\r\n navigator.webkitGetUserMedia ||\r\n navigator.mozGetUserMedia ||\r\n navigator.msGetUserMedia\r\n )\r\n (mediasettings, resolve, reject);\r\n }\r\n\r\n }).catch(reject)\r\n\r\n })\r\n \r\n }\r\n \r\n self.get = function(mediasettings){\r\n\r\n return initMedia(mediasettings)\r\n\r\n }\r\n\r\n self.permissions = initPermissions\r\n\r\n}\r\n\r\n\r\nexport default Media","// Copied from https://github.com/chris-rudmin/Recorderjs\n\nexport default () => {\n let BYTES_PER_SAMPLE = 2\n\n let recorded = []\n\n function encode (buffer) {\n let length = buffer.length\n let data = new Uint8Array(length * BYTES_PER_SAMPLE)\n for (let i = 0; i < length; i++) {\n let index = i * BYTES_PER_SAMPLE\n let sample = buffer[i]\n if (sample > 1) {\n sample = 1\n } else if (sample < -1) {\n sample = -1\n }\n sample = sample * 32768\n data[index] = sample\n data[index + 1] = sample >> 8\n }\n recorded.push(data)\n }\n\n function dump (sampleRate) {\n let bufferLength = recorded.length ? recorded[0].length : 0\n let length = recorded.length * bufferLength\n let wav = new Uint8Array(44 + length)\n let view = new DataView(wav.buffer)\n\n // RIFF identifier 'RIFF'\n view.setUint32(0, 1380533830, false)\n // file length minus RIFF identifier length and file description length\n view.setUint32(4, 36 + length, true)\n // RIFF type 'WAVE'\n view.setUint32(8, 1463899717, false)\n // format chunk identifier 'fmt '\n view.setUint32(12, 1718449184, false)\n // format chunk length\n view.setUint32(16, 16, true)\n // sample format (raw)\n view.setUint16(20, 1, true)\n // channel count\n view.setUint16(22, 1, true)\n // sample rate\n view.setUint32(24, sampleRate, true)\n // byte rate (sample rate * block align)\n view.setUint32(28, sampleRate * BYTES_PER_SAMPLE, true)\n // block align (channel count * bytes per sample)\n view.setUint16(32, BYTES_PER_SAMPLE, true)\n // bits per sample\n view.setUint16(34, 8 * BYTES_PER_SAMPLE, true)\n // data chunk identifier 'data'\n view.setUint32(36, 1684108385, false)\n // data chunk length\n view.setUint32(40, length, true)\n\n // eslint-disable-next-line unicorn/no-for-loop\n for (let i = 0; i < recorded.length; i++) {\n wav.set(recorded[i], i * bufferLength + 44)\n }\n\n recorded = []\n postMessage(wav.buffer, [wav.buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else if (e.data[0] === 'dump') {\n dump(e.data[1])\n }\n }\n}\n","import waveEncoder from './wave-encoder/index.js'\n\nlet AudioContext = window.AudioContext || window.webkitAudioContext\n\nlet createWorker = fn => {\n let js = fn\n .toString()\n .replace(/^(\\(\\)\\s*=>|function\\s*\\(\\))\\s*{/, '')\n .replace(/}$/, '')\n let blob = new Blob([js])\n return new Worker(URL.createObjectURL(blob))\n}\n\nlet error = method => {\n let event = new Event('error')\n event.data = new Error('Wrong state for ' + method)\n return event\n}\n\nlet context\n\n/**\n * Audio Recorder with MediaRecorder API.\n *\n * @example\n * navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {\n * let recorder = new MediaRecorder(stream)\n * })\n */\nclass MediaRecorder {\n /**\n * @param {MediaStream} stream The audio stream to record.\n */\n constructor (stream, config = null) {\n /**\n * The `MediaStream` passed into the constructor.\n * @type {MediaStream}\n */\n this.stream = stream\n this.config = config\n /**\n * The current state of recording process.\n * @type {\"inactive\"|\"recording\"|\"paused\"}\n */\n this.state = 'inactive'\n\n this.em = document.createDocumentFragment()\n this.encoder = createWorker(MediaRecorder.encoder)\n\n let recorder = this\n this.encoder.addEventListener('message', e => {\n let event = new Event('dataavailable')\n event.data = new Blob([e.data], { type: recorder.mimeType })\n recorder.em.dispatchEvent(event)\n if (recorder.state === 'inactive') {\n recorder.em.dispatchEvent(new Event('stop'))\n }\n })\n }\n\n /**\n * Begins recording media.\n *\n * @param {number} [timeslice] The milliseconds to record into each `Blob`.\n * If this parameter isn’t included, single `Blob`\n * will be recorded.\n *\n * @return {undefined}\n *\n * @example\n * recordButton.addEventListener('click', () => {\n * recorder.start()\n * })\n */\n start (timeslice) {\n if (this.state !== 'inactive') {\n return this.em.dispatchEvent(error('start'))\n }\n\n this.state = 'recording'\n\n if (!context) {\n context = new AudioContext(this.config)\n }\n this.clone = this.stream.clone()\n this.input = context.createMediaStreamSource(this.clone)\n this.processor = context.createScriptProcessor(2048, 1, 1)\n\n this.encoder.postMessage(['init', context.sampleRate])\n\n this.processor.onaudioprocess = e => {\n if (this.state === 'recording') {\n this.encoder.postMessage(['encode', e.inputBuffer.getChannelData(0)])\n }\n }\n\n this.input.connect(this.processor)\n this.processor.connect(context.destination)\n\n this.em.dispatchEvent(new Event('start'))\n\n if (timeslice) {\n this.slicing = setInterval(() => {\n if (this.state === 'recording') this.requestData()\n }, timeslice)\n }\n\n return undefined\n }\n\n /**\n * Stop media capture and raise `dataavailable` event with recorded data.\n *\n * @return {undefined}\n *\n * @example\n * finishButton.addEventListener('click', () => {\n * recorder.stop()\n * })\n */\n stop () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('stop'))\n }\n\n this.requestData()\n this.state = 'inactive'\n this.clone.getTracks().forEach(track => {\n track.stop()\n })\n this.processor.disconnect()\n this.input.disconnect()\n return clearInterval(this.slicing)\n }\n\n /**\n * Pauses recording of media streams.\n *\n * @return {undefined}\n *\n * @example\n * pauseButton.addEventListener('click', () => {\n * recorder.pause()\n * })\n */\n pause () {\n if (this.state !== 'recording') {\n return this.em.dispatchEvent(error('pause'))\n }\n\n this.state = 'paused'\n return this.em.dispatchEvent(new Event('pause'))\n }\n\n /**\n * Resumes media recording when it has been previously paused.\n *\n * @return {undefined}\n *\n * @example\n * resumeButton.addEventListener('click', () => {\n * recorder.resume()\n * })\n */\n resume () {\n if (this.state !== 'paused') {\n return this.em.dispatchEvent(error('resume'))\n }\n\n this.state = 'recording'\n return this.em.dispatchEvent(new Event('resume'))\n }\n\n /**\n * Raise a `dataavailable` event containing the captured media.\n *\n * @return {undefined}\n *\n * @example\n * this.on('nextData', () => {\n * recorder.requestData()\n * })\n */\n requestData () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('requestData'))\n }\n\n return this.encoder.postMessage(['dump', context.sampleRate])\n }\n\n /**\n * Add listener for specified event type.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The listener function.\n *\n * @return {undefined}\n *\n * @example\n * recorder.addEventListener('dataavailable', e => {\n * audio.src = URL.createObjectURL(e.data)\n * })\n */\n addEventListener (...args) {\n this.em.addEventListener(...args)\n }\n\n /**\n * Remove event listener.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The same function used in `addEventListener`.\n *\n * @return {undefined}\n */\n removeEventListener (...args) {\n this.em.removeEventListener(...args)\n }\n\n /**\n * Calls each of the listeners registered for a given event.\n *\n * @param {Event} event The event object.\n *\n * @return {boolean} Is event was no canceled by any listener.\n */\n dispatchEvent (...args) {\n this.em.dispatchEvent(...args)\n }\n}\n\n/**\n * The MIME type that is being used for recording.\n * @type {string}\n */\nMediaRecorder.prototype.mimeType = 'audio/wav'\n\n/**\n * Returns `true` if the MIME type specified is one the polyfill can record.\n *\n * This polyfill supports `audio/wav` and `audio/mpeg`.\n *\n * @param {string} mimeType The mimeType to check.\n *\n * @return {boolean} `true` on `audio/wav` and `audio/mpeg` MIME type.\n */\nMediaRecorder.isTypeSupported = mimeType => {\n return MediaRecorder.prototype.mimeType === mimeType\n}\n\n/**\n * `true` if MediaRecorder can not be polyfilled in the current browser.\n * @type {boolean}\n *\n * @example\n * if (MediaRecorder.notSupported) {\n * showWarning('Audio recording is not supported in this browser')\n * }\n */\nMediaRecorder.notSupported = !navigator.mediaDevices || !AudioContext\n\n/**\n * Converts RAW audio buffer to compressed audio files.\n * It will be loaded to Web Worker.\n * By default, WAVE encoder will be used.\n * @type {function}\n *\n * @example\n * MediaRecorder.prototype.mimeType = 'audio/ogg'\n * MediaRecorder.encoder = oggEncoder\n */\nMediaRecorder.encoder = waveEncoder\n\nexport default MediaRecorder\n","\n\n\nexport default () => {\n importScripts(\n 'https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js'\n )\n\n let CHANNELS = 1\n let KBPS = 128\n let DEFAULT_SAMPLE_RATE = 44100\n\n let encoder\n let recorded = new Int8Array()\n\n function concat (a, b) {\n if (b.length === 0) {\n return a\n }\n let c = new Int8Array(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n\n function init (sampleRate) {\n encoder = new lamejs.Mp3Encoder(\n CHANNELS,\n sampleRate || DEFAULT_SAMPLE_RATE,\n KBPS\n )\n }\n\n function encode (buffer) {\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = buffer[i] * 32767.5\n }\n\n let buf = encoder.encodeBuffer(buffer)\n recorded = concat(recorded, buf)\n }\n\n function dump () {\n let buf = encoder.flush()\n recorded = concat(recorded, buf)\n let buffer = recorded.buffer\n recorded = new Int8Array()\n postMessage(buffer, [buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'init') {\n init(e.data[1])\n } else if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else {\n dump(e.data[1])\n }\n }\n}\n","\r\n\r\nimport MTRX from \"./mtrx.js\";\r\nimport Notifier from \"./notifier.js\";\r\nimport PNUser from \"./user/pnuser.js\";\r\nimport ApiWrapper from \"./api.js\";\r\nimport Pcrypto from \"./pcrypto.js\";\r\nimport listeners from './listeners'\r\nimport f from './functions'\r\nimport Media from './media'\r\n/*\r\nimport pcm from '@/application/utils/pcm.js'\r\nlet Mp3 = require('js-mp3');\r\n*/\r\n/*\r\nvar {register} = require('extendable-media-recorder')\r\nvar {connect} = require('extendable-media-recorder-wav-encoder')*/\r\n\r\n\r\nimport AudioRecorder from 'audio-recorder-polyfill'\r\nimport mpegEncoder from 'audio-recorder-polyfill/mpeg-encoder'\r\n\r\nAudioRecorder.encoder = mpegEncoder\r\nAudioRecorder.prototype.mimeType = 'audio/mpeg'\r\n\r\n\r\n\r\n\r\nclass Core {\r\n constructor(vm, p){\r\n if(!p) p = {}\r\n\r\n this.options = {\r\n listofproxies : p.listofproxies\r\n }\r\n\r\n if(!p.mtrx) p.mtrx = {}\r\n p.mtrx.baseUrl = 'https://' + p.domain\r\n\r\n if (p.mtrx.baseUrl == 'https://test.matrix.pocketnet.app'){\r\n \r\n this.options.burn = {\r\n v : 'minutes',\r\n w : 120,\r\n m : 30,\r\n b : 15\r\n }\r\n }\r\n else{\r\n this.options.burn = {\r\n v : 'days',\r\n w : 7,\r\n m : 2,\r\n b : 1\r\n }\r\n }\r\n\r\n \r\n\r\n this.apiHandlers = {\r\n error : function(){},\r\n success : function(){}\r\n }\r\n\r\n this.domain = p.domain\r\n\r\n this.vm = vm\r\n this.mtrx = new MTRX(this, p.mtrx)\r\n this.user = new PNUser(this, p.user || {})\r\n this.notifier = new Notifier(this, p.notifier || {})\r\n this.pcrypto = new Pcrypto(this, p.pcrypto || {})\r\n this.api = new ApiWrapper(this, p.servers)\r\n\r\n this.onlineListener = new listeners.online(this)\r\n this.focusListener = new listeners.focus(this)\r\n this.online = true\r\n this.focus = true\r\n this.store = vm.$store\r\n this.loading = true\r\n\r\n this.external = {}\r\n this.hiddenInParent = false\r\n\r\n this.customRecorderConnected = false\r\n\r\n this.pcrypto.init(this.user)\r\n\r\n this.media = new Media()\r\n this.audioContext = null\r\n\r\n }\r\n\r\n hideOptimization = function(v){\r\n\r\n //this.hideOptimization = v\r\n this.store.commit('hideOptimization', v)\r\n\r\n }\r\n\r\n hideInParent = function(v){\r\n this.hiddenInParent = v\r\n this.store.commit('hiddenInParent', v)\r\n\r\n\r\n /*if(!v)\r\n this.store.commit('wasunhidden', true)*/\r\n }\r\n\r\n canback = function(){\r\n return this.store.state.gallery ? false : true\r\n }\r\n\r\n update = function({block}){\r\n\r\n this.pcrypto.set.block(block)\r\n }\r\n\r\n logerror = function(type, data){\r\n\r\n\r\n if (window.POCKETNETINSTANCE){\r\n\r\n window.POCKETNETINSTANCE.Logger.error({\r\n err: type,\r\n payload: data,\r\n code: 402,\r\n });\r\n\r\n }\r\n }\r\n\r\n destroy = function(){\r\n this.store.commit('clearall')\r\n this.removeEvents()\r\n\r\n if(!this.vm.$route.name != 'chats')\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n this.user.destroy()\r\n this.mtrx.destroy()\r\n this.pcrypto.destroy()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.unlink(this)\r\n }\r\n\r\n this.vm.$destroy();\r\n\r\n }\r\n\r\n init = function(){\r\n \r\n this.focusListener.init()\r\n this.onlineListener.init()\r\n\r\n this.initEvents()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.link(this)\r\n }\r\n }\r\n \r\n\r\n setUnauthorized = function(v){\r\n this.unauthorized = v\r\n this.store.commit('SET_UNAUTHORIZED', v)\r\n }\r\n\r\n initWithUserBase = function(){\r\n\r\n this.loading = true\r\n\r\n return this.user.checkCredentials().then(state => {\r\n\r\n return this.user.userInfo()\r\n\r\n }).then(r => {\r\n\r\n if(!r){\r\n return Promise.reject('unknown')\r\n }\r\n\r\n if(r.deleted){\r\n return Promise.reject('deleted')\r\n }\r\n\r\n return this.pcrypto.prepare()\r\n\r\n }).then(r => {\r\n\r\n return this.mtrx.init()\r\n\r\n }).then(r => {\r\n\r\n this.loading = false\r\n this.setUnauthorized(null)\r\n\r\n this.pcrypto.helpers.checkuser()\r\n\r\n if (f.deep(this.user,'userinfo.name'))\r\n this.mtrx.client.setDisplayName(f.deep(this.user,'userinfo.name'))\r\n\r\n return Promise.resolve()\r\n\r\n }).catch(e => {\r\n\r\n console.log(\"E\", e)\r\n \r\n this.loading = false\r\n\r\n if(e == 'unauthorized' || e == 'unknown' || e == 'deleted'){\r\n this.setUnauthorized(e)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n initWithUser = function(credentials){\r\n\r\n\r\n this.user.setCredentials(credentials)\r\n\r\n return this.initWithUserBase().then(() => {\r\n return this.user.initKeysProcess()\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n }\r\n\r\n waitonline = function(){\r\n\r\n if(this.online) return Promise.resolve()\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n f.retry(() => {\r\n return this.online;\r\n }, function () {\r\n\r\n resolve()\r\n\r\n }, 5)\r\n\r\n })\r\n\r\n\r\n }\r\n\r\n removeEvents = function(){\r\n delete this.focusListener.clbks.resume.core\r\n delete this.focusListener.clbks.pause.core\r\n delete this.onlineListener.clbks.online.core\r\n delete this.onlineListener.clbks.offline.core\r\n }\r\n\r\n initEvents = function(){\r\n this.focusListener.clbks.resume.core = (time) => {\r\n\r\n this.focus = this.focusListener.focus\r\n\r\n if(time > 60){\r\n }\r\n }\r\n\r\n this.focusListener.clbks.pause.core = () => {\r\n this.focus = this.focusListener.focus\r\n }\r\n\r\n this.onlineListener.clbks.online.core = (time) => {\r\n this.online = this.onlineListener.online\r\n }\r\n\r\n this.onlineListener.clbks.offline.core = () => {\r\n this.online = this.onlineListener.online\r\n }\r\n }\r\n\r\n externalLink = function(pobj){\r\n this.external = pobj\r\n\r\n }\r\n\r\n destroyExternalLink = function(){\r\n this.external = {}\r\n }\r\n\r\n currentTime = function () {\r\n var created = Math.floor((new Date().getTime()) / 1000)\r\n\r\n if (this.timeDifference) {\r\n created += this.timeDifference\r\n }\r\n\r\n return created;\r\n }\r\n\r\n wait = function(){\r\n return f.pretry(() => {\r\n\t\t\treturn !this.loading\r\n\t\t}).then(() => {\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t})\r\n }\r\n\r\n joinRoom(roomid){\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('JOINROOM', roomid)\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }).then(info => {\r\n\r\n if (this.store.state.chatsMap[roomid]){\r\n /// old chat\r\n this.vm.$router.push('/chat?id=' + roomid).catch(e => {})\r\n }\r\n else\r\n {\r\n this.store.commit('JOINROOM', roomid)\r\n this.vm.$router.push('/publicPreview?id=' + roomid).catch(e => {})\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n connect(address){\r\n\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('CONNECT', f.hexEncode(address))\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n else{\r\n return this.user.usersInfo([address], true)\r\n }\r\n\r\n }).then(info => {\r\n\r\n var roomId = this.mtrx.kit.tetatetid(info[0], this.user.userinfo)\r\n\r\n\r\n if(!roomId) return Promise.reject('roomId')\r\n\r\n if (this.store.state.chatsMap[roomId]){\r\n /// old chat\r\n\r\n this.gotoRoute('/chat?id=' + roomId)\r\n /*this.vm.$router.push('/chat?id=' + roomId).catch(e => {\r\n console.error('e', e)\r\n })*/\r\n }\r\n else\r\n {\r\n\r\n this.gotoRoute('/contact?id=' + f.hexEncode(address))\r\n //this.store.commit('CONTACT', roomId)\r\n //this.gotoRoute('/chat?id=' + roomId + '&u=' + f.hexEncode(address))\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n cancelshare(){\r\n this.store.commit('SHARE', null)\r\n\r\n return Promise.resolve()\r\n }\r\n\r\n share(share){\r\n\t\tthis.store.commit('SHARE', share)\r\n\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n return Promise.resolve()\r\n\t}\r\n\r\n goto(roomId){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push('/chat?id=' + roomId).catch(e => {});\r\n });\r\n }\r\n\r\n gotoRoute(route){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push(route).catch(e => {});\r\n });\r\n }\r\n\r\n updateUser(){\r\n \r\n return this.user.userInfo(true).then(r => {\r\n\r\n /*if (this.unauthorized){\r\n return this.initWithUserBase()\r\n }*/\r\n \r\n })\r\n }\r\n\r\n isactive(){\r\n return this.vm.$store.state.minimized && this.vm.$store.state.active && this.vm.$store.state.pocketnet\r\n } \r\n\r\n sitemessage(title){\r\n\r\n var position = \"bottom-right\";\r\n\r\n if (this.vm.$store.state.mobile){\r\n position = 'top-left'\r\n }\r\n \r\n this.vm.$message({\r\n title: title,\r\n zIndex: 999,\r\n supportHTML: true,\r\n wrapperClassName: \"notificationWrapper\",\r\n position: position,\r\n type: 'info',\r\n duration : 2000\r\n })\r\n }\r\n\r\n menu(v){\r\n\r\n this.store.commit('SET_MENU', v ? {\r\n\t\t\titems : v.items,\r\n\t\t\titem : v.item,\r\n handler : v.handler\r\n\t\t} : null)\r\n }\r\n\r\n invitepnt(){\r\n\r\n var ui = f.deep(this, 'user.userinfo.source')\r\n\r\n if(ui){\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.platform){\r\n \r\n if(this.backtoapp) this.backtoapp()\r\n\r\n window.POCKETNETINSTANCE.platform.ui.socialshare('welcome?connect=' + ui.address, {\r\n sharing : {\r\n image : '',\r\n images : [ui.i],\r\n title : this.vm.$i18n.t(\"caption.joinApp\"),\r\n html : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n },\r\n \r\n text : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n }\r\n \r\n },\r\n embedding : {\r\n type : 'connect',\r\n id : ui.address\r\n }\r\n })\r\n\r\n }\r\n else{\r\n var l = 'https://bastyon.com/welcome?connect=' + ui.address\r\n\r\n f.copytext(l)\r\n\r\n this.sitemessage('The link was copied successfully')\r\n }\r\n\r\n }\r\n\r\n else{\r\n this.sitemessage('The error was occuried')\r\n }\r\n\r\n \r\n }\r\n\r\n async convertAudioToBase64(blob) {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(blob)\r\n return new Promise(resolve => {\r\n reader.onloadend = () => {\r\n resolve(reader.result)\r\n }\r\n })\r\n }\r\n\r\n /*async connectCustomRecorder() {\r\n\r\n if (this.customRecorderConnected) return\r\n this.customRecorderConnected = true\r\n \r\n await register(await connect());\r\n \r\n }*/\r\n\r\n /*mp3ToWav(base64Audio){\r\n\r\n var mp3ArrayBuffer = f._base64ToArrayBuffer(base64Audio.split(',')[1])\r\n\r\n var decoder = Mp3.newDecoder(mp3ArrayBuffer);\r\n var pcmArrayBuffer = decoder.decode();\r\n\r\n var dataURI = new pcm({channels: 1, rate: 8000, depth: 8}).toWav(pcmArrayBuffer).encode();\r\n\r\n return dataURI\r\n\r\n }*/\r\n\r\n initMediaRecorder() {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n\r\n\r\n return this.media.get({ audio: true }).then(stream => {\r\n\r\n let mediaRecorder = new AudioRecorder(stream, { audioBitsPerSecond : 32000 })\r\n \r\n return mediaRecorder\r\n \r\n }).catch(function (err) {\r\n return Promise.reject(err)\r\n });\r\n\r\n } else {\r\n return Promise.reject()\r\n }\r\n }\r\n\r\n getAudioContext(){\r\n\r\n if(this.audioContext && this.audioContext.state != 'closed') {\r\n\r\n\r\n if(this.audioContext.state === \"suspended\") this.audioContext.resume()\r\n\r\n\r\n\r\n return this.audioContext\r\n }\r\n else{\r\n }\r\n\r\n this.audioContext = new (window.AudioContext || window.webkitAudioContext)() || null;\r\n\r\n if(f.isios() && window.unmute){\r\n unmute(this.audioContext, false, false);\r\n }\r\n\r\n return this.audioContext\r\n }\r\n}\r\n\r\nexport default Core\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"preloader\",\"platform\":_vm.platform}},[_vm._m(0)])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"variant \"},[_c('div',{staticClass:\"iospreloadercenter\"},[_c('div',{staticClass:\"spinner-eff spinner-eff-3\"},[_c('div',{staticClass:\"circle circle-1\"}),_c('div',{staticClass:\"circle circle-2\"}),_c('div',{staticClass:\"circle circle-3\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\nimport f from '@/application/functions'\r\nexport default {\r\n name: 'preloader',\r\n props: {\r\n },\r\n\r\n computed : mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active : state => state.active,\r\n platform : function(){\r\n return f.deep(window, 'device.platform') || 'browser'\r\n },\r\n })\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3e6353d6&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index_ex.sass?vue&type=style&index=0&id=3e6353d6&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3e6353d6\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"wai-fixedmessageicon\"}},[_c('div',{staticClass:\"wrapper\"},[_c('div',{staticClass:\"table\"},[_c('div',{staticClass:\"cell\"},[(_vm.icon)?_c('div',{staticClass:\"iconWrapper\"},[_c('sweetalert',{attrs:{\"icon\":_vm.icon}})],1):_vm._e(),(_vm.message)?_c('div',{staticClass:\"message\"},[_c('div',[_vm._v(_vm._s(_vm.message))])]):_vm._e()])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa\",style:(_vm.cssVars)},[(_vm.isIcon('error'))?_c('div',{staticClass:\"sa-error\"},[_vm._m(0),_c('div',{staticClass:\"sa-error-placeholder\"}),_c('div',{staticClass:\"sa-error-fix\"})]):(_vm.isIcon('warning'))?_c('div',{staticClass:\"sa-warning\"},[_c('div',{staticClass:\"sa-warning-body\"}),_c('div',{staticClass:\"sa-warning-dot\"})]):(_vm.isIcon('info'))?_c('div',{staticClass:\"sa-info\"},[_c('div',{staticClass:\"sa-info-body\"}),_c('div',{staticClass:\"sa-info-dot\"})]):(_vm.isIcon('loading'))?_c('div',{staticClass:\"sa-loading\"},[_c('div',{staticClass:\"sa-loading-body\"})]):_c('div',{staticClass:\"sa-success\"},[_c('div',{staticClass:\"sa-success-tip\"}),_c('div',{staticClass:\"sa-success-long\"}),_c('div',{staticClass:\"sa-success-placeholder\"}),_c('div',{staticClass:\"sa-success-fix\"})])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa-error-x\"},[_c('div',{staticClass:\"sa-error-left\"}),_c('div',{staticClass:\"sa-error-right\"})])}]\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=0635047f&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=0635047f&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0635047f\",\n null\n ,true\n)\n\nexport default component.exports","import { mapState } from 'vuex';\r\nimport sweetalert from '@/editedplugins/vue-sweetalert-icons/src/components/icon.vue'\r\nexport default {\r\n name: 'fixedmessageicon',\r\n props: {\r\n \r\n },\r\n\r\n components : {\r\n sweetalert\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n icon : {\r\n immediate: true,\r\n handler(){\r\n this.init()\r\n }\r\n }\r\n },\r\n\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n icon : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.icon : null\r\n },\r\n\r\n message : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.message : null\r\n },\r\n\r\n \r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n init : function(){\r\n var t = this\r\n\r\n const timeout = this.$store.state.icon?.timeout;\r\n\r\n if(this.$store.state.icon.manual) return\r\n\r\n setTimeout(function(){\r\n\r\n t.$store.commit('icon', null)\r\n\r\n }, timeout || 2000)\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1cf419f0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1cf419f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1cf419f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{attrs:{\"id\":\"wai-date\"}},[_vm._v(_vm._s(_vm.label))])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'date',\r\n props: ['date'],\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n label : function(){\r\n\r\n moment.locale(this.$i18n.locale)\r\n\r\n return moment(moment.utc(this.date).toDate()).local().fromNow();\r\n\r\n }\r\n }),\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=eb4df516&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=eb4df516&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"eb4df516\",\n null\n ,true\n)\n\nexport default component.exports","var render = function (_h,_vm) {var _c=_vm._c;return _c('div',{staticClass:\"userpic\"},[_c('div',{staticClass:\"userpicSquareWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\",class:_vm.props.status},[(_vm.props.userinfo.image)?_c('bgimage',{attrs:{\"src\":_vm.props.userinfo.image}}):_vm._e(),(!_vm.props.userinfo.image && _vm.props.userinfo.name && (_vm.props.status != 'blocked' && _vm.props.status != 'invite' && _vm.props.status != 'ban'))?_c('div',{staticClass:\"charAvatar\"},[_c('span',[_vm._v(_vm._s(_vm.props.userinfo.name.charAt(0)))])]):_vm._e(),_c('div',{staticClass:\"statusIcon\"},[(_vm.props.status == 'blocked' || _vm.props.status == 'ban')?_c('i',{staticClass:\"fas fa-ban\"}):_vm._e(),(_vm.props.status == 'invite')?_c('i',{staticClass:\"fas fa-user-plus\"}):_vm._e()])],1)])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nexport default {\r\n name: 'userpic',\r\n props: {\r\n userinfo: {\r\n type : Object,\r\n default : {}\r\n },\r\n status : ''\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=5034d1e2&scoped=true&functional=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=5034d1e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n true,\n injectStyles,\n \"5034d1e2\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.users)?_c('div',{staticClass:\"userspic\",class:{oneuser : _vm.users && _vm.users.length === 1}},[(_vm.users.length === 0)?_c('userpic',{attrs:{\"userinfo\":_vm.single,\"status\":_vm.single.status}}):_vm._e(),(_vm.users.length === 1)?_c('userpic',{attrs:{\"status\":_vm.status[_vm.users[0].id],\"userinfo\":_vm.users[0],\"unseen\":_vm.unseen}}):_vm._e(),(_vm.users.length > 1)?_c('many',{attrs:{\"slidesPerView\":_vm.slidesPerView,\"status\":_vm.status,\"userinfo\":_vm.users,\"unseen\":_vm.unseen}}):_vm._e(),(_vm.unseen)?_c('div',{staticClass:\"unseen\"},[_vm._v(\" \"+_vm._s(_vm.unseen > 99 ? '99' : _vm.unseen)+\" \")]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import many from '@/components/assets/userspic/many.vue'\r\n\r\nexport default {\r\n name: 'userspic',\r\n props: {\r\n users: Array,\r\n single: {},\r\n unseen: Number,\r\n slidesPerView: Number,\r\n status : {\r\n type : Object,\r\n default : {}\r\n }\r\n \r\n },\r\n\r\n data : function(){\r\n return {}\r\n },\r\n components: {\r\n many\r\n },\r\n\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=792279b0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=792279b0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"792279b0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"bgimage\",class:{loaded: _vm.loaded, hasimage : _vm.src},style:('background-image:url('+_vm.imageSrc+'); background-size: cover; background-position: center center; background-repeat: no-repeat')},[_vm._t(\"cnt\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./bgimage.vue?vue&type=template&id=5d20f73c&scoped=true&\"\nimport script from \"./bgimage.vue?vue&type=script&lang=js&\"\nexport * from \"./bgimage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"5d20f73c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"wai-logotype\"}},[_c('div',{staticClass:\"items\"},[_c('div',{staticClass:\"item\"},[_c('div',{staticClass:\"logo\"},[_c('img',{attrs:{\"src\":'img/ldpiwide-' + _vm.themeL + '.png'}})])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nvar bwl = {\r\n black : 'black',\r\n white : 'white',\r\n classic : 'white'\r\n\r\n}\r\n\r\nexport default {\r\n name: 'wai-logotype',\r\n props: {\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n themeL : function(state){\r\n return bwl[state.theme] || 'white'\r\n }\r\n }),\r\n\r\n methods : {\r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e33cd7cc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e33cd7cc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e33cd7cc\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"outer-div\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},on:{\"click\":function($event){$event.stopPropagation();}}},[(_vm.menuIsVisible && !_vm.hiddenInParent)?_c('div',{staticClass:\"dropdown\",class:{visible: _vm.menuIsVisible}},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.hidePopup),expression:\"hidePopup\"}],staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menuItems},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e(),_c('div',{staticClass:\"dropDownIcon\",on:{\"click\":_vm.onClickHandler}},[_c('i',{class:'icon ' + (_vm.icon || 'fas fa-ellipsis-h')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'dropdownMenu',\r\n props: {\r\n menuItems: {\r\n type: Array,\r\n required: true\r\n },\r\n\r\n rowObject: {\r\n type: Object,\r\n },\r\n\r\n icon : String\r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false,\r\n menuIsVisible: false,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n menuIsVisible: function(newValue) {\r\n this.$emit('menuIsVisible', newValue);\r\n }\r\n },\r\n\r\n computed: {\r\n\r\n dropdownWidthInner(){\r\n return this.dropdownWidth;\r\n },\r\n \r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n this.$emit('itemClicked', item, this.rowObject, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n });\r\n },\r\n onClickHandler() {\r\n this.menuIsVisible = !this.menuIsVisible;\r\n\r\n\r\n },\r\n hidePopup() {\r\n this.menuIsVisible = false;\r\n\r\n },\r\n showPopup() {\r\n \r\n this.menuIsVisible = true;\r\n\r\n\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e4f39dca&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e4f39dca&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e4f39dca\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"back\",on:{\"click\":_vm.click}},[_c('div',{staticClass:\"iconbutton\"},[_c('i',{class:(_vm.icon || 'fas fa-angle-left')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7e97eec1&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7e97eec1&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7e97eec1\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active, unauthorized: _vm.unauthorized, modalShowed : _vm.modalShowed ? true : false, mobile: _vm.mobile},attrs:{\"id\":\"maincontent\"},on:{\"mouseenter\":_vm.mouseenter,\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"headerSpacerWrapper\"},[_c('div',{staticClass:\"headerSpacerWrapperOvf\"},[_c('div',{ref:\"scrollable\",staticClass:\"headerSpacer\"},[_vm._t(\"content\",function(){return [_vm._v(\"   \")]})],2)]),_c('pmenu'),(_vm.modalShowed && _vm.modalShowed.data && !_vm.hiddenInParent)?_c('modal',{on:{\"close\":_vm.closeModal},scopedSlots:_vm._u([{key:\"header\",fn:function(){return [_vm._v(_vm._s(_vm.modalShowed.caption))]},proxy:true},{key:\"body\",fn:function(){return [_c('div',{staticClass:\"modalcommoncontent\"},[(_vm.modalShowed.type == 'complain')?_c('complain',{attrs:{\"p\":_vm.modalShowed.data}}):_vm._e(),(_vm.modalShowed.type == 'contact')?_c('contact',{attrs:{\"contact\":_vm.modalShowed.data.contact}}):_vm._e(),(_vm.modalShowed.type == 'showuserselect')?_c('contacts',{attrs:{\"users\":_vm.modalShowed.data.users,\"mode\":\"Select\"},on:{\"close\":_vm.closeModal,\"select\":function (contact) {_vm.modalShowed.data.userselected(contact); _vm.closeModal()}}}):_vm._e()],1)]},proxy:true},{key:\"footer\",fn:function(){return undefined},proxy:true}],null,false,3972288297)}):_vm._e(),(!_vm.unauthorized && _vm.rbackexp)?_c('div',{staticClass:\"expandp\",on:{\"click\":_vm.setactive,\"mousemove\":_vm.effect}},[_vm._m(0)]):_vm._e()],1),(_vm.iconshow)?_c('transition',{attrs:{\"name\":\"fade\"}},[_c('fixedmessageicon')],1):_vm._e()],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"etablew\"},[_c('div',{staticClass:\"etable table\"},[_c('div',[_c('i',{staticClass:\"fas fa-expand-arrows-alt\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'maincontent',\r\n props: {\r\n rbackexp : Boolean\r\n },\r\n\r\n components : {\r\n\r\n 'contact': () => import('@/components/contact/index.vue'),\r\n 'contacts': () => import('@/components/contacts/list/index.vue'),\r\n 'complain': () => import('@/components/complain/index.vue')\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n iconshow: function() {\r\n\t\t\treturn this.$store.state.icon ? true : false\r\n\t\t},\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n modalShowed : state => state.modalShowed,\r\n hiddenInParent : state => state.hiddenInParent,\r\n mobile : state => state.mobile,\r\n unauthorized : state => state.unauthorized\r\n }),\r\n\r\n methods : {\r\n setactive : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})\r\n this.$store.commit('setiteraction', true)\r\n },\r\n mouseenter : function(){\r\n /*this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})*/\r\n },\r\n\r\n mouseleave : function(){\r\n\r\n if (this.$store.state.autohide){\r\n this.$store.commit('active', false)\r\n }\r\n this.$store.commit('blockactive', {value : false, item : 'main'})\r\n },\r\n\r\n effect : function(e){\r\n /*const x = e.pageX - e.target.offsetLeft\r\n const y = e.pageY - e.target.offsetTop\r\n\r\n e.target.style.setProperty('--x', `${ x }px`)\r\n e.target.style.setProperty('--y', `${ y }px`)*/\r\n },\r\n\r\n closeModal : function(){\r\n this.$store.commit('setmodal', null)\r\n },\r\n\r\n scroll : function(v){\r\n this.$refs['scrollable'].scrollTop = v || 0\r\n },\r\n \r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a8a70f9c&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=a8a70f9c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a8a70f9c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"search\"}},[_c('div',{staticClass:\"searchWrapper\"},[_c('div',{staticClass:\"inputWrapper\"},[_c('input',{ref:\"input\",attrs:{\"placeholder\":_vm.placeholder || this.$i18n.t('caption.search'),\"type\":\"text\"},domProps:{\"value\":_vm.searchTxt},on:{\"keyup\":_vm.change,\"input\":_vm.change,\"focus\":_vm.focused,\"blur\":_vm.blured}})]),(!_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\"},[_c('i',{staticClass:\"fas fa-search\"})]):_vm._e(),(_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-times\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import {mapState} from 'vuex';\r\n// TODO IGOR' SEARCH ALL COMPONENTS\r\nexport default {\r\n name: 'search',\r\n props: {\r\n placeholder: String,\r\n minimize: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n isTyping: false,\r\n searchTxt: ''\r\n }\r\n\r\n },\r\n\r\n created: () => {\r\n\r\n },\r\n\r\n watch: {\r\n searchTxt : {\r\n handler : _.debounce(function() {\r\n\r\n var text = this.searchTxt.toLowerCase()\r\n this.$emit('search', text)\r\n \r\n }, 500)\r\n }\r\n },\r\n computed: mapState({\r\n auth: state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active: function (state) {\r\n return state.active || !this.minimize\r\n },\r\n }),\r\n\r\n methods: {\r\n change : function(event){\r\n this.searchTxt = event.target.value\r\n },\r\n\r\n clear : function(event){\r\n this.searchTxt = ''\r\n }, \r\n \r\n clickicon: function () {\r\n this.$refs['input'].focus()\r\n },\r\n\r\n blured: function () {\r\n this.$store.commit('blockactive', {value: false, item: 'input'})\r\n },\r\n\r\n focused: function () {\r\n this.$store.commit('blockactive', {value: true, item: 'input'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1774f2a8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1774f2a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1774f2a8\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"linepreloader\"}},[_c('span'),_c('span'),_c('span')])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'linepreloader',\r\n props: {\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=bcf20e38&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=bcf20e38&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"bcf20e38\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=01d24e5e&shadow\"\nimport script from \"./App.vue?vue&type=script&lang=js&shadow\"\nexport * from \"./App.vue?vue&type=script&lang=js&shadow\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./editedplugins/vue-m-message/dist/index.css?vue&type=style&index=0&lang=css&shadow\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&lang=sass&shadow\")\nif (style1.__inject__) style1.__inject__(context)\nvar style2 = require(\"./App.vue?vue&type=style&index=2&lang=css&shadow\")\nif (style2.__inject__) style2.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","import './setPublicPath'\nimport Vue from 'vue'\nimport wrap from '@vue/web-component-wrapper'\n\n// runtime shared by every component chunk\nimport 'css-loader/dist/runtime/api.js'\nimport 'vue-style-loader/lib/addStylesShadow'\nimport 'vue-loader/lib/runtime/componentNormalizer'\n\nimport matrixElement from '~root/src/App.vue?shadow'\nwindow.customElements.define('matrix-element', wrap(Vue, matrixElement))","var MD5 = require('md5.js')\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n","module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var a=r[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var a in e)n.d(t,a,function(r){return e[r]}.bind(null,a));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,\"a\",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p=\"\",n(n.s=0)}([function(e,r,n){\"use strict\";n.r(r),n.d(r,\"validateHTMLColorName\",(function(){return l})),n.d(r,\"validateHTMLColorSpecialName\",(function(){return i})),n.d(r,\"validateHTMLColorHex\",(function(){return u})),n.d(r,\"validateHTMLColorRgb\",(function(){return d})),n.d(r,\"validateHTMLColorHsl\",(function(){return f})),n.d(r,\"validateHTMLColorHwb\",(function(){return h})),n.d(r,\"validateHTMLColorLab\",(function(){return g})),n.d(r,\"validateHTMLColor\",(function(){return m}));const t=e=>e&&\"string\"==typeof e,a=[\"AliceBlue\",\"AntiqueWhite\",\"Aqua\",\"Aquamarine\",\"Azure\",\"Beige\",\"Bisque\",\"Black\",\"BlanchedAlmond\",\"Blue\",\"BlueViolet\",\"Brown\",\"BurlyWood\",\"CadetBlue\",\"Chartreuse\",\"Chocolate\",\"Coral\",\"CornflowerBlue\",\"Cornsilk\",\"Crimson\",\"Cyan\",\"DarkBlue\",\"DarkCyan\",\"DarkGoldenrod\",\"DarkGray\",\"DarkGreen\",\"DarkKhaki\",\"DarkMagenta\",\"DarkOliveGreen\",\"DarkOrange\",\"DarkOrchid\",\"DarkRed\",\"DarkSalmon\",\"DarkSeaGreen\",\"DarkSlateBlue\",\"DarkSlateGray\",\"DarkTurquoise\",\"DarkViolet\",\"DeepPink\",\"DeepSkyBlue\",\"DimGray\",\"DodgerBlue\",\"FireBrick\",\"FloralWhite\",\"ForestGreen\",\"Fuchsia\",\"Gainsboro\",\"GhostWhite\",\"Gold\",\"Goldenrod\",\"Gray\",\"Green\",\"GreenYellow\",\"HoneyDew\",\"HotPink\",\"IndianRed\",\"Indigo\",\"Ivory\",\"Khaki\",\"Lavender\",\"LavenderBlush\",\"LawnGreen\",\"LemonChiffon\",\"LightBlue\",\"LightCoral\",\"LightCyan\",\"LightGoldenrodYellow\",\"LightGray\",\"LightGreen\",\"LightPink\",\"LightSalmon\",\"LightSalmon\",\"LightSeaGreen\",\"LightSkyBlue\",\"LightSlateGray\",\"LightSteelBlue\",\"LightYellow\",\"Lime\",\"LimeGreen\",\"Linen\",\"Magenta\",\"Maroon\",\"MediumAquamarine\",\"MediumBlue\",\"MediumOrchid\",\"MediumPurple\",\"MediumSeaGreen\",\"MediumSlateBlue\",\"MediumSlateBlue\",\"MediumSpringGreen\",\"MediumTurquoise\",\"MediumVioletRed\",\"MidnightBlue\",\"MintCream\",\"MistyRose\",\"Moccasin\",\"NavajoWhite\",\"Navy\",\"OldLace\",\"Olive\",\"OliveDrab\",\"Orange\",\"OrangeRed\",\"Orchid\",\"PaleGoldenrod\",\"PaleGreen\",\"PaleTurquoise\",\"PaleVioletRed\",\"PapayaWhip\",\"PeachPuff\",\"Peru\",\"Pink\",\"Plum\",\"PowderBlue\",\"Purple\",\"RebeccaPurple\",\"Red\",\"RosyBrown\",\"RoyalBlue\",\"SaddleBrown\",\"Salmon\",\"SandyBrown\",\"SeaGreen\",\"SeaShell\",\"Sienna\",\"Silver\",\"SkyBlue\",\"SlateBlue\",\"SlateGray\",\"Snow\",\"SpringGreen\",\"SteelBlue\",\"Tan\",\"Teal\",\"Thistle\",\"Tomato\",\"Turquoise\",\"Violet\",\"Wheat\",\"White\",\"WhiteSmoke\",\"Yellow\",\"YellowGreen\"],o=[\"currentColor\",\"inherit\",\"transparent\"],l=e=>{let r=!1;return t(e)&&a.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},i=e=>{let r=!1;return t(e)&&o.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},u=e=>{if(t(e)){const r=/^#([\\da-f]{3}){1,2}$|^#([\\da-f]{4}){1,2}$/i;return e&&r.test(e)}},d=e=>{if(t(e)){const r=/(rgb)a?\\((\\s*\\d+%?\\s*?,?\\s*){2}(\\s*\\d+%?\\s*?,?\\s*\\)?)(\\s*,?\\s*\\/?\\s*(0?\\.?\\d+%?\\s*)?|1|0)?\\)$/i;return e&&r.test(e)}},s=\"(([0-9]|[1-9][0-9]|100)%)\",c=`\\\\s*?\\\\)?)(\\\\s*?(\\\\/?)\\\\s+${`(((${s}))|(0?(\\\\.\\\\d+)?)|1))?`}\\\\s*?\\\\)$`,f=e=>{if(t(e)){const r=new RegExp(`(hsl)a?\\\\((\\\\s*?(${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}|${\"(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)gra)\"}|${\"((([0-5])?\\\\.\\\\d+|6\\\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)\"}|${\"((0?(\\\\.\\\\d+)?|1)turn)\"})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})\\\\s*?\\\\)?)(\\\\s*?(\\\\/?|,?)\\\\s*?(((${s}))|(0?(\\\\.\\\\d+)?)|1))?\\\\)$`);return e&&r.test(e)}},h=e=>{if(t(e)){const r=new RegExp(`(hwb\\\\(\\\\s*?${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}\\\\s+)((0|${s})\\\\s+)((0|${s})${c}`);return e&&r.test(e)}},g=e=>{if(t(e)){const r=\"(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])(\\\\.\\\\d+)??|160))\",n=new RegExp(`(lab\\\\(\\\\s*?((\\\\d*(\\\\.\\\\d+)?)%)\\\\s+${r}\\\\s+${r}${c}`);return e&&n.test(e)}},m=e=>!!(e&&u(e)||d(e)||f(e)||h(e)||g(e));r.default=e=>!!(e&&u(e)||l(e)||i(e)||d(e)||f(e)||h(e)||g(e))}]);","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#teamroom.mobile[data-v-9b340a7a]{margin-bottom:10px}#teamroom[data-v-9b340a7a]:hover{cursor:pointer}#teamroom .teamChatWrapper[data-v-9b340a7a]{padding:.5em .25em;display:flex;align-items:center;transition:.3s}#teamroom .teamChatWrapper .iconWrapper[data-v-9b340a7a]{width:44px;display:flex;align-items:center;min-width:44px;height:44px;position:relative}#teamroom .teamChatWrapper .iconWrapper .logo[data-v-9b340a7a]{background-size:cover;background-position:50%;background-repeat:no-repeat;height:44px;width:44px;margin-left:0;margin-top:0;position:absolute;background:rgb(var(--text-on-bg-ac-color));border-radius:50%;padding-top:8px;text-align:center}#teamroom .teamChatWrapper .iconWrapper .logo img[data-v-9b340a7a]{width:28px;height:28px;margin:0 auto}#teamroom .teamChatWrapper .iconWrapper .unseen[data-v-9b340a7a]{background:rgba(var(--color-bg-ac),.9);color:rgb(var(--text-on-bg-ac-color));position:absolute;width:22px;height:22px;right:-10%;top:-10%;line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em}#teamroom .teamChatWrapper .infoWrapper[data-v-9b340a7a]{padding-left:.5em}#teamroom .teamChatWrapper .infoWrapper>div[data-v-9b340a7a]{display:flex;align-content:center}#teamroom .teamChatWrapper .infoWrapper .infoName span[data-v-9b340a7a]{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;display:inline-block;max-width:190px;color:rgb(var(--text-color))}#teamroom .teamChatWrapper .infoWrapper .previewMessage[data-v-9b340a7a]{display:flex;justify-content:flex-start;align-items:center;width:100%}#teamroom .teamChatWrapper .infoWrapper .previewMessage span[data-v-9b340a7a]{display:block;color:rgb(var(--color-txt-gray));font-size:.9em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:210px}#teamroom.minimized:not(.active) .teamChatWrapper[data-v-9b340a7a]{padding:.5em 0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n'use strict';\n\nvar eos;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\n\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\n\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true; // request.destroy just do .end - .abort is what we want\n\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\n\nfunction call(fn) {\n fn();\n}\n\nfunction pipe(from, to) {\n return from.pipe(to);\n}\n\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\n\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\n\nmodule.exports = pipeline;","// style-loader: Adds some css to the DOM by adding a \n","import mod from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ClipLoader.vue?vue&type=template&id=7edc50d8&\"\nimport script from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nexport * from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ClipLoader.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3d50eb11&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"listPreview\"},[(_vm.urlpreview && _vm.metaPreviewLink)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"linkTitle txt\"},[_vm._v(\"sent link: \"+_vm._s(_vm.meta['og:title'])+\" \")]),(_vm.meta['og:site_name'] === 'Pocketnet')?_c('span',{staticClass:\"pocketnetLink\"},[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")]):_c('span',[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.file')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" sent file: \"+_vm._s(JSON.parse(_vm.content.body).name)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.bad.encrypted')?_c('div',{staticClass:\"previewMessage\"},[_c('span',[_vm._v(\" \"+_vm._s(_vm.$t(\"caption.unabletoDecrypt\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.redaction')?_c('div',{staticClass:\"previewMessage\"},[_c('span',{staticClass:\"txt\"},[_c('i',{staticClass:\"fas fa-eraser\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.messageDeleted\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.power_levels')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" \"+_vm._s(_vm.powerLevels)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.image')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentImage\")))])]):_vm._e(),(_vm.content.msgtype === 'm.audio')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentVoiceMessage\")))])]):_vm._e(),((_vm.content.msgtype === 'm.text') && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.content.body}})],1)]):_vm._e(),(_vm.content.msgtype === 'm.encrypted' && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.decryptEvent.body}})],1)]):_vm._e(),(_vm.content.membership === 'invite')?_c('div',{staticClass:\"invitedEvent\"},[(_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToChat\")))]):_vm._e(),(!_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToRoom\")))]):_vm._e()]):_vm._e(),(_vm.content.membership === 'leave')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt sname\"},[_vm._v(\" \"+_vm._s(_vm.name)+\" \")]),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.leftChat\")))])]):_vm._e(),(_vm.content.membership === 'ban')?_c('div',[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"txt\"},[_vm._v(\"banned \"+_vm._s(_vm.content.displayname))])]):_vm._e(),(_vm.content.membership === 'join' && _vm.event.getSender() !== _vm.userId)?_c('div',{staticClass:\"invitedEvent\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.joined\")))])]):_vm._e(),(_vm.content.name)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatRenamed\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.name))])])]):_vm._e(),(_vm.content.topic)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatTopic\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.topic.replace(/_/g, ' ')))])])]):_vm._e(),(_vm.readed)?_c('div',{staticClass:\"statusWrapper\"},[(_vm.my)?_c('div',{staticClass:\"my\"},[_c('i',{staticClass:\"fas fa-check-double\"})]):_vm._e()]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',_vm._l((_vm.chunks),function(chunk,index){return _c('label',{key:index,attrs:{\"chunks\":_vm.chunks}},[(chunk.id)?_c('label',{staticClass:\"likelink\",on:{\"click\":function($event){return _vm.show(chunk)}}},[_vm._v(\"@\"+_vm._s(chunk.name))]):_c('label',[_vm._v(_vm._s(chunk))])])}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./incomingMessage.vue?vue&type=template&id=6b3704ba&scoped=true&\"\nimport script from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nexport * from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./incomingMessage.vue?vue&type=style&index=0&id=6b3704ba&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6b3704ba\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=ba5ac396&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=ba5ac396&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"ba5ac396\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"urlMessage\",attrs:{\"id\":\"url\"}},[(_vm.urltype!= 'impty' && !_vm.error)?_c('div',{staticClass:\"urlwrapper\"},[(!_vm.loading)?_c('metaMessage',{ref:\"metamessage\",attrs:{\"type\":_vm.urltype,\"name\":_vm.meta['og:site_name'],\"title\":_vm.meta['og:title'],\"description\":_vm.meta['og:description'],\"image\":_vm.previewImageUrl,\"url\":_vm.url,\"h\":_vm.meta['og:image:height'],\"w\":_vm.meta['og:image:width']},on:{\"updatedSize\":_vm.updatedSize}}):_c('div',[_c('div',{staticClass:\"preloaderWrapperLocal\"},[_c('linepreloader')],1)])],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=791cf1f7&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=791cf1f7&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"791cf1f7\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"voiceMessage\",class:{playing:_vm.isPlaying}},[_c('div',{staticClass:\"voiceMessage_wrapper\"},[_c('button',{staticClass:\"voiceMessage_toggle\",class:{encrypted: _vm.encrypted},on:{\"touchend\":_vm.audioToggle,\"click\":_vm.audioToggleClick}},[_c('i',{class:_vm.isPlaying ? 'fas fa-pause': 'fas fa-play'})]),_c('div',{staticClass:\"voiceMessage_graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"width\":\"100\",\"height\":\"50\"},on:{\"mousedown\":_vm.goTo}})]),_c('div',{staticClass:\"voiceMessage_options\"},[(!_vm.error)?_c('span',[_vm._v(_vm._s(_vm.getDurationString))]):_vm._e(),(_vm.error)?_c('i',{staticClass:\"fas fa-exclamation-circle\"}):_vm._e()]),(_vm.encrypted && !_vm.error)?_c('div',{staticClass:\"encsign\"},[_c('i',{staticClass:\"fas fa-lock\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0438bc11&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0438bc11&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0438bc11\",\n null\n ,true\n)\n\nexport default component.exports","import actions from \"@/components/events/event/actions/index.vue\";\r\nimport filePreview from \"@/components/events/previews/filePreview/index.vue\";\r\nimport fileMessage from \"@/components/events/event/fileMessage/index.vue\";\r\nimport listPreview from \"@/components/events/event/message/listPreview/index.vue\";\r\nimport f from '@/application/functions'\r\nimport url from '@/components/events/event/url/index.vue'\r\nimport imagesLoaded from 'vue-images-loaded'\r\nimport dummypreviews from \"@/components/chats/dummypreviews\";\r\nimport IncomingMessage from \"./incomingMessage/incomingMessage.vue\"\r\nimport VoiceMessage from '@/components/events/event/VoiceMessage';\r\n\r\nexport default {\r\n name: 'eventsMessage',\r\n props: {\r\n decryptEvent: {},\r\n origin: Object,\r\n prevevent : Object,\r\n event: Object,\r\n preview: Boolean,\r\n userinfo: Object,\r\n readed: Object,\r\n downloaded: Boolean,\r\n baseImg: {\r\n type: String,\r\n default: 'empty'\r\n },\r\n filePreview: Object,\r\n imgEvent: {},\r\n add_image: Function,\r\n goToGallery: Function,\r\n chat: Object,\r\n encrypted: false,\r\n encryptedData: Boolean,\r\n decryptedInfo: null,\r\n error: String,\r\n withImage: Boolean,\r\n reference: Object,\r\n last : Boolean,\r\n showmyicontrue : false,\r\n fromreference : Boolean,\r\n multiSelect: {\r\n default: false,\r\n type: Boolean,\r\n },\r\n selectedMessages: {\r\n default: [],\r\n type: Array,\r\n },\r\n isRemoveSelectedMessages: false,\r\n audioBuffer : null\r\n },\r\n directives: {\r\n imagesLoaded\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n referenceshowed : false,\r\n }\r\n\r\n },\r\n components: {\r\n actions,\r\n filePreview,\r\n fileMessage,\r\n listPreview,\r\n url,\r\n dummypreviews,\r\n IncomingMessage,\r\n VoiceMessage,\r\n },\r\n watch : {\r\n isRemoveSelectedMessages: {\r\n immediate: true,\r\n handler: function () {\r\n if (this.isRemoveSelectedMessages) {\r\n for (let i = 0; i < this.selectedMessages.length; i++) {\r\n if (\r\n this.selectedMessages[i].message_id === this.origin.event.event_id\r\n ) {\r\n this.$emit('remove');\r\n\r\n return this.core.mtrx.client.redactEvent(\r\n this.chat.roomId,\r\n this.origin.event.event_id,\r\n null,\r\n {\r\n reason: 'messagedeleting',\r\n }\r\n );\r\n }\r\n }\r\n this.$emit('messagesIsDeleted', true);\r\n }\r\n },\r\n },\r\n readyToRender : {\r\n immediate : true,\r\n handler : function(){\r\n if(this.readyToRender) this.$emit('readyToRender')\r\n }\r\n }\r\n },\r\n computed: {\r\n showburn : function(){ \r\n\r\n if(new Date() < new Date(2021,11,28)) {\r\n return ''\r\n }\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.b) return 'big'\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.m) return 'medium'\r\n\r\n return ''\r\n },\r\n willburn : function(){\r\n\r\n var d = moment(this.origin._localTimestamp).add(this.core.options.burn.w, this.core.options.burn.v)\r\n\r\n return d\r\n\r\n },\r\n\r\n readyToRender : function(){\r\n\r\n var r = ( this.content.msgtype === 'm.encrypted' && !this.textWithoutLinks && this.badenctypted ) || \r\n\r\n (this.content.membership) ||\r\n\r\n ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && this.textWithoutLinks) ||\r\n (this.file) || (this.error) || \r\n (this.content.msgtype === 'm.image' && this.imageUrl) ||\r\n (this.content.msgtype === 'm.audio' && this.audioUrl) ||\r\n (this.urlpreview) || \r\n (this.preview)\r\n\r\n return r \r\n\r\n },\r\n my: function () {\r\n return this.userinfo.id === this.core.user.userinfo?.id\r\n },\r\n stateChat: function () {\r\n var id = this.$route.query.id\r\n\r\n return this.$store.state.chatsMap[id]\r\n },\r\n\r\n\r\n sending: function () {\r\n return this.origin.status == 'sending'\r\n },\r\n\r\n showmeta : function(){\r\n if(!this.prevevent) return true\r\n\r\n var prevuser = this.$f.getmatrixid(this.prevevent.getSender())\r\n\r\n var t = 10 * 60000\r\n\r\n if((moment().diff(this.origin._localTimestamp, 'days')) != 0){\r\n t = 60 * 1000 * 60 * 24\r\n }\r\n\r\n if (prevuser != this.userinfo.id || this.prevevent._localTimestamp + t < this.origin._localTimestamp){\r\n return true\r\n }\r\n \r\n },\r\n\r\n imageFrom: function () {\r\n if (this.content && this.content.info) return this.content.info.from\r\n },\r\n\r\n showmyicon: function () {\r\n \r\n return this.showmyicontrue || \r\n this.content.msgtype === 'm.image' ||\r\n /*this.content.msgtype === 'm.audio' ||*/\r\n this.content.msgtype === 'm.file' || \r\n this.urlpreview || (!this.$store.state.active && this.$store.state.minimized)\r\n\r\n\r\n },\r\n\r\n file: function () {\r\n if (this.content.msgtype === 'm.file') {\r\n return this.body\r\n }\r\n },\r\n\r\n replacedmintionsbody:function(){\r\n return this.body.replace(/@\\w{68}:(\\w{1,50})/g, function(str, l){\r\n return '@' + l\r\n })\r\n\r\n },\r\n\r\n body: function () {\r\n\r\n var bc = this.origin.event.content\r\n\r\n if (this.origin.event.content.msgtype == 'm.encrypted') {\r\n bc = this.decryptEvent\r\n }\r\n\r\n return bc.pbody || bc.body || ''\r\n },\r\n\r\n content: function () {\r\n return this.origin.event.content\r\n },\r\n\r\n badenctypted: function () {\r\n return this.decryptEvent.msgtype == 'm.bad.encrypted'\r\n },\r\n\r\n \r\n\r\n textWithoutLinks: function () {\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (!this.urlpreview || this.urlpreview.length < 10 ||\r\n (trimmed.indexOf(this.urlpreview) > 0 && trimmed.indexOf(this.urlpreview) + this.urlpreview.length < trimmed.length)\r\n ) {\r\n return trimmed\r\n }\r\n\r\n return this.$f.trim(trimmed.replace(this.urlpreview, ''))\r\n\r\n },\r\n\r\n imageUrl: function () {\r\n if (this.content.msgtype === 'm.image') {\r\n\r\n if (this.encryptedData) {\r\n return this.decryptedInfo\r\n } else {\r\n\r\n \r\n\r\n return this.content && this.content.url;\r\n }\r\n\r\n }\r\n },\r\n\r\n audioUrl: function () {\r\n if (this.content.msgtype === 'm.audio') {\r\n\r\n if(this.encryptedData && this.decryptedInfo) return this.decryptedInfo\r\n\r\n return this.audioBuffer\r\n\r\n //return this.content && this.content.audioData\r\n }\r\n },\r\n\r\n\r\n canediting: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n cancopy: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n menuItems: function () {\r\n var menu = [\r\n {\r\n click: \"reply\",\r\n title: this.$i18n.t(\"button.reply\"),\r\n icon: \"fas fa-reply\"\r\n },\r\n {\r\n click: \"showMultiSelect\",\r\n title: this.$i18n.t(\"button.select\"),\r\n icon: \"fas fa-check-circle\",\r\n },\r\n ]\r\n\r\n if(!this.file){\r\n menu.push({\r\n click: \"share\",\r\n title: this.$i18n.t(\"button.share\"),\r\n icon: \"fas fa-share-alt\"\r\n })\r\n }\r\n\r\n\r\n if (this.my) {\r\n menu.push({\r\n click: \"delete\",\r\n title: this.$i18n.t(\"button.delete\"),\r\n icon: \"far fa-trash-alt\"\r\n })\r\n }\r\n\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n menu.unshift({\r\n click: \"copy\",\r\n title: this.$i18n.t(\"button.copy\"),\r\n icon: \"far fa-copy\"\r\n })\r\n\r\n if (this.my && this.canediting)\r\n menu.unshift({\r\n click: \"edit\",\r\n title: this.$i18n.t(\"button.edit\"),\r\n icon: \"far fa-edit\"\r\n })\r\n }\r\n\r\n return menu\r\n },\r\n\r\n\r\n urlpreview: function () {\r\n if (!this.preview && this.content.msgtype !== 'm.file') {\r\n\r\n\r\n var url = f.getUrl(this.body)\r\n\r\n if (url){\r\n var _u = new URL(url)\r\n\r\n if(_u.pathname == '/'){\r\n if(f.knsite(url)) return ''\r\n }\r\n\r\n return url\r\n }\r\n\r\n return url || ''\r\n }\r\n },\r\n\r\n edited: function () {\r\n if (this.content.edited) return true\r\n\r\n if (\r\n this.origin.event.content['m.relates_to'] &&\r\n this.origin.event.content['m.relates_to']['rel_type'] == 'm.replace') return true\r\n },\r\n\r\n selectedMessage: function () {\r\n const elem = this.selectedMessages.filter(\r\n (item) => item.message_id === this.origin.event.event_id\r\n );\r\n return elem[0]?.message_id === this.origin.event.event_id ? true : false;\r\n },\r\n },\r\n\r\n mounted() {\r\n\r\n },\r\n\r\n methods: {\r\n gotoreference: function () {\r\n var id = this.reference.getId()\r\n\r\n this.$emit('gotoreference', id)\r\n },\r\n\r\n showwhenburn : function(){\r\n\r\n var text = ''\r\n\r\n //console.log(this.willburn.toDate(), new Date(), this.willburn.toDate() > new Date())\r\n\r\n if(this.willburn.toDate() < new Date()){\r\n text = this.$i18n.t(\"messagewasburn\")\r\n }\r\n else{\r\n text = this.$i18n.t(\"messagewillburn\")\r\n\r\n //this.willburn.locale(this.$i18n.locale).format('DD MMMM YYYY')\r\n }\r\n\r\n this.$store.commit('icon', {\r\n\t\t\t\ticon: 'info',\r\n\t\t\t\tmessage: text\r\n \r\n \r\n\t\t\t})\r\n\r\n },\r\n\r\n imagesLoaded: function () {\r\n this.updatedSize()\r\n },\r\n updatedSize: function (before) {\r\n this.$emit('updatedSize', before)\r\n },\r\n\r\n dropDownMenuShow: function () {\r\n\r\n if(this.urlpreview) return\r\n\r\n setTimeout(() => {\r\n this.setmenu()\r\n }, 200)\r\n\r\n },\r\n\r\n setmenu : function(){\r\n this.core.menu({\r\n items : this.menuItems,\r\n handler : this.menuItemClickHandler,\r\n item : {}\r\n })\r\n },\r\n\r\n menushare: function () {\r\n\r\n var sharing = {}\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (this.content.msgtype === 'm.image' && this.imageUrl) sharing.images = [this.imageUrl]\r\n\r\n if (this.content.msgtype === 'm.audio' && this.audioUrl) sharing.audio = [this.audioUrl]\r\n\r\n if ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && trimmed) sharing.messages = [trimmed]\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id\r\n\r\n this.$emit('share', sharing)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menuedit: function () {\r\n this.$emit('editing', this.body)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menushowMultiSelect: function () {\r\n this.$emit('showMultiSelect');\r\n this.selectMessage();\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menureply: function () {\r\n\r\n this.$emit('reply')\r\n\r\n return Promise.resolve()\r\n },\r\n menucopy: function () {\r\n\r\n \r\n\r\n this.$f.copytext(this.replacedmintionsbody)\r\n\r\n return Promise.resolve()\r\n },\r\n menudelete: function () {\r\n\r\n return this.$dialog.confirm(\r\n 'Do you really want to delete message?', {\r\n okText: this.$i18n.t(\"yes\"),\r\n cancelText: this.$i18n.t(\"cancel\")\r\n })\r\n\r\n .then((dialog) => {\r\n\r\n this.$emit('remove')\r\n\r\n\r\n return this.core.mtrx.client.redactEvent(this.chat.roomId, this.origin.event.event_id, null, {\r\n reason: \"messagedeleting\",\r\n })\r\n\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n\r\n },\r\n menuItemClickHandler: function (item, d, p) {\r\n\r\n p.hidePopup()\r\n\r\n this['menu' + item.click]().then(r => {\r\n\r\n }).catch(e => {\r\n p.showPopup()\r\n })\r\n\r\n },\r\n\r\n imagePaddingStyle : function(c){\r\n\r\n if(c.info && c.info.h && c.info.w){\r\n\r\n var cc = c.info.h / c.info.w\r\n\r\n if (cc > 1.7) cc = 1.7\r\n\r\n var h = 'padding-bottom:' + ((cc) * 100) + '%'\r\n\r\n return h\r\n }\r\n\r\n return ''\r\n },\r\n parser(event) {\r\n return JSON.parse(event)['og:title']\r\n },\r\n openImage(img) {\r\n this.$emit('openImg', img)\r\n },\r\n\r\n format_date(value) {\r\n if (value) {\r\n if ((moment().diff(value, 'days')) === 0) {\r\n return new Date(value).toLocaleTimeString([], {hour: '2-digit', minute: \"2-digit\", hour12: false})\r\n } else {\r\n if (moment().year() === moment(value).year()) {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM')\r\n } else {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM YYYY')\r\n }\r\n }\r\n }\r\n },\r\n\r\n download: function () {\r\n this.$emit('download')\r\n },\r\n\r\n decryptagain : function(){\r\n this.$emit('decryptagain')\r\n },\r\n \r\n openImageGallery(msgEvent) {\r\n this.$emit('openGalleryImg', msgEvent)\r\n },\r\n reshareKeys() {\r\n let roomId = this.chat.roomId\r\n },\r\n textDonation: function (withTx = false) {\r\n var from = this.$i18n.t(\"caption.somebody\"), msg = '';\r\n try {\r\n from = this.$f.deep(this, '$store.state.users.' + this.content.from).name;\r\n } catch (err) {\r\n }\r\n var to = this.$i18n.t(\"caption.somebody\");\r\n try {\r\n to = this.$f.deep(this, '$store.state.users.' + this.content.to).name;\r\n } catch (err) {\r\n }\r\n msg += from + this.$i18n.t(\"caption.sent\") + this.content.amount + this.$i18n.t(\"caption.sent\") + to;\r\n return msg;\r\n },\r\n\r\n menuIsVisibleHandler(isVisible) {\r\n this.$emit('menuIsVisible', isVisible);\r\n },\r\n\r\n showreference : function(){\r\n this.referenceshowed = !this.referenceshowed\r\n },\r\n\r\n selectMessage: function () {\r\n var sharing = {};\r\n\r\n var trimmed = this.$f.trim(this.body);\r\n\r\n if (this.content.msgtype === 'm.image' && this.imageUrl)\r\n sharing.images = [this.imageUrl];\r\n\r\n if (this.content.msgtype === 'm.audio' && this.decryptedInfo)\r\n sharing.audio = [this.decryptedInfo];\r\n\r\n if (\r\n (this.content.msgtype === 'm.text' ||\r\n this.content.msgtype === 'm.encrypted') &&\r\n trimmed\r\n )\r\n sharing.messages = [trimmed];\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true;\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id;\r\n this.$emit('selectMessage', {\r\n message_id: this.origin.event.event_id,\r\n ...sharing,\r\n });\r\n },\r\n removeMessage: function () {\r\n this.$emit('removeMessage', {\r\n message_id: this.origin.event.event_id,\r\n });\r\n },\r\n\r\n eventMessage: function (state) {\r\n state ? this.removeMessage() : this.selectMessage()\r\n }\r\n }\r\n}","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=c8f458dc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=c8f458dc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"c8f458dc\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=72e46191&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=72e46191&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"72e46191\",\n null\n ,true\n)\n\nexport default component.exports","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\"","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.EventTimelineSet = EventTimelineSet;\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _eventTimeline = require(\"./event-timeline\");\r\n\r\nvar _event = require(\"./event\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _relations = require(\"./relations\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module models/event-timeline-set\r\n */\r\n// var DEBUG = false;\r\nconst DEBUG = true;\r\nlet debuglog;\r\n\r\nif (DEBUG) {\r\n // using bind means that we get to keep useful line numbers in the console\r\n debuglog = _logger.logger.log.bind(_logger.logger);\r\n} else {\r\n debuglog = function () {};\r\n}\r\n/**\r\n * Construct a set of EventTimeline objects, typically on behalf of a given\r\n * room. A room may have multiple EventTimelineSets for different levels\r\n * of filtering. The global notification list is also an EventTimelineSet, but\r\n * lacks a room.\r\n *\r\n *

This is an ordered sequence of timelines, which may or may not\r\n * be continuous. Each timeline lists a series of events, as well as tracking\r\n * the room state at the start and the end of the timeline (if appropriate).\r\n * It also tracks forward and backward pagination tokens, as well as containing\r\n * links to the next timeline in the sequence.\r\n *\r\n *

There is one special timeline - the 'live' timeline, which represents the\r\n * timeline to which events are being added in real-time as they are received\r\n * from the /sync API. Note that you should not retain references to this\r\n * timeline - even if it is the current timeline right now, it may not remain\r\n * so if the server gives us a timeline gap in /sync.\r\n *\r\n *

In order that we can find events from their ids later, we also maintain a\r\n * map from event_id to timeline and index.\r\n *\r\n * @constructor\r\n * @param {?Room} room\r\n * Room for this timelineSet. May be null for non-room cases, such as the\r\n * notification timeline.\r\n * @param {Object} opts Options inherited from Room.\r\n *\r\n * @param {boolean} [opts.timelineSupport = false]\r\n * Set to true to enable improved timeline support.\r\n * @param {Object} [opts.filter = null]\r\n * The filter object, if any, for this timelineSet.\r\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\r\n * Optional. Set to true to enable client-side aggregation of event relations\r\n * via `getRelationsForEvent`.\r\n * This feature is currently unstable and the API may change without notice.\r\n */\r\n\r\n\r\nfunction EventTimelineSet(room, opts) {\r\n this.room = room;\r\n this._timelineSupport = Boolean(opts.timelineSupport);\r\n this._liveTimeline = new _eventTimeline.EventTimeline(this);\r\n this._unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation; // just a list - *not* ordered.\r\n\r\n this._timelines = [this._liveTimeline];\r\n this._eventIdToTimeline = {};\r\n this._filter = opts.filter || null;\r\n\r\n if (this._unstableClientRelationAggregation) {\r\n // A tree of objects to access a set of relations for an event, as in:\r\n // this._relations[relatesToEventId][relationType][relationEventType]\r\n this._relations = {};\r\n }\r\n}\r\n\r\nutils.inherits(EventTimelineSet, _events.EventEmitter);\r\n/**\r\n * Get all the timelines in this set\r\n * @return {module:models/event-timeline~EventTimeline[]} the timelines in this set\r\n */\r\n\r\nEventTimelineSet.prototype.getTimelines = function () {\r\n return this._timelines;\r\n};\r\n/**\r\n * Get the filter object this timeline set is filtered on, if any\r\n * @return {?Filter} the optional filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getFilter = function () {\r\n return this._filter;\r\n};\r\n/**\r\n * Set the filter object this timeline set is filtered on\r\n * (passed to the server when paginating via /messages).\r\n * @param {Filter} filter the filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setFilter = function (filter) {\r\n this._filter = filter;\r\n};\r\n/**\r\n * Get the list of pending sent events for this timelineSet's room, filtered\r\n * by the timelineSet's filter if appropriate.\r\n *\r\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\r\n * waiting for remote echo.\r\n *\r\n * @throws If opts.pendingEventOrdering was not 'detached'\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getPendingEvents = function () {\r\n if (!this.room) {\r\n return [];\r\n }\r\n\r\n if (this._filter) {\r\n return this._filter.filterRoomTimeline(this.room.getPendingEvents());\r\n } else {\r\n return this.room.getPendingEvents();\r\n }\r\n};\r\n/**\r\n * Get the live timeline for this room.\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} live timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getLiveTimeline = function () {\r\n return this._liveTimeline;\r\n};\r\n/**\r\n * Return the timeline (if any) this event is in.\r\n * @param {String} eventId the eventId being sought\r\n * @return {module:models/event-timeline~EventTimeline} timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.eventIdToTimeline = function (eventId) {\r\n return this._eventIdToTimeline[eventId];\r\n};\r\n/**\r\n * Track a new event as if it were in the same timeline as an old event,\r\n * replacing it.\r\n * @param {String} oldEventId event ID of the original event\r\n * @param {String} newEventId event ID of the replacement event\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.replaceEventId = function (oldEventId, newEventId) {\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n }\r\n};\r\n/**\r\n * Reset the live timeline, and start a new one.\r\n *\r\n *

This is used when /sync returns a 'limited' timeline.\r\n *\r\n * @param {string=} backPaginationToken token for back-paginating the new timeline\r\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\r\n * if absent or null, all timelines are reset.\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timelineReset\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.resetLiveTimeline = function (backPaginationToken, forwardPaginationToken) {\r\n // Each EventTimeline has RoomState objects tracking the state at the start\r\n // and end of that timeline. The copies at the end of the live timeline are\r\n // special because they will have listeners attached to monitor changes to\r\n // the current room state, so we move this RoomState from the end of the\r\n // current live timeline to the end of the new one and, if necessary,\r\n // replace it with a newly created one. We also make a copy for the start\r\n // of the new timeline.\r\n // if timeline support is disabled, forget about the old timelines\r\n const resetAllTimelines = !this._timelineSupport || !forwardPaginationToken;\r\n const oldTimeline = this._liveTimeline;\r\n const newTimeline = resetAllTimelines ? oldTimeline.forkLive(_eventTimeline.EventTimeline.FORWARDS) : oldTimeline.fork(_eventTimeline.EventTimeline.FORWARDS);\r\n\r\n if (resetAllTimelines) {\r\n this._timelines = [newTimeline];\r\n this._eventIdToTimeline = {};\r\n } else {\r\n this._timelines.push(newTimeline);\r\n }\r\n\r\n if (forwardPaginationToken) {\r\n // Now set the forward pagination token on the old live timeline\r\n // so it can be forward-paginated.\r\n oldTimeline.setPaginationToken(forwardPaginationToken, _eventTimeline.EventTimeline.FORWARDS);\r\n } // make sure we set the pagination token before firing timelineReset,\r\n // otherwise clients which start back-paginating will fail, and then get\r\n // stuck without realising that they *can* back-paginate.\r\n\r\n\r\n newTimeline.setPaginationToken(backPaginationToken, _eventTimeline.EventTimeline.BACKWARDS); // Now we can swap the live timeline to the new one.\r\n\r\n this._liveTimeline = newTimeline;\r\n this.emit(\"Room.timelineReset\", this.room, this, resetAllTimelines);\r\n};\r\n/**\r\n * Get the timeline which contains the given event, if any\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\r\n * the given event, or null if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getTimelineForEvent = function (eventId) {\r\n const res = this._eventIdToTimeline[eventId];\r\n return res === undefined ? null : res;\r\n};\r\n/**\r\n * Get an event which is stored in our timelines\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event~MatrixEvent} the given event, or undefined if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.findEventById = function (eventId) {\r\n const tl = this.getTimelineForEvent(eventId);\r\n\r\n if (!tl) {\r\n return undefined;\r\n }\r\n\r\n return utils.findElement(tl.getEvents(), function (ev) {\r\n return ev.getId() == eventId;\r\n });\r\n};\r\n/**\r\n * Add a new timeline to this timeline list\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addTimeline = function () {\r\n if (!this._timelineSupport) {\r\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" + \" parameter to true when creating MatrixClient to enable\" + \" it.\");\r\n }\r\n\r\n const timeline = new _eventTimeline.EventTimeline(this);\r\n\r\n this._timelines.push(timeline);\r\n\r\n return timeline;\r\n};\r\n/**\r\n * Add events to a timeline\r\n *\r\n *

Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent[]} events A list of events to add.\r\n *\r\n * @param {boolean} toStartOfTimeline True to add these events to the start\r\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\r\n * event will be the last element of 'events'.\r\n *\r\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\r\n * add events to.\r\n *\r\n * @param {string=} paginationToken token for the next batch of events\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n *\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventsToTimeline = function (events, toStartOfTimeline, timeline, paginationToken) {\r\n if (!timeline) {\r\n throw new Error(\"'timeline' not specified for EventTimelineSet.addEventsToTimeline\");\r\n }\r\n\r\n if (!toStartOfTimeline && timeline == this._liveTimeline) {\r\n throw new Error(\"EventTimelineSet.addEventsToTimeline cannot be used for adding events to \" + \"the live timeline - use Room.addLiveEvents instead\");\r\n }\r\n\r\n if (this._filter) {\r\n events = this._filter.filterRoomTimeline(events);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const direction = toStartOfTimeline ? _eventTimeline.EventTimeline.BACKWARDS : _eventTimeline.EventTimeline.FORWARDS;\r\n const inverseDirection = toStartOfTimeline ? _eventTimeline.EventTimeline.FORWARDS : _eventTimeline.EventTimeline.BACKWARDS; // Adding events to timelines can be quite complicated. The following\r\n // illustrates some of the corner-cases.\r\n //\r\n // Let's say we start by knowing about four timelines. timeline3 and\r\n // timeline4 are neighbours:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M] [P] [S] <------> [T]\r\n //\r\n // Now we paginate timeline1, and get the following events from the server:\r\n // [M, N, P, R, S, T, U].\r\n //\r\n // 1. First, we ignore event M, since we already know about it.\r\n //\r\n // 2. Next, we append N to timeline 1.\r\n //\r\n // 3. Next, we don't add event P, since we already know about it,\r\n // but we do link together the timelines. We now have:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P] [S] <------> [T]\r\n //\r\n // 4. Now we add event R to timeline2:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] [S] <------> [T]\r\n //\r\n // Note that we have switched the timeline we are working on from\r\n // timeline1 to timeline2.\r\n //\r\n // 5. We ignore event S, but again join the timelines:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T]\r\n //\r\n // 6. We ignore event T, and the timelines are already joined, so there\r\n // is nothing to do.\r\n //\r\n // 7. Finally, we add event U to timeline4:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T, U]\r\n //\r\n // The important thing to note in the above is what happened when we\r\n // already knew about a given event:\r\n //\r\n // - if it was appropriate, we joined up the timelines (steps 3, 5).\r\n // - in any case, we started adding further events to the timeline which\r\n // contained the event we knew about (steps 3, 5, 6).\r\n //\r\n //\r\n // So much for adding events to the timeline. But what do we want to do\r\n // with the pagination token?\r\n //\r\n // In the case above, we will be given a pagination token which tells us how to\r\n // get events beyond 'U' - in this case, it makes sense to store this\r\n // against timeline4. But what if timeline4 already had 'U' and beyond? in\r\n // that case, our best bet is to throw away the pagination token we were\r\n // given and stick with whatever token timeline4 had previously. In short,\r\n // we want to only store the pagination token if the last event we receive\r\n // is one we didn't previously know about.\r\n //\r\n // We make an exception for this if it turns out that we already knew about\r\n // *all* of the events, and we weren't able to join up any timelines. When\r\n // that happens, it means our existing pagination token is faulty, since it\r\n // is only telling us what we already know. Rather than repeatedly\r\n // paginating with the same token, we might as well use the new pagination\r\n // token in the hope that we eventually work our way out of the mess.\r\n\r\n let didUpdate = false;\r\n let lastEventWasNew = false;\r\n\r\n for (let i = 0; i < events.length; i++) {\r\n const event = events[i];\r\n const eventId = event.getId();\r\n const existingTimeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!existingTimeline) {\r\n // we don't know about this event yet. Just add it to the timeline.\r\n this.addEventToTimeline(event, timeline, toStartOfTimeline);\r\n lastEventWasNew = true;\r\n didUpdate = true;\r\n continue;\r\n }\r\n\r\n lastEventWasNew = false;\r\n\r\n if (existingTimeline == timeline) {\r\n debuglog(\"Event \" + eventId + \" already in timeline \" + timeline);\r\n continue;\r\n }\r\n\r\n const neighbour = timeline.getNeighbouringTimeline(direction);\r\n\r\n if (neighbour) {\r\n // this timeline already has a neighbour in the relevant direction;\r\n // let's assume the timelines are already correctly linked up, and\r\n // skip over to it.\r\n //\r\n // there's probably some edge-case here where we end up with an\r\n // event which is in a timeline a way down the chain, and there is\r\n // a break in the chain somewhere. But I can't really imagine how\r\n // that would happen, so I'm going to ignore it for now.\r\n //\r\n if (existingTimeline == neighbour) {\r\n debuglog(\"Event \" + eventId + \" in neighbouring timeline - \" + \"switching to \" + existingTimeline);\r\n } else {\r\n debuglog(\"Event \" + eventId + \" already in a different \" + \"timeline \" + existingTimeline);\r\n }\r\n\r\n timeline = existingTimeline;\r\n continue;\r\n } // time to join the timelines.\r\n\r\n\r\n _logger.logger.info(\"Already have timeline for \" + eventId + \" - joining timeline \" + timeline + \" to \" + existingTimeline); // Variables to keep the line length limited below.\r\n\r\n\r\n const existingIsLive = existingTimeline === this._liveTimeline;\r\n const timelineIsLive = timeline === this._liveTimeline;\r\n const backwardsIsLive = direction === _eventTimeline.EventTimeline.BACKWARDS && existingIsLive;\r\n const forwardsIsLive = direction === _eventTimeline.EventTimeline.FORWARDS && timelineIsLive;\r\n\r\n if (backwardsIsLive || forwardsIsLive) {\r\n // The live timeline should never be spliced into a non-live position.\r\n // We use independent logging to better discover the problem at a glance.\r\n if (backwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set a preceding existingTimeLine on our \" + \"timeline as the existingTimeLine is live (\" + existingTimeline + \")\");\r\n }\r\n\r\n if (forwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set our preceding timeline on a existingTimeLine \" + \"as our timeline is live (\" + timeline + \")\");\r\n }\r\n\r\n continue; // abort splicing - try next event\r\n }\r\n\r\n timeline.setNeighbouringTimeline(existingTimeline, direction);\r\n existingTimeline.setNeighbouringTimeline(timeline, inverseDirection);\r\n timeline = existingTimeline;\r\n didUpdate = true;\r\n } // see above - if the last event was new to us, or if we didn't find any\r\n // new information, we update the pagination token for whatever\r\n // timeline we ended up on.\r\n\r\n\r\n if (lastEventWasNew || !didUpdate) {\r\n if (direction === _eventTimeline.EventTimeline.FORWARDS && timeline === this._liveTimeline) {\r\n _logger.logger.warn({\r\n lastEventWasNew,\r\n didUpdate\r\n }); // for debugging\r\n\r\n\r\n _logger.logger.warn(`Refusing to set forwards pagination token of live timeline ` + `${timeline} to ${paginationToken}`);\r\n\r\n return;\r\n }\r\n\r\n timeline.setPaginationToken(paginationToken, direction);\r\n }\r\n};\r\n/**\r\n * Add an event to the end of this live timeline.\r\n *\r\n * @param {MatrixEvent} event Event to be added\r\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addLiveEvent = function (event, duplicateStrategy, fromCache) {\r\n if (this._filter) {\r\n const events = this._filter.filterRoomTimeline([event]);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const timeline = this._eventIdToTimeline[event.getId()];\r\n\r\n if (timeline) {\r\n if (duplicateStrategy === \"replace\") {\r\n debuglog(\"EventTimelineSet.addLiveEvent: replacing duplicate event \" + event.getId());\r\n const tlEvents = timeline.getEvents();\r\n\r\n for (let j = 0; j < tlEvents.length; j++) {\r\n if (tlEvents[j].getId() === event.getId()) {\r\n // still need to set the right metadata on this event\r\n _eventTimeline.EventTimeline.setEventMetadata(event, timeline.getState(_eventTimeline.EventTimeline.FORWARDS), false);\r\n\r\n if (!tlEvents[j].encryptedType) {\r\n tlEvents[j] = event;\r\n } // XXX: we need to fire an event when this happens.\r\n\r\n\r\n break;\r\n }\r\n }\r\n } else {\r\n debuglog(\"EventTimelineSet.addLiveEvent: ignoring duplicate event \" + event.getId());\r\n }\r\n\r\n return;\r\n }\r\n\r\n this.addEventToTimeline(event, this._liveTimeline, false, fromCache);\r\n};\r\n/**\r\n * Add event to the given timeline, and emit Room.timeline. Assumes\r\n * we have already checked we don't know about this event.\r\n *\r\n * Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent} event\r\n * @param {EventTimeline} timeline\r\n * @param {boolean} toStartOfTimeline\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventToTimeline = function (event, timeline, toStartOfTimeline, fromCache) {\r\n const eventId = event.getId();\r\n timeline.addEvent(event, toStartOfTimeline);\r\n this._eventIdToTimeline[eventId] = timeline;\r\n this.setRelationsTarget(event);\r\n this.aggregateRelations(event);\r\n const data = {\r\n timeline: timeline,\r\n liveEvent: !toStartOfTimeline && timeline == this._liveTimeline && !fromCache\r\n };\r\n this.emit(\"Room.timeline\", event, this.room, Boolean(toStartOfTimeline), false, data);\r\n};\r\n/**\r\n * Replaces event with ID oldEventId with one with newEventId, if oldEventId is\r\n * recognised. Otherwise, add to the live timeline. Used to handle remote echos.\r\n *\r\n * @param {MatrixEvent} localEvent the new event to be added to the timeline\r\n * @param {String} oldEventId the ID of the original event\r\n * @param {boolean} newEventId the ID of the replacement event\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.handleRemoteEcho = function (localEvent, oldEventId, newEventId) {\r\n // XXX: why don't we infer newEventId from localEvent?\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n } else {\r\n if (this._filter) {\r\n if (this._filter.filterRoomTimeline([localEvent]).length) {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n } else {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n }\r\n};\r\n/**\r\n * Removes a single event from this room.\r\n *\r\n * @param {String} eventId The id of the event to remove\r\n *\r\n * @return {?MatrixEvent} the removed event, or null if the event was not found\r\n * in this room.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.removeEvent = function (eventId) {\r\n const timeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!timeline) {\r\n return null;\r\n }\r\n\r\n const removed = timeline.removeEvent(eventId);\r\n\r\n if (removed) {\r\n delete this._eventIdToTimeline[eventId];\r\n const data = {\r\n timeline: timeline\r\n };\r\n this.emit(\"Room.timeline\", removed, this.room, undefined, true, data);\r\n }\r\n\r\n return removed;\r\n};\r\n/**\r\n * Determine where two events appear in the timeline relative to one another\r\n *\r\n * @param {string} eventId1 The id of the first event\r\n * @param {string} eventId2 The id of the second event\r\n\r\n * @return {?number} a number less than zero if eventId1 precedes eventId2, and\r\n * greater than zero if eventId1 succeeds eventId2. zero if they are the\r\n * same event; null if we can't tell (either because we don't know about one\r\n * of the events, or because they are in separate timelines which don't join\r\n * up).\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.compareEventOrdering = function (eventId1, eventId2) {\r\n if (eventId1 == eventId2) {\r\n // optimise this case\r\n return 0;\r\n }\r\n\r\n const timeline1 = this._eventIdToTimeline[eventId1];\r\n const timeline2 = this._eventIdToTimeline[eventId2];\r\n\r\n if (timeline1 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline2 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline1 === timeline2) {\r\n // both events are in the same timeline - figure out their\r\n // relative indices\r\n let idx1;\r\n let idx2;\r\n const events = timeline1.getEvents();\r\n\r\n for (let idx = 0; idx < events.length && (idx1 === undefined || idx2 === undefined); idx++) {\r\n const evId = events[idx].getId();\r\n\r\n if (evId == eventId1) {\r\n idx1 = idx;\r\n }\r\n\r\n if (evId == eventId2) {\r\n idx2 = idx;\r\n }\r\n }\r\n\r\n return idx1 - idx2;\r\n } // the events are in different timelines. Iterate through the\r\n // linkedlist to see which comes first.\r\n // first work forwards from timeline1\r\n\r\n\r\n let tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline1 is before timeline2\r\n return -1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.FORWARDS);\r\n } // now try backwards from timeline1\r\n\r\n\r\n tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline2 is before timeline1\r\n return 1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.BACKWARDS);\r\n } // the timelines are not contiguous.\r\n\r\n\r\n return null;\r\n};\r\n/**\r\n * Get a collection of relations to a given event in this timeline set.\r\n *\r\n * @param {String} eventId\r\n * The ID of the event that you'd like to access relation events for.\r\n * For example, with annotations, this would be the ID of the event being annotated.\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\", \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @throws If eventId, relationType or eventType\r\n * are not valid.\r\n *\r\n * @returns {?Relations}\r\n * A container for relation events or undefined if there are no relation events for\r\n * the relationType.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getRelationsForEvent = function (eventId, relationType, eventType) {\r\n if (!this._unstableClientRelationAggregation) {\r\n throw new Error(\"Client-side relation aggregation is disabled\");\r\n }\r\n\r\n if (!eventId || !relationType || !eventType) {\r\n throw new Error(\"Invalid arguments for `getRelationsForEvent`\");\r\n } // debuglog(\"Getting relations for: \", eventId, relationType, eventType);\r\n\r\n\r\n const relationsForEvent = this._relations[eventId] || {};\r\n const relationsWithRelType = relationsForEvent[relationType] || {};\r\n return relationsWithRelType[eventType];\r\n};\r\n/**\r\n * Set an event as the target event if any Relations exist for it already\r\n *\r\n * @param {MatrixEvent} event\r\n * The event to check as relation target.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setRelationsTarget = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n const relationsForEvent = this._relations[event.getId()];\r\n\r\n if (!relationsForEvent) {\r\n return;\r\n } // don't need it for non m.replace relations for now\r\n\r\n\r\n const relationsWithRelType = relationsForEvent[\"m.replace\"];\r\n\r\n if (!relationsWithRelType) {\r\n return;\r\n } // only doing replacements for messages for now (e.g. edits)\r\n\r\n\r\n const relationsWithEventType = relationsWithRelType[\"m.room.message\"];\r\n\r\n if (relationsWithEventType) {\r\n relationsWithEventType.setTargetEvent(event);\r\n }\r\n};\r\n/**\r\n * Add relation events to the relevant relation collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be aggregated.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.aggregateRelations = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n if (event.isRedacted() || event.status === _event.EventStatus.CANCELLED) {\r\n return;\r\n } // If the event is currently encrypted, wait until it has been decrypted.\r\n\r\n\r\n if (event.isBeingDecrypted()) {\r\n event.once(\"Event.decrypted\", () => {\r\n this.aggregateRelations(event);\r\n });\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n return;\r\n }\r\n\r\n const relatesToEventId = relation.event_id;\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType(); // debuglog(\"Aggregating relation: \", event.getId(), eventType, relation);\r\n\r\n let relationsForEvent = this._relations[relatesToEventId];\r\n\r\n if (!relationsForEvent) {\r\n relationsForEvent = this._relations[relatesToEventId] = {};\r\n }\r\n\r\n let relationsWithRelType = relationsForEvent[relationType];\r\n\r\n if (!relationsWithRelType) {\r\n relationsWithRelType = relationsForEvent[relationType] = {};\r\n }\r\n\r\n let relationsWithEventType = relationsWithRelType[eventType];\r\n let isNewRelations = false;\r\n let relatesToEvent;\r\n\r\n if (!relationsWithEventType) {\r\n relationsWithEventType = relationsWithRelType[eventType] = new _relations.Relations(relationType, eventType, this.room);\r\n isNewRelations = true;\r\n relatesToEvent = this.findEventById(relatesToEventId) || this.room.getPendingEvent(relatesToEventId);\r\n\r\n if (relatesToEvent) {\r\n relationsWithEventType.setTargetEvent(relatesToEvent);\r\n }\r\n }\r\n\r\n relationsWithEventType.addEvent(event); // only emit once event has been added to relations\r\n\r\n if (isNewRelations && relatesToEvent) {\r\n relatesToEvent.emit(\"Event.relationsCreated\", relationType, eventType);\r\n }\r\n};\r\n/**\r\n * Fires whenever the timeline in a room is updated.\r\n * @event module:client~MatrixClient#\"Room.timeline\"\r\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\r\n * @param {?Room} room The room, if any, whose timeline was updated.\r\n * @param {boolean} toStartOfTimeline True if this event was added to the start\r\n * @param {boolean} removed True if this event has just been removed from the timeline\r\n * (beginning; oldest) of the timeline e.g. due to pagination.\r\n *\r\n * @param {object} data more data about the event\r\n *\r\n * @param {module:models/event-timeline.EventTimeline} data.timeline the timeline the\r\n * event was added to/removed from\r\n *\r\n * @param {boolean} data.liveEvent true if the event was a real-time event\r\n * added to the end of the live timeline\r\n *\r\n * @example\r\n * matrixClient.on(\"Room.timeline\",\r\n * function(event, room, toStartOfTimeline, removed, data) {\r\n * if (!toStartOfTimeline && data.liveEvent) {\r\n * var messageToAppend = room.timeline.[room.timeline.length - 1];\r\n * }\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever the live timeline in a room is reset.\r\n *\r\n * When we get a 'limited' sync (for example, after a network outage), we reset\r\n * the live timeline to be empty before adding the recent events to the new\r\n * timeline. This event is fired after the timeline is reset, and before the\r\n * new events are added.\r\n *\r\n * @event module:client~MatrixClient#\"Room.timelineReset\"\r\n * @param {Room} room The room whose live timeline was reset, if any\r\n * @param {EventTimelineSet} timelineSet timelineSet room whose live timeline was reset\r\n * @param {boolean} resetAllTimelines True if all timelines were reset.\r\n */","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.logger = void 0;\r\n\r\nvar _loglevel = _interopRequireDefault(require(\"loglevel\"));\r\n\r\n/*\r\nCopyright 2018 André Jaenisch\r\nCopyright 2019, 2021 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module logger\r\n */\r\n// This is to demonstrate, that you can use any namespace you want.\r\n// Namespaces allow you to turn on/off the logging for specific parts of the\r\n// application.\r\n// An idea would be to control this via an environment variable (on Node.js).\r\n// See https://www.npmjs.com/package/debug to see how this could be implemented\r\n// Part of #332 is introducing a logging library in the first place.\r\nconst DEFAULT_NAMESPACE = \"matrix\"; // because rageshakes in react-sdk hijack the console log, also at module load time,\r\n// initializing the logger here races with the initialization of rageshakes.\r\n// to avoid the issue, we override the methodFactory of loglevel that binds to the\r\n// console methods at initialization time by a factory that looks up the console methods\r\n// when logging so we always get the current value of console methods.\r\n\r\n_loglevel.default.methodFactory = function (methodName, logLevel, loggerName) {\r\n return function (...args) {\r\n /* eslint-disable @babel/no-invalid-this */\r\n if (this.prefix) {\r\n args.unshift(this.prefix);\r\n }\r\n /* eslint-enable @babel/no-invalid-this */\r\n\r\n\r\n const supportedByConsole = methodName === \"error\" || methodName === \"warn\" || methodName === \"trace\" || methodName === \"info\";\r\n /* eslint-disable no-console */\r\n\r\n return\r\n\r\n if (supportedByConsole) {\r\n return console[methodName](...args);\r\n } else {\r\n return console.log(...args);\r\n }\r\n /* eslint-enable no-console */\r\n\r\n };\r\n};\r\n/**\r\n * Drop-in replacement for console using {@link https://www.npmjs.com/package/loglevel|loglevel}.\r\n * Can be tailored down to specific use cases if needed.\r\n */\r\n\r\n\r\nconst logger = _loglevel.default.getLogger(DEFAULT_NAMESPACE);\r\n\r\nexports.logger = logger;\r\nlogger.setLevel(_loglevel.default.levels.DEBUG);\r\n\r\nfunction extendLogger(logger) {\r\n logger.withPrefix = function (prefix) {\r\n const existingPrefix = this.prefix || \"\";\r\n return getPrefixedLogger(existingPrefix + prefix);\r\n };\r\n}\r\n\r\nextendLogger(logger);\r\n\r\nfunction getPrefixedLogger(prefix) {\r\n const prefixLogger = _loglevel.default.getLogger(`${DEFAULT_NAMESPACE}-${prefix}`);\r\n\r\n if (prefixLogger.prefix !== prefix) {\r\n // Only do this setup work the first time through, as loggers are saved by name.\r\n extendLogger(prefixLogger);\r\n prefixLogger.prefix = prefix;\r\n prefixLogger.setLevel(_loglevel.default.levels.DEBUG);\r\n }\r\n\r\n return prefixLogger;\r\n}","var Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar StringDecoder = require('string_decoder').StringDecoder\nvar inherits = require('inherits')\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.SyncApi = SyncApi;\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"./utils\"));\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nvar _pushprocessor = require(\"./pushprocessor\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/*\r\n * TODO:\r\n * This class mainly serves to take all the syncing logic out of client.js and\r\n * into a separate file. It's all very fluid, and this class gut wrenches a lot\r\n * of MatrixClient props (e.g. _http). Given we want to support WebSockets as\r\n * an alternative syncing API, we may want to have a proper syncing interface\r\n * for HTTP and WS at some point.\r\n */\r\nconst DEBUG = true; // /sync requests allow you to set a timeout= but the request may continue\r\n// beyond that and wedge forever, so we need to track how long we are willing\r\n// to keep open the connection. This constant is *ADDED* to the timeout= value\r\n// to determine the max time we're willing to wait.\r\n\r\nconst BUFFER_PERIOD_MS = 80 * 1000; // Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\r\n// to RECONNECTING. This is needed to inform the client of server issues when the\r\n// keepAlive is successful but the server /sync fails.\r\n\r\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\r\n\r\nfunction getFilterName(userId, suffix) {\r\n // scope this on the user ID because people may login on many accounts\r\n // and they all need to be stored!\r\n return \"FILTER_SYNC_\" + userId + (suffix ? \"_\" + suffix : \"\");\r\n}\r\n\r\nfunction debuglog(...params) {\r\n if (!DEBUG) {\r\n return;\r\n }\r\n\r\n _logger.logger.log(...params);\r\n}\r\n/**\r\n * Internal class - unstable.\r\n * Construct an entity which is able to sync with a homeserver.\r\n * @constructor\r\n * @param {MatrixClient} client The matrix client instance to use.\r\n * @param {Object} opts Config options\r\n * @param {module:crypto=} opts.crypto Crypto manager\r\n * @param {Function=} opts.canResetEntireTimeline A function which is called\r\n * with a room ID and returns a boolean. It should return 'true' if the SDK can\r\n * SAFELY remove events from this room. It may not be safe to remove events if\r\n * there are other references to the timelines for this room.\r\n * Default: returns false.\r\n * @param {Boolean=} opts.disablePresence True to perform syncing without automatically\r\n * updating presence.\r\n */\r\n\r\n\r\nfunction SyncApi(client, opts) {\r\n this.client = client;\r\n opts = opts || {};\r\n opts.initialSyncLimit = opts.initialSyncLimit === undefined ? 8 : opts.initialSyncLimit;\r\n opts.resolveInvitesToProfiles = opts.resolveInvitesToProfiles || false;\r\n opts.pollTimeout = opts.pollTimeout || 30 * 1000;\r\n opts.pendingEventOrdering = opts.pendingEventOrdering || \"chronological\";\r\n\r\n if (!opts.canResetEntireTimeline) {\r\n opts.canResetEntireTimeline = function (roomId) {\r\n return false;\r\n };\r\n }\r\n\r\n this.opts = opts;\r\n this._peekRoom = null;\r\n this._currentSyncRequest = null;\r\n this._syncState = null;\r\n this._syncStateData = null; // additional data (eg. error object for failed sync)\r\n\r\n this._catchingUp = false;\r\n this._running = false;\r\n this._keepAliveTimer = null;\r\n this._connectionReturnedDefer = null;\r\n this._notifEvents = []; // accumulator of sync events in the current sync response\r\n\r\n this._failedSyncCount = 0; // Number of consecutive failed /sync requests\r\n\r\n this._storeIsInvalid = false; // flag set if the store needs to be cleared before we can start\r\n\r\n if (client.getNotifTimelineSet()) {\r\n client.reEmitter.reEmit(client.getNotifTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\r\n }\r\n}\r\n/**\r\n * @param {string} roomId\r\n * @return {Room}\r\n */\r\n\r\n\r\nSyncApi.prototype.createRoom = function (roomId) {\r\n const client = this.client;\r\n const {\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n } = client;\r\n const room = new _room.Room(roomId, client, client.getUserId(), {\r\n lazyLoadMembers: this.opts.lazyLoadMembers,\r\n pendingEventOrdering: this.opts.pendingEventOrdering,\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n });\r\n client.reEmitter.reEmit(room, [\"Room.name\", \"Room.avatar\", \"Room.timeline\", \"Room.redaction\", \"Room.redactionCancelled\", \"Room.receipt\", \"Room.tags\", \"Room.timelineReset\", \"Room.localEchoUpdated\", \"Room.accountData\", \"Room.myMembership\", \"Room.replaceEvent\"]);\r\n\r\n this._registerStateListeners(room);\r\n\r\n return room;\r\n};\r\n/**\r\n * @param {string} groupId\r\n * @return {Group}\r\n */\r\n\r\n\r\nSyncApi.prototype.createGroup = function (groupId) {\r\n const client = this.client;\r\n const group = new _group.Group(groupId);\r\n client.reEmitter.reEmit(group, [\"Group.profile\", \"Group.myMembership\"]);\r\n client.store.storeGroup(group);\r\n return group;\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._registerStateListeners = function (room) {\r\n const client = this.client; // we need to also re-emit room state and room member events, so hook it up\r\n // to the client now. We need to add a listener for RoomState.members in\r\n // order to hook them correctly. (TODO: find a better way?)\r\n\r\n client.reEmitter.reEmit(room.currentState, [\"RoomState.events\", \"RoomState.members\", \"RoomState.newMember\"]);\r\n room.currentState.on(\"RoomState.newMember\", function (event, state, member) {\r\n member.user = client.getUser(member.userId);\r\n client.reEmitter.reEmit(member, [\"RoomMember.name\", \"RoomMember.typing\", \"RoomMember.powerLevel\", \"RoomMember.membership\"]);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._deregisterStateListeners = function (room) {\r\n // could do with a better way of achieving this.\r\n room.currentState.removeAllListeners(\"RoomState.events\");\r\n room.currentState.removeAllListeners(\"RoomState.members\");\r\n room.currentState.removeAllListeners(\"RoomState.newMember\");\r\n};\r\n/**\r\n * Sync rooms the user has left.\r\n * @return {Promise} Resolved when they've been added to the store.\r\n */\r\n\r\n\r\nSyncApi.prototype.syncLeftRooms = function () {\r\n const client = this.client;\r\n const self = this; // grab a filter with limit=1 and include_leave=true\r\n\r\n const filter = new _filter.Filter(this.client.credentials.userId);\r\n filter.setTimelineLimit(1);\r\n filter.setIncludeLeaveRooms(true);\r\n const localTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;\r\n const qps = {\r\n timeout: 0 // don't want to block since this is a single isolated req\r\n\r\n };\r\n return client.getOrCreateFilter(getFilterName(client.credentials.userId, \"LEFT_ROOMS\"), filter).then(function (filterId) {\r\n qps.filter = filterId;\r\n return client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, localTimeoutMs);\r\n }).then(function (data) {\r\n let leaveRooms = [];\r\n\r\n if (data.rooms && data.rooms.leave) {\r\n leaveRooms = self._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n\r\n const rooms = [];\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n rooms.push(room);\r\n\r\n if (!leaveObj.isBrandNewRoom) {\r\n // the intention behind syncLeftRooms is to add in rooms which were\r\n // *omitted* from the initial /sync. Rooms the user were joined to\r\n // but then left whilst the app is running will appear in this list\r\n // and we do not want to bother with them since they will have the\r\n // current state already (and may get dupe messages if we add\r\n // yet more timeline events!), so skip them.\r\n // NB: When we persist rooms to localStorage this will be more\r\n // complicated...\r\n return;\r\n }\r\n\r\n leaveObj.timeline = leaveObj.timeline || {};\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room); // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n\r\n\r\n room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n });\r\n return rooms;\r\n });\r\n};\r\n/**\r\n * Peek into a room. This will result in the room in question being synced so it\r\n * is accessible via getRooms(). Live updates for the room will be provided.\r\n * @param {string} roomId The room ID to peek into.\r\n * @return {Promise} A promise which resolves once the room has been added to the\r\n * store.\r\n */\r\n\r\n\r\nSyncApi.prototype.peek = function (roomId) {\r\n if (this._peekRoom && this._peekRoom.roomId === roomId) {\r\n return Promise.resolve(this._peekRoom);\r\n }\r\n\r\n const client = this.client;\r\n this._peekRoom = this.createRoom(roomId);\r\n return this.client.roomInitialSync(roomId, 20).then(response => {\r\n // make sure things are init'd\r\n response.messages = response.messages || {};\r\n response.messages.chunk = response.messages.chunk || [];\r\n response.state = response.state || []; // FIXME: Mostly duplicated from _processRoomEvents but not entirely\r\n // because \"state\" in this API is at the BEGINNING of the chunk\r\n\r\n const oldStateEvents = utils.map(utils.deepCopy(response.state), client.getEventMapper());\r\n const stateEvents = utils.map(response.state, client.getEventMapper());\r\n const messages = utils.map(response.messages.chunk, client.getEventMapper()); // XXX: copypasted from /sync until we kill off this\r\n // minging v1 API stuff)\r\n // handle presence events (User objects)\r\n\r\n if (response.presence && utils.isArray(response.presence)) {\r\n response.presence.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // set the pagination token before adding the events in case people\r\n // fire off pagination requests in response to the Room.timeline\r\n // events.\r\n\r\n\r\n if (response.messages.start) {\r\n this._peekRoom.oldState.paginationToken = response.messages.start;\r\n } // set the state of the room to as it was after the timeline executes\r\n\r\n\r\n this._peekRoom.oldState.setStateEvents(oldStateEvents);\r\n\r\n this._peekRoom.currentState.setStateEvents(stateEvents);\r\n\r\n this._resolveInvites(this._peekRoom);\r\n\r\n this._peekRoom.recalculate(); // roll backwards to diverge old state. addEventsToTimeline\r\n // will overwrite the pagination token, so make sure it overwrites\r\n // it with the right thing.\r\n\r\n\r\n this._peekRoom.addEventsToTimeline(messages.reverse(), true, this._peekRoom.getLiveTimeline(), response.messages.start);\r\n\r\n client.store.storeRoom(this._peekRoom);\r\n client.emit(\"Room\", this._peekRoom);\r\n\r\n this._peekPoll(this._peekRoom);\r\n\r\n return this._peekRoom;\r\n });\r\n};\r\n/**\r\n * Stop polling for updates in the peeked room. NOPs if there is no room being\r\n * peeked.\r\n */\r\n\r\n\r\nSyncApi.prototype.stopPeeking = function () {\r\n this._peekRoom = null;\r\n};\r\n/**\r\n * Do a peek room poll.\r\n * @param {Room} peekRoom\r\n * @param {string?} token from= token\r\n */\r\n\r\n\r\nSyncApi.prototype._peekPoll = function (peekRoom, token) {\r\n if (this._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n }\r\n\r\n const self = this; // FIXME: gut wrenching; hard-coded timeout values\r\n\r\n this.client._http.authedRequest(undefined, \"GET\", \"/events\", {\r\n room_id: peekRoom.roomId,\r\n timeout: 30 * 1000,\r\n from: token\r\n }, undefined, 50 * 1000).then(function (res) {\r\n if (self._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n } // We have a problem that we get presence both from /events and /sync\r\n // however, /sync only returns presence for users in rooms\r\n // you're actually joined to.\r\n // in order to be sure to get presence for all of the users in the\r\n // peeked room, we handle presence explicitly here. This may result\r\n // in duplicate presence events firing for some users, which is a\r\n // performance drain, but such is life.\r\n // XXX: copypasted from /sync until we can kill this minging v1 stuff.\r\n\r\n\r\n res.chunk.filter(function (e) {\r\n return e.type === \"m.presence\";\r\n }).map(self.client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = self.client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(self.client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n self.client.store.storeUser(user);\r\n }\r\n\r\n self.client.emit(\"event\", presenceEvent);\r\n }); // strip out events which aren't for the given room_id (e.g presence)\r\n // and also ephemeral events (which we're assuming is anything without\r\n // and event ID because the /events API doesn't separate them).\r\n\r\n const events = res.chunk.filter(function (e) {\r\n return e.room_id === peekRoom.roomId && e.event_id;\r\n }).map(self.client.getEventMapper());\r\n peekRoom.addLiveEvents(events);\r\n\r\n self._peekPoll(peekRoom, res.end);\r\n }, function (err) {\r\n _logger.logger.error(\"[%s] Peek poll failed: %s\", peekRoom.roomId, err);\r\n\r\n setTimeout(function () {\r\n self._peekPoll(peekRoom, token);\r\n }, 30 * 1000);\r\n });\r\n};\r\n/**\r\n * Returns the current state of this sync object\r\n * @see module:client~MatrixClient#event:\"sync\"\r\n * @return {?String}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncState = function () {\r\n return this._syncState;\r\n};\r\n/**\r\n * Returns the additional data object associated with\r\n * the current sync state, or null if there is no\r\n * such data.\r\n * Sync errors, if available, are put in the 'error' key of\r\n * this object.\r\n * @return {?Object}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncStateData = function () {\r\n return this._syncStateData;\r\n};\r\n\r\nSyncApi.prototype.recoverFromSyncStartupError = async function (savedSyncPromise, err) {\r\n // Wait for the saved sync to complete - we send the pushrules and filter requests\r\n // before the saved sync has finished so they can run in parallel, but only process\r\n // the results after the saved sync is done. Equivalently, we wait for it to finish\r\n // before reporting failures from these functions.\r\n await savedSyncPromise;\r\n\r\n const keepaliveProm = this._startKeepAlives();\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n\r\n await keepaliveProm;\r\n};\r\n/**\r\n * Is the lazy loading option different than in previous session?\r\n * @param {bool} lazyLoadMembers current options for lazy loading\r\n * @return {bool} whether or not the option has changed compared to the previous session */\r\n\r\n\r\nSyncApi.prototype._wasLazyLoadingToggled = async function (lazyLoadMembers) {\r\n lazyLoadMembers = !!lazyLoadMembers; // assume it was turned off before\r\n // if we don't know any better\r\n\r\n let lazyLoadMembersBefore = false;\r\n const isStoreNewlyCreated = await this.client.store.isNewlyCreated();\r\n\r\n if (!isStoreNewlyCreated) {\r\n const prevClientOptions = await this.client.store.getClientOptions();\r\n\r\n if (prevClientOptions) {\r\n lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers;\r\n }\r\n\r\n return lazyLoadMembersBefore !== lazyLoadMembers;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nSyncApi.prototype._shouldAbortSync = function (error) {\r\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\r\n // The logout already happened, we just need to stop.\r\n _logger.logger.warn(\"Token no longer valid - assuming logout\");\r\n\r\n this.stop();\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n/**\r\n * Main entry point\r\n */\r\n\r\n\r\nSyncApi.prototype.sync = function () {\r\n const client = this.client;\r\n const self = this;\r\n this._running = true;\r\n\r\n if (global.window && global.window.addEventListener) {\r\n this._onOnlineBound = this._onOnline.bind(this);\r\n global.window.addEventListener(\"online\", this._onOnlineBound, false);\r\n }\r\n\r\n let savedSyncPromise = Promise.resolve();\r\n let savedSyncToken = null; // We need to do one-off checks before we can begin the /sync loop.\r\n // These are:\r\n // 1) We need to get push rules so we can check if events should bing as we get\r\n // them from /sync.\r\n // 2) We need to get/create a filter which we can use for /sync.\r\n // 3) We need to check the lazy loading option matches what was used in the\r\n // stored sync. If it doesn't, we can't use the stored sync.\r\n\r\n async function getPushRules() {\r\n try {\r\n debuglog(\"Getting push rules...\");\r\n const result = await client.getPushRules();\r\n debuglog(\"Got push rules\");\r\n client.pushRules = result;\r\n } catch (err) {\r\n _logger.logger.error(\"Getting push rules failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying push rules...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getPushRules();\r\n return;\r\n }\r\n\r\n checkLazyLoadStatus(); // advance to the next stage\r\n }\r\n\r\n function buildDefaultFilter() {\r\n const filter = new _filter.Filter(client.credentials.userId);\r\n filter.setTimelineLimit(self.opts.initialSyncLimit);\r\n return filter;\r\n }\r\n\r\n const checkLazyLoadStatus = async () => {\r\n debuglog(\"Checking lazy load status...\");\r\n\r\n if (this.opts.lazyLoadMembers && client.isGuest()) {\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers) {\r\n debuglog(\"Checking server lazy load support...\");\r\n const supported = await client.doesServerSupportLazyLoading();\r\n\r\n if (supported) {\r\n debuglog(\"Enabling lazy load on sync filter...\");\r\n\r\n if (!this.opts.filter) {\r\n this.opts.filter = buildDefaultFilter();\r\n }\r\n\r\n this.opts.filter.setLazyLoadMembers(true);\r\n } else {\r\n debuglog(\"LL: lazy loading requested but not supported \" + \"by server, so disabling\");\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n } // need to vape the store when enabling LL and wasn't enabled before\r\n\r\n\r\n debuglog(\"Checking whether lazy loading has changed in store...\");\r\n const shouldClear = await this._wasLazyLoadingToggled(this.opts.lazyLoadMembers);\r\n\r\n if (shouldClear) {\r\n this._storeIsInvalid = true;\r\n const reason = _errors.InvalidStoreError.TOGGLED_LAZY_LOADING;\r\n const error = new _errors.InvalidStoreError(reason, !!this.opts.lazyLoadMembers);\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error\r\n }); // bail out of the sync loop now: the app needs to respond to this error.\r\n // we leave the state as 'ERROR' which isn't great since this normally means\r\n // we're retrying. The client must be stopped before clearing the stores anyway\r\n // so the app should stop the client, clear the store and start it again.\r\n\r\n\r\n _logger.logger.warn(\"InvalidStoreError: store is not usable: stopping sync.\");\r\n\r\n return;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers && this.opts.crypto) {\r\n this.opts.crypto.enableLazyLoading();\r\n }\r\n\r\n try {\r\n debuglog(\"Storing client options...\");\r\n await this.client._storeClientOptions();\r\n debuglog(\"Stored client options\");\r\n } catch (err) {\r\n _logger.logger.error(\"Storing client options failed\", err);\r\n\r\n throw err;\r\n }\r\n\r\n getFilter(); // Now get the filter and start syncing\r\n };\r\n\r\n async function getFilter() {\r\n debuglog(\"Getting filter...\");\r\n let filter;\r\n\r\n if (self.opts.filter) {\r\n filter = self.opts.filter;\r\n } else {\r\n filter = buildDefaultFilter();\r\n }\r\n\r\n let filterId;\r\n\r\n try {\r\n filterId = await client.getOrCreateFilter(getFilterName(client.credentials.userId), filter);\r\n } catch (err) {\r\n _logger.logger.error(\"Getting filter failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying filter...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getFilter();\r\n return;\r\n } // reset the notifications timeline to prepare it to paginate from\r\n // the current point in time.\r\n // The right solution would be to tie /sync pagination tokens into\r\n // /notifications API somehow.\r\n\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n if (self._currentSyncRequest === null) {\r\n // Send this first sync request here so we can then wait for the saved\r\n // sync data to finish processing before we process the results of this one.\r\n debuglog(\"Sending first sync request...\");\r\n self._currentSyncRequest = self._doSyncRequest({\r\n filterId\r\n }, savedSyncToken);\r\n } // Now wait for the saved sync to finish...\r\n\r\n\r\n debuglog(\"Waiting for saved sync before starting sync processing...\");\r\n await savedSyncPromise;\r\n\r\n self._sync({\r\n filterId\r\n });\r\n }\r\n\r\n if (client.isGuest()) {\r\n // no push rules for guests, no access to POST filter for guests.\r\n self._sync({});\r\n } else {\r\n // Pull the saved sync token out first, before the worker starts sending\r\n // all the sync data which could take a while. This will let us send our\r\n // first incremental sync request before we've processed our saved data.\r\n debuglog(\"Getting saved sync token...\");\r\n savedSyncPromise = client.store.getSavedSyncToken().then(tok => {\r\n debuglog(\"Got saved sync token\");\r\n savedSyncToken = tok;\r\n debuglog(\"Getting saved sync...\");\r\n return client.store.getSavedSync();\r\n }).then(savedSync => {\r\n debuglog(`Got reply from saved sync, exists? ${!!savedSync}`);\r\n\r\n if (savedSync) {\r\n return self._syncFromCache(savedSync);\r\n }\r\n }).catch(err => {\r\n _logger.logger.error(\"Getting saved sync failed\", err);\r\n }); // Now start the first incremental sync request: this can also\r\n // take a while so if we set it going now, we can wait for it\r\n // to finish while we process our saved sync data.\r\n\r\n getPushRules();\r\n }\r\n};\r\n/**\r\n * Stops the sync object from syncing.\r\n */\r\n\r\n\r\nSyncApi.prototype.stop = function () {\r\n debuglog(\"SyncApi.stop\");\r\n\r\n if (global.window) {\r\n global.window.removeEventListener(\"online\", this._onOnlineBound, false);\r\n this._onOnlineBound = undefined;\r\n }\r\n\r\n this._running = false;\r\n\r\n if (this._currentSyncRequest) {\r\n this._currentSyncRequest.abort();\r\n }\r\n\r\n if (this._keepAliveTimer) {\r\n clearTimeout(this._keepAliveTimer);\r\n this._keepAliveTimer = null;\r\n }\r\n};\r\n/**\r\n * Retry a backed off syncing request immediately. This should only be used when\r\n * the user explicitly attempts to retry their lost connection.\r\n * @return {boolean} True if this resulted in a request being retried.\r\n */\r\n\r\n\r\nSyncApi.prototype.retryImmediately = function () {\r\n if (!this._connectionReturnedDefer) {\r\n return false;\r\n }\r\n\r\n this._startKeepAlives(0);\r\n\r\n return true;\r\n};\r\n/**\r\n * Process a single set of cached sync data.\r\n * @param {Object} savedSync a saved sync that was persisted by a store. This\r\n * should have been acquired via client.store.getSavedSync().\r\n */\r\n\r\n\r\nSyncApi.prototype._syncFromCache = async function (savedSync) {\r\n debuglog(\"sync(): not doing HTTP hit, instead returning stored /sync data\");\r\n const nextSyncToken = savedSync.nextBatch; // Set sync token for future incremental syncing\r\n\r\n this.client.store.setSyncToken(nextSyncToken); // No previous sync, set old token to null\r\n\r\n const syncEventData = {\r\n oldSyncToken: null,\r\n nextSyncToken,\r\n catchingUp: false,\r\n fromCache: true\r\n };\r\n const data = {\r\n next_batch: nextSyncToken,\r\n rooms: savedSync.roomsData,\r\n groups: savedSync.groupsData,\r\n account_data: {\r\n events: savedSync.accountData\r\n }\r\n };\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n _logger.logger.error(\"Error processing cached sync\", e.stack || e);\r\n } // Don't emit a prepared if we've bailed because the store is invalid:\r\n // in this case the client will not be usable until stopped & restarted\r\n // so this would be useless and misleading.\r\n\r\n\r\n if (!this._storeIsInvalid) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n }\r\n};\r\n/**\r\n * Invoke me to do /sync calls\r\n * @param {Object} syncOptions\r\n * @param {string} syncOptions.filterId\r\n * @param {boolean} syncOptions.hasSyncedBefore\r\n */\r\n\r\n\r\nSyncApi.prototype._sync = async function (syncOptions) {\r\n const client = this.client;\r\n\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting.\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n const syncToken = client.store.getSyncToken();\r\n let data;\r\n\r\n try {\r\n //debuglog('Starting sync since=' + syncToken);\r\n if (this._currentSyncRequest === null) {\r\n this._currentSyncRequest = this._doSyncRequest(syncOptions, syncToken);\r\n }\r\n\r\n data = await this._currentSyncRequest;\r\n } catch (e) {\r\n this._onSyncError(e, syncOptions);\r\n\r\n return;\r\n } finally {\r\n this._currentSyncRequest = null;\r\n } //debuglog('Completed sync, next_batch=' + data.next_batch);\r\n // set the sync token NOW *before* processing the events. We do this so\r\n // if something barfs on an event we can skip it rather than constantly\r\n // polling with the same token.\r\n\r\n\r\n client.store.setSyncToken(data.next_batch); // Reset after a successful sync\r\n\r\n this._failedSyncCount = 0;\r\n await client.store.setSyncData(data);\r\n const syncEventData = {\r\n oldSyncToken: syncToken,\r\n nextSyncToken: data.next_batch,\r\n catchingUp: this._catchingUp\r\n };\r\n\r\n if (this.opts.crypto) {\r\n // tell the crypto module we're about to process a sync\r\n // response\r\n await this.opts.crypto.onSyncWillProcess(syncEventData);\r\n }\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n // log the exception with stack if we have it, else fall back\r\n // to the plain description\r\n _logger.logger.error(\"Caught /sync error\", e.stack || e); // Emit the exception for client handling\r\n\r\n\r\n this.client.emit(\"sync.unexpectedError\", e);\r\n } // update this as it may have changed\r\n\r\n\r\n syncEventData.catchingUp = this._catchingUp; // emit synced events\r\n\r\n if (!syncOptions.hasSyncedBefore) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n\r\n syncOptions.hasSyncedBefore = true;\r\n } // tell the crypto module to do its processing. It may block (to do a\r\n // /keys/changes request).\r\n\r\n\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.onSyncCompleted(syncEventData);\r\n } // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates\r\n\r\n\r\n this._updateSyncState(\"SYNCING\", syncEventData);\r\n\r\n if (client.store.wantsSave()) {\r\n // We always save the device list (if it's dirty) before saving the sync data:\r\n // this means we know the saved device list data is at least as fresh as the\r\n // stored sync data which means we don't have to worry that we may have missed\r\n // device changes. We can also skip the delay since we're not calling this very\r\n // frequently (and we don't really want to delay the sync for it).\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.saveDeviceList(0);\r\n } // tell databases that everything is now in a consistent state and can be saved.\r\n\r\n\r\n client.store.save();\r\n } // Begin next sync\r\n\r\n\r\n this._sync(syncOptions);\r\n};\r\n\r\nSyncApi.prototype._doSyncRequest = function (syncOptions, syncToken) {\r\n const qps = this._getSyncParams(syncOptions, syncToken);\r\n\r\n return this.client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, qps.timeout + BUFFER_PERIOD_MS);\r\n};\r\n\r\nSyncApi.prototype._getSyncParams = function (syncOptions, syncToken) {\r\n let pollTimeout = this.opts.pollTimeout;\r\n\r\n if (this.getSyncState() !== 'SYNCING' || this._catchingUp) {\r\n // unless we are happily syncing already, we want the server to return\r\n // as quickly as possible, even if there are no events queued. This\r\n // serves two purposes:\r\n //\r\n // * When the connection dies, we want to know asap when it comes back,\r\n // so that we can hide the error from the user. (We don't want to\r\n // have to wait for an event or a timeout).\r\n //\r\n // * We want to know if the server has any to_device messages queued up\r\n // for us. We do that by calling it with a zero timeout until it\r\n // doesn't give us any more to_device messages.\r\n this._catchingUp = true;\r\n pollTimeout = 0;\r\n }\r\n\r\n let filterId = syncOptions.filterId;\r\n\r\n if (this.client.isGuest() && !filterId) {\r\n filterId = this._getGuestFilter();\r\n }\r\n\r\n const qps = {\r\n filter: filterId,\r\n timeout: pollTimeout\r\n };\r\n\r\n if (this.opts.disablePresence) {\r\n qps.set_presence = \"offline\";\r\n }\r\n\r\n if (syncToken) {\r\n qps.since = syncToken;\r\n } else {\r\n // use a cachebuster for initialsyncs, to make sure that\r\n // we don't get a stale sync\r\n // (https://github.com/vector-im/vector-web/issues/1354)\r\n qps._cacheBuster = Date.now();\r\n }\r\n\r\n if (this.getSyncState() == 'ERROR' || this.getSyncState() == 'RECONNECTING') {\r\n // we think the connection is dead. If it comes back up, we won't know\r\n // about it till /sync returns. If the timeout= is high, this could\r\n // be a long time. Set it to 0 when doing retries so we don't have to wait\r\n // for an event or a timeout before emiting the SYNCING event.\r\n qps.timeout = 0;\r\n }\r\n\r\n return qps;\r\n};\r\n\r\nSyncApi.prototype._onSyncError = function (err, syncOptions) {\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n _logger.logger.error(\"/sync error %s\", err);\r\n\r\n _logger.logger.error(err);\r\n\r\n if (this._shouldAbortSync(err)) {\r\n return;\r\n }\r\n\r\n this._failedSyncCount++;\r\n\r\n _logger.logger.log('Number of consecutive failed sync requests:', this._failedSyncCount);\r\n\r\n debuglog(\"Starting keep-alive\"); // Note that we do *not* mark the sync connection as\r\n // lost yet: we only do this if a keepalive poke\r\n // fails, since long lived HTTP connections will\r\n // go away sometimes and we shouldn't treat this as\r\n // erroneous. We set the state to 'reconnecting'\r\n // instead, so that clients can observe this state\r\n // if they wish.\r\n\r\n this._startKeepAlives().then(connDidFail => {\r\n // Only emit CATCHUP if we detected a connectivity error: if we didn't,\r\n // it's quite likely the sync will fail again for the same reason and we\r\n // want to stay in ERROR rather than keep flip-flopping between ERROR\r\n // and CATCHUP.\r\n if (connDidFail && this.getSyncState() === 'ERROR') {\r\n this._updateSyncState(\"CATCHUP\", {\r\n oldSyncToken: null,\r\n nextSyncToken: null,\r\n catchingUp: true\r\n });\r\n }\r\n\r\n this._sync(syncOptions);\r\n });\r\n\r\n this._currentSyncRequest = null; // Transition from RECONNECTING to ERROR after a given number of failed syncs\r\n\r\n this._updateSyncState(this._failedSyncCount >= FAILED_SYNC_ERROR_THRESHOLD ? \"ERROR\" : \"RECONNECTING\", {\r\n error: err\r\n });\r\n};\r\n/**\r\n * Process data returned from a sync response and propagate it\r\n * into the model objects\r\n *\r\n * @param {Object} syncEventData Object containing sync tokens associated with this sync\r\n * @param {Object} data The response from /sync\r\n */\r\n\r\n\r\nSyncApi.prototype._processSyncResponse = async function (syncEventData, data) {\r\n const client = this.client;\r\n const self = this; // data looks like:\r\n // {\r\n // next_batch: $token,\r\n // presence: { events: [] },\r\n // account_data: { events: [] },\r\n // device_lists: { changed: [\"@user:server\", ... ]},\r\n // to_device: { events: [] },\r\n // device_one_time_keys_count: { signed_curve25519: 42 },\r\n // rooms: {\r\n // invite: {\r\n // $roomid: {\r\n // invite_state: { events: [] }\r\n // }\r\n // },\r\n // join: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token, limited: true },\r\n // ephemeral: { events: [] },\r\n // summary: {\r\n // m.heroes: [ $user_id ],\r\n // m.joined_member_count: $count,\r\n // m.invited_member_count: $count\r\n // },\r\n // account_data: { events: [] },\r\n // unread_notifications: {\r\n // highlight_count: 0,\r\n // notification_count: 0,\r\n // }\r\n // }\r\n // },\r\n // leave: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token }\r\n // }\r\n // }\r\n // },\r\n // groups: {\r\n // invite: {\r\n // $groupId: {\r\n // inviter: $inviter,\r\n // profile: {\r\n // avatar_url: $avatarUrl,\r\n // name: $groupName,\r\n // },\r\n // },\r\n // },\r\n // join: {},\r\n // leave: {},\r\n // },\r\n // }\r\n // TODO-arch:\r\n // - Each event we pass through needs to be emitted via 'event', can we\r\n // do this in one place?\r\n // - The isBrandNewRoom boilerplate is boilerplatey.\r\n // handle presence events (User objects)\r\n\r\n if (data.presence && utils.isArray(data.presence.events)) {\r\n data.presence.events.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getSender());\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getSender());\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // handle non-room account_data\r\n\r\n\r\n if (data.account_data && utils.isArray(data.account_data.events)) {\r\n const events = data.account_data.events.map(client.getEventMapper());\r\n const prevEventsMap = events.reduce((m, c) => {\r\n m[c.getId()] = client.store.getAccountData(c.getType());\r\n return m;\r\n }, {});\r\n client.store.storeAccountDataEvents(events);\r\n events.forEach(function (accountDataEvent) {\r\n // Honour push rules that come down the sync stream but also\r\n // honour push rules that were previously cached. Base rules\r\n // will be updated when we receive push rules via getPushRules\r\n // (see SyncApi.prototype.sync) before syncing over the network.\r\n if (accountDataEvent.getType() === 'm.push_rules') {\r\n const rules = accountDataEvent.getContent();\r\n client.pushRules = _pushprocessor.PushProcessor.rewriteDefaultRules(rules);\r\n }\r\n\r\n const prevEvent = prevEventsMap[accountDataEvent.getId()];\r\n client.emit(\"accountData\", accountDataEvent, prevEvent);\r\n return accountDataEvent;\r\n });\r\n } // handle to-device events\r\n\r\n\r\n if (data.to_device && utils.isArray(data.to_device.events) && data.to_device.events.length > 0) {\r\n const cancelledKeyVerificationTxns = [];\r\n data.to_device.events.map(client.getEventMapper()).map(toDeviceEvent => {\r\n // map is a cheap inline forEach\r\n // We want to flag m.key.verification.start events as cancelled\r\n // if there's an accompanying m.key.verification.cancel event, so\r\n // we pull out the transaction IDs from the cancellation events\r\n // so we can flag the verification events as cancelled in the loop\r\n // below.\r\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\r\n const txnId = toDeviceEvent.getContent()['transaction_id'];\r\n\r\n if (txnId) {\r\n cancelledKeyVerificationTxns.push(txnId);\r\n }\r\n } // as mentioned above, .map is a cheap inline forEach, so return\r\n // the unmodified event.\r\n\r\n\r\n return toDeviceEvent;\r\n }).forEach(function (toDeviceEvent) {\r\n const content = toDeviceEvent.getContent();\r\n\r\n if (toDeviceEvent.getType() == \"m.room.message\" && content.msgtype == \"m.bad.encrypted\") {\r\n // the mapper already logged a warning.\r\n _logger.logger.log('Ignoring undecryptable to-device event from ' + toDeviceEvent.getSender());\r\n\r\n return;\r\n }\r\n\r\n if (toDeviceEvent.getType() === \"m.key.verification.start\" || toDeviceEvent.getType() === \"m.key.verification.request\") {\r\n const txnId = content['transaction_id'];\r\n\r\n if (cancelledKeyVerificationTxns.includes(txnId)) {\r\n toDeviceEvent.flagCancelled();\r\n }\r\n }\r\n\r\n client.emit(\"toDeviceEvent\", toDeviceEvent);\r\n });\r\n } else {\r\n // no more to-device events: we can stop polling with a short timeout.\r\n this._catchingUp = false;\r\n }\r\n\r\n if (data.groups) {\r\n if (data.groups.invite) {\r\n this._processGroupSyncEntry(data.groups.invite, 'invite');\r\n }\r\n\r\n if (data.groups.join) {\r\n this._processGroupSyncEntry(data.groups.join, 'join');\r\n }\r\n\r\n if (data.groups.leave) {\r\n this._processGroupSyncEntry(data.groups.leave, 'leave');\r\n }\r\n } // the returned json structure is a bit crap, so make it into a\r\n // nicer form (array) after applying sanity to make sure we don't fail\r\n // on missing keys (on the off chance)\r\n\r\n\r\n let inviteRooms = [];\r\n let joinRooms = [];\r\n let leaveRooms = [];\r\n\r\n if (data.rooms) {\r\n if (data.rooms.invite) {\r\n inviteRooms = this._mapSyncResponseToRoomArray(data.rooms.invite);\r\n }\r\n\r\n if (data.rooms.join) {\r\n joinRooms = this._mapSyncResponseToRoomArray(data.rooms.join);\r\n }\r\n\r\n if (data.rooms.leave) {\r\n leaveRooms = this._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n }\r\n\r\n this._notifEvents = []; // Handle invites\r\n\r\n inviteRooms.forEach(function (inviteObj) {\r\n const room = inviteObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(inviteObj.invite_state, room);\r\n\r\n self._processRoomEvents(room, stateEvents);\r\n\r\n if (inviteObj.isBrandNewRoom) {\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"invite\");\r\n }); // Handle joins\r\n\r\n await utils.promiseMapSeries(joinRooms, async function (joinObj) {\r\n const room = joinObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(joinObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(joinObj.timeline, room);\r\n\r\n const ephemeralEvents = self._mapSyncEventsFormat(joinObj.ephemeral);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(joinObj.account_data); // we do this first so it's correct when any of the events fire\r\n\r\n\r\n if (joinObj.unread_notifications) {\r\n room.setUnreadNotificationCount('total', joinObj.unread_notifications.notification_count); // We track unread notifications ourselves in encrypted rooms, so don't\r\n // bother setting it here. We trust our calculations better than the\r\n // server's for this case, and therefore will assume that our non-zero\r\n // count is accurate.\r\n\r\n const encrypted = client.isRoomEncrypted(room.roomId);\r\n\r\n if (!encrypted || encrypted && room.getUnreadNotificationCount('highlight') <= 0) {\r\n room.setUnreadNotificationCount('highlight', joinObj.unread_notifications.highlight_count);\r\n }\r\n }\r\n\r\n joinObj.timeline = joinObj.timeline || {};\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n room.getLiveTimeline().setPaginationToken(joinObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n } else if (joinObj.timeline.limited) {\r\n let limited = true; // we've got a limited sync, so we *probably* have a gap in the\r\n // timeline, so should reset. But we might have been peeking or\r\n // paginating and already have some of the events, in which\r\n // case we just want to append any subsequent events to the end\r\n // of the existing timeline.\r\n //\r\n // This is particularly important in the case that we already have\r\n // *all* of the events in the timeline - in that case, if we reset\r\n // the timeline, we'll end up with an entirely empty timeline,\r\n // which we'll try to paginate but not get any new events (which\r\n // will stop us linking the empty timeline into the chain).\r\n //\r\n\r\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\r\n const eventId = timelineEvents[i].getId();\r\n\r\n if (room.getTimelineForEvent(eventId)) {\r\n debuglog(\"Already have event \" + eventId + \" in limited \" + \"sync - not resetting\");\r\n limited = false; // we might still be missing some of the events before i;\r\n // we don't want to be adding them to the end of the\r\n // timeline because that would put them out of order.\r\n\r\n timelineEvents.splice(0, i); // XXX: there's a problem here if the skipped part of the\r\n // timeline modifies the state set in stateEvents, because\r\n // we'll end up using the state from stateEvents rather\r\n // than the later state from timelineEvents. We probably\r\n // need to wind stateEvents forward over the events we're\r\n // skipping.\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (limited) {\r\n self._deregisterStateListeners(room);\r\n\r\n room.resetLiveTimeline(joinObj.timeline.prev_batch, self.opts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken); // We have to assume any gap in any timeline is\r\n // reason to stop incrementally tracking notifications and\r\n // reset the timeline.\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n self._registerStateListeners(room);\r\n }\r\n }\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache); // set summary after processing events,\r\n // because it will trigger a name calculation\r\n // which needs the room state to be up to date\r\n\r\n\r\n if (joinObj.summary) {\r\n room.setSummary(joinObj.summary);\r\n } // we deliberately don't add ephemeral events to the timeline\r\n\r\n\r\n room.addEphemeralEvents(ephemeralEvents); // we deliberately don't add accountData to the timeline\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n async function processRoomEvent(e) {\r\n client.emit(\"event\", e);\r\n\r\n if (e.isState() && e.getType() == \"m.room.encryption\" && self.opts.crypto) {\r\n await self.opts.crypto.onCryptoEvent(e);\r\n }\r\n\r\n if (e.isState() && e.getType() === \"im.vector.user_status\") {\r\n let user = client.store.getUser(e.getStateKey());\r\n\r\n if (user) {\r\n user._unstable_updateStatusMessage(e);\r\n } else {\r\n user = createNewUser(client, e.getStateKey());\r\n\r\n user._unstable_updateStatusMessage(e);\r\n\r\n client.store.storeUser(user);\r\n }\r\n }\r\n }\r\n\r\n await utils.promiseMapSeries(stateEvents, processRoomEvent);\r\n await utils.promiseMapSeries(timelineEvents, processRoomEvent);\r\n ephemeralEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"join\");\r\n }); // Handle leaves (e.g. kicked rooms)\r\n\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(leaveObj.account_data);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (leaveObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n timelineEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"leave\");\r\n }); // update the notification timeline, if appropriate.\r\n // we only do this for live events, as otherwise we can't order them sanely\r\n // in the timeline relative to ones paginated in by /notifications.\r\n // XXX: we could fix this by making EventTimeline support chronological\r\n // ordering... but it doesn't, right now.\r\n\r\n if (syncEventData.oldSyncToken && this._notifEvents.length) {\r\n this._notifEvents.sort(function (a, b) {\r\n return a.getTs() - b.getTs();\r\n });\r\n\r\n this._notifEvents.forEach(function (event) {\r\n client.getNotifTimelineSet().addLiveEvent(event);\r\n });\r\n } // Handle device list updates\r\n\r\n\r\n if (data.device_lists) {\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists);\r\n } else {// FIXME if we *don't* have a crypto module, we still need to\r\n // invalidate the device lists. But that would require a\r\n // substantial bit of rework :/.\r\n }\r\n } // Handle one_time_keys_count\r\n\r\n\r\n if (this.opts.crypto && data.device_one_time_keys_count) {\r\n const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0;\r\n this.opts.crypto.updateOneTimeKeyCount(currentCount);\r\n }\r\n\r\n if (this.opts.crypto && data[\"org.matrix.msc2732.device_unused_fallback_key_types\"]) {\r\n // The presence of device_unused_fallback_key_types indicates that the\r\n // server supports fallback keys. If there's no unused\r\n // signed_curve25519 fallback key we need a new one.\r\n const unusedFallbackKeys = data[\"org.matrix.msc2732.device_unused_fallback_key_types\"];\r\n this.opts.crypto.setNeedsNewFallback(unusedFallbackKeys instanceof Array && !unusedFallbackKeys.includes(\"signed_curve25519\"));\r\n }\r\n};\r\n/**\r\n * Starts polling the connectivity check endpoint\r\n * @param {number} delay How long to delay until the first poll.\r\n * defaults to a short, randomised interval (to prevent\r\n * tightlooping if /versions succeeds but /sync etc. fail).\r\n * @return {promise} which resolves once the connection returns\r\n */\r\n\r\n\r\nSyncApi.prototype._startKeepAlives = function (delay) {\r\n if (delay === undefined) {\r\n delay = 2000 + Math.floor(Math.random() * 5000);\r\n }\r\n\r\n if (this._keepAliveTimer !== null) {\r\n clearTimeout(this._keepAliveTimer);\r\n }\r\n\r\n const self = this;\r\n\r\n if (delay > 0) {\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self), delay);\r\n } else {\r\n self._pokeKeepAlive();\r\n }\r\n\r\n if (!this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer = utils.defer();\r\n }\r\n\r\n return this._connectionReturnedDefer.promise;\r\n};\r\n/**\r\n * Make a dummy call to /_matrix/client/versions, to see if the HS is\r\n * reachable.\r\n *\r\n * On failure, schedules a call back to itself. On success, resolves\r\n * this._connectionReturnedDefer.\r\n *\r\n * @param {bool} connDidFail True if a connectivity failure has been detected. Optional.\r\n */\r\n\r\n\r\nSyncApi.prototype._pokeKeepAlive = function (connDidFail) {\r\n if (connDidFail === undefined) connDidFail = false;\r\n const self = this;\r\n\r\n function success() {\r\n clearTimeout(self._keepAliveTimer);\r\n\r\n if (self._connectionReturnedDefer) {\r\n self._connectionReturnedDefer.resolve(connDidFail);\r\n\r\n self._connectionReturnedDefer = null;\r\n }\r\n }\r\n\r\n this.client._http.request(undefined, // callback\r\n \"GET\", \"/_matrix/client/versions\", undefined, // queryParams\r\n undefined, // data\r\n {\r\n prefix: '',\r\n localTimeoutMs: 15 * 1000\r\n }).then(function () {\r\n success();\r\n }, function (err) {\r\n if (err.httpStatus == 400 || err.httpStatus == 404) {\r\n // treat this as a success because the server probably just doesn't\r\n // support /versions: point is, we're getting a response.\r\n // We wait a short time though, just in case somehow the server\r\n // is in a mode where it 400s /versions responses and sync etc.\r\n // responses fail, this will mean we don't hammer in a loop.\r\n self._keepAliveTimer = setTimeout(success, 2000);\r\n } else {\r\n connDidFail = true;\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self, connDidFail), 5000 + Math.floor(Math.random() * 5000)); // A keepalive has failed, so we emit the\r\n // error state (whether or not this is the\r\n // first failure).\r\n // Note we do this after setting the timer:\r\n // this lets the unit tests advance the mock\r\n // clock when they get the error.\r\n\r\n self._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n }\r\n });\r\n};\r\n/**\r\n * @param {Object} groupsSection Groups section object, eg. response.groups.invite\r\n * @param {string} sectionName Which section this is ('invite', 'join' or 'leave')\r\n */\r\n\r\n\r\nSyncApi.prototype._processGroupSyncEntry = function (groupsSection, sectionName) {\r\n // Processes entries from 'groups' section of the sync stream\r\n for (const groupId of Object.keys(groupsSection)) {\r\n const groupInfo = groupsSection[groupId];\r\n let group = this.client.store.getGroup(groupId);\r\n const isBrandNew = group === null;\r\n\r\n if (group === null) {\r\n group = this.createGroup(groupId);\r\n }\r\n\r\n if (groupInfo.profile) {\r\n group.setProfile(groupInfo.profile.name, groupInfo.profile.avatar_url);\r\n }\r\n\r\n if (groupInfo.inviter) {\r\n group.setInviter({\r\n userId: groupInfo.inviter\r\n });\r\n }\r\n\r\n group.setMyMembership(sectionName);\r\n\r\n if (isBrandNew) {\r\n // Now we've filled in all the fields, emit the Group event\r\n this.client.emit(\"Group\", group);\r\n }\r\n }\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @return {Object[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncResponseToRoomArray = function (obj) {\r\n // Maps { roomid: {stuff}, roomid: {stuff} }\r\n // to\r\n // [{stuff+Room+isBrandNewRoom}, {stuff+Room+isBrandNewRoom}]\r\n const client = this.client;\r\n const self = this;\r\n return utils.keys(obj).map(function (roomId) {\r\n const arrObj = obj[roomId];\r\n let room = client.store.getRoom(roomId);\r\n let isBrandNewRoom = false;\r\n\r\n if (!room) {\r\n room = self.createRoom(roomId);\r\n isBrandNewRoom = true;\r\n }\r\n\r\n arrObj.room = room;\r\n arrObj.isBrandNewRoom = isBrandNewRoom;\r\n return arrObj;\r\n });\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @param {Room} room\r\n * @return {MatrixEvent[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncEventsFormat = function (obj, room) {\r\n if (!obj || !utils.isArray(obj.events)) {\r\n return [];\r\n }\r\n\r\n const mapper = this.client.getEventMapper();\r\n return obj.events.map(function (e) {\r\n if (room) {\r\n e.room_id = room.roomId;\r\n }\r\n\r\n return mapper(e);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n */\r\n\r\n\r\nSyncApi.prototype._resolveInvites = function (room) {\r\n if (!room || !this.opts.resolveInvitesToProfiles) {\r\n return;\r\n }\r\n\r\n const client = this.client; // For each invited room member we want to give them a displayname/avatar url\r\n // if they have one (the m.room.member invites don't contain this).\r\n\r\n room.getMembersWithMembership(\"invite\").forEach(function (member) {\r\n if (member._requestedProfileInfo) {\r\n return;\r\n }\r\n\r\n member._requestedProfileInfo = true; // try to get a cached copy first.\r\n\r\n const user = client.getUser(member.userId);\r\n let promise;\r\n\r\n if (user) {\r\n promise = Promise.resolve({\r\n avatar_url: user.avatarUrl,\r\n displayname: user.displayName\r\n });\r\n } else {\r\n promise = client.getProfileInfo(member.userId);\r\n }\r\n\r\n promise.then(function (info) {\r\n // slightly naughty by doctoring the invite event but this means all\r\n // the code paths remain the same between invite/join display name stuff\r\n // which is a worthy trade-off for some minor pollution.\r\n const inviteEvent = member.events.member;\r\n\r\n if (inviteEvent.getContent().membership !== \"invite\") {\r\n // between resolving and now they have since joined, so don't clobber\r\n return;\r\n }\r\n\r\n inviteEvent.getContent().avatar_url = info.avatar_url;\r\n inviteEvent.getContent().displayname = info.displayname; // fire listeners\r\n\r\n member.setMembershipEvent(inviteEvent, room.currentState);\r\n }, function (err) {// OH WELL.\r\n });\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} stateEventList A list of state events. This is the state\r\n * at the *START* of the timeline list if it is supplied.\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processRoomEvents = function (room, stateEventList, timelineEventList, fromCache) {\r\n // If there are no events in the timeline yet, initialise it with\r\n // the given state events\r\n const liveTimeline = room.getLiveTimeline();\r\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\r\n\r\n if (timelineWasEmpty) {\r\n // Passing these events into initialiseState will freeze them, so we need\r\n // to compute and cache the push actions for them now, otherwise sync dies\r\n // with an attempt to assign to read only property.\r\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\r\n // these functions that it shouldn't be. We should probably either store the\r\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\r\n // find some solution where MatrixEvents are immutable but allow for a cache\r\n // field.\r\n for (const ev of stateEventList) {\r\n this.client.getPushActionsForEvent(ev);\r\n }\r\n\r\n liveTimeline.initialiseState(stateEventList);\r\n }\r\n\r\n this._resolveInvites(room); // recalculate the room name at this point as adding events to the timeline\r\n // may make notifications appear which should have the right name.\r\n // XXX: This looks suspect: we'll end up recalculating the room once here\r\n // and then again after adding events (_processSyncResponse calls it after\r\n // calling us) even if no state events were added. It also means that if\r\n // one of the room events in timelineEventList is something that needs\r\n // a recalculation (like m.room.name) we won't recalculate until we've\r\n // finished adding all the events, which will cause the notification to have\r\n // the old room name rather than the new one.\r\n\r\n\r\n room.recalculate(); // If the timeline wasn't empty, we process the state events here: they're\r\n // defined as updates to the state before the start of the timeline, so this\r\n // starts to roll the state forward.\r\n // XXX: That's what we *should* do, but this can happen if we were previously\r\n // peeking in a room, in which case we obviously do *not* want to add the\r\n // state events here onto the end of the timeline. Historically, the js-sdk\r\n // has just set these new state events on the old and new state. This seems\r\n // very wrong because there could be events in the timeline that diverge the\r\n // state, in which case this is going to leave things out of sync. However,\r\n // for now I think it;s best to behave the same as the code has done previously.\r\n\r\n if (!timelineWasEmpty) {\r\n // XXX: As above, don't do this...\r\n //room.addLiveEvents(stateEventList || []);\r\n // Do this instead...\r\n room.oldState.setStateEvents(stateEventList || []);\r\n room.currentState.setStateEvents(stateEventList || []);\r\n } // execute the timeline events. This will continue to diverge the current state\r\n // if the timeline has any state events in it.\r\n // This also needs to be done before running push rules on the events as they need\r\n // to be decorated with sender etc.\r\n\r\n\r\n room.addLiveEvents(timelineEventList || [], null, fromCache);\r\n};\r\n/**\r\n * Takes a list of timelineEvents and adds and adds to _notifEvents\r\n * as appropriate.\r\n * This must be called after the room the events belong to has been stored.\r\n *\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processEventsForNotifs = function (room, timelineEventList) {\r\n // gather our notifications into this._notifEvents\r\n if (this.client.getNotifTimelineSet()) {\r\n for (let i = 0; i < timelineEventList.length; i++) {\r\n const pushActions = this.client.getPushActionsForEvent(timelineEventList[i]);\r\n\r\n if (pushActions && pushActions.notify && pushActions.tweaks && pushActions.tweaks.highlight) {\r\n this._notifEvents.push(timelineEventList[i]);\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * @return {string}\r\n */\r\n\r\n\r\nSyncApi.prototype._getGuestFilter = function () {\r\n const guestRooms = this.client._guestRooms; // FIXME: horrible gut-wrenching\r\n\r\n if (!guestRooms) {\r\n return \"{}\";\r\n } // we just need to specify the filter inline if we're a guest because guests\r\n // can't create filters.\r\n\r\n\r\n return JSON.stringify({\r\n room: {\r\n timeline: {\r\n limit: 20\r\n }\r\n }\r\n });\r\n};\r\n/**\r\n * Sets the sync state and emits an event to say so\r\n * @param {String} newState The new state string\r\n * @param {Object} data Object of additional data to emit in the event\r\n */\r\n\r\n\r\nSyncApi.prototype._updateSyncState = function (newState, data) {\r\n const old = this._syncState;\r\n this._syncState = newState;\r\n this._syncStateData = data;\r\n this.client.emit(\"sync\", this._syncState, old, data);\r\n};\r\n/**\r\n * Event handler for the 'online' event\r\n * This event is generally unreliable and precise behaviour\r\n * varies between browsers, so we poll for connectivity too,\r\n * but this might help us reconnect a little faster.\r\n */\r\n\r\n\r\nSyncApi.prototype._onOnline = function () {\r\n debuglog(\"Browser thinks we are back online\");\r\n\r\n this._startKeepAlives(0);\r\n};\r\n\r\nfunction createNewUser(client, userId) {\r\n const user = new _user.User(userId);\r\n client.reEmitter.reEmit(user, [\"User.avatarUrl\", \"User.displayName\", \"User.presence\", \"User.currentlyActive\", \"User.lastPresenceTs\"]);\r\n return user;\r\n}","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\"","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".topheader[data-v-62a1ab6a]{top:0;z-index:999}.newChat[data-v-62a1ab6a] #maincontent .headerSpacer,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapper,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapperOvf{overflow:visible!important}.newChat.minimized.active[data-v-62a1ab6a] #maincontent .desktopList{display:none}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"br[data-v-ba5ac396]{content:\\\"\\\"}.sname[data-v-ba5ac396]{font-weight:700}.listPreview[data-v-ba5ac396]{display:flex;align-items:center}.statusWrapper[data-v-ba5ac396]{padding-left:.5em}.statusWrapper .my[data-v-ba5ac396]{font-size:.6em;opacity:.5}.previewMessage[data-v-ba5ac396]{min-height:25px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar colorString = require('color-string');\nvar convert = require('color-convert');\n\nvar _slice = [].slice;\n\nvar skippedModels = [\n\t// to be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// shouldn't really be in color-convert either...\n\t'hex'\n];\n\nvar hashedModelKeys = {};\nObject.keys(convert).forEach(function (model) {\n\thashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;\n});\n\nvar limiters = {};\n\nfunction Color(obj, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tvar i;\n\tvar channels;\n\n\tif (obj == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (obj instanceof Color) {\n\t\tthis.model = obj.model;\n\t\tthis.color = obj.color.slice();\n\t\tthis.valpha = obj.valpha;\n\t} else if (typeof obj === 'string') {\n\t\tvar result = colorString.get(obj);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + obj);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (obj.length) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tvar newArr = _slice.call(obj, 0, channels);\n\t\tthis.color = zeroArray(newArr, channels);\n\t\tthis.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;\n\t} else if (typeof obj === 'number') {\n\t\t// this is always RGB - can be converted later on.\n\t\tobj &= 0xFFFFFF;\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(obj >> 16) & 0xFF,\n\t\t\t(obj >> 8) & 0xFF,\n\t\t\tobj & 0xFF\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tvar keys = Object.keys(obj);\n\t\tif ('alpha' in obj) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;\n\t\t}\n\n\t\tvar hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(obj));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tvar labels = convert[this.model].labels;\n\t\tvar color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(obj[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tvar limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString: function () {\n\t\treturn this.string();\n\t},\n\n\ttoJSON: function () {\n\t\treturn this[this.model]();\n\t},\n\n\tstring: function (places) {\n\t\tvar self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to[self.model](args);\n\t},\n\n\tpercentString: function (places) {\n\t\tvar self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to.rgb.percent(args);\n\t},\n\n\tarray: function () {\n\t\treturn this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);\n\t},\n\n\tobject: function () {\n\t\tvar result = {};\n\t\tvar channels = convert[this.model].channels;\n\t\tvar labels = convert[this.model].labels;\n\n\t\tfor (var i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray: function () {\n\t\tvar rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject: function () {\n\t\tvar rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround: function (places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);\n\t},\n\n\talpha: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(100)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(100)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn colorString.to.hex(this.rgb().round().color);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.rgb().color;\n\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.rgb().color;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight: function () {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = this.rgb();\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\t\treturn rgb;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale: function () {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar rgb = this.rgb().color;\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(val, val, val);\n\t},\n\n\tfade: function (ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer: function (ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.hsl();\n\t\tvar hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix: function (mixinColor, weight) {\n\t\t// ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\t\tvar color1 = mixinColor.rgb();\n\t\tvar color2 = this.rgb();\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t}\n};\n\n// model conversion methods and static constructors\nObject.keys(convert).forEach(function (model) {\n\tif (skippedModels.indexOf(model) !== -1) {\n\t\treturn;\n\t}\n\n\tvar channels = convert[model].channels;\n\n\t// conversion methods\n\tColor.prototype[model] = function () {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments.length) {\n\t\t\treturn new Color(arguments, model);\n\t\t}\n\n\t\tvar newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;\n\t\treturn new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (color) {\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(_slice.call(arguments), channels);\n\t\t}\n\t\treturn new Color(color, model);\n\t};\n});\n\nfunction roundTo(num, places) {\n\treturn Number(num.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (num) {\n\t\treturn roundTo(num, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tmodel.forEach(function (m) {\n\t\t(limiters[m] || (limiters[m] = []))[channel] = modifier;\n\t});\n\n\tmodel = model[0];\n\n\treturn function (val) {\n\t\tvar result;\n\n\t\tif (arguments.length) {\n\t\t\tif (modifier) {\n\t\t\t\tval = modifier(val);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = val;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(val) {\n\treturn Array.isArray(val) ? val : [val];\n}\n\nfunction zeroArray(arr, length) {\n\tfor (var i = 0; i < length; i++) {\n\t\tif (typeof arr[i] !== 'number') {\n\t\t\tarr[i] = 0;\n\t\t}\n\t}\n\n\treturn arr;\n}\n\nmodule.exports = Color;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__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 (_) 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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar axios_1 = __importDefault(require(\"axios\"));\nvar CancelToken = axios_1.default.CancelToken;\n/**\n * Axios request with timeout throw\n */\nfunction axiosRequest(config) {\n return __awaiter(this, void 0, void 0, function () {\n var timeout, cancel;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n timeout = config.timeout;\n if (timeout) {\n config.cancelToken = new CancelToken(function (c) { return cancel = c; });\n setTimeout(function () {\n cancel('timeout cancel', { timeout: timeout });\n }, timeout);\n }\n return [4 /*yield*/, axios_1.default(config)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexports.default = axiosRequest;\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryStore = MemoryStore;\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link MemoryStore} for the public class.\r\n * @module store/memory\r\n */\r\nfunction isValidFilterId(filterId) {\r\n const isValidStr = typeof filterId === \"string\" && !!filterId && filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\r\n filterId !== \"null\";\r\n return isValidStr || typeof filterId === \"number\";\r\n}\r\n/**\r\n * Construct a new in-memory data store for the Matrix Client.\r\n * @constructor\r\n * @param {Object=} opts Config options\r\n * @param {LocalStorage} opts.localStorage The local storage instance to persist\r\n * some forms of data such as tokens. Rooms will NOT be stored.\r\n */\r\n\r\n\r\nfunction MemoryStore(opts) {\r\n opts = opts || {};\r\n this.rooms = {// roomId: Room\r\n };\r\n this.groups = {// groupId: Group\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n this.localStorage = opts.localStorage;\r\n this._oobMembers = {// roomId: [member events]\r\n };\r\n this._clientOptions = {};\r\n}\r\n\r\nMemoryStore.prototype = {\r\n /**\r\n * Retrieve the token to stream from.\r\n * @return {string} The token or null.\r\n */\r\n getSyncToken: function () {\r\n return this.syncToken;\r\n },\r\n\r\n /** @return {Promise} whether or not the database was newly created in this session. */\r\n isNewlyCreated: function () {\r\n return Promise.resolve(true);\r\n },\r\n\r\n /**\r\n * Set the token to stream from.\r\n * @param {string} token The token to stream from.\r\n */\r\n setSyncToken: function (token) {\r\n this.syncToken = token;\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Group} group The group to be stored\r\n */\r\n storeGroup: function (group) {\r\n this.groups[group.groupId] = group;\r\n },\r\n\r\n /**\r\n * Retrieve a group by its group ID.\r\n * @param {string} groupId The group ID.\r\n * @return {Group} The group or null.\r\n */\r\n getGroup: function (groupId) {\r\n return this.groups[groupId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known groups.\r\n * @return {Group[]} A list of groups, which may be empty.\r\n */\r\n getGroups: function () {\r\n return utils.values(this.groups);\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Room} room The room to be stored. All properties must be stored.\r\n */\r\n storeRoom: function (room) {\r\n this.rooms[room.roomId] = room; // add listeners for room member changes so we can keep the room member\r\n // map up-to-date.\r\n\r\n room.currentState.on(\"RoomState.members\", this._onRoomMember.bind(this)); // add existing members\r\n\r\n const self = this;\r\n room.currentState.getMembers().forEach(function (m) {\r\n self._onRoomMember(null, room.currentState, m);\r\n });\r\n },\r\n\r\n /**\r\n * Called when a room member in a room being tracked by this store has been\r\n * updated.\r\n * @param {MatrixEvent} event\r\n * @param {RoomState} state\r\n * @param {RoomMember} member\r\n */\r\n _onRoomMember: function (event, state, member) {\r\n if (member.membership === \"invite\") {\r\n // We do NOT add invited members because people love to typo user IDs\r\n // which would then show up in these lists (!)\r\n return;\r\n }\r\n\r\n const user = this.users[member.userId] || new _user.User(member.userId);\r\n\r\n if (member.name) {\r\n user.setDisplayName(member.name);\r\n\r\n if (member.events.member) {\r\n user.setRawDisplayName(member.events.member.getDirectionalContent().displayname);\r\n }\r\n }\r\n\r\n if (member.events.member && member.events.member.getContent().avatar_url) {\r\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\r\n }\r\n\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a room by its' room ID.\r\n * @param {string} roomId The room ID.\r\n * @return {Room} The room or null.\r\n */\r\n getRoom: function (roomId) {\r\n return this.rooms[roomId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known rooms.\r\n * @return {Room[]} A list of rooms, which may be empty.\r\n */\r\n getRooms: function () {\r\n return utils.values(this.rooms);\r\n },\r\n\r\n /**\r\n * Permanently delete a room.\r\n * @param {string} roomId\r\n */\r\n removeRoom: function (roomId) {\r\n if (this.rooms[roomId]) {\r\n this.rooms[roomId].removeListener(\"RoomState.members\", this._onRoomMember);\r\n }\r\n\r\n delete this.rooms[roomId];\r\n },\r\n\r\n /**\r\n * Retrieve a summary of all the rooms.\r\n * @return {RoomSummary[]} A summary of each room.\r\n */\r\n getRoomSummaries: function () {\r\n return utils.map(utils.values(this.rooms), function (room) {\r\n return room.summary;\r\n });\r\n },\r\n\r\n /**\r\n * Store a User.\r\n * @param {User} user The user to store.\r\n */\r\n storeUser: function (user) {\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a User by its' user ID.\r\n * @param {string} userId The user ID.\r\n * @return {User} The user or null.\r\n */\r\n getUser: function (userId) {\r\n return this.users[userId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known users.\r\n * @return {User[]} A list of users, which may be empty.\r\n */\r\n getUsers: function () {\r\n return utils.values(this.users);\r\n },\r\n\r\n /**\r\n * Retrieve scrollback for this room.\r\n * @param {Room} room The matrix room\r\n * @param {integer} limit The max number of old events to retrieve.\r\n * @return {Array} An array of objects which will be at most 'limit'\r\n * length and at least 0. The objects are the raw event JSON.\r\n */\r\n scrollback: function (room, limit) {\r\n return [];\r\n },\r\n\r\n /**\r\n * Store events for a room. The events have already been added to the timeline\r\n * @param {Room} room The room to store events for.\r\n * @param {Array} events The events to store.\r\n * @param {string} token The token associated with these events.\r\n * @param {boolean} toStart True if these are paginated results.\r\n */\r\n storeEvents: function (room, events, token, toStart) {// no-op because they've already been added to the room instance.\r\n },\r\n\r\n /**\r\n * Store a filter.\r\n * @param {Filter} filter\r\n */\r\n storeFilter: function (filter) {\r\n if (!filter) {\r\n return;\r\n }\r\n\r\n if (!this.filters[filter.userId]) {\r\n this.filters[filter.userId] = {};\r\n }\r\n\r\n this.filters[filter.userId][filter.filterId] = filter;\r\n },\r\n\r\n /**\r\n * Retrieve a filter.\r\n * @param {string} userId\r\n * @param {string} filterId\r\n * @return {?Filter} A filter or null.\r\n */\r\n getFilter: function (userId, filterId) {\r\n if (!this.filters[userId] || !this.filters[userId][filterId]) {\r\n return null;\r\n }\r\n\r\n return this.filters[userId][filterId];\r\n },\r\n\r\n /**\r\n * Retrieve a filter ID with the given name.\r\n * @param {string} filterName The filter name.\r\n * @return {?string} The filter ID or null.\r\n */\r\n getFilterIdByName: function (filterName) {\r\n if (!this.localStorage) {\r\n return null;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName; // XXX Storage.getItem doesn't throw ...\r\n // or are we using something different\r\n // than window.localStorage in some cases\r\n // that does throw?\r\n // that would be very naughty\r\n\r\n try {\r\n const value = this.localStorage.getItem(key);\r\n\r\n if (isValidFilterId(value)) {\r\n return value;\r\n }\r\n } catch (e) {}\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Set a filter name to ID mapping.\r\n * @param {string} filterName\r\n * @param {string} filterId\r\n */\r\n setFilterIdByName: function (filterName, filterId) {\r\n if (!this.localStorage) {\r\n return;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName;\r\n\r\n try {\r\n if (isValidFilterId(filterId)) {\r\n this.localStorage.setItem(key, filterId);\r\n } else {\r\n this.localStorage.removeItem(key);\r\n }\r\n } catch (e) {}\r\n },\r\n\r\n /**\r\n * Store user-scoped account data events.\r\n * N.B. that account data only allows a single event per type, so multiple\r\n * events with the same type will replace each other.\r\n * @param {Array} events The events to store.\r\n */\r\n storeAccountDataEvents: function (events) {\r\n const self = this;\r\n events.forEach(function (event) {\r\n self.accountData[event.getType()] = event;\r\n });\r\n },\r\n\r\n /**\r\n * Get account data event by event type\r\n * @param {string} eventType The event type being queried\r\n * @return {?MatrixEvent} the user account_data event of given type, if any\r\n */\r\n getAccountData: function (eventType) {\r\n return this.accountData[eventType];\r\n },\r\n\r\n /**\r\n * setSyncData does nothing as there is no backing data store.\r\n *\r\n * @param {Object} syncData The sync data\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n setSyncData: function (syncData) {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * We never want to save becase we have nothing to save to.\r\n *\r\n * @return {boolean} If the store wants to save\r\n */\r\n wantsSave: function () {\r\n return false;\r\n },\r\n\r\n /**\r\n * Save does nothing as there is no backing data store.\r\n * @param {bool} force True to force a save (but the memory\r\n * store still can't save anything)\r\n */\r\n save: function (force) {},\r\n\r\n /**\r\n * Startup does nothing as this store doesn't require starting up.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n startup: function () {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n getSavedSync: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n getSavedSyncToken: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * Delete all data from this store.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n deleteAllData: function () {\r\n this.rooms = {// roomId: Room\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n getOutOfBandMembers: function (roomId) {\r\n return Promise.resolve(this._oobMembers[roomId] || null);\r\n },\r\n\r\n /**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n setOutOfBandMembers: function (roomId, membershipEvents) {\r\n this._oobMembers[roomId] = membershipEvents;\r\n return Promise.resolve();\r\n },\r\n clearOutOfBandMembers: function () {\r\n this._oobMembers = {};\r\n return Promise.resolve();\r\n },\r\n getClientOptions: function () {\r\n return Promise.resolve(this._clientOptions);\r\n },\r\n storeClientOptions: function (options) {\r\n this._clientOptions = Object.assign({}, options);\r\n return Promise.resolve();\r\n }\r\n};","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"wrapper table\"},[_c('div',{staticClass:\"filecontent\"},[_c('div',{staticClass:\"name\"},[_c('span',[_vm._v(_vm._s(_vm.file.name))])]),_c('div',{staticClass:\"size\"},[_c('span',[_vm._v(_vm._s(_vm.humanReadableSize(_vm.file.size)))])]),(!_vm.encryptedData)?_c('div',{staticClass:\"download\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('button',{staticClass:\"button small rounded\"},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]):_c('div',{staticClass:\"download\"},[_c('button',{staticClass:\"button small rounded\",on:{\"click\":_vm.download}},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]),_c('div',{staticClass:\"icon\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('i',{staticClass:\"fas fa-file-download\"})])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f8b05de&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0f8b05de&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0f8b05de\",\n null\n ,true\n)\n\nexport default component.exports","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".m-message-container{position:fixed;z-index:1010;pointer-events:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;padding:15px}.m-message-container.is-top-center,.m-message-container.is-top-left,.m-message-container.is-top-right{width:100%;top:0;left:0}.m-message-container.is-top-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-top-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-top-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.is-center{width:100%;height:100%;left:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-message-container.is-bottom-center,.m-message-container.is-bottom-left,.m-message-container.is-bottom-right{bottom:0;left:0;width:100%;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.m-message-container.is-bottom-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-bottom-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-bottom-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.has-mask{background-color:hsla(0,0%,100%,.5);width:100%;height:100%;pointer-events:all}.m-message-wrapper{display:inline-block;max-width:500px}.m-message-wrapper+.m-message-wrapper{margin-top:15px}.m-message-wrapper:after,.m-message-wrapper:before{content:\\\"\\\";clear:both;display:table}.m-message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 16px;font-size:14px;overflow:hidden;border-radius:4px;-webkit-box-shadow:0 1px 8px rgba(0,0,0,.15);box-shadow:0 1px 8px rgba(0,0,0,.15);color:rgba(0,0,0,.65);background:hsla(0,0%,100%,.95);pointer-events:all;position:relative}.m-message,.m-message-icons{-webkit-box-sizing:border-box;box-sizing:border-box}.m-message-icons{float:left;margin-right:10px}.m-message--title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-message-content{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto;width:100%}.m-message--description{line-height:1.6;color:#777}.m-message--title+.m-message--description{margin-top:5px}.m-message--icon{width:25px;height:25px;vertical-align:middle;display:inline-block;border-radius:50%}.m-message--control{position:relative;height:100%;-ms-flex-item-align:start;align-self:flex-start;white-space:nowrap;margin-right:-5px;margin-left:10px}.m-message--button{border:none;outline:none;background:none;cursor:pointer;font-size:15px;color:#646464;font-weight:600;padding:0;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle}.m-message--button:hover{color:#f56c6c}.m-message--arrow-down.is-collapsed{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.m-message-fade-enter-active{-webkit-animation:m-message-fade-in-down .3s;animation:m-message-fade-in-down .3s}.m-message-fade-leave-active{-webkit-animation:m-message-fade-out .3s;animation:m-message-fade-out .3s}@-webkit-keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}@keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","\"use strict\";\n// Copyright (C) 2017 Tony Arcieri\n// MIT License. See LICENSE file for details.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst block_1 = require(\"../../internals/block\");\n/**\n * WebCrypto-based implementation of the AES block cipher.\n *\n * This implementation (ab)uses AES-CBC mode to implement AES-ECB. This is\n * likely to be rather slow, as it requires an async call per block, and\n * discards half the buffer.\n *\n * In theory it should be constant time due to the use of WebCrypto (provided\n * the browser's implementation is constant time), but it could probably benefit\n * from some clever optimization work, or improvements to the WebCrypto API.\n *\n * Some WebCrypto implementations (e.g. node-webcrypto-ossl) support ECB mode\n * natively, so we could take advantage of that to potentially encrypt multiple\n * blocks in a single invocation.\n *\n * Key size: 16 or 32 bytes, block size: 16 bytes.\n */\nclass WebCryptoAes {\n constructor(_crypto, _key) {\n this._crypto = _crypto;\n this._key = _key;\n // An initialization vector of all zeros, exposing the raw AES function\n this._iv = new block_1.default();\n this._emptyPromise = Promise.resolve(this);\n }\n /**\n * Create a new WebCryptoAes instance\n *\n * @param {Crypto} crypto - the Web Cryptography provider\n * @param {Uint8Array} keyData - the AES secret key\n * @returns {Promise}\n */\n encryptBlock(block) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = { name: \"AES-CBC\", iv: this._iv.data };\n const ctBlock = yield this._crypto.subtle.encrypt(params, this._key, block.data);\n // TODO: a more efficient way to do in-place encryption?\n block.data.set(new Uint8Array(ctBlock, 0, block_1.default.SIZE));\n return this._emptyPromise;\n });\n }\n}\nexports.default = WebCryptoAes;\n","\"use strict\";\n/** Type which represents AES blocks */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst constant_time_1 = require(\"./constant-time\");\nconst wipe_1 = require(\"./wipe\");\n/** An AES block (128-bits) */\nclass Block {\n constructor() {\n this.data = new Uint8Array(Block.SIZE);\n }\n /**\n * Clear the given array by setting its values to zero.\n *\n * WARNING: The fact that it sets bytes to zero can be relied on.\n *\n * There is no guarantee that this function makes data disappear from memory,\n * as runtime implementation can, for example, have copying garbage collector\n * that will make copies of sensitive data before we wipe it. Or that an\n * operating system will write our data to swap or sleep image. Another thing\n * is that an optimizing compiler can remove calls to this function or make it\n * no-op. There's nothing we can do with it, so we just do our best and hope\n * that everything will be okay and good will triumph over evil.\n */\n clear() {\n wipe_1.wipe(this.data);\n }\n /**\n * Make a copy of this block, returning a new block\n */\n clone() {\n const ret = new Block();\n ret.copy(this);\n return ret;\n }\n /** Copy the contents of another block into this one */\n copy(other) {\n this.data.set(other.data);\n }\n /**\n * Double a value over GF(2^128):\n *\n * a<<1 if firstbit(a)=0\n * (a<<1) ⊕ 0¹²⁰10000111 if firstbit(a)=1\n */\n dbl() {\n let carry = 0;\n for (let i = Block.SIZE - 1; i >= 0; i--) {\n const b = (this.data[i] >>> 7) & 0xff;\n this.data[i] = (this.data[i] << 1) | carry;\n carry = b;\n }\n this.data[Block.SIZE - 1] ^= constant_time_1.select(carry, Block.R, 0);\n carry = 0;\n }\n}\n/** Size of a block as used by the AES cipher */\nBlock.SIZE = 16;\n/** Minimal irreducible polynomial for a 128-bit block size */\nBlock.R = 0x87;\nexports.default = Block;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chats.vue?vue&type=template&id=62a1ab6a&scoped=true&\"\nimport script from \"./chats.vue?vue&type=script&lang=js&\"\nexport * from \"./chats.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"62a1ab6a\",\n null\n ,true\n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7ed73c7c&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7ed73c7c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7ed73c7c\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./name.vue?vue&type=template&id=72a9c575&scoped=true&\"\nimport script from \"./name.vue?vue&type=script&lang=js&\"\nexport * from \"./name.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"72a9c575\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".previewWrapper[data-v-691bf714]{height:60px;position:absolute;top:0;width:100%;display:flex;align-items:center;justify-content:flex-start;padding:0;border-bottom:1px solid rgb(var(--background-main))}.previewWrapper .previewContact[data-v-691bf714],.previewWrapper .previewContactSelect[data-v-691bf714]{width:100%}.previewWrapper .previewBox[data-v-691bf714]{width:100%;display:flex;justify-content:space-between;align-items:center}.previewWrapper .previewBox .previewWrapper[data-v-691bf714]{flex-grow:1;width:100%}.previewWrapper .checkBox[data-v-691bf714]{text-align:center;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList[data-v-691bf714]{margin-bottom:8px}.contactList .title[data-v-691bf714]{padding:0 .5em}.contactList.minimized .title[data-v-691bf714]{display:none}.contactList.minimized .previewWrapper[data-v-691bf714]{padding:.5em 0;border-bottom:0;cursor:pointer}.contactList.minimized .previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList.minimized .previewWrapper[data-v-691bf714] .previewWrapper{padding:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".matrin[data-v-9d2b1700]{margin:0 auto 0 0!important}.msgAction[data-v-9d2b1700]{position:absolute}.msgAction[data-v-9d2b1700]:before{content:\\\"\\\";display:block;width:100%;height:100%;position:fixed;z-index:10;opacity:.9;left:0;right:0;top:0;bottom:0}.msgAction .contentAction[data-v-9d2b1700],.msgAction[data-v-9d2b1700]:before{background-color:rgb(var(--background-main))}.msgAction .contentAction[data-v-9d2b1700]{width:180px;position:relative;z-index:300;border:.1em solid rgb(var(--neutral-grad-0));border-radius:.8em;margin:.6em 0 0 auto}.msgAction .contentAction ul[data-v-9d2b1700]{padding:0;list-style:none;margin:0;display:block;width:100%;height:100%}.msgAction .contentAction ul li[data-v-9d2b1700]{display:flex;justify-content:space-between;padding:.2em .8em;align-items:center;border-top:.1em solid rgb(var(--neutral-grad-1));font-size:1em}.msgAction .contentAction ul li[data-v-9d2b1700]:first-child{border:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".outer-div[data-v-e4f39dca]{line-height:inherit;border-radius:50%}.dropDownIcon[data-v-e4f39dca]{width:35px;height:35px;line-height:35px}.dropDownIcon i[data-v-e4f39dca]{line-height:35px!important}.menuwrapper[data-v-e4f39dca]{padding-left:1em;padding-right:1em;padding-bottom:1em;position:absolute;z-index:100;bottom:0;left:0;right:0}.menuwrapper[data-v-e4f39dca] .items{max-height:500px;overflow-y:auto;border-radius:3px;padding-left:.5em;padding-right:.5em;padding-bottom:.5em}.dropdown[data-v-e4f39dca]{z-index:10000;position:absolute;width:100%;right:0;height:auto;color:rgb(var(--text-color));transition:.3s;bottom:-100em;top:100em}.dropdown .backgr[data-v-e4f39dca]{background:rgba(var(--background-total-theme),.15);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);position:fixed;z-index:100;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}.dropdown.visible[data-v-e4f39dca]{bottom:0;top:0}.dropdown.visible .backgr[data-v-e4f39dca]{opacity:1}.dropdown[data-v-e4f39dca] .contentWrapper{margin-top:.25em;border-radius:10px;overflow:hidden}.dropdown .contentWrapper[data-v-e4f39dca],.dropdown[data-v-e4f39dca] .contentWrapper{border-top:1px solid rgba(var(--neutral-grad-1),.5);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .cancelWrapper .menu-item[data-v-e4f39dca]{margin-top:0;box-shadow:none;color:rgb(var(--neutral-grad-3));box-shadow:0 5px 5px -3px rgba(var(--color-shadow-base),.4)}.dropdown .menu-item[data-v-e4f39dca]{padding:.5em;background:rgb(var(--background-total-theme));color:rgb(var(--neutral-grad-3));line-height:44px;margin-top:.25em;display:flex;border-radius:10px;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .menu-item .title[data-v-e4f39dca]{flex-grow:2;padding-right:44px;text-align:center}.dropdown .menu-item .iconWrapper[data-v-e4f39dca]{width:44px;text-align:center}.dropdown .blocker[data-v-e4f39dca]{position:fixed;top:0;left:0;bottom:0;right:0;content:\\\" \\\"}.cancelWrapper[data-v-e4f39dca]{border-radius:3px;padding-left:.5em;padding-right:.5em;color:rgb(var(--neutral-grad-3))}.small[data-v-e4f39dca]{font-size:.85em}.outer-div.mobile .menuwrapper[data-v-e4f39dca]{position:fixed}.outer-div.minimized[data-v-e4f39dca]{position:static}.outer-div.minimized .backgr[data-v-e4f39dca]{border-radius:4px;height:1000px;bottom:0;top:auto;background:transparent;position:absolute}.outer-div.minimized .dropdown[data-v-e4f39dca]{z-index:10000;right:0}.outer-div.minimized .menuwrapper[data-v-e4f39dca]{border-radius:4px;padding-top:.5em}.outer-div.minimized .menuwrapper[data-v-e4f39dca] .menu-item{margin-top:.25em;border-radius:5px;background:rgba(var(--background-total-theme),.95)}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nmodule.exports = Readable;\n/**/\n\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n/**/\n\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\n\n\nvar Stream = require('./internal/streams/stream');\n/**/\n\n\nvar Buffer = require('buffer').Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n\nvar debugUtil = require('util');\n\nvar debug;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\n\nvar BufferList = require('./internal/streams/buffer_list');\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.\n\n\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\n\nrequire('inherits')(Readable, Stream);\n\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')\n\n this.autoDestroy = !!options.autoDestroy; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n } // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n\n\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n\n return er;\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8\n\n this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:\n\n var p = this._readableState.buffer.head;\n var content = '';\n\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n\n this._readableState.buffer.clear();\n\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n}; // Don't raise the hwm > 1GB\n\n\nvar MAX_HWM = 0x40000000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true;\n\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\n\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n } // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n\n\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused\n\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true; // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume'); // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n\n state.paused = false;\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n\n if (!state.reading) {\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n this._readableState.paused = true;\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {\n ;\n }\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n\n return createReadableStreamAsyncIterator(this);\n };\n}\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n}); // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.\n\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\n\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n\n return from(Readable, iterable, opts);\n };\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","module.exports = require('./lib/_stream_writable.js');\n","export * from \"-!../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst aes_1 = require(\"./polyfill/aes\");\nconst aes_ctr_1 = require(\"./polyfill/aes_ctr\");\n/**\n * Pure JavaScript cryptography implementations\n *\n * WARNING: Not constant time! May leak keys or have other security issues.\n */\nclass PolyfillCryptoProvider {\n constructor() {\n // This class doesn't do anything, it just signals that polyfill impls should be used\n }\n importBlockCipherKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_1.default(keyData);\n });\n }\n importCTRKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_ctr_1.default(new aes_1.default(keyData));\n });\n }\n}\nexports.PolyfillCryptoProvider = PolyfillCryptoProvider;\n","// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./many.vue?vue&type=template&id=71d5e826&scoped=true&\"\nimport script from \"./many.vue?vue&type=script&lang=js&\"\nexport * from \"./many.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./many.vue?vue&type=style&index=0&id=71d5e826&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"71d5e826\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.IndexedDBStore = IndexedDBStore;\r\n\r\nvar _memory = require(\"./memory\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _indexeddbLocalBackend = require(\"./indexeddb-local-backend.js\");\r\n\r\nvar _indexeddbRemoteBackend = require(\"./indexeddb-remote-backend.js\");\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* eslint-disable @babel/no-invalid-this */\r\n\r\n/**\r\n * This is an internal module. See {@link IndexedDBStore} for the public class.\r\n * @module store/indexeddb\r\n */\r\n// If this value is too small we'll be writing very often which will cause\r\n// noticable stop-the-world pauses. If this value is too big we'll be writing\r\n// so infrequently that the /sync size gets bigger on reload. Writing more\r\n// often does not affect the length of the pause since the entire /sync\r\n// response is persisted each time.\r\nconst WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes\r\n\r\n/**\r\n * Construct a new Indexed Database store, which extends MemoryStore.\r\n *\r\n * This store functions like a MemoryStore except it periodically persists\r\n * the contents of the store to an IndexedDB backend.\r\n *\r\n * All data is still kept in-memory but can be loaded from disk by calling\r\n * startup(). This can make startup times quicker as a complete\r\n * sync from the server is not required. This does not reduce memory usage as all\r\n * the data is eagerly fetched when startup() is called.\r\n *
\r\n * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };\r\n * let store = new IndexedDBStore(opts);\r\n * await store.startup(); // load from indexed db\r\n * let client = sdk.createClient({\r\n *     store: store,\r\n * });\r\n * client.startClient();\r\n * client.on(\"sync\", function(state, prevState, data) {\r\n *     if (state === \"PREPARED\") {\r\n *         console.log(\"Started up, now with go faster stripes!\");\r\n *     }\r\n * });\r\n * 
\r\n *\r\n * @constructor\r\n * @extends MemoryStore\r\n * @param {Object} opts Options object.\r\n * @param {Object} opts.indexedDB The Indexed DB interface e.g.\r\n * window.indexedDB\r\n * @param {string=} opts.dbName Optional database name. The same name must be used\r\n * to open the same database.\r\n * @param {string=} opts.workerScript Optional URL to a script to invoke a web\r\n * worker with to run IndexedDB queries on the web worker. The IndexedDbStoreWorker\r\n * class is provided for this purpose and requires the application to provide a\r\n * trivial wrapper script around it.\r\n * @param {Object=} opts.workerApi The webWorker API object. If omitted, the global Worker\r\n * object will be used if it exists.\r\n * @prop {IndexedDBStoreBackend} backend The backend instance. Call through to\r\n * this API if you need to perform specific indexeddb actions like deleting the\r\n * database.\r\n */\r\n\r\nfunction IndexedDBStore(opts) {\r\n _memory.MemoryStore.call(this, opts);\r\n\r\n if (!opts.indexedDB) {\r\n throw new Error('Missing required option: indexedDB');\r\n }\r\n\r\n if (opts.workerScript) {\r\n // try & find a webworker-compatible API\r\n let workerApi = opts.workerApi;\r\n\r\n if (!workerApi) {\r\n // default to the global Worker object (which is where it in a browser)\r\n workerApi = global.Worker;\r\n }\r\n\r\n this.backend = new _indexeddbRemoteBackend.RemoteIndexedDBStoreBackend(opts.workerScript, opts.dbName, workerApi);\r\n } else {\r\n this.backend = new _indexeddbLocalBackend.LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);\r\n }\r\n\r\n this.startedUp = false;\r\n this._syncTs = 0; // Records the last-modified-time of each user at the last point we saved\r\n // the database, such that we can derive the set if users that have been\r\n // modified since we last saved.\r\n\r\n this._userModifiedMap = {// user_id : timestamp\r\n };\r\n}\r\n\r\nutils.inherits(IndexedDBStore, _memory.MemoryStore);\r\nutils.extend(IndexedDBStore.prototype, _events.EventEmitter.prototype);\r\n\r\nIndexedDBStore.exists = function (indexedDB, dbName) {\r\n return _indexeddbLocalBackend.LocalIndexedDBStoreBackend.exists(indexedDB, dbName);\r\n};\r\n/**\r\n * @return {Promise} Resolved when loaded from indexed db.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.startup = function () {\r\n if (this.startedUp) {\r\n _logger.logger.log(`IndexedDBStore.startup: already started`);\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n _logger.logger.log(`IndexedDBStore.startup: connecting to backend`);\r\n\r\n return this.backend.connect().then(() => {\r\n _logger.logger.log(`IndexedDBStore.startup: loading presence events`);\r\n\r\n return this.backend.getUserPresenceEvents();\r\n }).then(userPresenceEvents => {\r\n _logger.logger.log(`IndexedDBStore.startup: processing presence events`);\r\n\r\n userPresenceEvents.forEach(([userId, rawEvent]) => {\r\n const u = new _user.User(userId);\r\n\r\n if (rawEvent) {\r\n u.setPresenceEvent(new _event.MatrixEvent(rawEvent));\r\n }\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n this.storeUser(u);\r\n });\r\n });\r\n};\r\n/**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.getSavedSync = degradable(function () {\r\n return this.backend.getSavedSync();\r\n}, \"getSavedSync\");\r\n/** @return {Promise} whether or not the database was newly created in this session. */\r\n\r\nIndexedDBStore.prototype.isNewlyCreated = degradable(function () {\r\n return this.backend.isNewlyCreated();\r\n}, \"isNewlyCreated\");\r\n/**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n\r\nIndexedDBStore.prototype.getSavedSyncToken = degradable(function () {\r\n return this.backend.getNextBatchToken();\r\n}, \"getSavedSyncToken\"),\r\n/**\r\n * Delete all data from this store.\r\n * @return {Promise} Resolves if the data was deleted from the database.\r\n */\r\nIndexedDBStore.prototype.deleteAllData = degradable(function () {\r\n _memory.MemoryStore.prototype.deleteAllData.call(this);\r\n\r\n return this.backend.clearDatabase().then(() => {\r\n _logger.logger.log(\"Deleted indexeddb data.\");\r\n }, err => {\r\n _logger.logger.error(`Failed to delete indexeddb data: ${err}`);\r\n\r\n throw err;\r\n });\r\n});\r\n/**\r\n * Whether this store would like to save its data\r\n * Note that obviously whether the store wants to save or\r\n * not could change between calling this function and calling\r\n * save().\r\n *\r\n * @return {boolean} True if calling save() will actually save\r\n * (at the time this function is called).\r\n */\r\n\r\nIndexedDBStore.prototype.wantsSave = function () {\r\n const now = Date.now();\r\n return now - this._syncTs > WRITE_DELAY_MS;\r\n};\r\n/**\r\n * Possibly write data to the database.\r\n *\r\n * @param {bool} force True to force a save to happen\r\n * @return {Promise} Promise resolves after the write completes\r\n * (or immediately if no write is performed)\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.save = function (force) {\r\n if (force || this.wantsSave()) {\r\n return this._reallySave();\r\n }\r\n\r\n return Promise.resolve();\r\n};\r\n\r\nIndexedDBStore.prototype._reallySave = degradable(function () {\r\n this._syncTs = Date.now(); // set now to guard against multi-writes\r\n // work out changed users (this doesn't handle deletions but you\r\n // can't 'delete' users as they are just presence events).\r\n\r\n const userTuples = [];\r\n\r\n for (const u of this.getUsers()) {\r\n if (this._userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;\r\n if (!u.events.presence) continue;\r\n userTuples.push([u.userId, u.events.presence.event]); // note that we've saved this version of the user\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n }\r\n\r\n return this.backend.syncToDatabase(userTuples);\r\n});\r\nIndexedDBStore.prototype.setSyncData = degradable(function (syncData) {\r\n return this.backend.setSyncData(syncData);\r\n}, \"setSyncData\");\r\n/**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n\r\nIndexedDBStore.prototype.getOutOfBandMembers = degradable(function (roomId) {\r\n return this.backend.getOutOfBandMembers(roomId);\r\n}, \"getOutOfBandMembers\");\r\n/**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n\r\nIndexedDBStore.prototype.setOutOfBandMembers = degradable(function (roomId, membershipEvents) {\r\n _memory.MemoryStore.prototype.setOutOfBandMembers.call(this, roomId, membershipEvents);\r\n\r\n return this.backend.setOutOfBandMembers(roomId, membershipEvents);\r\n}, \"setOutOfBandMembers\");\r\nIndexedDBStore.prototype.clearOutOfBandMembers = degradable(function (roomId) {\r\n _memory.MemoryStore.prototype.clearOutOfBandMembers.call(this);\r\n\r\n return this.backend.clearOutOfBandMembers(roomId);\r\n}, \"clearOutOfBandMembers\");\r\nIndexedDBStore.prototype.getClientOptions = degradable(function () {\r\n return this.backend.getClientOptions();\r\n}, \"getClientOptions\");\r\nIndexedDBStore.prototype.storeClientOptions = degradable(function (options) {\r\n _memory.MemoryStore.prototype.storeClientOptions.call(this, options);\r\n\r\n return this.backend.storeClientOptions(options);\r\n}, \"storeClientOptions\");\r\n/**\r\n * All member functions of `IndexedDBStore` that access the backend use this wrapper to\r\n * watch for failures after initial store startup, including `QuotaExceededError` as\r\n * free disk space changes, etc.\r\n *\r\n * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`\r\n * in place so that the current operation and all future ones are in-memory only.\r\n *\r\n * @param {Function} func The degradable work to do.\r\n * @param {String} fallback The method name for fallback.\r\n * @returns {Function} A wrapped member function.\r\n */\r\n\r\nfunction degradable(func, fallback) {\r\n return async function (...args) {\r\n try {\r\n return await func.call(this, ...args);\r\n } catch (e) {\r\n _logger.logger.error(\"IndexedDBStore failure, degrading to MemoryStore\", e);\r\n\r\n this.emit(\"degraded\", e);\r\n\r\n try {\r\n // We try to delete IndexedDB after degrading since this store is only a\r\n // cache (the app will still function correctly without the data).\r\n // It's possible that deleting repair IndexedDB for the next app load,\r\n // potenially by making a little more space available.\r\n _logger.logger.log(\"IndexedDBStore trying to delete degraded data\");\r\n\r\n await this.backend.clearDatabase();\r\n\r\n _logger.logger.log(\"IndexedDBStore delete after degrading succeeeded\");\r\n } catch (e) {\r\n _logger.logger.warn(\"IndexedDBStore delete after degrading failed\", e);\r\n } // Degrade the store from being an instance of `IndexedDBStore` to instead be\r\n // an instance of `MemoryStore` so that future API calls use the memory path\r\n // directly and skip IndexedDB entirely. This should be safe as\r\n // `IndexedDBStore` already extends from `MemoryStore`, so we are making the\r\n // store become its parent type in a way. The mutator methods of\r\n // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are\r\n // not overridden at all).\r\n\r\n\r\n Object.setPrototypeOf(this, _memory.MemoryStore.prototype);\r\n\r\n if (fallback) {\r\n return await _memory.MemoryStore.prototype[fallback].call(this, ...args);\r\n }\r\n }\r\n };\r\n}","(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Scrollparent = factory();\n }\n}(this, function () {\n var regex = /(auto|scroll)/;\n\n var parents = function (node, ps) {\n if (node.parentNode === null) { return ps; }\n\n return parents(node.parentNode, ps.concat([node]));\n };\n\n var style = function (node, prop) {\n return getComputedStyle(node, null).getPropertyValue(prop);\n };\n\n var overflow = function (node) {\n return style(node, \"overflow\") + style(node, \"overflow-y\") + style(node, \"overflow-x\");\n };\n\n var scroll = function (node) {\n return regex.test(overflow(node));\n };\n\n var scrollParent = function (node) {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return ;\n }\n\n var ps = parents(node.parentNode, []);\n\n for (var i = 0; i < ps.length; i += 1) {\n if (scroll(ps[i])) {\n return ps[i];\n }\n }\n\n return document.scrollingElement || document.documentElement;\n };\n\n return scrollParent;\n}));\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".bgimage[data-v-5d20f73c]{width:100%;height:100%;opacity:0;transition:.3s}.bgimage.loaded[data-v-5d20f73c]{opacity:1}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.PushProcessor = PushProcessor;\r\n\r\nvar _utils = require(\"./utils\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module pushprocessor\r\n */\r\nconst RULEKINDS_IN_ORDER = ['override', 'content', 'room', 'sender', 'underride']; // The default override rules to apply to the push rules that arrive from the server.\r\n// We do this for two reasons:\r\n// 1. Synapse is unlikely to send us the push rule in an incremental sync - see\r\n// https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for\r\n// more details.\r\n// 2. We often want to start using push rules ahead of the server supporting them,\r\n// and so we can put them here.\r\n\r\nconst DEFAULT_OVERRIDE_RULES = [{\r\n // For homeservers which don't support MSC1930 yet\r\n rule_id: \".m.rule.tombstone\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.room.tombstone\"\r\n }, {\r\n kind: \"event_match\",\r\n key: \"state_key\",\r\n pattern: \"\"\r\n }],\r\n actions: [\"notify\", {\r\n set_tweak: \"highlight\",\r\n value: true\r\n }]\r\n}, {\r\n // For homeservers which don't support MSC2153 yet\r\n rule_id: \".m.rule.reaction\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.reaction\"\r\n }],\r\n actions: [\"dont_notify\"]\r\n}];\r\n/**\r\n * Construct a Push Processor.\r\n * @constructor\r\n * @param {Object} client The Matrix client object to use\r\n */\r\n\r\nfunction PushProcessor(client) {\r\n const cachedGlobToRegex = {// $glob: RegExp,\r\n };\r\n\r\n const matchingRuleFromKindSet = (ev, kindset) => {\r\n for (let ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) {\r\n const kind = RULEKINDS_IN_ORDER[ruleKindIndex];\r\n const ruleset = kindset[kind];\r\n\r\n if (!ruleset) {\r\n continue;\r\n }\r\n\r\n for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) {\r\n const rule = ruleset[ruleIndex];\r\n\r\n if (!rule.enabled) {\r\n continue;\r\n }\r\n\r\n const rawrule = templateRuleToRaw(kind, rule);\r\n\r\n if (!rawrule) {\r\n continue;\r\n }\r\n\r\n if (this.ruleMatchesEvent(rawrule, ev)) {\r\n rule.kind = kind;\r\n return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const templateRuleToRaw = function (kind, tprule) {\r\n const rawrule = {\r\n 'rule_id': tprule.rule_id,\r\n 'actions': tprule.actions,\r\n 'conditions': []\r\n };\r\n\r\n switch (kind) {\r\n case 'underride':\r\n case 'override':\r\n rawrule.conditions = tprule.conditions;\r\n break;\r\n\r\n case 'room':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'room_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'sender':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'user_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'content':\r\n if (!tprule.pattern) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'content.body',\r\n 'pattern': tprule.pattern\r\n });\r\n break;\r\n }\r\n\r\n return rawrule;\r\n };\r\n\r\n const eventFulfillsCondition = function (cond, ev) {\r\n const condition_functions = {\r\n \"event_match\": eventFulfillsEventMatchCondition,\r\n \"contains_display_name\": eventFulfillsDisplayNameCondition,\r\n \"room_member_count\": eventFulfillsRoomMemberCountCondition,\r\n \"sender_notification_permission\": eventFulfillsSenderNotifPermCondition\r\n };\r\n\r\n if (condition_functions[cond.kind]) {\r\n return condition_functions[cond.kind](cond, ev);\r\n } // unknown conditions: we previously matched all unknown conditions,\r\n // but given that rules can be added to the base rules on a server,\r\n // it's probably better to not match unknown conditions.\r\n\r\n\r\n return false;\r\n };\r\n\r\n const eventFulfillsSenderNotifPermCondition = function (cond, ev) {\r\n const notifLevelKey = cond['key'];\r\n\r\n if (!notifLevelKey) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState) {\r\n return false;\r\n } // Note that this should not be the current state of the room but the state at\r\n // the point the event is in the DAG. Unfortunately the js-sdk does not store\r\n // this.\r\n\r\n\r\n return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender());\r\n };\r\n\r\n const eventFulfillsRoomMemberCountCondition = function (cond, ev) {\r\n if (!cond.is) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members) {\r\n return false;\r\n }\r\n\r\n const memberCount = room.currentState.getJoinedMemberCount();\r\n const m = cond.is.match(/^([=<>]*)([0-9]*)$/);\r\n\r\n if (!m) {\r\n return false;\r\n }\r\n\r\n const ineq = m[1];\r\n const rhs = parseInt(m[2]);\r\n\r\n if (isNaN(rhs)) {\r\n return false;\r\n }\r\n\r\n switch (ineq) {\r\n case '':\r\n case '==':\r\n return memberCount == rhs;\r\n\r\n case '<':\r\n return memberCount < rhs;\r\n\r\n case '>':\r\n return memberCount > rhs;\r\n\r\n case '<=':\r\n return memberCount <= rhs;\r\n\r\n case '>=':\r\n return memberCount >= rhs;\r\n\r\n default:\r\n return false;\r\n }\r\n };\r\n\r\n const eventFulfillsDisplayNameCondition = function (cond, ev) {\r\n let content = ev.getContent();\r\n\r\n if (ev.isEncrypted() && ev.getClearContent()) {\r\n content = ev.getClearContent();\r\n }\r\n\r\n if (!content || !content.body || typeof content.body != 'string') {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members || !room.currentState.getMember(client.credentials.userId)) {\r\n return false;\r\n }\r\n\r\n const displayName = room.currentState.getMember(client.credentials.userId).name; // N.B. we can't use \\b as it chokes on unicode. however \\W seems to be okay\r\n // as shorthand for [^0-9A-Za-z_].\r\n\r\n const pat = new RegExp(\"(^|\\\\W)\" + (0, _utils.escapeRegExp)(displayName) + \"(\\\\W|$)\", 'i');\r\n return content.body.search(pat) > -1;\r\n };\r\n\r\n const eventFulfillsEventMatchCondition = function (cond, ev) {\r\n if (!cond.key) {\r\n return false;\r\n }\r\n\r\n const val = valueForDottedKey(cond.key, ev);\r\n\r\n if (typeof val !== 'string') {\r\n return false;\r\n }\r\n\r\n if (cond.value) {\r\n return cond.value === val;\r\n }\r\n\r\n if (typeof cond.pattern !== 'string') {\r\n return false;\r\n }\r\n\r\n let regex;\r\n\r\n if (cond.key == 'content.body') {\r\n regex = createCachedRegex('(^|\\\\W)', cond.pattern, '(\\\\W|$)');\r\n } else {\r\n regex = createCachedRegex('^', cond.pattern, '$');\r\n }\r\n\r\n return !!val.match(regex);\r\n };\r\n\r\n const createCachedRegex = function (prefix, glob, suffix) {\r\n if (cachedGlobToRegex[glob]) {\r\n return cachedGlobToRegex[glob];\r\n }\r\n\r\n cachedGlobToRegex[glob] = new RegExp(prefix + (0, _utils.globToRegexp)(glob) + suffix, 'i');\r\n return cachedGlobToRegex[glob];\r\n };\r\n\r\n const valueForDottedKey = function (key, ev) {\r\n const parts = key.split('.');\r\n let val; // special-case the first component to deal with encrypted messages\r\n\r\n const firstPart = parts[0];\r\n\r\n if (firstPart === 'content') {\r\n val = ev.getContent();\r\n parts.shift();\r\n } else if (firstPart === 'type') {\r\n val = ev.getType();\r\n parts.shift();\r\n } else {\r\n // use the raw event for any other fields\r\n val = ev.event;\r\n }\r\n\r\n while (parts.length > 0) {\r\n const thisPart = parts.shift();\r\n\r\n if ((0, _utils.isNullOrUndefined)(val[thisPart])) {\r\n return null;\r\n }\r\n\r\n val = val[thisPart];\r\n }\r\n\r\n return val;\r\n };\r\n\r\n const matchingRuleForEventWithRulesets = function (ev, rulesets) {\r\n if (!rulesets) {\r\n return null;\r\n }\r\n\r\n if (ev.getSender() === client.credentials.userId) {\r\n return null;\r\n }\r\n\r\n return matchingRuleFromKindSet(ev, rulesets.global);\r\n };\r\n\r\n const pushActionsForEventAndRulesets = function (ev, rulesets) {\r\n const rule = matchingRuleForEventWithRulesets(ev, rulesets);\r\n\r\n if (!rule) {\r\n return {};\r\n }\r\n\r\n const actionObj = PushProcessor.actionListToActionsObject(rule.actions); // Some actions are implicit in some situations: we add those here\r\n\r\n if (actionObj.tweaks.highlight === undefined) {\r\n // if it isn't specified, highlight if it's a content\r\n // rule but otherwise not\r\n actionObj.tweaks.highlight = rule.kind == 'content';\r\n }\r\n\r\n return actionObj;\r\n };\r\n\r\n this.ruleMatchesEvent = function (rule, ev) {\r\n let ret = true;\r\n\r\n for (let i = 0; i < rule.conditions.length; ++i) {\r\n const cond = rule.conditions[i];\r\n ret &= eventFulfillsCondition(cond, ev);\r\n } //console.log(\"Rule \"+rule.rule_id+(ret ? \" matches\" : \" doesn't match\"));\r\n\r\n\r\n return ret;\r\n };\r\n /**\r\n * Get the user's push actions for the given event\r\n *\r\n * @param {module:models/event.MatrixEvent} ev\r\n *\r\n * @return {PushAction}\r\n */\r\n\r\n\r\n this.actionsForEvent = function (ev) {\r\n return pushActionsForEventAndRulesets(ev, client.pushRules);\r\n };\r\n /**\r\n * Get one of the users push rules by its ID\r\n *\r\n * @param {string} ruleId The ID of the rule to search for\r\n * @return {object} The push rule, or null if no such rule was found\r\n */\r\n\r\n\r\n this.getPushRuleById = function (ruleId) {\r\n for (const scope of ['global']) {\r\n if (client.pushRules[scope] === undefined) continue;\r\n\r\n for (const kind of RULEKINDS_IN_ORDER) {\r\n if (client.pushRules[scope][kind] === undefined) continue;\r\n\r\n for (const rule of client.pushRules[scope][kind]) {\r\n if (rule.rule_id === ruleId) return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n}\r\n/**\r\n * Convert a list of actions into a object with the actions as keys and their values\r\n * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ]\r\n * becomes { notify: true, tweaks: { sound: 'default' } }\r\n * @param {array} actionlist The actions list\r\n *\r\n * @return {object} A object with key 'notify' (true or false) and an object of actions\r\n */\r\n\r\n\r\nPushProcessor.actionListToActionsObject = function (actionlist) {\r\n const actionobj = {\r\n 'notify': false,\r\n 'tweaks': {}\r\n };\r\n\r\n for (let i = 0; i < actionlist.length; ++i) {\r\n const action = actionlist[i];\r\n\r\n if (action === 'notify') {\r\n actionobj.notify = true;\r\n } else if (typeof action === 'object') {\r\n if (action.value === undefined) {\r\n action.value = true;\r\n }\r\n\r\n actionobj.tweaks[action.set_tweak] = action.value;\r\n }\r\n }\r\n\r\n return actionobj;\r\n};\r\n/**\r\n * Rewrites conditions on a client's push rules to match the defaults\r\n * where applicable. Useful for upgrading push rules to more strict\r\n * conditions when the server is falling behind on defaults.\r\n * @param {object} incomingRules The client's existing push rules\r\n * @returns {object} The rewritten rules\r\n */\r\n\r\n\r\nPushProcessor.rewriteDefaultRules = function (incomingRules) {\r\n let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone\r\n // These lines are mostly to make the tests happy. We shouldn't run into these\r\n // properties missing in practice.\r\n\r\n if (!newRules) newRules = {};\r\n if (!newRules.global) newRules.global = {};\r\n if (!newRules.global.override) newRules.global.override = []; // Merge the client-level defaults with the ones from the server\r\n\r\n const globalOverrides = newRules.global.override;\r\n\r\n for (const override of DEFAULT_OVERRIDE_RULES) {\r\n const existingRule = globalOverrides.find(r => r.rule_id === override.rule_id);\r\n\r\n if (existingRule) {\r\n // Copy over the actions, default, and conditions. Don't touch the user's\r\n // preference.\r\n existingRule.default = override.default;\r\n existingRule.conditions = override.conditions;\r\n existingRule.actions = override.actions;\r\n } else {\r\n // Add the rule\r\n const ruleId = override.rule_id;\r\n\r\n _logger.logger.warn(`Adding default global override for ${ruleId}`);\r\n\r\n globalOverrides.push(override);\r\n }\r\n }\r\n\r\n return newRules;\r\n};\r\n/**\r\n * @typedef {Object} PushAction\r\n * @type {Object}\r\n * @property {boolean} notify Whether this event should notify the user or not.\r\n * @property {Object} tweaks How this event should be notified.\r\n * @property {boolean} tweaks.highlight Whether this event should be highlighted\r\n * on the UI.\r\n * @property {boolean} tweaks.sound Whether this notification should produce a\r\n * noise.\r\n */","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\"","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\"","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vue-js-toggle-button\"] = factory();\n\telse\n\t\troot[\"vue-js-toggle-button\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(8)\n\nvar Component = __webpack_require__(6)(\n /* script */\n __webpack_require__(1),\n /* template */\n __webpack_require__(7),\n /* scopeId */\n \"data-v-25adc6c0\",\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(3);\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\nvar DEFAULT_COLOR_CHECKED = '#75c791';\nvar DEFAULT_COLOR_UNCHECKED = '#bfcbd9';\nvar DEFAULT_LABEL_CHECKED = 'on';\nvar DEFAULT_LABEL_UNCHECKED = 'off';\nvar DEFAULT_SWITCH_COLOR = '#fff';\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'ToggleButton',\n props: {\n value: {\n type: Boolean,\n default: false\n },\n name: {\n type: String\n },\n disabled: {\n type: Boolean,\n default: false\n },\n tag: {\n type: String\n },\n sync: {\n type: Boolean,\n default: false\n },\n speed: {\n type: Number,\n default: 300\n },\n color: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'disabled');\n }\n },\n switchColor: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked');\n }\n },\n cssColors: {\n type: Boolean,\n default: false\n },\n labels: {\n type: [Boolean, Object],\n default: false,\n validator: function validator(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' ? value.checked || value.unchecked : typeof value === 'boolean';\n }\n },\n height: {\n type: Number,\n default: 22\n },\n width: {\n type: Number,\n default: 50\n },\n margin: {\n type: Number,\n default: 3\n },\n fontSize: {\n type: Number\n }\n },\n computed: {\n className: function className() {\n var toggled = this.toggled,\n disabled = this.disabled;\n\n\n return ['vue-js-switch', {\n toggled: toggled,\n disabled: disabled\n }];\n },\n coreStyle: function coreStyle() {\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n backgroundColor: this.cssColors ? null : this.disabled ? this.colorDisabled : this.colorCurrent,\n borderRadius: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(Math.round(this.height / 2))\n };\n },\n buttonRadius: function buttonRadius() {\n return this.height - this.margin * 2;\n },\n distance: function distance() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width - this.height + this.margin);\n },\n buttonStyle: function buttonStyle() {\n var transition = 'transform ' + this.speed + 'ms';\n var margin = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.margin);\n\n var transform = this.toggled ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(this.distance, margin) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(margin, margin);\n\n var background = this.switchColor ? this.switchColorCurrent : null;\n\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n transition: transition,\n transform: transform,\n background: background\n };\n },\n labelStyle: function labelStyle() {\n return {\n lineHeight: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n fontSize: this.fontSize ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.fontSize) : null\n };\n },\n colorChecked: function colorChecked() {\n var color = this.color;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(color)) {\n return color || DEFAULT_COLOR_CHECKED;\n }\n\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(color, 'checked', DEFAULT_COLOR_CHECKED);\n },\n colorUnchecked: function colorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'unchecked', DEFAULT_COLOR_UNCHECKED);\n },\n colorDisabled: function colorDisabled() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'disabled', this.colorCurrent);\n },\n colorCurrent: function colorCurrent() {\n return this.toggled ? this.colorChecked : this.colorUnchecked;\n },\n labelChecked: function labelChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'checked', DEFAULT_LABEL_CHECKED);\n },\n labelUnchecked: function labelUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'unchecked', DEFAULT_LABEL_UNCHECKED);\n },\n switchColorChecked: function switchColorChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'checked', DEFAULT_SWITCH_COLOR);\n },\n switchColorUnchecked: function switchColorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'unchecked', DEFAULT_SWITCH_COLOR);\n },\n switchColorCurrent: function switchColorCurrent() {\n var switchColor = this.switchColor;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(this.switchColor)) {\n return this.switchColor || DEFAULT_SWITCH_COLOR;\n }\n\n return this.toggled ? this.switchColorChecked : this.switchColorUnchecked;\n }\n },\n watch: {\n value: function value(_value) {\n if (this.sync) {\n this.toggled = !!_value;\n }\n }\n },\n data: function data() {\n return {\n toggled: !!this.value\n };\n },\n\n methods: {\n toggle: function toggle(event) {\n var toggled = !this.toggled;\n\n if (!this.sync) {\n this.toggled = toggled;\n }\n\n this.$emit('input', toggled);\n this.$emit('change', {\n value: toggled,\n tag: this.tag,\n srcEvent: event\n });\n }\n }\n});\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Button_vue__);\n/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, \"ToggleButton\", function() { return __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a; });\n\n\nvar installed = false;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n install: function install(Vue) {\n if (installed) {\n return;\n }\n\n Vue.component('ToggleButton', __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a);\n installed = true;\n }\n});\n\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return isString; });\n/* unused harmony export isBoolean */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return px; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return translate3d; });\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isString = function isString(value) {\n return typeof value === 'string';\n};\n\nvar isBoolean = function isBoolean(value) {\n return typeof value === 'boolean';\n};\n\nvar isObject = function isObject(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';\n};\n\nvar has = function has(object, key) {\n return isObject(object) && object.hasOwnProperty(key);\n};\n\nvar get = function get(object, key, defaultValue) {\n return has(object, key) ? object[key] : defaultValue;\n};\n\nvar px = function px(value) {\n return value + 'px';\n};\n\nvar translate3d = function translate3d(x, y) {\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0px';\n\n return 'translate3d(' + x + ', ' + y + ', ' + z + ')';\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)();\n// imports\n\n\n// module\nexports.push([module.i, \".vue-js-switch[data-v-25adc6c0]{display:inline-block;position:relative;vertical-align:middle;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input[data-v-25adc6c0]{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label[data-v-25adc6c0]{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left[data-v-25adc6c0]{left:10px}.vue-js-switch .v-switch-label.v-right[data-v-25adc6c0]{right:10px}.vue-js-switch .v-switch-core[data-v-25adc6c0]{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;user-select:none}.vue-js-switch .v-switch-core .v-switch-button[data-v-25adc6c0]{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:#fff;z-index:2}.vue-js-switch.disabled[data-v-25adc6c0]{pointer-events:none;opacity:.6}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n scopeId,\n cssModules\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n // inject cssModules\n if (cssModules) {\n var computed = Object.create(options.computed || null)\n Object.keys(cssModules).forEach(function (key) {\n var module = cssModules[key]\n computed[key] = function () { return module }\n })\n options.computed = computed\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('label', {\n class: _vm.className\n }, [_c('input', {\n staticClass: \"v-switch-input\",\n attrs: {\n \"type\": \"checkbox\",\n \"name\": _vm.name,\n \"disabled\": _vm.disabled\n },\n domProps: {\n \"checked\": _vm.value\n },\n on: {\n \"change\": function($event) {\n $event.stopPropagation();\n return _vm.toggle($event)\n }\n }\n }), _vm._v(\" \"), _c('div', {\n staticClass: \"v-switch-core\",\n style: (_vm.coreStyle)\n }, [_c('div', {\n staticClass: \"v-switch-button\",\n style: (_vm.buttonStyle)\n })]), _vm._v(\" \"), (_vm.labels) ? [(_vm.toggled) ? _c('span', {\n staticClass: \"v-switch-label v-left\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"checked\", [\n [_vm._v(_vm._s(_vm.labelChecked))]\n ])], 2) : _c('span', {\n staticClass: \"v-switch-label v-right\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"unchecked\", [\n [_vm._v(_vm._s(_vm.labelUnchecked))]\n ])], 2)] : _vm._e()], 2)\n},staticRenderFns: []}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ModalWindow.vue?vue&type=template&id=96a5a68e&scoped=true&\"\nimport script from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nexport * from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ModalWindow.vue?vue&type=style&index=0&id=96a5a68e&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"96a5a68e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapActions, mapGetters, mapState} from 'vuex'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport ModalWindow from '@/components/utils/ModalWindow.vue'\r\n\r\n\r\nexport default {\r\n name: \"contactsList\",\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n }\r\n\r\n },\r\n components: {\r\n preview,\r\n ModalWindow\r\n },\r\n\r\n props: {\r\n mode: {\r\n default: '',\r\n type: String\r\n },\r\n users: Array,\r\n selected : Object,\r\n title: String,\r\n },\r\n \r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n minimized : state => state.minimized,\r\n\r\n ...mapActions([\r\n 'PREPARE_USERDATA'\r\n ]),\r\n\r\n ...mapState([\r\n 'contactsMap',\r\n 'signedUpUsers',\r\n ]),\r\n\r\n }),\r\n\r\n methods: {\r\n select(contact) {\r\n this.$emit('select', contact)\r\n },\r\n\r\n navigateToProfile(id, contact) {\r\n\r\n if(this.mode == \"Select\"){\r\n this.select(contact)\r\n }\r\n else{\r\n this.$router.push({path: `/contact?id=${id}`}).catch(e => {})\r\n }\r\n },\r\n\r\n toggleUser(contact){\r\n this.$emit('toggleUser', contact.id)\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=691bf714&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=691bf714&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"691bf714\",\n null\n ,true\n)\n\nexport default component.exports","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=9b340a7a&scoped=true&lang=sass&\"","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","// style-loader: Adds some css to the DOM by adding a ",html:''};Qi.add(eo.name,eo),Qi.add(to.name,to),Qi.add(no.name,no),Qi.add(ro.name,ro),Qi.add(io.name,io);var oo=Qi,ao={components:{Icon:oo,mmessage:Yi},data(){return{show:!1,type:"info",iconImg:"",title:"",message:{},roomId:"",event:null,chat:null,duration:3e3,showClose:!1,isCollapsed:!1,width:"",className:"",wrapperClassName:"",supportHTML:!1,onClose:null,onClick:null,timer:null,closed:!1}},watch:{closed(e){e&&(this.show=!1,this.$el.addEventListener("animationend",this.destroyElement))}},methods:{close(){this.closed=!0,"function"===typeof this.onClose&&this.onClose(this)},click(){"function"===typeof this.onClick&&this.onClick(this)},clearTimer(){clearTimeout(this.timer)},startTimer(){this.duration>0&&"loading"!==this.type&&(this.timer=setTimeout(()=>{this.closed||this.close()},this.duration))},destroyElement(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)}},mounted(){"loading"!==this.type&&(this.startTimer(),this.duration<=0&&(this.showClose=!0))}},so=ao,co=Object(E["a"])(so,zi,qi,!1,null,null,null,!0),lo=co.exports;const uo=s["default"].extend(lo),fo=[];let ho=1;const po={},mo=function(e){let t=e.onClose,n=e.onClick;const r=e.position||"top-center",i=e.hasMask||!1,o=r+(i?"-mask":"");let a=po[o];a||(a=po[o]=document.createElement("div"),a.className=["m-message-container","is-"+r,i?"has-mask":""].filter((function(e){return!!e})).join(" "),document.body.appendChild(a)),e.zIndex&&(a.style.zIndex=e.zIndex);const s=ho++;e.onClose=function(){mo.close(s,t)},e.onClick=function(){mo.click(s,n,t)};const c=new uo({el:document.createElement("div"),data:e});return c.id=s,c.containerKey=o,0===r.indexOf("bottom")&&a.firstChild?a.insertBefore(c.$el,a.firstChild):a.appendChild(c.$el),c.show=!0,fo.push(c),c};mo.click=function(e,t,n){for(let r=0,i=fo.length;r=0;e--)fo[e].close()};const vo=["info","success","error","warning","loading"];vo.forEach(e=>{mo[e]=function(t){return t="string"===typeof t?{message:t}:t,mo({...t,type:e})}});var go=mo;r("a45a");go.install=function(e,t){t&&t.name?e.prototype["$"+t.name]=go:e.prototype.$message=go};var yo=go,bo=(r("2e4b"),r("0086")),_o=r.n(bo),wo=r("03a5"),xo=r.n(wo),ko=r("f206"),So=r.n(ko),Eo=r("6167"),Co=(r("c5c5"),r("1da1")),To=r("ade3"),Io=(r("907a"),{});class Ro{constructor(e,t){t||(t={}),this.core=e}tetatetchat(e){if(!e)return!1;if("undefined"!=typeof e.tetatet)return e.tetatet;var t=this.core.mtrx.chatUsersInfo(e.roomId),n=!1;return 2==t.length&&(n=e.name=="#"+this.tetatetid(t[0],t[1])),t.length>1&&(e.tetatet=n),n}tetatetid(e,t){var n=2;if(e.id==t.id)return null;var r=parseInt(e.id,16)*parseInt(t.id,16)*n;if(Io[r])return Io[r];var i=re["a"].sha224(r.toString()).toString("hex");return Io[r]=i,i}unknowngroupusers(e){return e&&"invite"===e._selfMembership&&!e.summary.members&&!this.tetatetchat(this.m_chat)}usersFromChats(e){var t={};return _.each(e,e=>{t[e.roomId]=_.map(_.uniq([].concat(_.toArray(e.currentState.members),e.summary.members||[]),e=>e.userId),(function(e){return{userId:re["a"].getmatrixid(e.userId),membership:e.membership,powerLevel:e.powerLevel}}))}),t}prepareChat(e){return this.usersInfoForChatsStore([e]).then(()=>this.core.pcrypto.addroom(e))}fillContacts(e){return e=_.filter(e,e=>"join"==e._selfMembership&&57==e.name.length),this.usersInfoForChatsStore(e).then(e=>{this.core.store.commit("SET_CONTACTS_FROM_MATRIX",_.filter(e,e=>!this.core.user.userinfo||e.id!==this.core.user.userinfo.id))})}usersInfoForChatsStore(e,t){return this.usersInfoForChats(e,t).then(t=>(this.core.store.commit("SET_CHATS_USERS",this.usersFromChats(e)),Promise.resolve(t))).catch(e=>Promise.resolve())}allchatmembers(e,t,n){var r=[],i=[];if(n)i=_.map(e,e=>"invite"!==e._selfMembership||e.summary.members&&!t||e.summary.membersloading?Promise.resolve():(e.summary.membersloading=!0,e._loadMembersFromServer().then(t=>(e.summary.membersloading=!1,e.summary.members=_.map(t,e=>({name:re["a"].getmatrixid(e.state_key),membership:e.content.membership,user:e,userId:e.state_key,powerLevel:e.content.powerLevel||0})),"invite"===e._selfMembership&&this.core.user.userinfo&&(_.find(e.summary.members,e=>e.userId==this.core.user.matrixId(this.core.user.userinfo.id))||e.summary.members.push({name:this.core.user.userinfo.id,membership:"invite",user:this.core.user.userinfo,userId:this.core.user.matrixId(this.core.user.userinfo.id),powerLevel:0})),Promise.resolve())).catch(t=>(e.summary.membersloading=!1,Promise.resolve()))));return Promise.all(i).then(t=>(_.each(e,e=>{r=r.concat(_.toArray(e.currentState.members),e.summary.members||[])}),r=_.uniq(r,(function(e){return e.userId})),Promise.resolve(r)))}usersInfoForChats(e,t){return this.allchatmembers(e,t).then(e=>this.usersInfo(e,t))}usersInfoById(e){var t=[re["a"].getmatrixid(e)];return this.core.user.usersInfo(t,!1).then(e=>Promise.resolve(e[0]))}usersInfo(e,t){var n=_.map(e,(function(e){return re["a"].getmatrixid(e.userId)}));return n=_.uniq(n),this.core.user.usersInfo(n,!1,t)}groupId(e){let t=[],n=[];e.forEach(e=>{n.push(this.core.user.matrixId(e.id))}),e.forEach((function(e){let n=parseInt(e.id,16);t.push(n)}));const r=t.reduce((e,t)=>e*t,1),i=re["a"].makeid(r);let o=re["a"].sha224(i.toString()).toString("hex");return{hash:o,idForInviting:n}}groupIdLight(e){let t=[],n=[];var r=[null];window.chatinvitedomains&&(r=[].concat(r,window.chatinvitedomains)),_.each(r,t=>{_.each(e,e=>{n.push(this.core.user.matrixId(e,t))})}),_.each(e,e=>{let n=parseInt(e,16);t.push(n)});const i=t.reduce((e,t)=>e*t,1),o=re["a"].makeid(i);let a=re["a"].sha224(o.toString()).toString("hex");return{hash:a,idForInviting:n}}chatIsPublic(e){var t=e.currentState.getStateEvents("m.room.join_rules");return console.log("join_rules",t),!!_.find(t,e=>"public"==re["a"].deep(e,"event.content.join_rule"))}}var Oo=Ro,Mo=r("5059");var Ao=function(){return Ao=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=r+n?(r=o,[4,No(0)]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++i,[3,1];case 4:return[2]}}))}))}function zo(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function qo(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Wo(e,t){return t%=64,32===t?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function Ko(e,t){return t%=64,0===t?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=qo(e,[4283543511,3981806797]),e=Vo(e,[0,e[0]>>>1]),e=qo(e,[3301882366,444984403]),e=Vo(e,[0,e[0]>>>1]),e}function Ho(e,t){e=e||"",t=t||0;var n,r=e.length%16,i=e.length-r,o=[0,t],a=[0,t],s=[0,0],c=[0,0],l=[2277735313,289559509],u=[1291169091,658871167];for(n=0;n>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function Yo(e){var t;return Ao({name:e.name,message:e.message,stack:null===(t=e.stack)||void 0===t?void 0:t.split("\n")},e)}function Jo(e,t){for(var n=0,r=e.length;n=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function ra(e){for(var t,n,r="Unexpected syntax '"+e+"'",i=/^\s*([a-z-]*)(.*)$/i.exec(e),o=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var l=s.exec(i[2]);if(!l)break;var u=l[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(r);c(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[o,a]}function ia(e){return e&&"object"===typeof e&&"message"in e?e:{message:e}}function oa(e,t){var n=function(e){return"function"!==typeof e},r=new Promise((function(r){var i=Date.now();Bo(e.bind(null,t),(function(){for(var e=[],t=0;t=4}function ca(){var e=window,t=navigator;return ta(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!sa()}function la(){var e=window,t=navigator;return ta(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function ua(){var e=window,t=navigator;return ta(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function da(){var e=window;return ta(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function fa(){var e,t,n=window;return ta(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function ha(){var e=window;return ta([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl==="[object Intl]",""+e.Reflect==="[object Reflect]"])>=3}function pa(){var e=window;return ta(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function ma(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return ta(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function va(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function ga(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function ya(){var e=la(),t=fa();if(!e&&!t)return!1;var n=window;return ta(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function ba(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(_a())return-1;var n=4500,r=5e3,i=new t(1,r,44100),o=i.createOscillator();o.type="triangle",o.frequency.value=1e4;var a=i.createDynamicsCompressor();a.threshold.value=-50,a.knee.value=40,a.ratio.value=12,a.attack.value=0,a.release.value=.25,o.connect(a),a.connect(i.destination),o.start(0);var s=wa(i),c=s[0],l=s[1],u=c.then((function(e){return xa(e.getChannelData(0).subarray(n))}),(function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return u.catch((function(){})),function(){return l(),u}}function _a(){return ua()&&!da()&&!pa()}function wa(e){var t=3,n=500,r=500,i=5e3,o=function(){},a=new Promise((function(a,s){var c=!1,l=0,u=0;e.oncomplete=function(e){return a(e.renderedBuffer)};var d=function(){setTimeout((function(){return s(ka("timeout"))}),Math.min(r,u+i-Date.now()))},f=function(){try{switch(e.startRendering(),e.state){case"running":u=Date.now(),c&&d();break;case"suspended":document.hidden||l++,c&&l>=t?s(ka("suspended")):setTimeout(f,n);break}}catch(r){s(r)}};f(),o=function(){c||(c=!0,u>0&&d())}}));return[a,o]}function xa(e){for(var t=0,n=0;n=0?"+":"")+Math.abs(r)}function ns(){var e=(new Date).getFullYear();return Math.max(Qo(new Date(e,0,1).getTimezoneOffset()),Qo(new Date(e,6,1).getTimezoneOffset()))}function rs(){try{return!!window.sessionStorage}catch(e){return!0}}function is(){try{return!!window.localStorage}catch(e){return!0}}function os(){if(!sa()&&!ca())try{return!!window.indexedDB}catch(e){return!0}}function as(){return!!window.openDatabase}function ss(){return navigator.cpuClass}function cs(){var e=navigator.platform;return"MacIntel"===e&&ua()&&!da()?ma()?"iPad":"iPhone":e}function ls(){return navigator.vendor||""}function us(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t.6*t.length})),i.sort(),[2,i]}}))}))}function ps(){return ua()||ya()}function ms(e){var t;return Po(this,void 0,void 0,(function(){var n,r,i,o,a,s,c;return jo(this,(function(l){switch(l.label){case 0:for(n=document,r=n.createElement("div"),i=new Array(e.length),o={},vs(r),c=0;c')}var $s={fonts:Oa,domBlockers:hs,fontPreferences:Ls,audio:ba,screenFrame:Xa,osCpu:Ba,languages:Fa,colorDepth:za,deviceMemory:qa,screenResolution:Wa,hardwareConcurrency:es,timezone:ts,sessionStorage:rs,localStorage:is,indexedDB:os,openDatabase:as,cpuClass:ss,platform:cs,plugins:Ma,canvas:Aa,touchSupport:Ua,vendor:ls,vendorFlavors:us,cookiesEnabled:ds,colorGamut:ys,invertedColors:bs,forcedColors:ws,monochrome:Ss,contrast:Es,reducedMotion:Ts,hdr:Rs,math:Ps};function Us(e){return aa($s,e,[])}var Bs="$ if upgrade to Pro: https://fpjs.dev/pro";function Fs(e){var t=zs(e),n=qs(t);return{score:t,comment:Bs.replace(/\$/g,""+n)}}function zs(e){if(ya())return.4;if(ua())return da()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function qs(e){return na(.99+.01*e,1e-4)}function Ws(e){for(var t="",n=0,r=Object.keys(e).sort();n=.01))try{var e=new XMLHttpRequest;e.open("get","https://openfpcdn.io/fingerprintjs/v"+Lo+"/npm-monitoring",!0),e.send()}catch(t){console.error(t)}}function Xs(e){var t=void 0===e?{}:e,n=t.delayFallback,r=t.debug,i=t.monitoring,o=void 0===i||i;return Po(this,void 0,void 0,(function(){var e;return jo(this,(function(t){switch(t.label){case 0:return o&&Js(),[4,Hs(n)];case 1:return t.sent(),e=Us({debug:r}),[2,Ys(e,r)]}}))}))}var Zs={load:Xs,hashComponents:Vs,componentsToDebugString:Ks},Qs=Zs,ec=r("4328"),tc=r.n(ec),nc=r("21a6"),rc=r.n(nc),ic=r("6129");const oc=r("0a00");var ac=r("bc3a");console.log("sdk",oc);class sc{constructor(e,t){Object(To["a"])(this,"fastsync",(function(){var e=this.client.getSyncState();if("PREPARED"!==e&&"SYNCING"!==e)return this.client.retryImmediately().catch(e=>{console.log("fastsyncerror",e)})})),t||(t={}),this.core=e,this.baseUrl=t.baseUrl,this.ready=!1,this.error=!1,this.kit=new Oo(this.core,t),this.sdk=oc,this.sync="",this.nd=!1,this.version=4,this.dversion="2",this.backup={},this.db=null,this.customrequest=!0,this.devicekey="m8_device"}setCredentials(){var e=this;return Object(Co["a"])((function*(){return e.core.user.matrixCredentials().then(t=>(e.credentials=t,Promise.resolve(t)))}))()}getDevices(){var t=localStorage[this.devicekey]||"";if(t)try{var n=JSON.parse(t);return n}catch(e){}return{}}setDevice(e,t){var n=this.getDevices();n[t]=e,localStorage[this.devicekey]=JSON.stringify(n),localStorage.device_=JSON.stringify(e)}getDevice(e){}request(t,n){var r=null,i=null;const o=ac.CancelToken.source();var a={url:t.uri,params:t.qs,data:JSON.parse(t.body||"{}"),timeout:t.timeout,headers:t.headers,json:t.json,method:t.method,withCredentials:t.withCredentials,_matrix_opts:t,cancelToken:o.token,paramsSerializer:function(e){return tc.a.stringify(e,t.qsStringifyOptions)}},s=ac(a).then(e=>Promise.resolve(e)).catch(e=>(i=e,r=e.response,Promise.resolve(r))).then(t=>{var r=i;if(i)try{r=JSON.parse(re["a"].deep(t,"request.responseText")),i=new oc.MatrixError(r)}catch(e){}n(i,t,re["a"].deep(t,"request.responseText")||"")});return s.abort=function(){o.cancel()},s}getFingerprint(){var e=this;return Object(Co["a"])((function*(){var t=yield Qs.load(),n=yield t.get();return n.visitorId+e.dversion}))()}createMtrxClient(e){var t=oc.createClient(e);return t.getProfileInfo=function(){return Promise.resolve({avatar_url:"",displayname:"test"})},t}getClient(){var t=this;return Object(Co["a"])((function*(){yield t.setCredentials();var n={baseUrl:t.baseUrl},r={baseUrl:t.baseUrl};t.customrequest&&(r.request=t.request);var i=t.createMtrxClient(r);try{var o=yield i.login("m.login.password",{user:t.credentials.username,password:t.credentials.password})}catch(e){if(e&&e.indexOf&&e.indexOf("M_USER_DEACTIVATED")>-1)return t.error="M_USER_DEACTIVATED",null;if(!(yield i.isUsernameAvailable(t.credentials.username)))throw"Signup error, username is not available: "+e;o=yield i.register(t.credentials.username,t.credentials.password,null,{type:"m.login.dummy"})}localStorage.accessToken=o.access_token;var a=new oc.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-js-sdk:"+t.credentials.username});yield a.startup(),Object.assign(n,{userId:o.user_id,accessToken:o.access_token,unstableClientRelationAggregation:!0,timelineSupport:!0,store:a}),t.customrequest&&(n.request=t.request);var s=t.createMtrxClient(n);return window.client=s,window.core=t.core,yield s.startClient({pollTimeout:6e4,resolveInvitesToProfiles:!0}),t.access=n,t.client=s,s}))()}clearstorage(e){var t=Object.keys(localStorage),n=t.length;while(n--)t[n]&&0==t[n].indexOf(e)&&localStorage.removeItem(t[n])}clearstore(){var e=Number(localStorage.matrixversion||"0");if(ethis.ready).then(()=>this.error?Promise.reject(this.error):Promise.resolve())}waitchats(){return re["a"].pretry(()=>this.chatsready).then(()=>this.error?Promise.reject(this.error):Promise.resolve())}me(e){var t;return re["a"].getmatrixid(e)==(null===(t=this.core.user.userinfo)||void 0===t?void 0:t.id)}reciepts(e){var t=null;return re["a"].pretry(()=>{var n=this.core.mtrx.store.rooms;return t=n[e.getRoomId()],t}).then(()=>t.getReceiptsForEvent(e))}storeFileLocal(e,t){return t.arrayBuffer().then(n=>{const r=new Blob([new Uint8Array(n)],{type:t.type});return window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.storage&&window.cordova?window.POCKETNETINSTANCE.storage.saveFile(e,r):this.db?this.db.set(e,r):void 0})}download(e){var t=()=>re["a"].fetchLocal(e).then(t=>(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.storage&&window.cordova?window.POCKETNETINSTANCE.storage.saveFile(e,t.data):this.db&&this.db.set(e,t.data),Promise.resolve(t.data)));return window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.storage&&window.cordova?window.POCKETNETINSTANCE.storage.loadFile(e).then(e=>Promise.resolve(e),e=>t()):this.db?this.db.get(e).then(e=>Promise.resolve(e)).catch(()=>t()):t()}customRoomType(e){var t,n=this.core.mtrx.client.getRoom(e);if(!n)return null;var r=n.currentState.getStateEvents("m.room.custom","")||{};return null===(t=r.event)||void 0===t?void 0:t.content.type}isReaded(e,t){return this.reciepts(e).then(e=>Promise.resolve(_.find(e,e=>{var n=this.me(e.userId);return"m.read"==e.type&&(t&&n||!n&&!t)})))}initEvents(){let e=this.core.mtrx.client.credentials.userId;this.client.on("RoomMember.membership",(t,n)=>{this.chatsready&&("invite"!==n.membership&&"join"!==n.membership||t.getSender()===e||this.core.notifier.event(t))}),this.client.on("Room.timeline",(t,n)=>{if(this.chatsready&&t.event.content&&("m.file"===t.event.content.msgtype&&(t.event.content.pbody=JSON.parse(t.event.content.body)),t.getSender()!==e)){var r=this.core.mtrx.client.getRoom(t.event.room_id);if(t.event.content["m.relates_to"]&&"m.replace"==t.event.content["m.relates_to"]["rel_type"])return!1;r&&this.core.pcrypto.rooms[t.event.room_id]&&this.core.notifier.event(t,r)}}),this.client.on("RoomMember.typing",(e,t)=>{this.core.store.dispatch("TYPING_EVENT",t)}),this.client.on("sync",(e,t,n)=>{"PREPARED"===e&&this.setready(),this.core.store.dispatch("FETCH_CHATS").then(e=>{this.core.store.dispatch("FETCH_EVENTS"),this.core.store.commit("ALL_NOTIFICATIONS_COUNT",this.client.getRooms())})})}setready(){this.chatsready||(this.chatsready=!0,this.core.store.commit("SET_CHATS_READY",!0))}initdb(){return Object(ic["a"])("files",1).then(e=>(this.db=e,Promise.resolve())).catch(()=>Promise.resolve())}init(){return this.createClient().then(()=>this.error?Promise.reject(this.error):this.initdb()).then(()=>(this.initEvents(),Promise.resolve()))}deactivateAccount(){return this.client?this.client.deactivateAccount(this.credentials,!0):Promise.reject("noclient")}destroy(){this.client&&(window.cordova&&this.deletePusher(),this.client.stopClient()),this.chatsready=!1,this.ready=!1,this.error=!1}deletePusher(){var e;if(window.cordova&&(localStorage&&(e=localStorage.getItem("fcmtoken5")),e&&this.client.setPusher)){var t="pocketnet",n={app_display_name:t,app_id:t+window.cordova.platformId,data:{url:this.core.mtrx.baseUrl+"/_matrix/push/v1/notify",default_payload:{aps:{sound:"default","content-available":1}}},device_display_name:window.device.manufacturer+" "+window.device.model,kind:null,lang:localStorage.getItem("loc")||"en",pushkey:e};this.core.mtrx.client.setPusher(n).then(()=>{localStorage.removeItem("fcmtoken5")},e=>{console.log(e)})}}uploadContent(e,t){return this.client.uploadContent(e).then(e=>Promise.resolve(this.core.mtrx.client.mxcUrlToHttp(e))).then(n=>t?this.storeFileLocal(n,e).then(()=>Promise.resolve(n)).catch(e=>Promise.resolve(n)):Promise.resolve())}originalEvent(t,n){var r=n._timelineSet.getRelationsForEvent(e.event.event_id,"m.reference","m.room.message");if(r){var i=r.getRelations();return i[0]}}clearEventId(e){var t=null;return e.event.content["m.relates_to"]&&"m.replace"==e.event.content["m.relates_to"]["rel_type"]&&(t=e.event.content["m.relates_to"]["event_id"]),t||e.getId()}textEvent(e,t){return e.pcrypto.canBeEncrypt()?e.pcrypto.encryptEvent(t):Promise.resolve(this.sdk.ContentHelpers.makeTextMessage(t))}sendtext(e,t,n){let{relation:r,from:i}=n;return this.textEvent(e,t).then(t=>(r&&(t["m.relates_to"]={rel_type:r.type,event_id:this.clearEventId(r.event)}),i&&(t["from"]=i),e.pcrypto.canBeEncrypt()?this.client.sendEvent(e.roomId,"m.room.message",t):this.client.sendMessage(e.roomId,t)))}sendFile(e,t,n,r,i){let{relation:o,from:a}=r;n||(n={});var s={};s.name=t.name,s.size=t.size;var c=(()=>Promise.resolve(t))(),l=null;return e.pcrypto.canBeEncrypt()&&!i&&(c=e.pcrypto.encryptFile(t).then(e=>(s.secrets=e.secrets,Promise.resolve(e.file)))),c.then(e=>(l=this.client.uploadContent(e),l.abort&&(n.abort=l.abort),l)).then(e=>n.aborted?Promise.reject("aborted"):Promise.resolve(this.client.mxcUrlToHttp(e))).then(t=>{s.url=t;let n=JSON.stringify(s);var r={body:n,msgtype:"m.file"};return o&&(r["m.relates_to"]={rel_type:o.type,event_id:this.clearEventId(o.event)}),a&&(r["from"]=a),this.client.sendMessage(e.roomId,r)})}sendImageBase64(e,t,n,r){var i="toFileFetch";return t.indexOf("data:")>-1&&(i="toFile"),re["a"].Base64[i](t).then(i=>this.sendImage(e,t,i,n,r))}sendAudioBase64(e,t,n,r){var i="toFileFetch";return t.indexOf("data:")>-1&&(i="toFile"),re["a"].Base64[i](t).then(i=>this.sendAudio(e,t,i,n,r))}sendImage(e,t,n,r){let{relation:i,from:o}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!n)return this.sendImageBase64(e,t,r);var a=new Mo["a"],s={};return r||(r={}),a.wh(t).then(t=>(s=t,o&&(s.from=o),e.pcrypto.canBeEncrypt()?e.pcrypto.encryptFile(n).then(e=>(s.secrets=e.secrets,Promise.resolve(e.file))):Promise.resolve(n))).then(e=>{var t=this.core.mtrx.uploadContent(e,!0);return t.abort&&(r.abort=t.abort),t}).then(t=>r.aborted?Promise.reject("aborted"):this.client.sendImageMessage(e.roomId,t,s,"Image"))}sendAudio(e,t,n,r){let{relation:i,from:o}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!n)return this.sendAudioBase64(e,t,r);let a={};return a.from=o,new Promise(t=>{if(e.pcrypto.canBeEncrypt())return console.log("??????????"),e.pcrypto.encryptFile(n).then(e=>(a.secrets=e.secrets,t(e.file)));t(n)}).then(e=>{let t=this.core.mtrx.uploadContent(e,!0);return t.abort&&(r.abort=t.abort),t}).then(t=>(console.log(t,a),r.aborted?Promise.reject("aborted"):this.client.sendAudioMessage(e.roomId,t,a,"Audio")))}getFile(t,n){var r=this;return Object(Co["a"])((function*(){try{var i=yield t.pcrypto.decryptKey(n.event);n.event.decryptKey=i}catch(e){return Promise.reject(e)}return r.download(n.event.content.pbody.url).then(e=>t.pcrypto.decryptFile(e,i)).then(e=>Promise.resolve({file:e,name:n.event.content.pbody.name})).catch(e=>Promise.reject(e))}))()}downloadFile(e,t){var n=this;return Object(Co["a"])((function*(){return n.getFile(e,t).then(e=>window.cordova&&re["a"].saveFileCordova?new Promise((t,n)=>{re["a"].saveFileCordova(e.file,e.name,(function(e,r){r&&console.error(r),r?n("unable"):t()}))}):rc.a.saveAs(e.file,e.name)).catch(e=>(console.error(e),Promise.reject(e)))}))()}getAudioUnencrypt(e,t){var n=this;return Object(Co["a"])((function*(){return console.log("getAudioUnencrypt"),t.event.content.audioData?Promise.resolve(t.event.content.audioData):n.download(t.event.content.url,!0).then(e=>re["a"].readFile(e)).then(e=>(t.event.content.audioData=e,Promise.resolve(e)))}))()}getAudio(t,n){var r=this;return Object(Co["a"])((function*(){if(n.event.decryptedAudio)return Promise.resolve(n.event.decryptedAudio);try{var i=yield t.pcrypto.decryptKey(n.event);return n.event.decryptKey=i,r.download(n.event.content.url,!0).then(e=>t.pcrypto.decryptFile(e,i)).then(e=>re["a"].readFile(e)).then(e=>(n.event.decryptedAudio=e,Promise.resolve(n.event.decryptedAudio))).catch(e=>Promise.reject(e))}catch(e){return Promise.reject(e)}}))()}getImage(t,n){var r=this;return Object(Co["a"])((function*(){if(n.event.decryptedImage)return Promise.resolve(n.event.decryptedImage);try{var i=yield t.pcrypto.decryptKey(n.event);return n.event.decryptKey=i,r.download(n.event.content.url,!0).then(e=>t.pcrypto.decryptFile(e,i)).then(e=>re["a"].Base64.fromFile(e)).then(e=>(n.event.decryptedImage=e.replace("data:file;","data:image/jpeg;"),Promise.resolve(n.event.decryptedImage))).catch(e=>Promise.reject(e))}catch(e){return Promise.reject(e)}}))()}shareInChat(e,t){var n=this.client.getRoom(e);return this.core.mtrx.kit.prepareChat(n).then(e=>{var r=[];return _.each(t.images,e=>{var i=this.sendImageBase64(n,e,{},{from:t.from});r.push(i)}),_.each(t.files,e=>{r.push(this.sendFile(n,e,{},{from:t.from}))}),_.each(t.urls,e=>{r.push(this.sendtext(n,e,{from:t.from}))}),_.each(t.messages,e=>{r.push(this.sendtext(n,e,{from:t.from}))}),_.each(t.audio,e=>{var i="data:audio/mpeg;base64,"+re["a"]._arrayBufferToBase64(e);r.push(this.sendAudioBase64(n,i,{},{from:t.from}))}),Promise.all(r)})}opencontact(e){this.core.store.commit("setmodal",{caption:e.name,type:"contact",data:{contact:e}})}complain(e,t){this.core.store.commit("setmodal",{caption:e,type:"complain",data:t})}blockeduser(e){if(this.core.mtrx.client)return this.core.mtrx.client.isUserIgnored(this.core.user.matrixId(e))}blockUser(e){if(e=this.core.user.matrixId(e),this.client.isUserIgnored(e))return Promise.resolve();var t=this.client.getIgnoredUsers();return t.push(e),this.client.setIgnoredUsers(t).then(e=>Promise.resolve(e))}unblockUser(e){if(e=this.core.user.matrixId(e),!this.client.isUserIgnored(e))return Promise.resolve();var t=this.client.getIgnoredUsers();return t=_.filter(t,(function(t){return e!=t})),this.client.setIgnoredUsers(t).then(e=>Promise.resolve(e))}chatUsersInfo(e,t){t||(t="chatUsers");var n=this.core.store.state.users;return _.filter(_.map(this[t](e),e=>n[e.userId]),(function(e){return e}))}chatUsers(e){return this.core.store.state.chatusers[e]||[]}anotherChatUsers(e){return _.filter(this.chatUsers(e),e=>e.userId!=this.core.user.userinfo.id)}}var cc=sc;class lc{constructor(e,t){Object(To["a"])(this,"key","showednotifications"),Object(To["a"])(this,"showed",{}),Object(To["a"])(this,"show",(function(e,t){if("function"!=typeof t){var n=t;t=()=>{this.core.vm.$router.push(n).catch(e=>{}),this.core.apptochat&&this.core.apptochat()}}var r="bottom-right";this.core.vm.$store.state.mobile&&(r="top-left"),this.core.vm.$message({event:e.event,title:e.title,message:e.message,roomId:e.roomId,iconImg:e.icon||null,onClick:t,zIndex:999,supportHTML:!0,wrapperClassName:"notificationWrapper",position:r,type:"info",chat:e.chat,duration:5e3})})),t||(t={}),this.core=e,this.showed=JSON.parse(localStorage[this.key]||"{}"),this.ion=null,"undefined"!=typeof ion&&(this.ion=ion)}addshowed(e){this.showed=JSON.parse(localStorage[this.key]||"{}"),this.showed[e]=!0,localStorage[this.key]=JSON.stringify(this.showed)}clearshowed(){this.showed={},localStorage[this.key]=JSON.stringify(this.showed)}playsound(){if(window.Media&&window.cordova&&window.cordova.file&&window.cordova.file.applicationDirectory){var e=window.cordova.file.applicationDirectory+"www/sounds/glass.mp3";e.startsWith("file://")&&(e=e.substring(7));var t=new Media(e);t.play()}else window.ion&&ion.sound.play("glass")}notifySoundOrAction(){var e=localStorage["lastsounddate"]||null;e&&(e=new Date(e),re["a"].date.addseconds(e,10)>new Date)||(localStorage["lastsounddate"]=new Date,window.cordova&&window.POCKETNETINSTANCE?window.POCKETNETINSTANCE.mobile.vibration.small():this.playsound())}decrypt(e,t){return this.core.mtrx.kit.prepareChat(t).then(n=>e.event.decrypted?Promise.resolve():t.pcrypto.decryptEvent(e.event)).catch(e=>Promise.resolve())}message(e,t,n){var r=this.core.vm.$store.state;if(!this.showed[e.event.event_id]){this.addshowed(e.event.event_id);var i=re["a"].deep(this,"core.external.clbks.NOTIFICATION")||{},o="",a=re["a"].deep(e,"event.type");["m.room.member"].indexOf(a)>-1&&(o="invite"),["m.room.message"].indexOf(a)>-1&&(o="message"),["m.room.name"].indexOf(a)>-1&&(o=""),["m.room.power_levels"].indexOf(a)>-1&&(o="moder"),["m.room.redaction"].indexOf(a)>-1&&(o="redaction"),"m.encrypted"==re["a"].deep(e,"event.content.msgtype")&&(o="encrypted");var s=()=>{var a={title:t.name,event:e,message:"m.encrypted"==e.event.content.type?"***":e.event.content.body,roomId:e.event.room_id,icon:t.image,chat:n,ctype:o};_.each(i,(function(e){e(a)})),(r.currentRoom!==e.event.room_id||this.core.hiddenInParent)&&(this.notifySoundOrAction(),this.show(a,"/chat?id="+e.event.room_id))};"encrypted"==o?this.decrypt(e,n).then(s):s()}}event(e,t){let n=this.core.mtrx.client.getPushActionsForEvent(e);if(n.notify){var r=moment(moment.utc(e.event.origin_server_ts).toDate()).local().toDate(),i=re["a"].date.addseconds(r,10)>moment().toDate();i&&this.core.mtrx.isReaded(e,!0).then(n=>{n||!this.core.mtrx.me(e.getSender())&&e.getSender()&&e.getSender()!==this.core.mtrx.client.credentials.userId&&this.core.user.usersInfo([re["a"].getmatrixid(e.getSender())]).then(n=>{n&&n[0]&&this.message(e,n[0],t)})})}}}var uc=lc,dc=r("e7f6"),fc=r("6967"),hc=r.n(fc),pc=r("bc3a"),{error:mc,byError:vc}=r("d854"),gc=(pc=function(){var t=["data.result"],n=["data.error"];function r(e){return i.apply(this,arguments)}function i(){return i=Object(Co["a"])((function*(r){let{to:i,data:o}=r;o||(o={}),_.each(o,(e,t)=>{(_.isArray(e)||_.isObject(e))&&(o[t]=JSON.stringify(e))});var a=null;try{a=yield hc()({method:"post",headers:{"content-type":"application/x-www-form-urlencoded"},url:i,data:tc.a.stringify(o),timeout:35e3})}catch(e){a=e.response}if(!a)return Promise.reject("noresponse");var s=_.find(n,(function(e){return re["a"].deep(a.data,e)}));if(s)return Promise.reject(vc(re["a"].deep(a.data,s)));var c=_.find(t,(function(e){return re["a"].deep(a.data,e)}));return c?Promise.resolve(re["a"].deep(a.data,c)):Promise.reject("error")})),i.apply(this,arguments)}return{axios:r}},pc),{error:yc}=r("d854"),bc=function(e){var t=this,n=new gc,r={},i={},o={},a={pocketnet:null},s=function(){return Promise.resolve()},c=function(e){return o[e.storage]?Promise.resolve(o[e.storage]):Object(ic["a"])(e.storage,e.version||1,e.time).then(t=>(o[e.storage]=t,Promise.resolve(t)))},l=function(e,t,n,o,a){_.isArray(e)||(e=[e]);var l={};return n||(n=t),r[t]||(r[t]={}),i[t]||(i[t]={}),(a?c(a):s()).then(i=>i?Promise.all(_.map(e,e=>r[t][e]?Promise.resolve():i.get(e).then(e=>(r[t][e[n]]=e,Promise.resolve())).catch(e=>Promise.resolve()))):Promise.resolve()).then(u=>{var d=_.uniq(_.filter(e,(function(e){return o||!r[t][e]||r[t][e].nocache}))),f=_.filter(d,(function(e){if(!i[t][e])return i[t][e]=!0,!0;l[e]=!0})),h=function(o,u){return(a?c(a):s()).then(e=>e?Promise.all(_.map(o,t=>t[n]?e.set(t[n],t):Promise.resolve())):Promise.resolve()).then(()=>{_.each(o,(function(e){e[n]&&(r[t][e[n]]=e)})),_.each(u,(function(e){delete i[t][e],delete l[e],r[t][e]||(r[t][e]="error")}));var a={};return re["a"].pretry(()=>(_.each(e,(function(e){r[t][e]&&("error"!=r[t][e]&&(a[e]=r[t][e]),delete i[t][e],delete l[e])})),0==_.toArray(l).length)).then(()=>Promise.resolve(a))})};return Promise.resolve({id:f,handle:h})})},u=function(){return e&&e.waitonline?e.waitonline():Promise.resolve()},d=function(e,t,n,r,i){return l(e,t,n,r,i).then(e=>e.id.length?Promise.reject(e):e.handle([]))},f=function(e,t){return u().then(()=>(e||(e={}),n.axios({to:t,data:e}).then(e=>Promise.resolve(e)).catch(n=>"noresponse"==n?new Promise((n,r)=>{setTimeout((function(){f(e,t).then(e=>n(e)).catch(e=>r(e))}),3e3)}):Promise.reject(n))))};return t.clearCache=function(e){e?delete r[e]:r={}},t.pocketnet={common:(t,n)=>(t||(t={}),a.pocketnet||(a.pocketnet=re["a"].deep(window,"POCKETNETINSTANCE.api")),a.pocketnet||"undefined"==typeof Api||(a.pocketnet=new Api(e)),a.pocketnet?a.pocketnet.initIf().then(()=>a.pocketnet.wait.ready("use",3e3)).then(e=>a.pocketnet.rpc(n,t.parameters)).catch(e=>({error:e})):(t.method=n,t.node="185.148.147.15",t.parameters=re["a"].hexEncode(JSON.stringify(t.parameters||"")),f(t,servers.pocketnet+"/rpc-"+(n||"common")))),userState:e=>{_.isArray(e)||(e=[e]);var n=[e.join(",")];return t.pocketnet.common({parameters:n},"getuserstate")},userStateMe:e=>{var n=re["a"].deep(window,"POCKETNETINSTANCE.platform.sdk.ustate.storage."+e);return n?Promise.resolve(n):t.pocketnet.userState(e)},userInfoCached:(e,n)=>{var r=[];return n||(r=_.filter(_.map(e,e=>re["a"].deep(window,"POCKETNETINSTANCE.platform.sdk.userscl.storage."+e)||null),e=>e),e=_.filter(e,e=>!_.find(r,t=>t.address==e))),t.pocketnet.userInfo(e,n).then(e=>(e=_.toArray(e),_.each(r,t=>{e.push(t)}),Promise.resolve(e)))},search:e=>{var n=[e,"users"];return t.pocketnet.common({parameters:n},"searchusers").then(e=>Promise.resolve(e||[]))},userInfo:(e,n)=>e.length?d(e,"pocketnet_userInfo","address",n,{storage:"userInfo",time:86400}).catch(e=>{if(!e||!e.id)return Promise.reject(e);var n=[e.id,"1"];return t.pocketnet.common({parameters:n},"getuserprofile").then(t=>e.handle(t,e.id))}):Promise.resolve([]),postInfo:e=>{var n=[[e.parameters]];return t.pocketnet.common({parameters:n},"getrawtransactionwithmessagebyid").then(e=>Promise.resolve(e))},pocketNetProfileAddress:e=>{var n=[[e.parameters]];return t.pocketnet.common({parameters:n},"getuseraddress").then(e=>Promise.resolve(e))},pocketNetProfileInfo:e=>{var n=[[e.parameters]];return t.pocketnet.common({parameters:n},"getuserprofile").then(e=>Promise.resolve(e))}},t},_c=bc,wc=r("9c21"),xc=r("ebaa"),kc=function(){var e=this;e.gettingmedia=!1;var t={ios:{audio:function(){return new Promise((e,t)=>{window.audioinput.checkMicrophonePermission((function(n){n?e():window.audioinput.getMicrophonePermission((function(n,r){n?e():t("permissions")}))}))})},video:function(){return new Promise((e,t)=>{var n=!0,r=!0;cordova.plugins.iosrtc.requestPermission(n,r,(function(n){n?e():t("permissions")}))})}},audio:function(){var e=window.cordova.plugins.permissions;return new Promise((t,n)=>{if(e){var r=function(){e.requestPermission(e.RECORD_AUDIO,e=>{e.hasPermission?t():n("permissions")},e=>{console.error(e),n("permissions")})};e.checkPermission(e.RECORD_AUDIO,e=>{e.hasPermission?t():r()},e=>{console.error(e),r()})}else n("permissions")})},video:function(){var e=window.cordova.plugins.permissions;return new Promise((t,n)=>{e?e.hasPermission(e.CAMERA,r=>{r.hasPermission?t():e.requestPermission(e.CAMERA,()=>{t()},()=>{n("permissions")})}):n("permissions")})}},n=function(e){var n=function(e,t){return t?e():Promise.resolve()};if(window.cordova&&window.device){var r=re["a"].isios();return n(r?t.ios.audio:t.audio,e.audio).then(()=>n(r?t.ios.video:t.video,e.video)).catch(e=>(console.error("E",e),Promise.reject(e)))}return Promise.resolve()},r=function(e){return new Promise((t,r)=>{n(e).then(()=>{navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(t).catch(r):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,t,r)}).catch(r)})};e.get=function(e){return r(e)},e.permissions=n},Sc=kc,Ec=()=>{let e=2,t=[];function n(n){let r=n.length,i=new Uint8Array(r*e);for(let t=0;t1?o=1:o<-1&&(o=-1),o*=32768,i[r]=o,i[r+1]=o>>8}t.push(i)}function r(n){let r=t.length?t[0].length:0,i=t.length*r,o=new Uint8Array(44+i),a=new DataView(o.buffer);a.setUint32(0,1380533830,!1),a.setUint32(4,36+i,!0),a.setUint32(8,1463899717,!1),a.setUint32(12,1718449184,!1),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,n,!0),a.setUint32(28,n*e,!0),a.setUint16(32,e,!0),a.setUint16(34,8*e,!0),a.setUint32(36,1684108385,!1),a.setUint32(40,i,!0);for(let e=0;e{"encode"===e.data[0]?n(e.data[1]):"dump"===e.data[0]&&r(e.data[1])}};let Cc,Tc=window.AudioContext||window.webkitAudioContext,Ic=e=>{let t=e.toString().replace(/^(\(\)\s*=>|function\s*\(\))\s*{/,"").replace(/}$/,""),n=new Blob([t]);return new Worker(URL.createObjectURL(n))},Rc=e=>{let t=new Event("error");return t.data=new Error("Wrong state for "+e),t};class Oc{constructor(e,t=null){this.stream=e,this.config=t,this.state="inactive",this.em=document.createDocumentFragment(),this.encoder=Ic(Oc.encoder);let n=this;this.encoder.addEventListener("message",e=>{let t=new Event("dataavailable");t.data=new Blob([e.data],{type:n.mimeType}),n.em.dispatchEvent(t),"inactive"===n.state&&n.em.dispatchEvent(new Event("stop"))})}start(e){if("inactive"!==this.state)return this.em.dispatchEvent(Rc("start"));this.state="recording",Cc||(Cc=new Tc(this.config)),this.clone=this.stream.clone(),this.input=Cc.createMediaStreamSource(this.clone),this.processor=Cc.createScriptProcessor(2048,1,1),this.encoder.postMessage(["init",Cc.sampleRate]),this.processor.onaudioprocess=e=>{"recording"===this.state&&this.encoder.postMessage(["encode",e.inputBuffer.getChannelData(0)])},this.input.connect(this.processor),this.processor.connect(Cc.destination),this.em.dispatchEvent(new Event("start")),e&&(this.slicing=setInterval(()=>{"recording"===this.state&&this.requestData()},e))}stop(){return"inactive"===this.state?this.em.dispatchEvent(Rc("stop")):(this.requestData(),this.state="inactive",this.clone.getTracks().forEach(e=>{e.stop()}),this.processor.disconnect(),this.input.disconnect(),clearInterval(this.slicing))}pause(){return"recording"!==this.state?this.em.dispatchEvent(Rc("pause")):(this.state="paused",this.em.dispatchEvent(new Event("pause")))}resume(){return"paused"!==this.state?this.em.dispatchEvent(Rc("resume")):(this.state="recording",this.em.dispatchEvent(new Event("resume")))}requestData(){return"inactive"===this.state?this.em.dispatchEvent(Rc("requestData")):this.encoder.postMessage(["dump",Cc.sampleRate])}addEventListener(...e){this.em.addEventListener(...e)}removeEventListener(...e){this.em.removeEventListener(...e)}dispatchEvent(...e){this.em.dispatchEvent(...e)}}Oc.prototype.mimeType="audio/wav",Oc.isTypeSupported=e=>Oc.prototype.mimeType===e,Oc.notSupported=!navigator.mediaDevices||!Tc,Oc.encoder=Ec;var Mc=Oc,Ac=()=>{importScripts("https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js");let e,t=1,n=128,r=44100,i=new Int8Array;function o(e,t){if(0===t.length)return e;let n=new Int8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function a(i){e=new lamejs.Mp3Encoder(t,i||r,n)}function s(t){for(let e=0;e{"init"===e.data[0]?a(e.data[1]):"encode"===e.data[0]?s(e.data[1]):c(e.data[1])}};Mc.encoder=Ac,Mc.prototype.mimeType="audio/mpeg";class Pc{constructor(e,t){Object(To["a"])(this,"hideOptimization",(function(e){this.store.commit("hideOptimization",e)})),Object(To["a"])(this,"hideInParent",(function(e){this.hiddenInParent=e,this.store.commit("hiddenInParent",e)})),Object(To["a"])(this,"canback",(function(){return!this.store.state.gallery})),Object(To["a"])(this,"update",(function(e){let{block:t}=e;this.pcrypto.set.block(t)})),Object(To["a"])(this,"logerror",(function(e,t){window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.Logger.error({err:e,payload:t,code:402})})),Object(To["a"])(this,"destroy",(function(){this.store.commit("clearall"),this.removeEvents(),"chats"!=!this.vm.$route.name&&this.vm.$router.push("/chats").catch(e=>{}),this.user.destroy(),this.mtrx.destroy(),this.pcrypto.destroy(),window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform.matrixchat.unlink(this),this.vm.$destroy()})),Object(To["a"])(this,"init",(function(){this.focusListener.init(),this.onlineListener.init(),this.initEvents(),window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform.matrixchat.link(this)})),Object(To["a"])(this,"setUnauthorized",(function(e){this.unauthorized=e,this.store.commit("SET_UNAUTHORIZED",e)})),Object(To["a"])(this,"initWithUserBase",(function(){return this.loading=!0,this.user.checkCredentials().then(e=>this.user.userInfo()).then(e=>e?e.deleted?Promise.reject("deleted"):this.pcrypto.prepare():Promise.reject("unknown")).then(e=>this.mtrx.init()).then(e=>(this.loading=!1,this.setUnauthorized(null),this.pcrypto.helpers.checkuser(),re["a"].deep(this.user,"userinfo.name")&&this.mtrx.client.setDisplayName(re["a"].deep(this.user,"userinfo.name")),Promise.resolve())).catch(e=>(console.log("E",e),this.loading=!1,"unauthorized"!=e&&"unknown"!=e&&"deleted"!=e||this.setUnauthorized(e),Promise.resolve()))})),Object(To["a"])(this,"initWithUser",(function(e){return this.user.setCredentials(e),this.initWithUserBase().then(()=>this.user.initKeysProcess()).catch(e=>Promise.resolve())})),Object(To["a"])(this,"waitonline",(function(){return this.online?Promise.resolve():new Promise((e,t)=>{re["a"].retry(()=>this.online,(function(){e()}),5)})})),Object(To["a"])(this,"removeEvents",(function(){delete this.focusListener.clbks.resume.core,delete this.focusListener.clbks.pause.core,delete this.onlineListener.clbks.online.core,delete this.onlineListener.clbks.offline.core})),Object(To["a"])(this,"initEvents",(function(){this.focusListener.clbks.resume.core=e=>{this.focus=this.focusListener.focus},this.focusListener.clbks.pause.core=()=>{this.focus=this.focusListener.focus},this.onlineListener.clbks.online.core=e=>{this.online=this.onlineListener.online},this.onlineListener.clbks.offline.core=()=>{this.online=this.onlineListener.online}})),Object(To["a"])(this,"externalLink",(function(e){this.external=e})),Object(To["a"])(this,"destroyExternalLink",(function(){this.external={}})),Object(To["a"])(this,"currentTime",(function(){var e=Math.floor((new Date).getTime()/1e3);return this.timeDifference&&(e+=this.timeDifference),e})),Object(To["a"])(this,"wait",(function(){return re["a"].pretry(()=>!this.loading).then(()=>Promise.resolve())})),t||(t={}),this.options={listofproxies:t.listofproxies},t.mtrx||(t.mtrx={}),t.mtrx.baseUrl="https://"+t.domain,"https://test.matrix.pocketnet.app"==t.mtrx.baseUrl?this.options.burn={v:"minutes",w:120,m:30,b:15}:this.options.burn={v:"days",w:7,m:2,b:1},this.apiHandlers={error:function(){},success:function(){}},this.domain=t.domain,this.vm=e,this.mtrx=new cc(this,t.mtrx),this.user=new dc["a"](this,t.user||{}),this.notifier=new uc(this,t.notifier||{}),this.pcrypto=new wc["a"](this,t.pcrypto||{}),this.api=new _c(this,t.servers),this.onlineListener=new xc["a"].online(this),this.focusListener=new xc["a"].focus(this),this.online=!0,this.focus=!0,this.store=e.$store,this.loading=!0,this.external={},this.hiddenInParent=!1,this.customRecorderConnected=!1,this.pcrypto.init(this.user),this.media=new Sc,this.audioContext=null}joinRoom(e){return this.wait().then(()=>this.mtrx.wait()).then(()=>this.unauthorized?(this.store.commit("JOINROOM",e),Promise.reject(this.unauthorized)):Promise.resolve()).then(t=>(this.store.state.chatsMap[e]?this.vm.$router.push("/chat?id="+e).catch(e=>{}):(this.store.commit("JOINROOM",e),this.vm.$router.push("/publicPreview?id="+e).catch(e=>{})),Promise.resolve()))}connect(e){return this.wait().then(()=>this.mtrx.wait()).then(()=>this.unauthorized?(this.store.commit("CONNECT",re["a"].hexEncode(e)),Promise.reject(this.unauthorized)):this.user.usersInfo([e],!0)).then(t=>{var n=this.mtrx.kit.tetatetid(t[0],this.user.userinfo);return n?(this.store.state.chatsMap[n]?this.gotoRoute("/chat?id="+n):this.gotoRoute("/contact?id="+re["a"].hexEncode(e)),Promise.resolve()):Promise.reject("roomId")})}cancelshare(){return this.store.commit("SHARE",null),Promise.resolve()}share(e){return this.store.commit("SHARE",e),this.vm.$router.push("/chats").catch(e=>{}),Promise.resolve()}goto(e){this.cancelDefaultRoute=!0,this.mtrx.wait().then(()=>{this.vm.$router.push("/chat?id="+e).catch(e=>{})})}gotoRoute(e){this.cancelDefaultRoute=!0,this.mtrx.wait().then(()=>{this.vm.$router.push(e).catch(e=>{})})}updateUser(){return this.user.userInfo(!0).then(e=>{})}isactive(){return this.vm.$store.state.minimized&&this.vm.$store.state.active&&this.vm.$store.state.pocketnet}sitemessage(e){var t="bottom-right";this.vm.$store.state.mobile&&(t="top-left"),this.vm.$message({title:e,zIndex:999,supportHTML:!0,wrapperClassName:"notificationWrapper",position:t,type:"info",duration:2e3})}menu(e){this.store.commit("SET_MENU",e?{items:e.items,item:e.item,handler:e.handler}:null)}invitepnt(){var e=re["a"].deep(this,"user.userinfo.source");if(e)if(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform)this.backtoapp&&this.backtoapp(),window.POCKETNETINSTANCE.platform.ui.socialshare("welcome?connect="+e.address,{sharing:{image:"",images:[e.i],title:this.vm.$i18n.t("caption.joinApp"),html:{body:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin"),preview:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin")},text:{body:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin"),preview:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin")}},embedding:{type:"connect",id:e.address}});else{var t="https://bastyon.com/welcome?connect="+e.address;re["a"].copytext(t),this.sitemessage("The link was copied successfully")}else this.sitemessage("The error was occuried")}convertAudioToBase64(e){return Object(Co["a"])((function*(){const t=new FileReader;return t.readAsDataURL(e),new Promise(e=>{t.onloadend=()=>{e(t.result)}})}))()}initMediaRecorder(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?this.media.get({audio:!0}).then(e=>{let t=new Mc(e,{audioBitsPerSecond:32e3});return t}).catch((function(e){return Promise.reject(e)})):Promise.reject()}getAudioContext(){return this.audioContext&&"closed"!=this.audioContext.state?("suspended"===this.audioContext.state&&this.audioContext.resume(),this.audioContext):(this.audioContext=new(window.AudioContext||window.webkitAudioContext)||null,re["a"].isios()&&window.unmute&&unmute(this.audioContext,!1,!1),this.audioContext)}}var jc=Pc,Dc=r("e508"),Lc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"preloader",platform:e.platform}},[e._m(0)])},Nc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"variant "},[n("div",{staticClass:"iospreloadercenter"},[n("div",{staticClass:"spinner-eff spinner-eff-3"},[n("div",{staticClass:"circle circle-1"}),n("div",{staticClass:"circle circle-2"}),n("div",{staticClass:"circle circle-3"})])])])}],$c={name:"preloader",props:{},computed:Object(A["c"])({pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active,platform:function(){return re["a"].deep(window,"device.platform")||"browser"}})},Uc=$c;function Bc(e){var t=r("4578");t.__inject__&&t.__inject__(e);var n=r("3f02");n.__inject__&&n.__inject__(e)}var Fc=Object(E["a"])(Uc,Lc,Nc,!1,Bc,"3e6353d6",null,!0),zc=Fc.exports,qc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"wai-fixedmessageicon"}},[n("div",{staticClass:"wrapper"},[n("div",{staticClass:"table"},[n("div",{staticClass:"cell"},[e.icon?n("div",{staticClass:"iconWrapper"},[n("sweetalert",{attrs:{icon:e.icon}})],1):e._e(),e.message?n("div",{staticClass:"message"},[n("div",[e._v(e._s(e.message))])]):e._e()])])])])},Wc=[],Kc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sa",style:e.cssVars},[e.isIcon("error")?n("div",{staticClass:"sa-error"},[e._m(0),n("div",{staticClass:"sa-error-placeholder"}),n("div",{staticClass:"sa-error-fix"})]):e.isIcon("warning")?n("div",{staticClass:"sa-warning"},[n("div",{staticClass:"sa-warning-body"}),n("div",{staticClass:"sa-warning-dot"})]):e.isIcon("info")?n("div",{staticClass:"sa-info"},[n("div",{staticClass:"sa-info-body"}),n("div",{staticClass:"sa-info-dot"})]):e.isIcon("loading")?n("div",{staticClass:"sa-loading"},[n("div",{staticClass:"sa-loading-body"})]):n("div",{staticClass:"sa-success"},[n("div",{staticClass:"sa-success-tip"}),n("div",{staticClass:"sa-success-long"}),n("div",{staticClass:"sa-success-placeholder"}),n("div",{staticClass:"sa-success-fix"})])])},Vc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sa-error-x"},[n("div",{staticClass:"sa-error-left"}),n("div",{staticClass:"sa-error-right"})])}],Gc=r("5b1b"),Hc=r.n(Gc),Yc=r("6929"),Jc=r.n(Yc);const Xc=["success","warning","error","info","loading"],Zc={success:"#007d09",warning:"#ff7800",error:"#ff007e",info:"#0600ff",loading:"#0600ff"};var Qc={name:"sweetalert-icon",props:{icon:{type:String,default:"success",validator:e=>-1!==Xc.indexOf(e)},color:{type:String,validator:Hc.a}},computed:{cssVars(){const e=Hc()(this.color)?this.color:Zc[this.icon];return{"--icon-color":e,"--icon-color-alpha":Jc()(e).alpha(.25)}}},methods:{isIcon(e){return e===this.icon}}},el=Qc;function tl(e){var t=r("826f");t.__inject__&&t.__inject__(e)}var nl=Object(E["a"])(el,Kc,Vc,!1,tl,"0635047f",null,!0),rl=nl.exports,il={name:"fixedmessageicon",props:{},components:{sweetalert:rl},data:function(){return{loading:!1}},created:()=>{},watch:{icon:{immediate:!0,handler(){this.init()}}},computed:Object(A["c"])({auth:e=>e.auth,icon:function(){return this.$store.state.icon?this.$store.state.icon.icon:null},message:function(){return this.$store.state.icon?this.$store.state.icon.message:null},pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active}),methods:{init:function(){var e,t=this;const n=null===(e=this.$store.state.icon)||void 0===e?void 0:e.timeout;this.$store.state.icon.manual||setTimeout((function(){t.$store.commit("icon",null)}),n||2e3)}}},ol=il;function al(e){var t=r("17e1");t.__inject__&&t.__inject__(e)}var sl=Object(E["a"])(ol,qc,Wc,!1,al,"1cf419f0",null,!0),cl=sl.exports,ll=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{attrs:{id:"wai-date"}},[e._v(e._s(e.label))])},ul=[],dl={name:"date",props:["date"],computed:Object(A["c"])({auth:e=>e.auth,label:function(){return moment.locale(this.$i18n.locale),moment(moment.utc(this.date).toDate()).local().fromNow()}})},fl=dl;function hl(e){var t=r("4382");t.__inject__&&t.__inject__(e)}var pl=Object(E["a"])(fl,ll,ul,!1,hl,"eb4df516",null,!0),ml=pl.exports,vl=function(e,t){var n=t._c;return n("div",{staticClass:"userpic"},[n("div",{staticClass:"userpicSquareWrapper"},[n("div",{staticClass:"userpicSquareInnerWrapper"},[n("div",{staticClass:"userpicSquareInnerWrapper",class:t.props.status},[t.props.userinfo.image?n("bgimage",{attrs:{src:t.props.userinfo.image}}):t._e(),!t.props.userinfo.image&&t.props.userinfo.name&&"blocked"!=t.props.status&&"invite"!=t.props.status&&"ban"!=t.props.status?n("div",{staticClass:"charAvatar"},[n("span",[t._v(t._s(t.props.userinfo.name.charAt(0)))])]):t._e(),n("div",{staticClass:"statusIcon"},["blocked"==t.props.status||"ban"==t.props.status?n("i",{staticClass:"fas fa-ban"}):t._e(),"invite"==t.props.status?n("i",{staticClass:"fas fa-user-plus"}):t._e()])],1)])])])},gl=[],yl={name:"userpic",props:{userinfo:{type:Object,default:{}},status:""}},bl=yl;function _l(e){var t=r("b93b");t.__inject__&&t.__inject__(e)}var wl=Object(E["a"])(bl,vl,gl,!0,_l,"5034d1e2",null,!0),xl=wl.exports,kl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.users?n("div",{staticClass:"userspic",class:{oneuser:e.users&&1===e.users.length}},[0===e.users.length?n("userpic",{attrs:{userinfo:e.single,status:e.single.status}}):e._e(),1===e.users.length?n("userpic",{attrs:{status:e.status[e.users[0].id],userinfo:e.users[0],unseen:e.unseen}}):e._e(),e.users.length>1?n("many",{attrs:{slidesPerView:e.slidesPerView,status:e.status,userinfo:e.users,unseen:e.unseen}}):e._e(),e.unseen?n("div",{staticClass:"unseen"},[e._v(" "+e._s(e.unseen>99?"99":e.unseen)+" ")]):e._e()],1):e._e()},Sl=[],El=r("ecec"),Cl={name:"userspic",props:{users:Array,single:{},unseen:Number,slidesPerView:Number,status:{type:Object,default:{}}},data:function(){return{}},components:{many:El["a"]}},Tl=Cl;function Il(e){var t=r("4606");t.__inject__&&t.__inject__(e)}var Rl=Object(E["a"])(Tl,kl,Sl,!1,Il,"792279b0",null,!0),Ol=Rl.exports,Ml=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bgimage",class:{loaded:e.loaded,hasimage:e.src},style:"background-image:url("+e.imageSrc+"); background-size: cover; background-position: center center; background-repeat: no-repeat"},[e._t("cnt")],2)},Al=[],Pl={name:"bgimage",directives:{},props:{src:String},watch:{src:{immediate:!0,handler:function(){this.load()}}},data:function(){return{loaded:!1,imageSrc:""}},methods:{load:function(){if(this.src){this.imageSrc=this.src;var e=new Image;e.src=this.src,e.onload=()=>{this.loaded=!0}}else this.loaded=!0}}},jl=Pl;function Dl(e){var t=r("f0bc");t.__inject__&&t.__inject__(e)}var Ll=Object(E["a"])(jl,Ml,Al,!1,Dl,"5d20f73c",null,!0),Nl=Ll.exports,$l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"wai-logotype"}},[n("div",{staticClass:"items"},[n("div",{staticClass:"item"},[n("div",{staticClass:"logo"},[n("img",{attrs:{src:"img/ldpiwide-"+e.themeL+".png"}})])])])])},Ul=[],Bl={black:"black",white:"white",classic:"white"},Fl={name:"wai-logotype",props:{},data:function(){return{loading:!1}},created:()=>{},watch:{},computed:Object(A["c"])({auth:e=>e.auth,themeL:function(e){return Bl[e.theme]||"white"}}),methods:{}},zl=Fl;function ql(e){var t=r("d6cc");t.__inject__&&t.__inject__(e)}var Wl=Object(E["a"])(zl,$l,Ul,!1,ql,"e33cd7cc",null,!0),Kl=Wl.exports,Vl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"outer-div",class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,active:e.active,mobile:e.mobile},on:{click:function(e){e.stopPropagation()}}},[e.menuIsVisible&&!e.hiddenInParent?n("div",{staticClass:"dropdown",class:{visible:e.menuIsVisible}},[n("div",{staticClass:"backgr",on:{click:function(t){return e.hidePopup()}}}),n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hidePopup,expression:"hidePopup"}],staticClass:"menuwrapper"},[n("simpleMenu",{attrs:{items:e.menuItems},scopedSlots:e._u([{key:"default",fn:function(t){return[e._t("default",(function(){return[n("div",{staticClass:"menu-item",on:{click:function(n){return e.menuItemClick(t.item)}}},[n("div",{staticClass:"iconWrapper"},[t.item.icon?n("i",{class:t.item.icon}):e._e()]),n("div",{staticClass:"title"},[e._v(" "+e._s(t.item.title)+" ")])])]}),{item:t.item})]}}],null,!0)}),n("div",{staticClass:"cancelWrapper"},[n("div",{staticClass:"menu-item",on:{click:function(t){return e.hidePopup()}}},[n("div",{staticClass:"iconWrapper"}),n("div",{staticClass:"title"},[e._v(e._s(e.$t("cancel")))])])])],1)]):e._e(),n("div",{staticClass:"dropDownIcon",on:{click:e.onClickHandler}},[n("i",{class:"icon "+(e.icon||"fas fa-ellipsis-h")})])])},Gl=[],Hl={name:"dropdownMenu",props:{menuItems:{type:Array,required:!0},rowObject:{type:Object},icon:String},components:{simpleMenu:Yn},data:function(){return{loading:!1,menuIsVisible:!1}},watch:{menuIsVisible:function(e){this.$emit("menuIsVisible",e)}},computed:{dropdownWidthInner(){return this.dropdownWidth},...Object(A["c"])({pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,mobile:e=>e.mobile,active:e=>e.active,hiddenInParent:e=>e.hiddenInParent})},methods:{menuItemClick(e){this.$emit("itemClicked",e,this.rowObject,{hidePopup:this.hidePopup,showPopup:this.showPopup})},onClickHandler(){this.menuIsVisible=!this.menuIsVisible},hidePopup(){this.menuIsVisible=!1},showPopup(){this.menuIsVisible=!0}}},Yl=Hl;function Jl(e){var t=r("5722");t.__inject__&&t.__inject__(e)}var Xl=Object(E["a"])(Yl,Vl,Gl,!1,Jl,"e4f39dca",null,!0),Zl=Xl.exports,Ql=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"back",on:{click:e.click}},[n("div",{staticClass:"iconbutton"},[n("i",{class:e.icon||"fas fa-angle-left"})])])},eu=[],tu={name:"backButton",props:{icon:String,action:{type:String,default:"/"},caption:{type:String,default:""}},methods:{click:function(){"back"==this.action?this.$router.go(-1):this.$router.push(this.action).catch(e=>{})}}},nu=tu;function ru(e){var t=r("b215");t.__inject__&&t.__inject__(e)}var iu=Object(E["a"])(nu,Ql,eu,!1,ru,"7e97eec1",null,!0),ou=iu.exports,au=r("08da"),su=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"fixedOnPageTop",class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active,unauthorized:e.unauthorized,modalShowed:!!e.modalShowed,mobile:e.mobile},attrs:{id:"maincontent"},on:{mouseenter:e.mouseenter,mouseleave:e.mouseleave}},[n("div",{staticClass:"headerSpacerWrapper"},[n("div",{staticClass:"headerSpacerWrapperOvf"},[n("div",{ref:"scrollable",staticClass:"headerSpacer"},[e._t("content",(function(){return[e._v("   ")]}))],2)]),n("pmenu"),e.modalShowed&&e.modalShowed.data&&!e.hiddenInParent?n("modal",{on:{close:e.closeModal},scopedSlots:e._u([{key:"header",fn:function(){return[e._v(e._s(e.modalShowed.caption))]},proxy:!0},{key:"body",fn:function(){return[n("div",{staticClass:"modalcommoncontent"},["complain"==e.modalShowed.type?n("complain",{attrs:{p:e.modalShowed.data}}):e._e(),"contact"==e.modalShowed.type?n("contact",{attrs:{contact:e.modalShowed.data.contact}}):e._e(),"showuserselect"==e.modalShowed.type?n("contacts",{attrs:{users:e.modalShowed.data.users,mode:"Select"},on:{close:e.closeModal,select:function(t){e.modalShowed.data.userselected(t),e.closeModal()}}}):e._e()],1)]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,3972288297)}):e._e(),!e.unauthorized&&e.rbackexp?n("div",{staticClass:"expandp",on:{click:e.setactive,mousemove:e.effect}},[e._m(0)]):e._e()],1),e.iconshow?n("transition",{attrs:{name:"fade"}},[n("fixedmessageicon")],1):e._e()],1)},cu=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"etablew"},[n("div",{staticClass:"etable table"},[n("div",[n("i",{staticClass:"fas fa-expand-arrows-alt"})])])])}],lu={name:"maincontent",props:{rbackexp:Boolean},components:{contact:()=>Promise.resolve().then(r.bind(null,"d3ff")),contacts:()=>Promise.resolve().then(r.bind(null,"f978")),complain:()=>r.e(14).then(r.bind(null,"c27d"))},data:function(){return{loading:!1}},created:()=>{},watch:{},computed:Object(A["c"])({auth:e=>e.auth,iconshow:function(){return!!this.$store.state.icon},pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active,modalShowed:e=>e.modalShowed,hiddenInParent:e=>e.hiddenInParent,mobile:e=>e.mobile,unauthorized:e=>e.unauthorized}),methods:{setactive:function(){this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"main"}),this.$store.commit("setiteraction",!0)},mouseenter:function(){},mouseleave:function(){this.$store.state.autohide&&this.$store.commit("active",!1),this.$store.commit("blockactive",{value:!1,item:"main"})},effect:function(e){},closeModal:function(){this.$store.commit("setmodal",null)},scroll:function(e){this.$refs["scrollable"].scrollTop=e||0}}},uu=lu;function du(e){var t=r("52ce");t.__inject__&&t.__inject__(e)}var fu=Object(E["a"])(uu,su,cu,!1,du,"a8a70f9c",null,!0),hu=fu.exports,pu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"search"}},[n("div",{staticClass:"searchWrapper"},[n("div",{staticClass:"inputWrapper"},[n("input",{ref:"input",attrs:{placeholder:e.placeholder||this.$i18n.t("caption.search"),type:"text"},domProps:{value:e.searchTxt},on:{keyup:e.change,input:e.change,focus:e.focused,blur:e.blured}})]),e.searchTxt?e._e():n("div",{staticClass:"iconWrapper"},[n("i",{staticClass:"fas fa-search"})]),e.searchTxt?n("div",{staticClass:"iconWrapper",on:{click:e.clear}},[n("i",{staticClass:"fas fa-times"})]):e._e()])])},mu=[],vu={name:"search",props:{placeholder:String,minimize:{type:Boolean,default:!1}},data:function(){return{loading:!1,isTyping:!1,searchTxt:""}},created:()=>{},watch:{searchTxt:{handler:_.debounce((function(){var e=this.searchTxt.toLowerCase();this.$emit("search",e)}),500)}},computed:Object(A["c"])({auth:e=>e.auth,pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:function(e){return e.active||!this.minimize}}),methods:{change:function(e){this.searchTxt=e.target.value},clear:function(e){this.searchTxt=""},clickicon:function(){this.$refs["input"].focus()},blured:function(){this.$store.commit("blockactive",{value:!1,item:"input"})},focused:function(){this.$store.commit("blockactive",{value:!0,item:"input"})}}},gu=vu;function yu(e){var t=r("6bfd");t.__inject__&&t.__inject__(e)}var bu=Object(E["a"])(gu,pu,mu,!1,yu,"1774f2a8",null,!0),_u=bu.exports,wu=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},xu=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"linepreloader"}},[n("span"),n("span"),n("span")])}],ku={name:"linepreloader",props:{}},Su=ku;function Eu(e){var t=r("0095");t.__inject__&&t.__inject__(e)}var Cu=Object(E["a"])(Su,wu,xu,!1,Eu,"bcf20e38",null,!0),Tu=Cu.exports,Iu=r("9a41");function Ru(){const e=r("2db5"),t=e.keys().map(e=>({key:e,locale:e.match(/[a-z0-9-_]+/i)[0]})).reduce((t,n)=>{let{key:r,locale:i}=n;return{...t,[i]:e(r)}},{});return{context:e,messages:t}}s["default"].use(xo.a),s["default"].component("eventsEvent",Eo["default"]),s["default"].use(yo),s["default"].use(vr),s["default"].use(tr["a"]),s["default"].use(Fi),s["default"].use(_o.a),s["default"].use(So.a),s["default"].config.productionTip=!1,s["default"].prototype.$f=re["a"],s["default"].component("pmenu",er),s["default"].component("modal",Bn),s["default"].component("preloader",zc),s["default"].component("date",ml),s["default"].component("userpic",xl),s["default"].component("userspic",Ol),s["default"].component("fixedmessageicon",cl),s["default"].component("bgimage",Nl),s["default"].component("logotype",Kl),s["default"].component("dropdownMenu",Zl),s["default"].component("backButton",ou),s["default"].component("topheader",au["a"]),s["default"].component("maincontent",hu),s["default"].component("search",_u),s["default"].component("linepreloader",Tu),s["default"].use(Dc["a"]),s["default"].directive("click-outside",{bind:function(e,t,n){e.clickOutsideEvent=function(r){e==r.target||e.contains(r.target)||n.context[t.expression](r)},document.body.addEventListener("click",e.clickOutsideEvent)},unbind:function(e){document.body.removeEventListener("click",e.clickOutsideEvent)}});const{context:Ou,messages:Mu}=Ru(),Au=new Fi({locale:"en",messages:Mu,silentTranslationWarn:!0});var Pu=null,ju={install:function(e){Object.defineProperty(e.prototype,"core",{get(){return Pu}})}};s["default"].use(ju);var Du={de:!0,ru:!0,en:!0,fr:!0,cmn:!0,it:!0,es:!0,kr:!0},Lu={i18n:Au,store:ce,router:Pn,name:"App",components:{MainWrapper:H,chats:Iu["default"],userUnauthorized:ne},props:{address:{type:String,default:""},privatekey:{type:String,defautt:""},pocketnet:{type:String,default:""},mobile:{type:String,default:""},recording:{type:String,default:""},pkoindisabled:{type:String,default:""},ctheme:String,fcmtoken:String,localization:String,pip:{type:Boolean,default:!1}},watch:{fcmtoken:function(){this.setPusher(this.fcmtoken)},localization:{immediate:!0,handler:function(){Du[this.localization]?Au.locale=this.localization:Au.locale="en",this.generateTeamroomMessages()}},mobile:function(){this.$store.commit("setMobile",this.mobile),this.$store.commit("minimize")},pocketnet:function(){this.$store.commit("setPocketnet",this.pocketnet),this.$store.commit("minimize")}},computed:{statetheme:function(){return this.$store.state.theme},theme:function(){return this.ctheme||this.statetheme},unauthorized:function(){return this.$store.state.unauthorized},online:function(){return this.$store.state.online},loading:function(){return this.$store.state.loading},minimized:function(){return!this.mobile&&this.$store.state.minimized},active:function(){return!this.mobile&&this.$store.state.active},globalpreloader:function(){return this.$store.state.globalpreloader},share:function(){if(!this.unauthorized)return this.$store.state.share},closebybg:function(){return!this.$store.state.pinchat},unselect:function(){return this.$store.state.voicerecording}},methods:{hide:function(){this.$store.commit("minimize",!0),setTimeout(()=>{"chats"!==this.$route.name&&"contact"!==this.$route.name&&"publicPreview"!==this.$route.name&&"chatSettings"!==this.$route.name&&!0!==Pu.cancelDefaultRoute&&this.$router.push("/chats").catch(e=>{})},500)},iteraction:function(){this.$store.commit("setiteraction",!0)},importInitialScripts(){},setPusher(e){var t;localStorage&&(t=localStorage.getItem("fcmtoken5")),t!=e&&this.core.mtrx.wait().then(t=>{this.core.mtrx.deletePusher();var n={url:this.core.mtrx.baseUrl+"/_matrix/push/v1/notify"},r="pocketnet",i={app_display_name:r,app_id:r+window.cordova.platformId,data:n,user_id:this.core.mtrx.client.credentials.userId,device_display_name:window.device.manufacturer+" "+window.device.model,kind:"http",lang:localStorage.getItem("loc")||"en",pushkey:e};this.core.mtrx.client.setPusher(i).then(()=>{localStorage.setItem("fcmtoken5",e)},e=>{console.log(e)})})},generateTeamroomMessages(){this.$store.commit("SET_POCKETTEAMMESSAGES",[{id:1,text:`\n\t\t\t\t\t\t\t

${this.$i18n.t("teamMessages.1-title")}

\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t
  • ${this.$i18n.t("teamMessages.1-list1")}
  • \n\t\t\t\t\t\t\t\t
  • ${this.$i18n.t("teamMessages.1-list2")}
  • \n\t\t\t\t\t\t\t\t
  • ${this.$i18n.t("teamMessages.1-list3")}
  • \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t`,previewText:this.$i18n.t("teamMessages.1-title")}])}},beforeCreate(){this.$store.commit("init")},created(){this.$store.commit("setPocketnet",this.pocketnet),this.$store.commit("setMobile",this.mobile),this.$store.commit("setVoiceMessagesEnabled",this.recording),this.$store.commit("pkoindisabled",this.pkoindisabled),this.$store.commit("clearall"),this.$store.commit("ls"),this.importInitialScripts(),this.generateTeamroomMessages(),setTimeout(()=>{this.fcmtoken&&window.cordova&&this.setPusher(this.fcmtoken)},5e3);var e={matrixMan:{address:re["a"].hexEncode("PToMRMsMVh9dj4Cpa7yu1pB5iq65g4jrVC"),privateKey:"510aa931cdee36b9ac467ad04a2619f46be88815812b46e976e36bc8dbcdc41b"},ltme:{address:re["a"].hexEncode("PKszvjHwMWubQpeEKnQhRonGBVFWcJDbNJ"),privateKey:"513bc6a5014e7dd203537227fb0a78f7b974853478fcf95103125f6d793a5f8b"},travisnoscot1:{address:re["a"].hexEncode("PDjvHUQjcDX8Vq6rtpKveUDPtwPVUZEW7m"),privateKey:"63d91d001f7b5167a707dd4ee7e2638fc13e1fa3ff7171b040b432bcd1054e28"},mobRoocky:{address:re["a"].hexEncode("PCMnk8T3Edu81iGcTEpVCFq8FQd6UBXi2y"),privateKey:"0bbf6fb0dbf78a26f00345f6f96d4f76f52e0093417c51a1b7bccb7ca92e55df"},user1:{address:re["a"].hexEncode("PKxqtUuK3B6qwAxs6HLhvxrQVExuMwKWd5"),privateKey:"28f0fdc30094d517bc08abca3f219d77fc32230e313bbf0b699ecd42f80de82a0"},user2:{address:re["a"].hexEncode("PGe4xVAJRJtbD8swPipE2ug9Zk1rhSTa1y"),privateKey:"0b4562275da7e60a57e10432bdc7e3318dd9699b8b928224ba360b9fb951c77b"},FakeBadash:{address:re["a"].hexEncode("PDWPDFikMhLJHtiKLLXZGzfgphRcd19eHe"),privateKey:"99d8ce99383ccc5d6404535b98f2b43ce5ab939a28bfc52a442565b2351039fa"},Faketravis:{address:re["a"].hexEncode("PGURYzvoXuSvuwCuDty2wW37omjiKgzV5a"),privateKey:"93641f20095aa15b89b78d395ebe0a5a9b149ea2b54c57d896091c0ea9b86dfd"},fakeRocky:{address:re["a"].hexEncode("PRDKVP4yvF2wW8p5FUVkzrCvXYE8SMGkQK"),privateKey:"80d213d272405d4ff51752f91e79c639919f5f9f302583bdaa1c767b044ce2c0"},fakeFuture2:{address:"PBHvKTH5TGQYDbRHgQHTTvaBf7tuww6ho7",privateKey:"71cacb25f90b18e356e33bc12c428c2e8b6b7c6e2950ab6344412f226aab0b2c"},fakeFuture:{address:re["a"].hexEncode("PBHvKTH5TGQYDbRHgQHTTvaBf7tuww6ho7"),privateKey:"71cacb25f90b18e356e33bc12c428c2e8b6b7c6e2950ab6344412f226aab0b2c"},encMan:{address:re["a"].hexEncode("PEkKrb7WJgfU3rCkkU9JYT8jbGiQsw8Qy8"),privateKey:"616fd57f7610288978f4c01797a90d56b0c30392e598a2504b98c7a7246569a5"},harisCalvin:{address:re["a"].hexEncode("PXEWRce8siwbQWArQWyjnooogAEieHwhVd"),privateKey:"218bcb76df20438c1431c0394a42947f78f279bea987d7b238bfbd1cb1533b62"},oneSomeoneNigga:{address:re["a"].hexEncode("PGyjEoqmmK2tm6xmg69hGoSNM6hUrc4VfE"),privateKey:"254f5b9394f0490e78b41c6bf615bfd8e290fde3fb6d862f166b181b35764b06"},gomer:{address:re["a"].hexEncode("PVSdoFQqAg86p6tbAW8Y6CGGGjhiXkr4qh"),privateKey:"105de1935fa665bdc23b1b02bcdb3f62e01a3ad48823d5348edb5b94ec1b4526"},bart:{address:re["a"].hexEncode("PWioUw52q4iNpMQUauNYaWg9JpsPE1u9Ut"),privateKey:"a74bc4ee63290dd051d659fe46962176d2b9193e04104dea63116d25703bad72"},edSheeran:{address:re["a"].hexEncode("PVeqjqJk2GthxBK6QdhCCfQVEX1SAK92As"),privateKey:"d89952018721e6762de13fa2f1891b0dc2d1f1e75402ba483251086b2ba181ac"},duftPunkMan:{address:re["a"].hexEncode("PFnN8SExxLsUjMKzs2avdvBdcA3ZKXPPkF"),privateKey:"7d1a31cc49a05692cfd992359cd27e8b3783cd186d98053ea0b9307b00a19018"},jcole:{address:re["a"].hexEncode("P93cWU7X31wqn3R9GcUZ7c3fD11asXum5y"),privateKey:"900099127ad048d64523c4701d72d67b5b7f2afb18debbfdc53587f04a29c808"},flowMan:{address:re["a"].hexEncode("PM4gVCcWnTmysUXhMukoQA2mT7GpfWQvck"),privateKey:"12d28e4c950193665dcaaa32129c061b2213e736ffe20918f0f13b6a2857cc32"},JokeMan:{address:re["a"].hexEncode("PMSULgjrsCsEnWgNigCga5jSjhCvYBFSA8"),privateKey:"f7a2518393db3779a4394f4084473847bc4260a5aad20859eff9d32ab03c310e"},omgMan:{address:re["a"].hexEncode("P9R3aNvyjRbqTWfy5q1h5qvXFYaDtqaRi2"),privateKey:"80b4350df8c033a63fd7c6b71516ae05ab3a23a604a39afba5874b87b4effbf8"},nineBot:{address:re["a"].hexEncode("PNcvYsMXzf4RVmS9AjRYEqeeGjk1PiDjvF"),privateKey:"447554f94a3512a420ef6d089411dff3bc6d170f65e246cc52fc30aa9ed2216c"},tenBot:{address:re["a"].hexEncode("PS9F8hzGSxeL1Lc2VGvPoqXHotZvpoVkkX"),privateKey:"659bd118d33e541bb042015723cab1e6b644a9d330a988b10e6d593f9abe3542"},bikeBot:{address:re["a"].hexEncode("PBK1GDpiLNVFrKsPVAaNLU92byFY5P5KBr"),privateKey:"4c1ee4ae821a1ca885d77db84518b4dcbcd4efbed69603c8706b9557618529f9"},angryBot:{address:re["a"].hexEncode("PBMcLRBQNWtNQZYUbRZZAd5FuZ8yb7HMX2"),privateKey:"87bec25e930671a06e032dca484083d4b79e23aa985781995882d5d4594f8d8d"},test099090:{address:re["a"].hexEncode("PP582V47P8vCvXjdV3inwYNgxScZCuTWsq"),privateKey:"14ede296d13f8111c77a1da82519939329ee1b81ab23203da48df3f5e52fee3d"},tony:{address:re["a"].hexEncode("TLENU8HFyz8PqzpKBDWeN6Xix6rM8wjYKd"),privateKey:"8cf816c1c7a51cbc114db9aac8896b8654260f9b3a985232f27cf32823c7f45f"},invoker:{address:re["a"].hexEncode("TPjN8Dy4BpGDezMNw2ePuEdHiHetTvR3Mb"),privateKey:"a7ded16bd9d3350d6c3d233e6905b51e61bd879ba152ae24d0f8def76c4581c7"},drowRanger:{address:re["a"].hexEncode("TU8fAf96kSfQzmxmpjRDSSqvCiPWzWt67J"),privateKey:"38484a2047b5c8170847a97fc5cddf3d485c934c6532a51a73f64ec7e4659891"},nevermore:{address:re["a"].hexEncode("TKJ7xAC18XC4zQBvkNAWhkr3i7cARu11Uv"),privateKey:"8ec7f71d16b07d29bb49b3bc3054b5a4d2e65fb559e0ae695503568227584f53"},stormSpirit:{address:re["a"].hexEncode("TZBHmnZwLedPtHcJfJnFsbxobGuDKGf9uA"),privateKey:"642aaa706fe94ea77239468cb9aad6b463472793a2c4e1f60acf22078770c45f"},morph:{address:re["a"].hexEncode("TXyieuLsCntT1p4ougtiKURtYTxcdvWN1L"),privateKey:"8f59a6a6b7b8c1f63be47a6f571a11d726e9d7cde2baff52a51dc72326b6abb4"},alchemist:{address:re["a"].hexEncode("TT2CeQuHiM8E8hG4rkJcaMKQ8gWqhZmNUH"),privateKey:"957ad5e2a009e4c0f06f0ae2737ea4c36c48fa8312555fcd104ca9cff7db6848"},public_user_test:{address:re["a"].hexEncode("TLMXdC2UYSfMVbLzKtmJJTi4oK9LNHNVju"),privateKey:"509b219c5cead9545039ae38d428813af6671dbee3e37cadd2cd22f152013f2a"},cleanUser:{address:re["a"].hexEncode("THCRHFtVAoeDGLg548C4bQxXeDg9bwrs5K"),privateKey:"666919a742eb63bededea3fddc44b526148d8b0eb1126b0aaff480a2af888d92"},userwithoutavatar:{address:re["a"].hexEncode("TVcPMgVQ9TxgpzNrQyEAei5cnnR9jzXtzE"),privateKey:"2a3e96562c23a40e3d439b823453fb8fe6f8fb2c0267e8d2411734b3bdff90dd"},unnamed:{address:re["a"].hexEncode("THsA8rwdeAkq5bePA71Nw5CGtFg2duyDSq"),privateKey:"27b42dfba3d20ae7a945e09dd0688137fa7963fd48b94f7b4027dc4eed874a96"}},t={address:this.address?re["a"].hexEncode(this.address):"",privateKey:this.privatekey},n="nevermore",r=this.address&&this.privatekey?t:e[""+n],i=re["a"].deep(window,"window.POCKETNETINSTANCE.options.listofproxies")||[{host:"test.pocketnet.app",port:8899,wss:8099}],o=re["a"].deep(window,"window.POCKETNETINSTANCE.options.matrix")||"test.matrix.pocketnet.app";Pu=new jc(this,{domain:o,mtrx:{logger:function(){}},listofproxies:i,servers:{pocketnet:"https://pocketnet.app:8888"}}),Pu.init(),Pu.initWithUser(r).then(e=>Pu.mtrx.wait().then(()=>{Pu.user.getContacts(),setTimeout(()=>{"chats"!==this.$route.name&&"publicPreview"!==this.$route.name&&"chatSettings"!==this.$route.name&&"contact"!==this.$route.name&&!0!==Pu.cancelDefaultRoute&&this.$router.push("/chats").catch(e=>{})},100)})).catch(e=>{}),setInterval(()=>{!this.$store.state.autohide&&this.$store.state.iteraction||this.$store.commit("active",!1)},3e3),window.matrixchat=Pu}};var Nu=Lu;function $u(e){var t=r("c934");t.__inject__&&t.__inject__(e);var n=r("fca4");n.__inject__&&n.__inject__(e);var i=r("7cd7");i.__inject__&&i.__inject__(e)}var Uu=Object(E["a"])(Nu,C,T,!1,$u,null,null,!0),Bu=Uu.exports;window.customElements.define("matrix-element",S(s["default"],Bu))},"5a76":function(e,t,n){var r=n("f576");e.exports=function(e){return(new r).update(e).digest()}},"5b1b":function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"validateHTMLColorName",(function(){return a})),n.d(t,"validateHTMLColorSpecialName",(function(){return s})),n.d(t,"validateHTMLColorHex",(function(){return c})),n.d(t,"validateHTMLColorRgb",(function(){return l})),n.d(t,"validateHTMLColorHsl",(function(){return f})),n.d(t,"validateHTMLColorHwb",(function(){return h})),n.d(t,"validateHTMLColorLab",(function(){return p})),n.d(t,"validateHTMLColor",(function(){return m}));const r=e=>e&&"string"==typeof e,i=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],o=["currentColor","inherit","transparent"],a=e=>{let t=!1;return r(e)&&i.map(n=>(e.toLowerCase()===n.toLowerCase()&&(t=!0),null)),t},s=e=>{let t=!1;return r(e)&&o.map(n=>(e.toLowerCase()===n.toLowerCase()&&(t=!0),null)),t},c=e=>{if(r(e)){const t=/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i;return e&&t.test(e)}},l=e=>{if(r(e)){const t=/(rgb)a?\((\s*\d+%?\s*?,?\s*){2}(\s*\d+%?\s*?,?\s*\)?)(\s*,?\s*\/?\s*(0?\.?\d+%?\s*)?|1|0)?\)$/i;return e&&t.test(e)}},u="(([0-9]|[1-9][0-9]|100)%)",d=`\\s*?\\)?)(\\s*?(\\/?)\\s+(((${u}))|(0?(\\.\\d+)?)|1))?\\s*?\\)$`,f=e=>{if(r(e)){const t=new RegExp(`(hsl)a?\\((\\s*?((-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)gra)|((([0-5])?\\.\\d+|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?(\\.\\d+)?|1)turn))((\\s*,\\s*)|(\\s+)))(\\s*?(0|${u})((\\s*,\\s*)|(\\s+)))(\\s*?(0|${u})\\s*?\\)?)(\\s*?(\\/?|,?)\\s*?(((${u}))|(0?(\\.\\d+)?)|1))?\\)$`);return e&&t.test(e)}},h=e=>{if(r(e)){const t=new RegExp(`(hwb\\(\\s*?(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\\s+)((0|${u})\\s+)((0|${u})${d}`);return e&&t.test(e)}},p=e=>{if(r(e)){const t="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])(\\.\\d+)??|160))",n=new RegExp(`(lab\\(\\s*?((\\d*(\\.\\d+)?)%)\\s+${t}\\s+${t}${d}`);return e&&n.test(e)}},m=e=>!!(e&&c(e)||l(e)||f(e)||h(e)||p(e));t.default=e=>!!(e&&c(e)||a(e)||s(e)||l(e)||f(e)||h(e)||p(e))}])},"5b2d":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"#teamroom.mobile[data-v-9b340a7a]{margin-bottom:10px}#teamroom[data-v-9b340a7a]:hover{cursor:pointer}#teamroom .teamChatWrapper[data-v-9b340a7a]{padding:.5em .25em;display:flex;align-items:center;transition:.3s}#teamroom .teamChatWrapper .iconWrapper[data-v-9b340a7a]{width:44px;display:flex;align-items:center;min-width:44px;height:44px;position:relative}#teamroom .teamChatWrapper .iconWrapper .logo[data-v-9b340a7a]{background-size:cover;background-position:50%;background-repeat:no-repeat;height:44px;width:44px;margin-left:0;margin-top:0;position:absolute;background:rgb(var(--text-on-bg-ac-color));border-radius:50%;padding-top:8px;text-align:center}#teamroom .teamChatWrapper .iconWrapper .logo img[data-v-9b340a7a]{width:28px;height:28px;margin:0 auto}#teamroom .teamChatWrapper .iconWrapper .unseen[data-v-9b340a7a]{background:rgba(var(--color-bg-ac),.9);color:rgb(var(--text-on-bg-ac-color));position:absolute;width:22px;height:22px;right:-10%;top:-10%;line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em}#teamroom .teamChatWrapper .infoWrapper[data-v-9b340a7a]{padding-left:.5em}#teamroom .teamChatWrapper .infoWrapper>div[data-v-9b340a7a]{display:flex;align-content:center}#teamroom .teamChatWrapper .infoWrapper .infoName span[data-v-9b340a7a]{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;display:inline-block;max-width:190px;color:rgb(var(--text-color))}#teamroom .teamChatWrapper .infoWrapper .previewMessage[data-v-9b340a7a]{display:flex;justify-content:flex-start;align-items:center;width:100%}#teamroom .teamChatWrapper .infoWrapper .previewMessage span[data-v-9b340a7a]{display:block;color:rgb(var(--color-txt-gray));font-size:.9em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:210px}#teamroom.minimized:not(.active) .teamChatWrapper[data-v-9b340a7a]{padding:.5em 0}",""]),e.exports=t},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5c7d":function(t,n,r){var i,o;(function(e,a){"use strict";i=a,o="function"===typeof i?i.call(n,r,n,t):i,void 0===o||(t.exports=o)})(0,(function(){"use strict";var t=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function o(t,n){var r=t[n];if("function"===typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(e){return"debug"===e&&(e="log"),typeof console!==n&&("trace"===e&&r?a:void 0!==console[e]?o(console,e):void 0!==console.log?o(console,"log"):t)}function c(e,n){for(var r=0;r=0&&t<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(o=t,!1!==r&&l(t),c.call(a,t,e),typeof console===n&&t0;return u(e,a,s,(function(e){r||(r=e),e&&o.forEach(d),a||(o.forEach(d),i(r))}))}));return t.reduce(f)}e.exports=p},"5e55":function(e,t,n){var r=n("eb93");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("052ddcf1",r,e)}},"5e77":function(e,t,n){var r=n("83ab"),i=n("1a2d"),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},"5f02":function(e,t,n){"use strict";e.exports=function(e){return"object"===typeof e&&!0===e.isAxiosError}},"5f05":function(e,t,n){"use strict";var r=n("c973").default;Object.defineProperty(t,"__esModule",{value:!0}),t.RoomList=void 0;var i=n("b503");class o{constructor(e){this._cryptoStore=e,this._roomEncryption={}}init(){var e=this;return r((function*(){yield e._cryptoStore.doTxn("readwrite",[i.IndexedDBCryptoStore.STORE_ROOMS],t=>{e._cryptoStore.getEndToEndRooms(t,t=>{e._roomEncryption=t})})}))()}getRoomEncryption(e){return this._roomEncryption[e]||null}isRoomEncrypted(e){return Boolean(this.getRoomEncryption(e))}setRoomEncryption(e,t){var n=this;return r((function*(){n._roomEncryption[e]=t,yield n._cryptoStore.doTxn("readwrite",[i.IndexedDBCryptoStore.STORE_ROOMS],r=>{n._cryptoStore.storeEndToEndRoom(e,t,r)})}))()}}t.RoomList=o},"5faa":function(e,t,n){var r=n("4b1c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("7b306284",r,e)}},6129:function(e,t,n){"use strict";var r=n("1da1");n("d9e2");const i=function(e,t,n){const i=!1,o=!1;let a=()=>{};i&&(a=console.log);const s=3600,c=24*s,l=30*c;var u=n||l,d={};function f(){const e=Math.floor(Date.now()/1e3),t=e-e%s;return t}function h(){let n,r=indexedDB.open(e,t);function i(){const e=s("items"),t=e.objectStore("items"),n=t.getAll();return new Promise((e,t)=>{n.onsuccess=t=>{const n=t.target.result;n&&_.each(n,e=>{d[e.id]=e.message}),e()},n.onerror=t=>{a("PCryptoStorage CLEAR OUTDATED error",t),e()}})}function o(){const e=f()-u,t=n.transaction("items","readwrite"),r=t.objectStore("items"),i=r.openCursor();return new Promise((t,n)=>{i.onsuccess=n=>{const r=n.target.result;r&&(e>=r.value.cachedAt&&(a("PCryptoStorage CLEAR OUTDATED log",n),r.delete()),r.continue()),t()},i.onerror=e=>{a("PCryptoStorage CLEAR OUTDATED error",e),t()}})}function s(e){const t=n.transaction("items","readwrite");return t.onsuccess=function(e){a("PCryptoStorage TRANSACTION finished",e)},t.onabort=function(e){a("PCryptoStorage TRANSACTION abort",e.target.error)},t.onerror=function(e){a("PCryptoStorage TRANSACTION error",e.target.error)},t}r.onupgradeneeded=function(e){let t=r.result;const n=e.oldVersion!==e.newVersion,i=0===e.oldVersion;n&&!i&&(t.objectStoreNames.contains("items")||t.deleteObjectStore("items")),t.objectStoreNames.contains("items")||t.createObjectStore("items",{keyPath:"id"})};const c={clear:e=>{function t(t,n){const r=s("items",!0),i=r.objectStore("items"),o=i.delete(e);delete d[e],o.onsuccess=e=>{a("PCryptoStorage CLEAR log",e),t(!0)},o.onerror=e=>{a("PCryptoStorage CLEAR error",e.target.error),n(e.target.error)}}return a("PCryptoStorage clearing",e),new Promise(t)},set:(e,t)=>{function n(n,r){const i=s("items",!0),o=i.objectStore("items"),c=f(),l={id:e,message:t,cachedAt:c};d[e]=t;const u=o.put(l);u.onsuccess=function(e){a("PCryptoStorage SET log",e),n(!0)},u.onerror=function(e){a("PCryptoStorage SET error",e.target.error),r(e.target.error)}}return a("PCryptoStorage writing",e),new Promise(n)},get:e=>{function t(t,n){if(d[e])return t(d[e]);const r=s("items"),i=r.objectStore("items"),o=i.get(e);o.onsuccess=r=>{if(a("PCryptoStorage GET log",r,o.result),!o.result)return void n("Data does not exist");const i="message"in o.result;i?(d[e]=o.result.message,t(o.result.message)):n("Message property does not exist")},o.onerror=e=>{n(e.target.error)}}return a("PCryptoStorage reading",e),new Promise(t)}};function l(e,t){r.onerror=function(e){a("PCryptoStorage error occurred:",e),t("PCryptoStorage error initiating IndexedDB")},r.onsuccess=function(){n=r.result,o().then(e=>i()).then(t=>{e(c)})}}return new Promise(l)}function p(){function t(){const t=f()-7*c;let n=Object.keys(localStorage),r=n.filter(t=>t.includes(e));r.forEach(e=>{const n=JSON.parse(localStorage[e]);t>=n.cachedAt&&delete localStorage[e]})}const n={clear:function(){var t=Object(r["a"])((function*(t){a("PCryptoStorage clearing localstorage",t);const n=`${e}_${t}`,r=n in localStorage;if(!r)throw Error("Data does not exist");const i="message"in localStorage[n];if(!i)throw Error("Message property does not exist");return delete localStorage[n],new Promise(executor)}));return function(e){return t.apply(this,arguments)}}(),set:function(){var t=Object(r["a"])((function*(t,n){a("PCryptoStorage writing localstorage",t);const r=`${e}_${t}`,i=f(),o={message:n,cachedAt:i};localStorage[r]=JSON.stringify(o)}));return function(e,n){return t.apply(this,arguments)}}(),get:function(){var t=Object(r["a"])((function*(t){a("PCryptoStorage reading",t);const n=`${e}_${t}`,r=n in localStorage;if(!r)throw Error("Data does not exist");return localStorage[n]}));return function(e){return t.apply(this,arguments)}}()};return t(),n}return!window.indexedDB||o?(a("PCryptoStorage LOCALSTORAGE_FALLBACK"),p()):h()};t["a"]=i},6146:function(e,t,n){"use strict";function r(e,t){return new Promise((n,r)=>{let i=!0;const o=e.open(t);o.onupgradeneeded=()=>{i=!1},o.onblocked=()=>r(),o.onsuccess=()=>{const r=o.result;r.close(),i||e.deleteDatabase(t),n(i)},o.onerror=e=>r(e.target.error)})}Object.defineProperty(t,"__esModule",{value:!0}),t.exists=r},6167:function(t,n,r){"use strict";r.r(n);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.event.localRedactionEvent()||e.event.getRedactionEvent()||e.removed?n("div",{staticClass:"deletedMessage"},[n("i",{staticClass:"fas fa-eraser"}),e._v(" "+e._s(e.$t("caption.messageDeleted"))+" ")]):n("div",{ref:"msgElement",staticClass:"event",class:{readyToRender:e.readyToRender,my:e.my}},["member"!==e.type||e.preview?e._e():n("member",{attrs:{chat:e.chat,event:e.event,userinfo:e.userinfo,readed:e.readed,preview:e.preview||!1},on:{readyToRender:e.setReadyToRender}}),"message"===e.type||e.preview?n("message",{attrs:{chat:e.chat,event:e.event,prevevent:e.prevevent,origin:e.event,decryptEvent:e.decryptEvent,decryptedInfo:e.decryptedInfo,encryptedData:e.encryptedData,imgEvent:e.galleryData,userinfo:e.userinfo,readed:e.readed,preview:e.preview||!1,withImage:e.withImage||!1,clientWidth:e.clientWidth,encrypted:e.encrypted,subtype:e.subtype,error:e.error,reference:e.reference,downloaded:e.downloaded,last:e.last,showmyicontrue:e.showmyicontrue,fromreference:e.fromreference,multiSelect:e.multiSelect,selectedMessages:e.selectedMessages,audioBuffer:e.audioBuffer,isRemoveSelectedMessages:e.isRemoveSelectedMessages},on:{openGalleryImg:e.openImage,readyToRender:e.setReadyToRender,remove:e.removeEvent,download:e.downloadFile,decryptagain:e.decryptAgain,showMultiSelect:function(t){return e.$emit("showMultiSelect")},selectMessage:e.selectMessage,removeMessage:e.removeMessage,messagesIsDeleted:e.messagesIsDeleted,editing:e.editing,reply:e.reply,share:e.share,menuIsVisible:e.menuIsVisibleHandler}}):e._e(),"common"===e.type?n("common",{attrs:{event:e.event,userinfo:e.userinfo,readed:e.readed,preview:e.preview||!1}}):e._e(),e.downloading?n("div",{staticClass:"loading"},[n("linepreloader")],1):e._e()],1)},o=[],a=r("1da1"),s=r("a54c"),c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"eventsCommon"})},l=[],u=r("2f62"),d={name:"eventsCommon",props:{event:Object,preview:Boolean,userinfo:Object},data:function(){return{loading:!1}},computed:Object(u["c"])({auth:e=>e.auth}),methods:{}},f=d,h=r("2877");function p(e){var t=r("78ad");t.__inject__&&t.__inject__(e)}var m=Object(h["a"])(f,c,l,!1,p,"52fddf5e",null,!0),v=m.exports,g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"eventMember"},[e.preview?e._e():n("div",{staticClass:"iconWrapper",on:{click:function(t){return e.core.mtrx.opencontact(e.userinfo)}}},[n("userpic",{attrs:{userinfo:e.userinfo}})],1),n("div",{staticClass:"labelwrapper"},[n("span",{staticClass:"label"},[n("b",[e._v(e._s(e.userinfo.name||"Somebody"))]),e._v(" "+e._s(e.keyword))])])])},y=[],b=r("3139"),w={name:"eventsMember",props:{event:Object,preview:Boolean,userinfo:Object},data:function(){return{loading:!1,pName:Object,membership:"",moder:!1}},mounted:function(){this.$emit("readyToRender")},computed:Object(u["c"])({auth:e=>e.auth,keyword:function(){var e,t=this.$store.state.users,n=null===(e=this.event.event)||void 0===e?void 0:e.content.membership,r=b["a"].getmatrixid(b["a"].deep(this.event,"event.state_key")||this.event.getSender()),i="";if("join"===n)return this.$i18n.t("caption.joinedInTheChat");if("invite"===n)return _.find(t,(e,t)=>{if(e.id===r)return i=e.name}),this.$i18n.t("caption.hasInvited")+""+i+this.$i18n.t("caption.inTheChat");if("ban"===n)return _.find(t,(e,t)=>{if(e.id===r)return i=e.name}),this.$i18n.t("caption.banned")+` ${i} `+this.$i18n.t("caption.andRoom");if("leave"===n){let e=this.$store.state.users[b["a"].getmatrixid(this.event.target.userId)];if(e)return e.name+" "+this.$i18n.t("caption.left")+this.$i18n.t("caption.theChat")}if("m.room.power_levels"===this.event.event.type&&this.event.event.unsigned.prev_content){let e=Object.keys(b["a"].ObjDiff(this.event.event.content.users,this.event.event.unsigned.prev_content.users)),t=this.$store.state.users[""+b["a"].getmatrixid(e[0])],n=this.event.event.content.users[""+e[0]];if(!_.isEmpty(t)&&e[0]){if(0===n)return this.$i18n.t("caption.unmarked")+` ${t.name} `+this.$i18n.t("caption.asModerator");if(50===n)return this.$i18n.t("caption.marked")+` ${t.name} `+this.$i18n.t("caption.asModerator")}}return this.event.event.type,"m.room.name"===this.event.event.type?this.$i18n.t("caption.editedChatNameTo")+`"${this.event.event.content.name}"`:void 0}}),methods:{}},x=w;function k(e){var t=r("00e4");t.__inject__&&t.__inject__(e)}var S=Object(h["a"])(x,g,y,!1,k,"54a240c2",null,!0),E=S.exports,C=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"eventsMessage"},[e.referenceshowed&&e.reference&&!e.preview&&!e.fromreference?n("div",{staticClass:"reference referenceTop",class:{my:e.my}},[n("eventsEvent",{attrs:{event:e.reference,chat:e.chat,preview:!1,fromreference:!0}})],1):e._e(),e.preview||"m.notice"===e.content.msgtype?e._e():n("div",{directives:[{name:"touch",rawName:"v-touch:touchhold",value:e.dropDownMenuShow,expression:"dropDownMenuShow",arg:"touchhold"}],class:{referenceshowed:e.referenceshowed,showmeta:e.showmeta,my:e.my,messageRow:"messageRow",urlpreview:e.urlpreview,allscreen:e.urlpreview||"m.image"===e.content.msgtype||e.file,aligncenter:"m.audio"===e.content.msgtype},attrs:{my:e.my}},[e.urlpreview||e.imageUrl||"m.image"===e.content.msgtype||e.showmeta&&e.my||e.file?n("div",{staticClass:"timeWrapper"},[e.showburn?n("i",{class:"fas fa-fire burn "+e.showburn,on:{click:e.showwhenburn}}):e._e(),n("span",[e._v(" "+e._s(e.format_date(e.origin._localTimestamp)||"Now")+" ")])]):e._e(),"m.file"!==e.content.msgtype?n("div",{staticClass:"actionsWrapper"},[e.multiSelect?n("div",{staticClass:"multiSelect",on:{click:function(t){return e.eventMessage(e.selectedMessage)}}},[e.selectedMessage?n("i",{staticClass:"far fa-check-circle"}):n("i",{staticClass:"far fa-circle"})]):n("div",{staticClass:"mnwrapper"},[n("i",{staticClass:"fas fa-ellipsis-h",on:{click:e.setmenu}})])]):e._e(),!e.my||e.showmyicon?n("div",{staticClass:"iconWrapper",on:{click:function(t){return e.core.mtrx.opencontact(e.userinfo)}}},[n("userpic",{attrs:{userinfo:e.userinfo}})],1):e._e(),(e.content.from||e.imageFrom)&&(e.file||"m.image"===e.content.msgtype&&e.imageUrl||"m.audio"===e.content.msgtype&&e.audioUrl)?n("div",{staticClass:"fromimagesfiles"},[n("div",{staticClass:"fromCaption"},[n("i",{staticClass:"fas fa-share-alt"}),e._v(" "),n("span",[e._v(e._s(e.$t("caption.messagefrom")))])])]):e._e(),"m.image"===e.content.msgtype?n("div",{staticClass:"messageImg"},[e.imageUrl?n("div",{},[e.encryptedData?n("div",{staticClass:"encryptedDataIcon"},[n("i",{staticClass:"fas fa-lock"})]):e._e(),n("div",{staticClass:"imgMsg"},[n("div",{staticClass:"showImage",style:e.imagePaddingStyle(e.content),on:{click:function(t){return e.openImageGallery(e.origin)}}},[n("div",{staticClass:"abswrapper"},[n("img",{directives:[{name:"images-loaded",rawName:"v-images-loaded:on.loaded",value:e.imagesLoaded,expression:"imagesLoaded",arg:"on",modifiers:{loaded:!0}}],attrs:{src:e.imageUrl,alt:""}})])])])]):n("div",{staticClass:"preloaderImage",style:e.imagePaddingStyle(e.content)},[n("div",{staticClass:"abswrapper"},[n("linepreloader")],1)])]):e._e(),"m.audio"===e.content.msgtype?n("div",{staticClass:"messageAudio"},[e.audioUrl?n("VoiceMessage",{attrs:{audioBuffer:e.audioUrl,decryptedInfo:e.decryptedInfo,id:e.event._localTimestamp||Date.now()}}):e._e()],1):e._e(),"m.encrypted"===e.content.msgtype&&!e.textWithoutLinks&&e.badenctypted?n("div",{staticClass:"maxcontent",class:{my:e.my}},[n("div",{staticClass:"badenctyptedText"},[n("span",[e._v(e._s(e.$t("caption.unabletoDecrypt")))]),e._v(" "),n("i",{staticClass:"fas fa-undo decryptagain",on:{click:e.decryptagain}})])]):e._e(),"m.text"!==e.content.msgtype&&"m.encrypted"!==e.content.msgtype||!e.textWithoutLinks?e._e():n("div",{staticClass:"maxcontent",class:{my:e.my}},[n("div",{staticClass:"messageText"},[e.edited?n("div",{staticClass:"edited"},[n("i",{staticClass:"fas fa-pen"}),e._v(" "+e._s(e.$t("caption.edited"))+" ")]):e._e(),n("div",{staticClass:"msgtext"},[n("IncomingMessage",{attrs:{message:e.textWithoutLinks}})],1),!e.content.from&&!e.my&&e.showmeta||e.showmyicon&&!e.my?n("div",{staticClass:"sendername"},[n("span",[n("b",[e._v(e._s(e.userinfo.name))])]),e._v(" · "),n("span",[e._v(" "+e._s(e.format_date(e.origin._localTimestamp)||"Now")+" ")])]):e._e(),!e.reference||e.preview||e.fromreference?e._e():n("div",{staticClass:"reference showreference",on:{click:e.showreference}},[e.referenceshowed?e._e():n("eventsEvent",{attrs:{event:e.reference,chat:e.chat,preview:!0}}),n("div",{staticClass:"referenceCaption"},[e.referenceshowed?n("button",{staticClass:"button ghost small"},[e._v("Hide")]):n("span",[n("i",{staticClass:"fas fa-share"})])])],1),e.content.from?n("div",{staticClass:"from"},[n("div",{staticClass:"fromCaption"},[n("i",{staticClass:"fas fa-share-alt"}),n("span",[e._v(e._s(e.$t("caption.messagefrom"))+" "+e._s(this.userinfo.name))])])]):e._e()])]),e.file?n("div",{staticClass:"filePreview"},[n("fileMessage",{attrs:{encryptedData:e.encryptedData,file:e.file,downloaded:e.downloaded},on:{download:e.download}}),e.encryptedData?n("div",{staticClass:"encryptedDataIcon"},[n("i",{staticClass:"fas fa-lock"})]):e._e(),e.error?n("div",{staticClass:"badencrypted"},[n("span",[e._v(e._s(e.$t("caption.unabletoDecrypt")))])]):e._e()],1):e._e(),e.urlpreview?n("div",{staticClass:"linkPreview"},[e.sending?n("div",[n("linepreloader")],1):n("div",{staticClass:"pr"},[e.origin.localRedactionEvent()||e.origin.getRedactionEvent()?e._e():n("url",{attrs:{url:e.urlpreview,urllink:e.urlpreview,preview:!0},on:{updatedSize:e.updatedSize}})],1)]):e._e()]),e.preview?n("div",{staticClass:"messagePreview"},[n("listPreview",{attrs:{my:e.my,event:e.origin,decryptEvent:e.decryptEvent,userinfo:e.userinfo,chat:e.chat,readed:e.readed}})],1):e._e(),e.my&&e.readed&&!e.preview&&!e.fromreference?n("div",{staticClass:"statusWrapper"},[n("div",{staticClass:"my"},[n("i",{staticClass:"fas fa-check-double"}),e._v(" "),n("span",[e._v(e._s(e.$t("caption.messageRead")))])])]):e._e()])},T=[],I=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"msgAction"},[n("div",{staticClass:"contentAction",style:{margin:e.position}},[n("ul",[n("li",[n("a",{attrs:{href:"google.com"}},[e._v(e._s(e.$t("button.reply"))+" "),n("i",{staticClass:"fas fa-reply"})])]),n("li",[e._v(e._s(e.$t("button.copy"))+" "),n("i",{staticClass:"far fa-copy"})]),n("li",[e._v(e._s(e.$t("button.select"))+" "),n("i",{staticClass:"far fa-check-circle"})]),n("li",[e._v(e._s(e.$t("button.forward"))+" "),n("i",{staticClass:"fas fa-share"})]),n("li",[e._v(e._s(e.$t("button.delete"))+" "),n("i",{staticClass:"far fa-trash-alt"})])])])])},R=[],O={name:"msgActions",props:{position:String},data:function(){return{loading:!1,actionMessage:!1}},computed:Object(u["c"])({auth:e=>e.auth}),methods:{}},M=O;function A(e){var t=r("7acf");t.__inject__&&t.__inject__(e)}var P=Object(h["a"])(M,I,R,!1,A,"9d2b1700",null,!0),j=P.exports,D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("clip-loader",{staticClass:"clipLoader",attrs:{size:"25px",color:"#0035a8",loading:!0}}),n("p",[e._v(e._s(e.preview.name))]),n("p",[e._v(e._s(e.preview.size))])],1)},L=[],N=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"v-spinner"},[n("div",{staticClass:"v-clip",style:e.spinnerStyle})])},$=[],U={name:"ClipLoader",props:{loading:{type:Boolean,default:!0},color:{type:String,default:"#5dc596"},size:{type:String,default:"35px"},radius:{type:String,default:"100%"}},computed:{spinnerStyle(){return{height:this.size,width:this.size,borderWidth:"2px",borderStyle:"solid",borderColor:this.color+" "+this.color+" transparent",borderRadius:this.radius,background:"transparent"}}}},B=U;function F(e){var t=r("c337");t.__inject__&&t.__inject__(e)}var z=Object(h["a"])(B,N,$,!1,F,null,null,!0),q=z.exports,W={props:{preview:Object},components:{clipLoader:q}},K=W,V=Object(h["a"])(K,D,L,!1,null,null,null,!0),G=V.exports,H=r("696c2"),Y=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"listPreview"},[e.urlpreview&&e.metaPreviewLink?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"sname txt"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"linkTitle txt"},[e._v("sent link: "+e._s(e.meta["og:title"])+" ")]),"Pocketnet"===e.meta["og:site_name"]?n("span",{staticClass:"pocketnetLink"},[e._v(" "+e._s(e.meta["og:site_name"])+" ")]):n("span",[e._v(" "+e._s(e.meta["og:site_name"])+" ")])]):e._e(),"m.file"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"sname txt"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(" sent file: "+e._s(JSON.parse(e.content.body).name)+" ")])]):e._e(),"m.bad.encrypted"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[n("span",[e._v(" "+e._s(e.$t("caption.unabletoDecrypt"))+" ")])]):e._e(),"m.room.redaction"===e.event.event.type?n("div",{staticClass:"previewMessage"},[n("span",{staticClass:"txt"},[n("i",{staticClass:"fas fa-eraser"}),e._v(" "+e._s(e.$t("caption.messageDeleted"))+" ")])]):e._e(),"m.room.power_levels"===e.event.event.type?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(" "+e._s(e.powerLevels)+" ")])]):e._e(),"m.image"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.sentImage")))])]):e._e(),"m.audio"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.sentVoiceMessage")))])]):e._e(),"m.text"!==e.content.msgtype||e.urlpreview?e._e():n("div",{staticClass:"previewMessage"},[e.senderName&&"You"!=e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+": ")]):e._e(),n("span",{staticClass:"txt"},[n("IncomingMessage",{attrs:{message:e.content.body}})],1)]),"m.encrypted"!==e.content.msgtype||e.urlpreview?e._e():n("div",{staticClass:"previewMessage"},[e.senderName&&"You"!=e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+": ")]):e._e(),n("span",{staticClass:"txt"},[n("IncomingMessage",{attrs:{message:e.decryptEvent.body}})],1)]),"invite"===e.content.membership?n("div",{staticClass:"invitedEvent"},[e.tetatetchat?n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.invitationToChat")))]):e._e(),e.tetatetchat?e._e():n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.invitationToRoom")))])]):e._e(),"leave"===e.content.membership?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+": ")]):e._e(),n("span",{staticClass:"txt sname"},[e._v(" "+e._s(e.name)+" ")]),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.leftChat")))])]):e._e(),"ban"===e.content.membership?n("div",[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),e._v(" "),n("span",{staticClass:"txt"},[e._v("banned "+e._s(e.content.displayname))])]):e._e(),"join"===e.content.membership&&e.event.getSender()!==e.userId?n("div",{staticClass:"invitedEvent"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.joined")))])]):e._e(),e.content.name?n("div",[n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.chatRenamed"))+" "),n("b",[e._v(e._s(e.content.name))])])]):e._e(),e.content.topic?n("div",[n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.chatTopic"))+" "),n("b",[e._v(e._s(e.content.topic.replace(/_/g," ")))])])]):e._e(),e.readed?n("div",{staticClass:"statusWrapper"},[e.my?n("div",{staticClass:"my"},[n("i",{staticClass:"fas fa-check-double"})]):e._e()]):e._e()])},J=[],X=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",e._l(e.chunks,(function(t,r){return n("label",{key:r,attrs:{chunks:e.chunks}},[t.id?n("label",{staticClass:"likelink",on:{click:function(n){return e.show(t)}}},[e._v("@"+e._s(t.name))]):n("label",[e._v(e._s(t))])])})),0)},Z=[],Q={name:"IncomingMessage",props:{message:{type:String,default:""}},data(){return{user_id:/\w{68}:/,userCalled:/@\w{68}:\w{1,50}/g}},computed:{chunks:function(){if(-1==this.message.indexOf("@"))return[this.message];var e=this.message.split(this.userCalled),t=Array.from(this.message.matchAll(this.userCalled),e=>e[0]),n=[];return _.each(e,(function(e,r){if(n.push(e),t[r]){var i=t[r].replace("@","").split(":");2==i.length?n.push({id:i[0],name:i[1]}):n.push(t[r])}})),n}},methods:{show:function(e){this.core.mtrx.kit.usersInfoById(e.id).then(e=>{core.mtrx.opencontact(e)})}}},ee=Q;function te(e){var t=r("de56");t.__inject__&&t.__inject__(e)}var ne=Object(h["a"])(ee,X,Z,!1,te,"6b3704ba",null,!0),re=ne.exports,ie={props:{event:{},chat:{},decryptEvent:{},notificationPreview:!1,userinfo:Object,readed:Object,my:Boolean},components:{IncomingMessage:re},data:function(){return{meta:{}}},computed:{userId:function(){var e;return null===(e=this.core.user.userinfo)||void 0===e?void 0:e.id},countMembers:function(){var e;return _.size(null===(e=this.chat)||void 0===e?void 0:e.currentState.members)},urlpreview:function(){if("m.file"!==this.content.msgtype)return""},tetatetchat:function(){return this.core.mtrx.kit.tetatetchat(this.chat)},unknowngroupusers:function(){return this.core.mtrx.kit.unknowngroupusers(this.m_chat)},senderName:function(){return this.userinfo.id==this.userId?"You":this.userinfo.name||""},metaPreviewLink:function(){return this.core.mtrx.client.getUrlPreview(this.urlpreview,0).then(e=>this.meta=e),this.meta},ev:function(){return this.event._clearEvent||this.event},content:function(){return this.event.event.content},name:function(){var e=this.$store.state.users[""+b["a"].getmatrixid(this.event.event.state_key)].name;return e==this.senderName?"":e},powerLevels:function(){if("m.room.power_levels"===this.event.event.type&&this.event.event.unsigned.prev_content){let e=Object.keys(b["a"].ObjDiff(this.event.event.content.users,this.event.event.unsigned.prev_content.users)),t=this.$store.state.users[""+b["a"].getmatrixid(e[0])],n=this.event.event.content.users[""+e[0]];if(!_.isEmpty(t)&&e[0]){if(0===n&&t.name)return"unmarked "+t.name+" as moderator";if(50===n&&t.name)return"marked "+t.name+" as moderator"}}}}},oe=ie;function ae(e){var t=r("9801");t.__inject__&&t.__inject__(e)}var se=Object(h["a"])(oe,Y,J,!1,ae,"ba5ac396",null,!0),ce=se.exports,le=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"urlMessage",attrs:{id:"url"}},["impty"==e.urltype||e.error?e._e():n("div",{staticClass:"urlwrapper"},[e.loading?n("div",[n("div",{staticClass:"preloaderWrapperLocal"},[n("linepreloader")],1)]):n("metaMessage",{ref:"metamessage",attrs:{type:e.urltype,name:e.meta["og:site_name"],title:e.meta["og:title"],description:e.meta["og:description"],image:e.previewImageUrl,url:e.url,h:e.meta["og:image:height"],w:e.meta["og:image:width"]},on:{updatedSize:e.updatedSize}})],1)])},ue=[],de={name:"eventsurl",props:{url:String,preview:Boolean,data:Object},components:{metaMessage:()=>r.e(3).then(r.bind(null,"dacd"))},data:function(){return{meta:{},loading:!0,error:!1,groups:{p:["pocketnet.app","bastyon.com"],pt:["test.pocketnet.app","test.bastyon.com"]}}},computed:Object(u["c"])({auth:e=>e.auth,clearurl:function(){var e=this.url||"";return e=e.replace("http://","https://"),-1==e.indexOf("https://")&&(e="https://"+e),e},previewImageUrl(){if(this.meta["og:image"])return this.core.mtrx.client.mxcUrlToHttp(this.meta["og:image"])},urltype:function(){if(!this.url)return"empty";if(this.url.indexOf("embedVideo.php")>-1)return"video";var t={};try{t=new URL(this.url)}catch(e){this.error=e}if(!t.pathname||"/"==t.pathname)return"custom";var n=window.pocketnetdomain||"pocketnet.app";if(this.url.indexOf("publicroom=")>-1)return"matrix";if(this.url.indexOf("connect=")>-1)return"matrix";if(this.url.indexOf("bastyon://")>-1)return"pocketnet";if(this.url.indexOf("pocketnet://")>-1)return"pocketnet";var r=_.find(this.groups,(function(e){return _.indexOf(e,t.host)>-1&&_.indexOf(e,n)>-1}));return r&&-1==this.url.indexOf("embedVideo.php")?"pocketnet":"custom"}}),mounted:function(){"custom"==this.urltype?this.geturl():this.loading=!1},methods:{updatedSize:function(e){this.$emit("updatedSize",e)},geturl:function(){this.loading=!0,this.core.mtrx.client.getUrlPreview(this.clearurl,0).then(e=>{this.loading=!1,this.meta=e}).catch(e=>{this.meta={},this.loading=!1})}}},fe=de;function he(e){var t=r("fdca");t.__inject__&&t.__inject__(e)}var pe=Object(h["a"])(fe,le,ue,!1,he,"791cf1f7",null,!0),me=pe.exports,ve=r("8ff0"),ge=r.n(ve),ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"voiceMessage",class:{playing:e.isPlaying}},[n("div",{staticClass:"voiceMessage_wrapper"},[n("button",{staticClass:"voiceMessage_toggle",class:{encrypted:e.encrypted},on:{touchend:e.audioToggle,click:e.audioToggleClick}},[n("i",{class:e.isPlaying?"fas fa-pause":"fas fa-play"})]),n("div",{staticClass:"voiceMessage_graph"},[n("canvas",{ref:"canvas",attrs:{width:"100",height:"50"},on:{mousedown:e.goTo}})]),n("div",{staticClass:"voiceMessage_options"},[e.error?e._e():n("span",[e._v(e._s(e.getDurationString))]),e.error?n("i",{staticClass:"fas fa-exclamation-circle"}):e._e()]),e.encrypted&&!e.error?n("div",{staticClass:"encsign"},[n("i",{staticClass:"fas fa-lock"})]):e._e()])])},be=[],_e={name:"VoiceMessage",props:{decryptedInfo:Object,audioBuffer:{type:null|String,required:!0},id:{type:Number}},data(){return{voiceMessage:null,isPlaying:!1,interval:null,audioContext:null,audio:null,duration:null,currentTime:null,signal:null,audiobuffer:null,error:null}},inject:["addToQueue","playNext"],mounted(){this.initVoiceMessage()},beforeDestroy(){this.isPlaying&&this.pause(),this.interval&&(clearInterval(this.interval),this.interval=null)},watch:{isPlaying:function(e){this.isPlaying}},computed:{encrypted(){return!!this.decryptedInfo},...Object(u["c"])({mobile:e=>e.mobile}),getDurationString(){if(this.duration){let e,t;return this.currentTime?(e=Math.floor(this.currentTime),t=Math.floor(this.currentTime/60),`${t}:${e<10?"0"+e:e}`):(e=Math.floor(this.duration),t=Math.floor(this.duration/60),`${t}:${e<10?"0"+e:e}`)}return"0:00"},percentPlayed(){return this.currentTime/this.duration},localBuffer(){return b["a"].copyArrayBuffer(this.audioBuffer)}},methods:{goTo(e){if(this.$refs.canvas){var t=e.offsetX/this.$refs.canvas.width*this.duration;this.isPlaying?(this.pause(),setTimeout(()=>{this.setTime(t),this.play()},20)):(this.setTime(t),this.play())}},audioToggleClick(){this.mobile||this.audioToggle()},audioToggle(){this.isPlaying?this.pause():this.play()},pause(){this.audio&&(this.audio.stop(),this.audio.disconnect()),this.isPlaying=!1,this.draw();let e=this.$store.state.currentPlayingVoiceMessage;e&&e.id==this.id&&this.$store.commit("SET_CURRENT_PLAYING_VOICE_MESSAGE",null),this.interval&&(clearInterval(this.interval),this.interval=null)},play(){if(!this.audiobuffer)return;if(this.error)return void this.playNext(this.id);this.audioContext=this.core.getAudioContext(),this.isPlaying=!0,this.audio=this.initAudioNode(),this.currentTime>=this.duration&&this.setTime(0),this.audio.start?this.audio.start(0,this.currentTime):this.audio.play?this.audio.play(0,this.currentTime):this.audio.noteOn&&this.audio.noteOn(0,this.currentTime);let e=this.$store.state.currentPlayingVoiceMessage;e&&e.id!==this.id&&e.pause(),this.$store.commit("SET_CURRENT_PLAYING_VOICE_MESSAGE",this),this.interval&&clearInterval(this.interval);var t=50;this.interval=setInterval(()=>{var e=this.currentTime+t/1e3;this.duration-t/1e3this.duration&&this.pause(),this.draw(),this.setTime(e)},t)},draw(){const e=this.$refs.canvas;if(!this.signal)return;if(!e)return;const t=this.signal;var n=e.width,r=e.height,i=t.length,o=this.percentPlayed;const a=e.getContext("2d");a.clearRect(0,0,n,r);var s=Math.floor(i/20);for(let c=0;c{this.audio=null,this.isPlaying&&setTimeout(()=>{this.playNext(this.id)},300),this.duration-1000&&void 0!==arguments[0]?arguments[0]:0;this.currentTime=e},initVoiceMessage(){var t=this;return Object(a["a"])((function*(){try{t.audioContext=t.core.getAudioContext()}catch(e){t.error=e}if(!t.error){t.addToQueue(t,t.id),t.duration=0,t.setTime(0);try{yield t.audioContext.decodeAudioData(t.localBuffer,e=>{t.audiobuffer=e,t.duration=e.duration,t.setTime(0),t.signal=e.getChannelData(0),t.draw()})}catch(e){t.error=e}}}))()}}},we=_e;function xe(e){var t=r("e86a");t.__inject__&&t.__inject__(e)}var ke=Object(h["a"])(we,ye,be,!1,xe,"0438bc11",null,!0),Se=ke.exports,Ee={name:"eventsMessage",props:{decryptEvent:{},origin:Object,prevevent:Object,event:Object,preview:Boolean,userinfo:Object,readed:Object,downloaded:Boolean,baseImg:{type:String,default:"empty"},filePreview:Object,imgEvent:{},add_image:Function,goToGallery:Function,chat:Object,encrypted:!1,encryptedData:Boolean,decryptedInfo:null,error:String,withImage:Boolean,reference:Object,last:Boolean,showmyicontrue:!1,fromreference:Boolean,multiSelect:{default:!1,type:Boolean},selectedMessages:{default:[],type:Array},isRemoveSelectedMessages:!1,audioBuffer:null},directives:{imagesLoaded:ge.a},data:function(){return{referenceshowed:!1}},components:{actions:j,filePreview:G,fileMessage:H["a"],listPreview:ce,url:me,dummypreviews:s["a"],IncomingMessage:re,VoiceMessage:Se},watch:{isRemoveSelectedMessages:{immediate:!0,handler:function(){if(this.isRemoveSelectedMessages){for(let e=0;e0&&e.indexOf(this.urlpreview)+this.urlpreview.lengthe.message_id===this.origin.event.event_id);return(null===(e=t[0])||void 0===e?void 0:e.message_id)===this.origin.event.event_id}},mounted(){},methods:{gotoreference:function(){var e=this.reference.getId();this.$emit("gotoreference",e)},showwhenburn:function(){var e="";e=this.willburn.toDate(){this.setmenu()},200)},setmenu:function(){this.core.menu({items:this.menuItems,handler:this.menuItemClickHandler,item:{}})},menushare:function(){var e={},t=this.$f.trim(this.body);return"m.image"===this.content.msgtype&&this.imageUrl&&(e.images=[this.imageUrl]),"m.audio"===this.content.msgtype&&this.audioUrl&&(e.audio=[this.audioUrl]),"m.text"!==this.content.msgtype&&"m.encrypted"!==this.content.msgtype||!t||(e.messages=[t]),this.file&&(e.download=!0),e.from=this.userinfo.id,this.$emit("share",e),Promise.resolve()},menuedit:function(){return this.$emit("editing",this.body),Promise.resolve()},menushowMultiSelect:function(){return this.$emit("showMultiSelect"),this.selectMessage(),Promise.resolve()},menureply:function(){return this.$emit("reply"),Promise.resolve()},menucopy:function(){return this.$f.copytext(this.replacedmintionsbody),Promise.resolve()},menudelete:function(){return this.$dialog.confirm("Do you really want to delete message?",{okText:this.$i18n.t("yes"),cancelText:this.$i18n.t("cancel")}).then(e=>(this.$emit("remove"),this.core.mtrx.client.redactEvent(this.chat.roomId,this.origin.event.event_id,null,{reason:"messagedeleting"}))).catch(e=>Promise.resolve())},menuItemClickHandler:function(e,t,n){n.hidePopup(),this["menu"+e.click]().then(e=>{}).catch(e=>{n.showPopup()})},imagePaddingStyle:function(e){if(e.info&&e.info.h&&e.info.w){var t=e.info.h/e.info.w;t>1.7&&(t=1.7);var n="padding-bottom:"+100*t+"%";return n}return""},parser(e){return JSON.parse(e)["og:title"]},openImage(e){this.$emit("openImg",e)},format_date(e){if(e)return 0===moment().diff(e,"days")?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}):moment().year()===moment(e).year()?moment(e).locale(this.$i18n.locale).format("D MMMM"):moment(e).locale(this.$i18n.locale).format("D MMMM YYYY")},download:function(){this.$emit("download")},decryptagain:function(){this.$emit("decryptagain")},openImageGallery(e){this.$emit("openGalleryImg",e)},reshareKeys(){this.chat.roomId},textDonation:function(){var e=this.$i18n.t("caption.somebody"),t="";try{e=this.$f.deep(this,"$store.state.users."+this.content.from).name}catch(r){}var n=this.$i18n.t("caption.somebody");try{n=this.$f.deep(this,"$store.state.users."+this.content.to).name}catch(r){}return t+=e+this.$i18n.t("caption.sent")+this.content.amount+this.$i18n.t("caption.sent")+n,t},menuIsVisibleHandler(e){this.$emit("menuIsVisible",e)},showreference:function(){this.referenceshowed=!this.referenceshowed},selectMessage:function(){var e={},t=this.$f.trim(this.body);"m.image"===this.content.msgtype&&this.imageUrl&&(e.images=[this.imageUrl]),"m.audio"===this.content.msgtype&&this.decryptedInfo&&(e.audio=[this.decryptedInfo]),"m.text"!==this.content.msgtype&&"m.encrypted"!==this.content.msgtype||!t||(e.messages=[t]),this.file&&(e.download=!0),e.from=this.userinfo.id,this.$emit("selectMessage",{message_id:this.origin.event.event_id,...e})},removeMessage:function(){this.$emit("removeMessage",{message_id:this.origin.event.event_id})},eventMessage:function(e){e?this.removeMessage():this.selectMessage()}}},Ce=Ee;function Te(e){var t=r("dd47");t.__inject__&&t.__inject__(e)}var Ie=Object(h["a"])(Ce,C,T,!1,Te,"c8f458dc",null,!0),Re=Ie.exports,Oe={name:"eventsEvent",components:{common:v,member:E,message:Re,dummypreviews:s["a"]},data:function(){return{readed:null,decryptEvent:{},decryptedInfo:null,decryptReady:"",readyEvent:!1,downloading:!1,error:null,reference:null,removed:!1,downloaded:!1,readedInterval:null,audioBuffer:null,readyToRender:!1}},props:{event:Object,prevevent:Object,preview:Boolean,withImage:Boolean,timeline:Object,last:Boolean,chat:Object,showmyicontrue:Boolean,metaUrl:String,galleryData:{},goToGallery:Function,clientWidth:Number,fromreference:Boolean,multiSelect:{default:!1,type:Boolean},selectedMessages:{type:Array,default:()=>[]},isRemoveSelectedMessages:!1},computed:{type:function(){var e=b["a"].deep(this,"event.event.type");return["m.room.member"].indexOf(e)>-1?"member":["m.room.message"].indexOf(e)>-1?"message":["m.room.name"].indexOf(e)>-1||["m.room.power_levels"].indexOf(e)>-1?"member":["m.room.redaction"].indexOf(e)>-1?"message":["m.room.topic"].indexOf(e)>-1?"member":""},subtype:function(){return b["a"].deep(this,"event.event.content.msgtype")},encryptedData:function(){return!(!b["a"].deep(this,"event.event.content.info.secrets")&&!b["a"].deep(this,"event.event.content.pbody.secrets"))},userinfo:function(){return this.$f.deep(this,"$store.state.users."+this.$f.getmatrixid(this.event.getSender()))||{}},encrypted:function(){return!(!this.chat||!this.chat.roomId)&&this.core.mtrx.client.isRoomEncrypted(this.chat.roomId)},my:function(){var e;return this.userinfo.id===(null===(e=this.core.user.userinfo)||void 0===e?void 0:e.id)}},beforeDestroy:function(){this.readedInterval&&(clearInterval(this.readedInterval),this.readedInterval=null)},mounted:function(){this.$emit("mounted")},watch:{readed:{immediate:!0,handler:function(){this.manageReadedInterval()}},last:{handler:function(){this.manageReadedInterval()}},event:{immediate:!0,handler:function(){this.decryptEvent={},this.checkReaded(),this.relations(),this.encryptedData||"m.encrypted"==this.subtype?b["a"].pretry(()=>this.chat.pcrypto,20,1e4).then(()=>{this.encryptedData&&"m.image"==this.subtype&&this.decryptImage(),this.encryptedData&&"m.audio"==this.subtype&&this.decryptAudio(),"m.encrypted"==this.subtype&&this.decrypt()}):"m.audio"==this.subtype&&this.getAudioUnencrypt()}}},methods:{setReadyToRender(){setTimeout(()=>{this.readyToRender=!0},20)},manageReadedInterval(){!this.preview&&this.my&&(this.last||this.readed?this.readedInterval||(this.readedInterval=setInterval(()=>{this.checkReaded()},500)):this.readedInterval&&(clearInterval(this.readedInterval),this.readedInterval=null))},relations(){if(this.timeline){var e=this.timeline._timelineSet,t=this.event;if(!this.reference&&t.event.content["m.relates_to"]&&t.event.content["m.relates_to"]&&"m.reference"==t.event.content["m.relates_to"]["rel_type"]){var n=t.event.content["m.relates_to"]["event_id"];n&&this.core.mtrx.client.getEventTimeline(e,n).then(r=>{var i=_.find(r.getEvents(),e=>{if(e.getId()==n)return!0});if(i){this.reference=t.event.content.reference=i;var o=e.getRelationsForEvent(this.core.mtrx.clearEventId(i),"m.replace","m.room.message");if(o){var a=o.getLastReplacement();a&&(i.event.content.body=a.event.content.body,i.event.content.edited=a.event.event_id)}}})}}},editing(e){this.$emit("editing",e)},reply(){this.$emit("reply")},share(e){var t=Promise.resolve();return e.download&&(t=this.core.mtrx.getFile(this.chat,this.event).then(e=>b["a"].Base64.fromFile(e.file)).then(t=>(e.files=[t],Promise.resolve()))),t.then(()=>this.core.share(e))},downloadFile(){this.downloading=!0,this.core.mtrx.downloadFile(this.chat,this.event).catch(e=>(this.error=e.toString(),Promise.resolve(e))).then(e=>{this.downloading=!1,this.downloaded=!0,this.$store.commit("icon",{icon:"success",message:"Downloaded"})}).catch(e=>{this.$store.commit("icon",{icon:"error",message:"Downloading Failed"})})},getAudioUnencrypt(){this.core.mtrx.getAudioUnencrypt(this.chat,this.event).then(e=>{this.audioBuffer=e}).catch(e=>{})},decryptAudio(){var e=this;return Object(a["a"])((function*(){console.log("decryptAudiodecryptAudiodecryptAudiodecryptAudio"),e.core.mtrx.getAudio(e.chat,e.event).then(t=>{console.log("HE"),e.decryptedInfo=t}).catch(t=>{e.event.event.decryptKey=e.decryptKey={msgtype:"m.bad.encrypted"}})}))()},decryptImage(){var e=this;return Object(a["a"])((function*(){e.core.mtrx.getImage(e.chat,e.event).then(t=>{e.decryptedInfo=t}).catch(t=>{e.event.event.decryptKey=e.decryptKey={msgtype:"m.bad.encrypted"}})}))()},decryptAgain(){var e=this;return Object(a["a"])((function*(){return e.event.event.decrypted=null,e.decrypt()}))()},decrypt(){var t=this;return Object(a["a"])((function*(){if(console.log("this.event",t.event),t.event.event.decrypted)return t.decryptEvent=t.event.event.decrypted,Promise.resolve();try{var n=yield t.chat.pcrypto.decryptEvent(t.event.event);t.decryptEvent=n,t.event.event.decrypted=t.decryptEvent}catch(e){console.error(e),t.event.event.decrypted=t.decryptEvent={msgtype:"m.bad.encrypted"}}}))()},checkReaded:function(){this.event&&this.core.mtrx.isReaded(this.event).then(e=>{this.readed=e||null})},openImage:function(){this.$emit("openImageEvent",this.event)},removeEvent:function(e){this.$emit("removeEvent",e),this.removed=!0},menuIsVisibleHandler:function(e){this.$emit("menuIsVisible",e)},selectMessage:function(e){this.$emit("selectMessage",e)},removeMessage:function(e){this.$emit("removeMessage",e)},shareManyMessages:function(e){this.$emit("shareManyMessages",e)},messagesIsDeleted:function(e){this.$emit("messagesIsDeleted",e)}}},Me=Oe;function Ae(e){var t=r("72a7");t.__inject__&&t.__inject__(e)}var Pe=Object(h["a"])(Me,i,o,!1,Ae,"659136c0",null,!0);n["default"]=Pe.exports},"62c8":function(e,t,n){var r=n("b639"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},"62d6":function(e,t,n){"use strict";n.r(t);var r=n("96c4");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"62e4":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},6374:function(e,t,n){var r=n("da84"),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},6386:function(e,t,n){"use strict";n("d9e2");var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.EventTimelineSet=f;var i=n("faa1"),o=n("e685"),a=n("a120"),s=r(n("3987")),c=n("63c7"),l=n("3ed0");const u=!0;let d;function f(e,t){this.room=e,this._timelineSupport=Boolean(t.timelineSupport),this._liveTimeline=new o.EventTimeline(this),this._unstableClientRelationAggregation=!!t.unstableClientRelationAggregation,this._timelines=[this._liveTimeline],this._eventIdToTimeline={},this._filter=t.filter||null,this._unstableClientRelationAggregation&&(this._relations={})}d=u?c.logger.log.bind(c.logger):function(){},s.inherits(f,i.EventEmitter),f.prototype.getTimelines=function(){return this._timelines},f.prototype.getFilter=function(){return this._filter},f.prototype.setFilter=function(e){this._filter=e},f.prototype.getPendingEvents=function(){return this.room?this._filter?this._filter.filterRoomTimeline(this.room.getPendingEvents()):this.room.getPendingEvents():[]},f.prototype.getLiveTimeline=function(){return this._liveTimeline},f.prototype.eventIdToTimeline=function(e){return this._eventIdToTimeline[e]},f.prototype.replaceEventId=function(e,t){const n=this._eventIdToTimeline[e];n&&(delete this._eventIdToTimeline[e],this._eventIdToTimeline[t]=n)},f.prototype.resetLiveTimeline=function(e,t){const n=!this._timelineSupport||!t,r=this._liveTimeline,i=n?r.forkLive(o.EventTimeline.FORWARDS):r.fork(o.EventTimeline.FORWARDS);n?(this._timelines=[i],this._eventIdToTimeline={}):this._timelines.push(i),t&&r.setPaginationToken(t,o.EventTimeline.FORWARDS),i.setPaginationToken(e,o.EventTimeline.BACKWARDS),this._liveTimeline=i,this.emit("Room.timelineReset",this.room,this,n)},f.prototype.getTimelineForEvent=function(e){const t=this._eventIdToTimeline[e];return void 0===t?null:t},f.prototype.findEventById=function(e){const t=this.getTimelineForEvent(e);if(t)return s.findElement(t.getEvents(),(function(t){return t.getId()==e}))},f.prototype.addTimeline=function(){if(!this._timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");const e=new o.EventTimeline(this);return this._timelines.push(e),e},f.prototype.addEventsToTimeline=function(e,t,n,r){if(!n)throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");if(!t&&n==this._liveTimeline)throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");if(this._filter&&(e=this._filter.filterRoomTimeline(e),!e.length))return;const i=t?o.EventTimeline.BACKWARDS:o.EventTimeline.FORWARDS,a=t?o.EventTimeline.FORWARDS:o.EventTimeline.BACKWARDS;let s=!1,l=!1;for(let u=0;u{this.aggregateRelations(e)});const t=e.getRelation();if(!t)return;const n=t.event_id,r=t.rel_type,i=e.getType();let o=this._relations[n];o||(o=this._relations[n]={});let s=o[r];s||(s=o[r]={});let c,u=s[i],d=!1;u||(u=s[i]=new l.Relations(r,i,this.room),d=!0,c=this.findEventById(n)||this.room.getPendingEvent(n),c&&u.setTargetEvent(c)),u.addEvent(e),d&&c&&c.emit("Event.relationsCreated",r,i)}},"63c7":function(e,t,n){"use strict";var r=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var i=r(n("5c7d"));const o="matrix";i.default.methodFactory=function(e,t,n){return function(){for(var e=arguments.length,t=new Array(e),n=0;n{e.messages=e.messages||{},e.messages.chunk=e.messages.chunk||[],e.state=e.state||[];const n=l.map(l.deepCopy(e.state),t.getEventMapper()),r=l.map(e.state,t.getEventMapper()),i=l.map(e.messages.chunk,t.getEventMapper());return e.presence&&l.isArray(e.presence)&&e.presence.map(t.getEventMapper()).forEach((function(e){let n=t.store.getUser(e.getContent().user_id);n?n.setPresenceEvent(e):(n=w(t,e.getContent().user_id),n.setPresenceEvent(e),t.store.storeUser(n)),t.emit("event",e)})),e.messages.start&&(this._peekRoom.oldState.paginationToken=e.messages.start),this._peekRoom.oldState.setStateEvents(n),this._peekRoom.currentState.setStateEvents(r),this._resolveInvites(this._peekRoom),this._peekRoom.recalculate(),this._peekRoom.addEventsToTimeline(i.reverse(),!0,this._peekRoom.getLiveTimeline(),e.messages.start),t.store.storeRoom(this._peekRoom),t.emit("Room",this._peekRoom),this._peekPoll(this._peekRoom),this._peekRoom})},_.prototype.stopPeeking=function(){this._peekRoom=null},_.prototype._peekPoll=function(e,t){if(this._peekRoom!==e)return void b("Stopped peeking in room %s",e.roomId);const n=this;this.client._http.authedRequest(void 0,"GET","/events",{room_id:e.roomId,timeout:3e4,from:t},void 0,5e4).then((function(t){if(n._peekRoom!==e)return void b("Stopped peeking in room %s",e.roomId);t.chunk.filter((function(e){return"m.presence"===e.type})).map(n.client.getEventMapper()).forEach((function(e){let t=n.client.store.getUser(e.getContent().user_id);t?t.setPresenceEvent(e):(t=w(n.client,e.getContent().user_id),t.setPresenceEvent(e),n.client.store.storeUser(t)),n.client.emit("event",e)}));const r=t.chunk.filter((function(t){return t.room_id===e.roomId&&t.event_id})).map(n.client.getEventMapper());e.addLiveEvents(r),n._peekPoll(e,t.end)}),(function(r){h.logger.error("[%s] Peek poll failed: %s",e.roomId,r),setTimeout((function(){n._peekPoll(e,t)}),3e4)}))},_.prototype.getSyncState=function(){return this._syncState},_.prototype.getSyncStateData=function(){return this._syncStateData},_.prototype.recoverFromSyncStartupError=function(){var e=i((function*(e,t){yield e;const n=this._startKeepAlives();this._updateSyncState("ERROR",{error:t}),yield n}));return function(t,n){return e.apply(this,arguments)}}(),_.prototype._wasLazyLoadingToggled=function(){var e=i((function*(e){e=!!e;let t=!1;const n=yield this.client.store.isNewlyCreated();if(!n){const n=yield this.client.store.getClientOptions();return n&&(t=!!n.lazyLoadMembers),t!==e}return!1}));return function(t){return e.apply(this,arguments)}}(),_.prototype._shouldAbortSync=function(e){return"M_UNKNOWN_TOKEN"===e.errcode&&(h.logger.warn("Token no longer valid - assuming logout"),this.stop(),!0)},_.prototype.sync=function(){var e=this;const n=this.client,r=this;this._running=!0,t.window&&t.window.addEventListener&&(this._onOnlineBound=this._onOnline.bind(this),t.window.addEventListener("online",this._onOnlineBound,!1));let o=Promise.resolve(),a=null;function s(){return c.apply(this,arguments)}function c(){return c=i((function*(){try{b("Getting push rules...");const e=yield n.getPushRules();b("Got push rules"),n.pushRules=e}catch(e){if(h.logger.error("Getting push rules failed",e),r._shouldAbortSync(e))return;return b("Waiting for saved sync before retrying push rules..."),yield r.recoverFromSyncStartupError(o,e),void s()}d()})),c.apply(this,arguments)}function l(){const e=new u.Filter(n.credentials.userId);return e.setTimelineLimit(r.opts.initialSyncLimit),e}const d=function(){var t=i((function*(){if(b("Checking lazy load status..."),e.opts.lazyLoadMembers&&n.isGuest()&&(e.opts.lazyLoadMembers=!1),e.opts.lazyLoadMembers){b("Checking server lazy load support...");const t=yield n.doesServerSupportLazyLoading();t?(b("Enabling lazy load on sync filter..."),e.opts.filter||(e.opts.filter=l()),e.opts.filter.setLazyLoadMembers(!0)):(b("LL: lazy loading requested but not supported by server, so disabling"),e.opts.lazyLoadMembers=!1)}b("Checking whether lazy loading has changed in store...");const t=yield e._wasLazyLoadingToggled(e.opts.lazyLoadMembers);if(t){e._storeIsInvalid=!0;const t=p.InvalidStoreError.TOGGLED_LAZY_LOADING,n=new p.InvalidStoreError(t,!!e.opts.lazyLoadMembers);return e._updateSyncState("ERROR",{error:n}),void h.logger.warn("InvalidStoreError: store is not usable: stopping sync.")}e.opts.lazyLoadMembers&&e.opts.crypto&&e.opts.crypto.enableLazyLoading();try{b("Storing client options..."),yield e.client._storeClientOptions(),b("Stored client options")}catch(r){throw h.logger.error("Storing client options failed",r),r}f()}));return function(){return t.apply(this,arguments)}}();function f(){return m.apply(this,arguments)}function m(){return m=i((function*(){let e,t;b("Getting filter..."),e=r.opts.filter?r.opts.filter:l();try{t=yield n.getOrCreateFilter(y(n.credentials.userId),e)}catch(i){if(h.logger.error("Getting filter failed",i),r._shouldAbortSync(i))return;return b("Waiting for saved sync before retrying filter..."),yield r.recoverFromSyncStartupError(o,i),void f()}n.resetNotifTimelineSet(),null===r._currentSyncRequest&&(b("Sending first sync request..."),r._currentSyncRequest=r._doSyncRequest({filterId:t},a)),b("Waiting for saved sync before starting sync processing..."),yield o,r._sync({filterId:t})})),m.apply(this,arguments)}n.isGuest()?r._sync({}):(b("Getting saved sync token..."),o=n.store.getSavedSyncToken().then(e=>(b("Got saved sync token"),a=e,b("Getting saved sync..."),n.store.getSavedSync())).then(e=>{if(b("Got reply from saved sync, exists? "+!!e),e)return r._syncFromCache(e)}).catch(e=>{h.logger.error("Getting saved sync failed",e)}),s())},_.prototype.stop=function(){b("SyncApi.stop"),t.window&&(t.window.removeEventListener("online",this._onOnlineBound,!1),this._onOnlineBound=void 0),this._running=!1,this._currentSyncRequest&&this._currentSyncRequest.abort(),this._keepAliveTimer&&(clearTimeout(this._keepAliveTimer),this._keepAliveTimer=null)},_.prototype.retryImmediately=function(){return!!this._connectionReturnedDefer&&(this._startKeepAlives(0),!0)},_.prototype._syncFromCache=function(){var t=i((function*(t){b("sync(): not doing HTTP hit, instead returning stored /sync data");const n=t.nextBatch;this.client.store.setSyncToken(n);const r={oldSyncToken:null,nextSyncToken:n,catchingUp:!1,fromCache:!0},i={next_batch:n,rooms:t.roomsData,groups:t.groupsData,account_data:{events:t.accountData}};try{yield this._processSyncResponse(r,i)}catch(e){h.logger.error("Error processing cached sync",e.stack||e)}this._storeIsInvalid||this._updateSyncState("PREPARED",r)}));return function(e){return t.apply(this,arguments)}}(),_.prototype._sync=function(){var t=i((function*(t){const n=this.client;if(!this._running)return b("Sync no longer running: exiting."),this._connectionReturnedDefer&&(this._connectionReturnedDefer.reject(),this._connectionReturnedDefer=null),void this._updateSyncState("STOPPED");const r=n.store.getSyncToken();let i;try{null===this._currentSyncRequest&&(this._currentSyncRequest=this._doSyncRequest(t,r)),i=yield this._currentSyncRequest}catch(e){return void this._onSyncError(e,t)}finally{this._currentSyncRequest=null}n.store.setSyncToken(i.next_batch),this._failedSyncCount=0,yield n.store.setSyncData(i);const o={oldSyncToken:r,nextSyncToken:i.next_batch,catchingUp:this._catchingUp};this.opts.crypto&&(yield this.opts.crypto.onSyncWillProcess(o));try{yield this._processSyncResponse(o,i)}catch(e){h.logger.error("Caught /sync error",e.stack||e),this.client.emit("sync.unexpectedError",e)}o.catchingUp=this._catchingUp,t.hasSyncedBefore||(this._updateSyncState("PREPARED",o),t.hasSyncedBefore=!0),this.opts.crypto&&(yield this.opts.crypto.onSyncCompleted(o)),this._updateSyncState("SYNCING",o),n.store.wantsSave()&&(this.opts.crypto&&(yield this.opts.crypto.saveDeviceList(0)),n.store.save()),this._sync(t)}));return function(e){return t.apply(this,arguments)}}(),_.prototype._doSyncRequest=function(e,t){const n=this._getSyncParams(e,t);return this.client._http.authedRequest(void 0,"GET","/sync",n,void 0,n.timeout+v)},_.prototype._getSyncParams=function(e,t){let n=this.opts.pollTimeout;("SYNCING"!==this.getSyncState()||this._catchingUp)&&(this._catchingUp=!0,n=0);let r=e.filterId;this.client.isGuest()&&!r&&(r=this._getGuestFilter());const i={filter:r,timeout:n};return this.opts.disablePresence&&(i.set_presence="offline"),t?i.since=t:i._cacheBuster=Date.now(),"ERROR"!=this.getSyncState()&&"RECONNECTING"!=this.getSyncState()||(i.timeout=0),i},_.prototype._onSyncError=function(e,t){if(!this._running)return b("Sync no longer running: exiting"),this._connectionReturnedDefer&&(this._connectionReturnedDefer.reject(),this._connectionReturnedDefer=null),void this._updateSyncState("STOPPED");h.logger.error("/sync error %s",e),h.logger.error(e),this._shouldAbortSync(e)||(this._failedSyncCount++,h.logger.log("Number of consecutive failed sync requests:",this._failedSyncCount),b("Starting keep-alive"),this._startKeepAlives().then(e=>{e&&"ERROR"===this.getSyncState()&&this._updateSyncState("CATCHUP",{oldSyncToken:null,nextSyncToken:null,catchingUp:!0}),this._sync(t)}),this._currentSyncRequest=null,this._updateSyncState(this._failedSyncCount>=g?"ERROR":"RECONNECTING",{error:e}))},_.prototype._processSyncResponse=function(){var e=i((function*(e,t){const n=this.client,r=this;if(t.presence&&l.isArray(t.presence.events)&&t.presence.events.map(n.getEventMapper()).forEach((function(e){let t=n.store.getUser(e.getSender());t?t.setPresenceEvent(e):(t=w(n,e.getSender()),t.setPresenceEvent(e),n.store.storeUser(t)),n.emit("event",e)})),t.account_data&&l.isArray(t.account_data.events)){const e=t.account_data.events.map(n.getEventMapper()),r=e.reduce((e,t)=>(e[t.getId()]=n.store.getAccountData(t.getType()),e),{});n.store.storeAccountDataEvents(e),e.forEach((function(e){if("m.push_rules"===e.getType()){const t=e.getContent();n.pushRules=f.PushProcessor.rewriteDefaultRules(t)}const t=r[e.getId()];return n.emit("accountData",e,t),e}))}if(t.to_device&&l.isArray(t.to_device.events)&&t.to_device.events.length>0){const e=[];t.to_device.events.map(n.getEventMapper()).map(t=>{if("m.key.verification.cancel"===t.getType()){const n=t.getContent()["transaction_id"];n&&e.push(n)}return t}).forEach((function(t){const r=t.getContent();if("m.room.message"!=t.getType()||"m.bad.encrypted"!=r.msgtype){if("m.key.verification.start"===t.getType()||"m.key.verification.request"===t.getType()){const n=r["transaction_id"];e.includes(n)&&t.flagCancelled()}n.emit("toDeviceEvent",t)}else h.logger.log("Ignoring undecryptable to-device event from "+t.getSender())}))}else this._catchingUp=!1;t.groups&&(t.groups.invite&&this._processGroupSyncEntry(t.groups.invite,"invite"),t.groups.join&&this._processGroupSyncEntry(t.groups.join,"join"),t.groups.leave&&this._processGroupSyncEntry(t.groups.leave,"leave"));let o=[],a=[],s=[];if(t.rooms&&(t.rooms.invite&&(o=this._mapSyncResponseToRoomArray(t.rooms.invite)),t.rooms.join&&(a=this._mapSyncResponseToRoomArray(t.rooms.join)),t.rooms.leave&&(s=this._mapSyncResponseToRoomArray(t.rooms.leave))),this._notifEvents=[],o.forEach((function(e){const t=e.room,i=r._mapSyncEventsFormat(e.invite_state,t);r._processRoomEvents(t,i),e.isBrandNewRoom&&(t.recalculate(),n.store.storeRoom(t),n.emit("Room",t)),i.forEach((function(e){n.emit("event",e)})),t.updateMyMembership("invite")})),yield l.promiseMapSeries(a,function(){var t=i((function*(t){const o=t.room,a=r._mapSyncEventsFormat(t.state,o),s=r._mapSyncEventsFormat(t.timeline,o),c=r._mapSyncEventsFormat(t.ephemeral),u=r._mapSyncEventsFormat(t.account_data);if(t.unread_notifications){o.setUnreadNotificationCount("total",t.unread_notifications.notification_count);const e=n.isRoomEncrypted(o.roomId);(!e||e&&o.getUnreadNotificationCount("highlight")<=0)&&o.setUnreadNotificationCount("highlight",t.unread_notifications.highlight_count)}if(t.timeline=t.timeline||{},t.isBrandNewRoom)o.getLiveTimeline().setPaginationToken(t.timeline.prev_batch,d.EventTimeline.BACKWARDS);else if(t.timeline.limited){let i=!0;for(let e=s.length-1;e>=0;e--){const t=s[e].getId();if(o.getTimelineForEvent(t)){b("Already have event "+t+" in limited sync - not resetting"),i=!1,s.splice(0,e);break}}i&&(r._deregisterStateListeners(o),o.resetLiveTimeline(t.timeline.prev_batch,r.opts.canResetEntireTimeline(o.roomId)?null:e.oldSyncToken),n.resetNotifTimelineSet(),r._registerStateListeners(o))}function f(e){return h.apply(this,arguments)}function h(){return h=i((function*(e){if(n.emit("event",e),e.isState()&&"m.room.encryption"==e.getType()&&r.opts.crypto&&(yield r.opts.crypto.onCryptoEvent(e)),e.isState()&&"im.vector.user_status"===e.getType()){let t=n.store.getUser(e.getStateKey());t?t._unstable_updateStatusMessage(e):(t=w(n,e.getStateKey()),t._unstable_updateStatusMessage(e),n.store.storeUser(t))}})),h.apply(this,arguments)}r._processRoomEvents(o,a,s,e.fromCache),t.summary&&o.setSummary(t.summary),o.addEphemeralEvents(c),o.addAccountData(u),o.recalculate(),t.isBrandNewRoom&&(n.store.storeRoom(o),n.emit("Room",o)),r._processEventsForNotifs(o,s),yield l.promiseMapSeries(a,f),yield l.promiseMapSeries(s,f),c.forEach((function(e){n.emit("event",e)})),u.forEach((function(e){n.emit("event",e)})),o.updateMyMembership("join")}));return function(e){return t.apply(this,arguments)}}()),s.forEach((function(e){const t=e.room,i=r._mapSyncEventsFormat(e.state,t),o=r._mapSyncEventsFormat(e.timeline,t),a=r._mapSyncEventsFormat(e.account_data);r._processRoomEvents(t,i,o),t.addAccountData(a),t.recalculate(),e.isBrandNewRoom&&(n.store.storeRoom(t),n.emit("Room",t)),r._processEventsForNotifs(t,o),i.forEach((function(e){n.emit("event",e)})),o.forEach((function(e){n.emit("event",e)})),a.forEach((function(e){n.emit("event",e)})),t.updateMyMembership("leave")})),e.oldSyncToken&&this._notifEvents.length&&(this._notifEvents.sort((function(e,t){return e.getTs()-t.getTs()})),this._notifEvents.forEach((function(e){n.getNotifTimelineSet().addLiveEvent(e)}))),t.device_lists&&this.opts.crypto&&(yield this.opts.crypto.handleDeviceListChanges(e,t.device_lists)),this.opts.crypto&&t.device_one_time_keys_count){const e=t.device_one_time_keys_count.signed_curve25519||0;this.opts.crypto.updateOneTimeKeyCount(e)}if(this.opts.crypto&&t["org.matrix.msc2732.device_unused_fallback_key_types"]){const e=t["org.matrix.msc2732.device_unused_fallback_key_types"];this.opts.crypto.setNeedsNewFallback(e instanceof Array&&!e.includes("signed_curve25519"))}}));return function(t,n){return e.apply(this,arguments)}}(),_.prototype._startKeepAlives=function(e){void 0===e&&(e=2e3+Math.floor(5e3*Math.random())),null!==this._keepAliveTimer&&clearTimeout(this._keepAliveTimer);const t=this;return e>0?t._keepAliveTimer=setTimeout(t._pokeKeepAlive.bind(t),e):t._pokeKeepAlive(),this._connectionReturnedDefer||(this._connectionReturnedDefer=l.defer()),this._connectionReturnedDefer.promise},_.prototype._pokeKeepAlive=function(e){void 0===e&&(e=!1);const t=this;function n(){clearTimeout(t._keepAliveTimer),t._connectionReturnedDefer&&(t._connectionReturnedDefer.resolve(e),t._connectionReturnedDefer=null)}this.client._http.request(void 0,"GET","/_matrix/client/versions",void 0,void 0,{prefix:"",localTimeoutMs:15e3}).then((function(){n()}),(function(r){400==r.httpStatus||404==r.httpStatus?t._keepAliveTimer=setTimeout(n,2e3):(e=!0,t._keepAliveTimer=setTimeout(t._pokeKeepAlive.bind(t,e),5e3+Math.floor(5e3*Math.random())),t._updateSyncState("ERROR",{error:r}))}))},_.prototype._processGroupSyncEntry=function(e,t){for(const n of Object.keys(e)){const r=e[n];let i=this.client.store.getGroup(n);const o=null===i;null===i&&(i=this.createGroup(n)),r.profile&&i.setProfile(r.profile.name,r.profile.avatar_url),r.inviter&&i.setInviter({userId:r.inviter}),i.setMyMembership(t),o&&this.client.emit("Group",i)}},_.prototype._mapSyncResponseToRoomArray=function(e){const t=this.client,n=this;return l.keys(e).map((function(r){const i=e[r];let o=t.store.getRoom(r),a=!1;return o||(o=n.createRoom(r),a=!0),i.room=o,i.isBrandNewRoom=a,i}))},_.prototype._mapSyncEventsFormat=function(e,t){if(!e||!l.isArray(e.events))return[];const n=this.client.getEventMapper();return e.events.map((function(e){return t&&(e.room_id=t.roomId),n(e)}))},_.prototype._resolveInvites=function(e){if(!e||!this.opts.resolveInvitesToProfiles)return;const t=this.client;e.getMembersWithMembership("invite").forEach((function(n){if(n._requestedProfileInfo)return;n._requestedProfileInfo=!0;const r=t.getUser(n.userId);let i;i=r?Promise.resolve({avatar_url:r.avatarUrl,displayname:r.displayName}):t.getProfileInfo(n.userId),i.then((function(t){const r=n.events.member;"invite"===r.getContent().membership&&(r.getContent().avatar_url=t.avatar_url,r.getContent().displayname=t.displayname,n.setMembershipEvent(r,e.currentState))}),(function(e){}))}))},_.prototype._processRoomEvents=function(e,t,n,r){const i=e.getLiveTimeline(),o=0==i.getEvents().length;if(o){for(const e of t)this.client.getPushActionsForEvent(e);i.initialiseState(t)}this._resolveInvites(e),e.recalculate(),o||(e.oldState.setStateEvents(t||[]),e.currentState.setStateEvents(t||[])),e.addLiveEvents(n||[],null,r)},_.prototype._processEventsForNotifs=function(e,t){if(this.client.getNotifTimelineSet())for(let n=0;n>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var h=Object.keys(e);"alpha"in e&&(h.splice(h.indexOf("alpha"),1),this.valpha="number"===typeof e.alpha?e.alpha:0);var p=h.sort().join("");if(!(p in s))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=s[p];var v=i[this.model].labels,g=[];for(n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color,t=(299*e[0]+587*e[1]+114*e[2])/1e3;return t<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return l.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,c=1-s;return l.rgb(s*n.red()+c*r.red(),s*n.green()+c*r.green(),s*n.blue()+c*r.blue(),n.alpha()*i+r.alpha()*(1-i))}},Object.keys(i).forEach((function(e){if(-1===a.indexOf(e)){var t=i[e].channels;l.prototype[e]=function(){if(this.model===e)return new l(this);if(arguments.length)return new l(arguments,e);var n="number"===typeof arguments[t]?t:this.valpha;return new l(p(i[this.model][e].raw(this.color)).concat(n),e)},l[e]=function(n){return"number"===typeof n&&(n=m(o.call(arguments),t)),new l(n,e)}}})),e.exports=l},6967:function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))},o=this&&this.__generator||function(t,n){var r,i,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s)try{if(r=1,i&&(o=2&a[0]?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=0;t--){const n=this.data[t]>>>7&255;this.data[t]=this.data[t]<<1|e,e=n}this.data[o.SIZE-1]^=r.select(e,o.R,0),e=0}}o.SIZE=16,o.R=135,t.default=o},"6a45":function(e,t,n){var r=n("76a3");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("0017b470",r,e)}},"6b38":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".main-wrapper.minimized[data-v-c44504aa]:not(.active) .topheader{opacity:0}.main-wrapper.minimized[data-v-c44504aa]:not(.active) .encrypted{display:none}",""]),e.exports=t},"6beb":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".preloaderWrapperLocal[data-v-791cf1f7]{padding:.5em 0;text-align:center}.urlwrapper[data-v-791cf1f7]{margin-top:.25em}",""]),e.exports=t},"6bfd":function(e,t,n){"use strict";n.r(t);var r=n("94bc");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"6ce2":function(e){e.exports=JSON.parse('{"caption":{"create":"Create","addPublicChatName":"Add Public Chat Name","addGroupNamePlaceHolder":"Add Group Name","createPublicChat":"Create public chat","chatTopic":"Topic renamed","asModerator":"as moderator","marked":"marked","unmarked":"unmarked","removeBan":"Remove Ban","cancelModeration":"Remove moderation","uploadFiles":"Herunterladen von Dateien","header":"Header","dragAndDropAFile":"Drag & Drop-Datei","chatInvite":"Sie wurden eingeladen mit Benutzer zu chatten:","cantJoion":"Sie können den Chat mit dem Benutzer nicht beitreten:","chatInviteDecline":"Sie können im Chat teilnehmen oder Einladung ablehnen","creatorLeft":"Weil der Schöpfer den Raum verlassen hat","encrypted":"Verschlüssel","noImages":"Es gibt noch keine Bilder in diesem Chat","noFiles":"There are no files in this chat yet","inviteUser":"Benutzer einladen","invite":"Einladen","add":"Hinzufügen","mute":"Stumm","unmute":"Ton aktivieren","leave":"Verlassen","Info":"Info","new":"Neue","typing":"Tippt","accNotFound":"Ihr Konto wurde nicht in der Blockchain gefunden. Vielleicht müssen Sie warten","emptyList":"liste ist leer ( gefiltert oder nur leer )","welcome":"Willkommen bei Pocketnet Chat","startNewChat":"Fangen Sie einen neuen chat an","chats":"Chats","shareWith":"Teilen mit","newChat":"Neuer Chat","moveToChat":"Zum Chat wechseln","queryNoResults":"Abfrage meldet keine Ergebnisse","needMoreCharacters":"Benötigen Sie mehr Zeichen für das Ergebnis","createGroup":"Gruppe erstellen","unabletoDecrypt":"* Kann nicht entschlüsselnt","messageDeleted":"Nachricht gelöscht","sentImage":"gesendetes Bild","sentVoiceMessage":"eine Sprachnachricht gesendet","invitationToChat":"Einladung zum Chat","invitationToRoom":"Invitation to room","leftChat":"Hat den chat verlasst","joined":"beitretet","chatRenamed":"Chat umbenannt in","recentComment":"Letzter Kommentar:","share":"AKTIE","followers":"Anhänger:","reputation":"Reputation:","following":"Folgen:","theme":"Thema:","contacts":"Kontakte","phoneContacts":"Telefonische Kontakte","chooseInviteMedia":"Bitte wählen Sie, wie Sie einladen möchten","admin":"Admin","moderator":"Moderator","videocall":"Videoanrufe","call":"Anruf","leaveAndDelete":"Verlassen und Löschen","donate":"Donate","makeModerator":"Als Moderator ernennen","ban":"Ban","kick":"Kick","members":"Mitglieds","media":"Media","files":"Datei","contactsList":"Kontaktliste","send":"Senden","pageCaption":"Seite Beschriftung","caption":"Beschriftung","text":"Text","placeholder":"Platzhalter","sendTransactionTo":"Transaktion senden an","toBePaidByReceiver":"Zahlung durch den Empfänger","toBePaidBySender":"Zahlung durch Absender","source":"Quelle","amount":"Anzahl","receiver":"Empfänger","message":"Nachricht","includeFeesInAmount":"Gebühren in den Betrag einbeziehen","transactionFees":"Gebühren pro Transaktion","totalAmount":"Insgesamt","balanceTooLow":"Bilanz zu niedrig","transactionError":"Fehler: Transaktion kann nicht ausgeführt werden","calculateFees":"Gebühren berechnen","startChatWith":"Chat anfangen mit","searchResult":"Ergebnis der Suche","joinedInTheChat":"in den Chat eingeloggt","invited":"eingeladet ","hasInvited":"eingeladen ","inTheChat":" in den chat","banned":"banned","andRoom":"und Zimmer","left":"verließt","theChat":" Chat ","made":"Gemacht ","aModerator":" Moderator","editedChatNameTo ":"änderte den Chat-Namen in ","somebody":"Jemand","sent":"gesendet","PKOINto":" PKOIN für ","response":"Antwort","edited":"Bearbeitet","settings":"Einstellungen","unauthorized":"Nicht autorisiert","search":"Suche","replyOnMessage":"Antwort auf Nachricht","editMessage":"Nachricht bearbeiten","inviteFriend":"Пригласите друзей","emptyContactList":"Список контактов пуст","joinApp":"Pocketnet beitreten","hasInvitedToJoin":"hat Sie eingeladen, Pocketnet beizutreten","messagefrom":"Forwarded message from","usernotgen":"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.","younotgen":"Please wait a minute, Your encryption keys are being generated...","chatsearchingempty":"No chats found for the specified filter","sendmessage":"Send message"},"input":{"patientEmailPlaceholder":"Email","refillNamePlaceholder":"Den Namen Nachfüllen"},"message":{},"button":{"starChatButton":"Chat anfangen","decline":"Ablehnen","join":"Beitreten","ok":"Ok","copy":"Kopieren","forward":"Weiterleiten","delete":"Löschen","save":"Speichern","reply":"Antworten","share":"Share","download":"Herunterladen","downloaded":"Herunterladen","goToPocketnetProfile":"Zum Pocketnet Profil","sendFile":"Datai senden","takePhotoOrVideo":"Foto machen","sendCoins":"Münzen senden","edit":"Bearbeiten","select":"Auswählen","block":"Sperren","unblock":"Entsperren","blockUser":"Benutzer sperren"},"yes":"Ja","cancel":"Abbrechen","teamMessages":{"1-title":"Willkommen beim privaten Bastyon-Chat!","1-list1":"Privater Messenger, der NICHT mit Ihrer Telefonnummer verbunden ist.","1-list2":"Standardmäßig Ende-zu-Ende-Verschlüsselung jedes 1-zu-1-Gesprächs","1-list3":"Alle per Chat gesendeten oder empfangenen Bilder werden verschlüsselt gespeichert","1-list4":"Der Nachrichtenverlauf wird nur 7 Tage lang gespeichert","2-title":"Eine riesige Ankündigung! Die Pocketnet-Anwendung heißt jetzt Bastyon!","2-message1":"Die Domain wird auf Bastyon.com verschoben. Wir haben kürzlich die folgenden wichtigen Updates veröffentlicht:","2-list1":"Privater verschlüsselter Messenger, der nicht mit Ihrer Telefonnummer verbunden ist","2-list2":"Möglichkeit, PKOIN an Blogger zu spenden","2-list3":"Video- und Live-Streaming","2-message2":"Laden Sie jetzt Ihre Freunde ein und werden Sie Teil der großen Zukunft des dezentralen Internets!","2-button":"Freunde einladen"},"sendingerror":"An error occurred while sending the message","details":"Details","settings_pin":"Pin chat window","checked":"Yes","unchecked":"No","settings_read":"Send read receipts","messagewasburn":"This message remains only in the memory of your device","messagewillburn":"The message will be deleted soon","micaccessbrowser":"Access to the microphone is restricted, please check your browser settings.","micaccesscommonproblem":"Sorry, for some reason it is not possible to record voice messages on the device","micaccesscordova":"Access to the microphone is restricted, please check your device settings.","micdevicenotfound":"Audio recording device not found"}')},"6de4":function(e){e.exports=JSON.parse('{"0":"O","1":"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ","ﱞ":"ﹲّ","ࣲ":"ٍ","ﱟ":"ﹴّ","ﳲ":"ﹷّ","ﱠ":"ﹶّ","ﳳ":"ﹹّ","ﱡ":"ﹸّ","ؚ":"ِ","̗":"ِ","ﳴ":"ﹻّ","ﱢ":"ﹺّ","ﱣ":"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\\u2028":" ","\\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":","ː":":","ꓽ":":","⩴":"::=","⧴":":→","!":"!","ǃ":"!","ⵑ":"!","‼":"!!","⁉":"!?","ʔ":"?","Ɂ":"?","ॽ":"?","Ꭾ":"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·","ᐧ":"·","⋯":"···","ⵈ":"···","ᑄ":"·<","⋗":"·>","ᐷ":"·>","ᑀ":"·>","ᔯ":"·4","ᑾ":"·b","ᒀ":"·ḃ","ᑺ":"·d","ᒘ":"·J","ᒶ":"·L","ᑶ":"·P","ᑗ":"·U","ᐺ":"·V","ᐼ":"·Ʌ","ᒮ":"·Γ","ᐎ":"·Δ","ᑙ":"·Ո","ᐌ":"·ᐁ","ᐐ":"·ᐄ","ᐒ":"·ᐅ","ᐔ":"·ᐆ","ᐗ":"·ᐊ","ᐙ":"·ᐋ","ᐾ":"·ᐲ","ᑂ":"·ᐴ","ᑆ":"·ᐹ","ᑛ":"·ᑏ","ᑔ":"·ᑐ","ᑝ":"·ᑐ","ᑟ":"·ᑑ","ᑡ":"·ᑕ","ᑣ":"·ᑖ","ᑴ":"·ᑫ","ᑸ":"·ᑮ","ᑼ":"·ᑰ","ᒒ":"·ᒉ","ᒔ":"·ᒋ","ᒖ":"·ᒌ","ᒚ":"·ᒎ","ᒜ":"·ᒐ","ᒞ":"·ᒑ","ᒬ":"·ᒣ","ᒰ":"·ᒦ","ᒲ":"·ᒧ","ᒴ":"·ᒨ","ᒸ":"·ᒫ","ᓉ":"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ","ᓋ":"·ᓇ","ᓍ":"·ᓈ","ᓜ":"·ᓓ","ᓞ":"·ᓕ","ᓠ":"·ᓖ","ᓢ":"·ᓗ","ᓤ":"·ᓘ","ᓦ":"·ᓚ","ᓨ":"·ᓛ","ᓶ":"·ᓭ","ᓸ":"·ᓯ","ᓺ":"·ᓰ","ᓼ":"·ᓱ","ᓾ":"·ᓲ","ᔀ":"·ᓴ","ᔂ":"·ᓵ","ᔗ":"·ᔐ","ᔙ":"·ᔑ","ᔛ":"·ᔒ","ᔝ":"·ᔓ","ᔟ":"·ᔔ","ᔡ":"·ᔕ","ᔣ":"·ᔖ","ᔱ":"·ᔨ","ᔳ":"·ᔩ","ᔵ":"·ᔪ","ᔷ":"·ᔫ","ᔹ":"·ᔭ","ᔻ":"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ","ᕎ":"·ᕌ","ᕛ":"·ᕚ","ᕨ":"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"\'","'":"\'","‘":"\'","’":"\'","‛":"\'","′":"\'","‵":"\'","՚":"\'","׳":"\'","`":"\'","`":"\'","`":"\'","´":"\'","΄":"\'","´":"\'","᾽":"\'","᾿":"\'","῾":"\'","ʹ":"\'","ʹ":"\'","ˈ":"\'","ˊ":"\'","ˋ":"\'","˴":"\'","ʻ":"\'","ʽ":"\'","ʼ":"\'","ʾ":"\'","ꞌ":"\'","י":"\'","ߴ":"\'","ߵ":"\'","ᑊ":"\'","ᛌ":"\'","𖽑":"\'","𖽒":"\'","᳓":"\'\'","\\"":"\'\'",""":"\'\'","“":"\'\'","”":"\'\'","‟":"\'\'","″":"\'\'","‶":"\'\'","〃":"\'\'","״":"\'\'","˝":"\'\'","ʺ":"\'\'","˶":"\'\'","ˮ":"\'\'","ײ":"\'\'","‴":"\'\'\'","‷":"\'\'\'","⁗":"\'\'\'\'","Ɓ":"\'B","Ɗ":"\'D","ʼn":"\'n","Ƥ":"\'P","Ƭ":"\'T","Ƴ":"\'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬","く":"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/","〳":"/","Ⳇ":"/","ノ":"/","丿":"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\\\","﹨":"\\\\","∖":"\\\\","⟍":"\\\\","⧵":"\\\\","⧹":"\\\\","𝈏":"\\\\","𝈻":"\\\\","㇔":"\\\\","丶":"\\\\","⼂":"\\\\","⳹":"\\\\\\\\","⑊":"\\\\\\\\","⟈":"\\\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ","ъ":"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵","ð":"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<","ᐸ":"<","ᚲ":"<","⋖":"<·","Ⲵ":"<·","ᑅ":"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">","ᐳ":">","𖼿":">","ᑁ":">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー","ᅳ":"ー","ㅡ":"ー","一":"ー","⼀":"ー","ᆖ":"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ","ᆕ":"ーᅮ","ᅴ":"ー丨","ㅢ":"ー丨","ᆗ":"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2","Ƨ":"2","Ϩ":"2","Ꙅ":"2","ᒿ":"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁","ƻ":"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3","Ȝ":"3","Ʒ":"3","Ꝫ":"3","Ⳍ":"3","З":"3","Ӡ":"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂","Ҙ":"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4","Ꮞ":"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.","ᔰ":"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5","Ƽ":"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6","б":"6","Ꮾ":"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8","ȣ":"8","Ȣ":"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a","a":"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a","ɑ":"a","α":"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a","а":"a","ⷶ":"ͣ","A":"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A","Α":"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A","А":"A","Ꭺ":"A","ᗅ":"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲","ǎ":"ă","Ǎ":"Ă","ȧ":"å","Ȧ":"Å","ẚ":"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA","æ":"ae","ӕ":"ae","Æ":"AE","Ӕ":"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ","ᗄ":"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b","Ƅ":"b","Ь":"b","Ꮟ":"b","ᑲ":"b","ᖯ":"b","B":"B","ℬ":"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B","Β":"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B","В":"B","Ᏼ":"B","ᗷ":"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B","ɓ":"b̔","ᑳ":"ḃ","ƃ":"b̄","Ƃ":"b̄","Б":"b̄","ƀ":"b̵","ҍ":"b̵","Ҍ":"b̵","ѣ":"b̵","Ѣ":"b̵","ᑿ":"b·","ᒁ":"ḃ·","ᒈ":"b\'","Ы":"bl","в":"ʙ","ᏼ":"ʙ","c":"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c","ϲ":"c","ⲥ":"c","с":"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C","C":"C","Ⅽ":"C","ℂ":"C","ℭ":"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C","С":"C","Ꮯ":"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠","ç":"c̦","ҫ":"c̦","Ç":"C̦","Ҫ":"C̦","Ƈ":"C\'","℅":"c/o","℆":"c/u","🅭":"㏄\\t⃝","⋴":"ꞓ","ɛ":"ꞓ","ε":"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ","є":"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ","Є":"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d","Ꮷ":"d","ᑯ":"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D","Ꭰ":"D","ᗞ":"D","ᗪ":"D","ꓓ":"D","ɗ":"d̔","ɖ":"d̨","ƌ":"d̄","đ":"d̵","Đ":"D̵","Ð":"D̵","Ɖ":"D̵","₫":"ḏ̵","ꝺ":"Ꝺ","ᑻ":"d·","ᒇ":"d\'","ʤ":"dȝ","dz":"dz","ʣ":"dz","Dz":"Dz","DZ":"DZ","dž":"dž","Dž":"Dž","DŽ":"DŽ","ʥ":"dʑ","ꭰ":"ᴅ","⸹":"ẟ","δ":"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ","ծ":"ẟ","ᕷ":"ẟ","℮":"e","e":"e","ℯ":"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e","е":"e","ҽ":"e","ⷷ":"ͤ","⋿":"E","E":"E","ℰ":"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E","Ε":"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E","Е":"E","ⴹ":"E","Ꭼ":"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E","ě":"ĕ","Ě":"Ĕ","ɇ":"e̸","Ɇ":"E̸","ҿ":"ę","ꭼ":"ᴇ","ə":"ǝ","ә":"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ","ɚ":"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵","Ә":"Ə","𝈡":"Ɛ","ℇ":"Ɛ","Ԑ":"Ɛ","Ꮛ":"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ","з":"ɜ","ҙ":"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f","ſ":"f","ẝ":"f","ք":"f","𝈓":"F","ℱ":"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F","Ϝ":"F","𝟊":"F","ᖴ":"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F","ƒ":"f̦","Ƒ":"F̦","ᵮ":"f̴","℻":"FAX","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ʩ":"fŋ","ᖵ":"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ","ᖷ":"ꟻ","g":"g","ℊ":"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g","ɡ":"g","ᶃ":"g","ƍ":"g","ց":"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G","Ꮐ":"G","Ᏻ":"G","ꓖ":"G","ᶢ":"ᵍ","ɠ":"g̔","ǧ":"ğ","Ǧ":"Ğ","ǵ":"ģ","ǥ":"g̵","Ǥ":"G̵","Ɠ":"G\'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ","h":"h","ℎ":"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h","һ":"h","հ":"h","Ꮒ":"h","H":"H","ℋ":"H","ℌ":"H","ℍ":"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H","Η":"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H","Н":"H","Ꮋ":"H","ᕼ":"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ","ɦ":"h̔","ꚕ":"h̔","Ᏺ":"h̔","Ⱨ":"H̩","Ң":"H̩","ħ":"h̵","ℏ":"h̵","ћ":"h̵","Ħ":"H̵","Ӊ":"H̦","Ӈ":"H̦","н":"ʜ","ꮋ":"ʜ","ң":"ʜ̩","ӊ":"ʜ̦","ӈ":"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ","Ꭸ":"Ⱶ","Ꮀ":"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i","i":"i","ⅰ":"i","ℹ":"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i","ı":"i","𝚤":"i","ɪ":"i","ɩ":"i","ι":"i","ι":"i","ͺ":"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i","і":"i","ꙇ":"i","ӏ":"i","ꭵ":"i","Ꭵ":"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲","ǐ":"ĭ","Ǐ":"Ĭ","ɨ":"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii","ij":"ij","ⅳ":"iv","ⅸ":"ix","j":"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j","ϳ":"j","ј":"j","J":"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J","Ј":"J","Ꭻ":"J","ᒍ":"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵","ᒙ":"J·","𝚥":"ȷ","յ":"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k","K":"K","K":"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K","Κ":"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K","К":"K","Ꮶ":"K","ᛕ":"K","ꓗ":"K","𐔘":"K","ƙ":"k̔","Ⱪ":"K̩","Қ":"K̩","₭":"K̵","Ꝁ":"K̵","Ҟ":"K̵","Ƙ":"K\'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l","I":"l","I":"l","Ⅰ":"l","ℐ":"l","ℑ":"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l","Ɩ":"l","l":"l","ⅼ":"l","ℓ":"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l","ǀ":"l","Ι":"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l","І":"l","Ӏ":"l","ו":"l","ן":"l","ا":"l","𞸀":"l","𞺀":"l","ﺎ":"l","ﺍ":"l","ߊ":"l","ⵏ":"l","ᛁ":"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L","ℒ":"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L","Ꮮ":"L","ᒪ":"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L","ﴼ":"l̋","ﴽ":"l̋","ł":"l̸","Ł":"L̸","ɭ":"l̨","Ɨ":"l̵","ƚ":"l̵","ɫ":"l̴","إ":"lٕ","ﺈ":"lٕ","ﺇ":"lٕ","ٳ":"lٕ","ŀ":"l·","Ŀ":"l·","ᒷ":"l·","🄂":"l,","⒈":"l.","ױ":"l\'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点","lj":"lj","IJ":"lJ","Lj":"Lj","LJ":"LJ","‖":"ll","∥":"ll","Ⅱ":"ll","ǁ":"ll","װ":"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点","Ю":"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点","ʪ":"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX","ɮ":"lȝ","ʫ":"lz","أ":"lٴ","ﺄ":"lٴ","ﺃ":"lٴ","ٲ":"lٴ","ٵ":"lٴ","ﷳ":"lكبر","ﷲ":"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ","M":"M","Ⅿ":"M","ℳ":"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M","Μ":"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M","М":"M","Ꮇ":"M","ᗰ":"M","ᛖ":"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"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","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊","ɳ":"n̨","ƞ":"n̩","η":"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩","Ɲ":"N̦","ᵰ":"n̴","nj":"nj","Nj":"Nj","NJ":"NJ","№":"No","ͷ":"ᴎ","и":"ᴎ","𐑍":"ᴎ","ņ":"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o","o":"o","ℴ":"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o","ο":"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o","σ":"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o","о":"o","ჿ":"o","օ":"o","ס":"o","ه":"o","𞸤":"o","𞹤":"o","𞺄":"o","ﻫ":"o","ﻬ":"o","ﻪ":"o","ﻩ":"o","ھ":"o","ﮬ":"o","ﮭ":"o","ﮫ":"o","ﮪ":"o","ہ":"o","ﮨ":"o","ﮩ":"o","ﮧ":"o","ﮦ":"o","ە":"o","ഠ":"o","ဝ":"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O","O":"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O","Ο":"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O","О":"O","Օ":"O","ⵔ":"O","ዐ":"O","ଠ":"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º","ǒ":"ŏ","Ǒ":"Ŏ","ۿ":"ô","Ő":"Ö","ø":"o̸","ꬾ":"o̸","Ø":"O̸","ⵁ":"O̸","Ǿ":"Ó̸","ɵ":"o̵","ꝋ":"o̵","ө":"o̵","ѳ":"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵","Ɵ":"O̵","Ꝋ":"O̵","θ":"O̵","ϑ":"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵","Θ":"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵","Ө":"O̵","Ѳ":"O̵","ⴱ":"O̵","Ꮎ":"O̵","Ꮻ":"O̵","ꭴ":"ơ","ﳙ":"oٰ","🄁":"O,","🄀":"O.","ơ":"o\'","Ơ":"O\'","Ꭴ":"O\'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀","œ":"oe","Œ":"OE","ɶ":"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO","ﳗ":"oج","ﱑ":"oج","ﳘ":"oم","ﱒ":"oم","ﶓ":"oمج","ﶔ":"oمم","ﱓ":"oى","ﱔ":"oى","ൟ":"oരo","တ":"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p","p":"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p","ρ":"p","ϱ":"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p","р":"p","P":"P","ℙ":"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P","Ρ":"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P","Р":"P","Ꮲ":"P","ᑭ":"P","ꓑ":"P","𐊕":"P","ƥ":"p̔","ᵽ":"p̵","ᑷ":"p·","ᒆ":"P\'","ᴩ":"ᴘ","ꮲ":"ᴘ","φ":"ɸ","ϕ":"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ","ф":"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q","գ":"q","զ":"q","ℚ":"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q","ʠ":"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ","κ":"ĸ","ϰ":"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ","к":"ĸ","ꮶ":"ĸ","қ":"ĸ̩","ҟ":"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r","г":"r","ꮁ":"r","𝈖":"R","ℛ":"R","ℜ":"R","ℝ":"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R","Ʀ":"R","Ꭱ":"R","Ꮢ":"R","𐒴":"R","ᖇ":"R","ꓣ":"R","𖼵":"R","ɽ":"r̨","ɼ":"r̩","ɍ":"r̵","ғ":"r̵","ᵲ":"r̴","ґ":"r\'","𑣣":"rn","m":"rn","ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸","ɱ":"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ","я":"ᴙ","ᵳ":"ɾ̴","℩":"ɿ","s":"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s","ƽ":"s","ѕ":"s","ꮪ":"s","𑣁":"s","𐑈":"s","S":"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S","Ѕ":"S","Տ":"S","Ꮥ":"S","Ꮪ":"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S","ʂ":"s̨","ᵴ":"s̴","ꞵ":"ß","β":"ß","ϐ":"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß","Ᏸ":"ß","🝜":"sss","st":"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ","Σ":"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T","T":"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T","Τ":"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T","Т":"T","Ꭲ":"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T","ƭ":"t̔","⍡":"T̈","Ⱦ":"T̸","Ț":"Ţ","Ʈ":"T̨","Ҭ":"T̩","₮":"T⃫","ŧ":"t̵","Ŧ":"T̵","ᵵ":"t̴","Ⴀ":"Ꞇ","Ꜩ":"T3","ʨ":"tɕ","℡":"TEL","ꝷ":"tf","ʦ":"ts","ʧ":"tʃ","ꜩ":"tȝ","τ":"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ","т":"ᴛ","ꭲ":"ᴛ","ҭ":"ᴛ̩","ţ":"ƫ","ț":"ƫ","Ꮏ":"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u","ʋ":"u","υ":"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u","ս":"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U","Ս":"U","ሀ":"U","𐓎":"U","ᑌ":"U","ꓴ":"U","𖽂":"U","𑢸":"U","ǔ":"ŭ","Ǔ":"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵","Ꮜ":"U̵","ᑘ":"U·","ᑧ":"U\'","ᵫ":"ue","ꭣ":"uo","ṃ":"ꭑ","պ":"ɰ","ሣ":"ɰ","℧":"Ʊ","ᘮ":"Ʊ","ᘴ":"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v","v":"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v","ν":"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v","ѵ":"v","ט":"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V","Ѵ":"V","ⴸ":"V","Ꮩ":"V","ᐯ":"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵","ᐻ":"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ","Λ":"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ","Л":"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ","ᐱ":"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦","ᐽ":"Ʌ·","ɯ":"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w","ѡ":"w","ԝ":"w","ա":"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W","Ꮃ":"W","Ꮤ":"W","ꓪ":"W","ѽ":"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ","м":"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x","x":"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x","х":"x","ᕁ":"x","ᕽ":"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X","X":"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X","Χ":"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X","Х":"X","ⵝ":"X","ᚷ":"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ","Ҳ":"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll","ɣ":"y","ᶌ":"y","y":"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y","ʏ":"y","ỿ":"y","ꭚ":"y","γ":"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y","у":"y","ү":"y","ყ":"y","𑣜":"y","Y":"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y","Υ":"Y","ϒ":"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y","У":"Y","Ү":"Y","Ꭹ":"Y","Ꮍ":"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y","ƴ":"y̔","ɏ":"y̵","ұ":"y̵","¥":"Y̵","Ɏ":"Y̵","Ұ":"Y̵","ʒ":"ȝ","ꝫ":"ȝ","ⳍ":"ȝ","ӡ":"ȝ","ჳ":"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z","Z":"Z","ℤ":"Z","ℨ":"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z","Ζ":"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z","Ꮓ":"Z","ꓜ":"Z","𑢩":"Z","ʐ":"z̨","ƶ":"z̵","Ƶ":"Z̵","ȥ":"z̦","Ȥ":"Z̦","ᵶ":"z̴","ƿ":"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ","ϩ":"ƨ","ꙅ":"ƨ","ь":"ƅ","ꮟ":"ƅ","ы":"ƅi","ꭾ":"ɂ","ˤ":"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ","Г":"Γ","Ꮁ":"Γ","ᒥ":"Γ","𖼇":"Γ","Ғ":"Γ̵","ᒯ":"Γ·","Ґ":"Γ\'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ","ᐃ":"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲","ᐏ":"Δ·","ᐬ":"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ","µ":"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ","ϖ":"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π","п":"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π","П":"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ","ϛ":"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ","Ф":"Φ","Փ":"Φ","ቀ":"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ","ѱ":"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ","Ѱ":"Ψ","𐓑":"Ψ","ᛘ":"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω","Ω":"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω","ᘯ":"Ω","ᘵ":"Ω","𐊶":"Ω","⍹":"ω̲","ώ":"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ","җ":"ж̩","Җ":"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И","Й":"Ѝ","Ҋ":"Ѝ̦","ѝ":"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ","Ꮗ":"Ѡ","ᗯ":"Ѡ","Ѽ":"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ","ӌ":"ҷ","Ӌ":"Ҷ","Ҿ":"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ","և":"եւ","ኔ":"ձ","ﬔ":"մե","ﬕ":"մի","ﬗ":"մխ","ﬓ":"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո","በ":"Ո","ᑎ":"Ո","ꓵ":"Ո","ᑚ":"Ո·","ᑨ":"Ո\'","ﬖ":"վն","₽":"Ք","˓":"ՙ","ʿ":"ՙ","ℵ":"א","ﬡ":"א","אָ":"אַ","אּ":"אַ","ﭏ":"אל","ℶ":"ב","ℷ":"ג","ℸ":"ד","ﬢ":"ד","ﬣ":"ה","יּ":"יִ","ﬤ":"כ","ﬥ":"ל","ﬦ":"ם","ﬠ":"ע","ﬧ":"ר","שׂ":"שׁ","שּ":"שׁ","שּׂ":"שּׁ","ﬨ":"ת","ﺀ":"ء","۽":"ء͈","ﺂ":"آ","ﺁ":"آ","ﭑ":"ٱ","ﭐ":"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب","ﺑ":"ب","ﺒ":"ب","ﺐ":"ب","ﺏ":"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ","ﲠ":"بo","ﳢ":"بo","ﲜ":"بج","ﰅ":"بج","ﲝ":"بح","ﰆ":"بح","ﷂ":"بحى","ﲞ":"بخ","ﰇ":"بخ","ﳒ":"بخ","ﱋ":"بخ","ﶞ":"بخى","ﱪ":"بر","ﱫ":"بز","ﲟ":"بم","ﳡ":"بم","ﱬ":"بم","ﰈ":"بم","ﱭ":"بن","ﱮ":"بى","ﰉ":"بى","ﱯ":"بى","ﰊ":"بى","ﭔ":"ٻ","ﭕ":"ٻ","ﭓ":"ٻ","ﭒ":"ٻ","ې":"ٻ","ﯦ":"ٻ","ﯧ":"ٻ","ﯥ":"ٻ","ﯤ":"ٻ","ﭜ":"ڀ","ﭝ":"ڀ","ﭛ":"ڀ","ﭚ":"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة","ö":"ة","ﺔ":"ة","ﺓ":"ة","ۃ":"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت","ﺗ":"ت","ﺘ":"ت","ﺖ":"ت","ﺕ":"ت","ﲥ":"تo","ﳤ":"تo","ﲡ":"تج","ﰋ":"تج","ﵐ":"تجم","ﶠ":"تجى","ﶟ":"تجى","ﲢ":"تح","ﰌ":"تح","ﵒ":"تحج","ﵑ":"تحج","ﵓ":"تحم","ﲣ":"تخ","ﰍ":"تخ","ﵔ":"تخم","ﶢ":"تخى","ﶡ":"تخى","ﱰ":"تر","ﱱ":"تز","ﲤ":"تم","ﳣ":"تم","ﱲ":"تم","ﰎ":"تم","ﵕ":"تمج","ﵖ":"تمح","ﵗ":"تمخ","ﶤ":"تمى","ﶣ":"تمى","ﱳ":"تن","ﱴ":"تى","ﰏ":"تى","ﱵ":"تى","ﰐ":"تى","ﭠ":"ٺ","ﭡ":"ٺ","ﭟ":"ٺ","ﭞ":"ٺ","ﭤ":"ٿ","ﭥ":"ٿ","ﭣ":"ٿ","ﭢ":"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج","ﺟ":"ج","ﺠ":"ج","ﺞ":"ج","ﺝ":"ج","ﲧ":"جح","ﰕ":"جح","ﶦ":"جحى","ﶾ":"جحى","ﷻ":"جل جلlلo","ﲨ":"جم","ﰖ":"جم","ﵙ":"جمح","ﵘ":"جمح","ﶧ":"جمى","ﶥ":"جمى","ﴝ":"جى","ﴁ":"جى","ﴞ":"جى","ﴂ":"جى","ﭸ":"ڃ","ﭹ":"ڃ","ﭷ":"ڃ","ﭶ":"ڃ","ﭴ":"ڄ","ﭵ":"ڄ","ﭳ":"ڄ","ﭲ":"ڄ","ﭼ":"چ","ﭽ":"چ","ﭻ":"چ","ﭺ":"چ","ﮀ":"ڇ","ﮁ":"ڇ","ﭿ":"ڇ","ﭾ":"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح","ﺣ":"ح","ﺤ":"ح","ﺢ":"ح","ﺡ":"ح","څ":"حۛ","ځ":"حٔ","ݲ":"حٔ","ﲩ":"حج","ﰗ":"حج","ﶿ":"حجى","ﲪ":"حم","ﰘ":"حم","ﵛ":"حمى","ﵚ":"حمى","ﴛ":"حى","ﳿ":"حى","ﴜ":"حى","ﴀ":"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ","ﺧ":"خ","ﺨ":"خ","ﺦ":"خ","ﺥ":"خ","ﲫ":"خج","ﰙ":"خج","ﰚ":"خح","ﲬ":"خم","ﰛ":"خم","ﴟ":"خى","ﴃ":"خى","ﴠ":"خى","ﴄ":"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د","ﺪ":"د","ﺩ":"د","ڈ":"دؕ","ﮉ":"دؕ","ﮈ":"دؕ","ڎ":"دۛ","ﮇ":"دۛ","ﮆ":"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ","ﺬ":"ذ","ﺫ":"ذ","ﱛ":"ذٰ","ڋ":"ڊؕ","ﮅ":"ڌ","ﮄ":"ڌ","ﮃ":"ڍ","ﮂ":"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر","ﺮ":"ر","ﺭ":"ر","ڑ":"رؕ","ﮍ":"رؕ","ﮌ":"رؕ","ژ":"رۛ","ﮋ":"رۛ","ﮊ":"رۛ","ڒ":"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ","ﱜ":"رٰ","ﷶ":"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز","ﺰ":"ز","ﺯ":"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س","ﺳ":"س","ﺴ":"س","ﺲ":"س","ﺱ":"س","ش":"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ","ﺷ":"سۛ","ﺸ":"سۛ","ﺶ":"سۛ","ﺵ":"سۛ","ݾ":"س̂","ﴱ":"سo","ﳨ":"سo","ﴲ":"سۛo","ﳪ":"سۛo","ﲭ":"سج","ﴴ":"سج","ﰜ":"سج","ﴭ":"سۛج","ﴷ":"سۛج","ﴥ":"سۛج","ﴉ":"سۛج","ﵝ":"سجح","ﵞ":"سجى","ﵩ":"سۛجى","ﲮ":"سح","ﴵ":"سح","ﰝ":"سح","ﴮ":"سۛح","ﴸ":"سۛح","ﴦ":"سۛح","ﴊ":"سۛح","ﵜ":"سحج","ﵨ":"سۛحم","ﵧ":"سۛحم","ﶪ":"سۛحى","ﲯ":"سخ","ﴶ":"سخ","ﰞ":"سخ","ﴯ":"سۛخ","ﴹ":"سۛخ","ﴧ":"سۛخ","ﴋ":"سۛخ","ﶨ":"سخى","ﷆ":"سخى","ﴪ":"سر","ﴎ":"سر","ﴩ":"سۛر","ﴍ":"سۛر","ﲰ":"سم","ﳧ":"سم","ﰟ":"سم","ﴰ":"سۛم","ﳩ":"سۛم","ﴨ":"سۛم","ﴌ":"سۛم","ﵡ":"سمج","ﵠ":"سمح","ﵟ":"سمح","ﵫ":"سۛمخ","ﵪ":"سۛمخ","ﵣ":"سمم","ﵢ":"سمم","ﵭ":"سۛمم","ﵬ":"سۛمم","ﴗ":"سى","ﳻ":"سى","ﴘ":"سى","ﳼ":"سى","ﴙ":"سۛى","ﳽ":"سۛى","ﴚ":"سۛى","ﳾ":"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص","ﺻ":"ص","ﺼ":"ص","ﺺ":"ص","ﺹ":"ص","ڞ":"صۛ","ࢯ":"ص̤̣","ﲱ":"صح","ﰠ":"صح","ﵥ":"صحح","ﵤ":"صحح","ﶩ":"صحى","ﲲ":"صخ","ﴫ":"صر","ﴏ":"صر","ﷵ":"صلعم","ﷹ":"صلى","ﷰ":"صلى","ﷺ":"صلى lللo علىo وسلم","ﲳ":"صم","ﰡ":"صم","ﷅ":"صمم","ﵦ":"صمم","ﴡ":"صى","ﴅ":"صى","ﴢ":"صى","ﴆ":"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض","ﺿ":"ض","ﻀ":"ض","ﺾ":"ض","ﺽ":"ض","ﲴ":"ضج","ﰢ":"ضج","ﲵ":"ضح","ﰣ":"ضح","ﵮ":"ضحى","ﶫ":"ضحى","ﲶ":"ضخ","ﰤ":"ضخ","ﵰ":"ضخم","ﵯ":"ضخم","ﴬ":"ضر","ﴐ":"ضر","ﲷ":"ضم","ﰥ":"ضم","ﴣ":"ضى","ﴇ":"ضى","ﴤ":"ضى","ﴈ":"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط","ﻃ":"ط","ﻄ":"ط","ﻂ":"ط","ﻁ":"ط","ڟ":"طۛ","ﲸ":"طح","ﰦ":"طح","ﴳ":"طم","ﴺ":"طم","ﰧ":"طم","ﵲ":"طمح","ﵱ":"طمح","ﵳ":"طمم","ﵴ":"طمى","ﴑ":"طى","ﳵ":"طى","ﴒ":"طى","ﳶ":"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ","ﻇ":"ظ","ﻈ":"ظ","ﻆ":"ظ","ﻅ":"ظ","ﲹ":"ظم","ﴻ":"ظم","ﰨ":"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع","ﻋ":"ع","ﻌ":"ع","ﻊ":"ع","ﻉ":"ع","ﲺ":"عج","ﰩ":"عج","ﷄ":"عجم","ﵵ":"عجم","ﷷ":"علىo","ﲻ":"عم","ﰪ":"عم","ﵷ":"عمم","ﵶ":"عمم","ﵸ":"عمى","ﶶ":"عمى","ﴓ":"عى","ﳷ":"عى","ﴔ":"عى","ﳸ":"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ","ﻏ":"غ","ﻐ":"غ","ﻎ":"غ","ﻍ":"غ","ﲼ":"غج","ﰫ":"غج","ﲽ":"غم","ﰬ":"غم","ﵹ":"غمم","ﵻ":"غمى","ﵺ":"غمى","ﴕ":"غى","ﳹ":"غى","ﴖ":"غى","ﳺ":"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف","ﻓ":"ف","ﻔ":"ف","ﻒ":"ف","ﻑ":"ف","ڧ":"ف","ﲾ":"فج","ﰭ":"فج","ﲿ":"فح","ﰮ":"فح","ﳀ":"فخ","ﰯ":"فخ","ﵽ":"فخم","ﵼ":"فخم","ﳁ":"فم","ﰰ":"فم","ﷁ":"فمى","ﱼ":"فى","ﰱ":"فى","ﱽ":"فى","ﰲ":"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ","ڤ":"ڡۛ","ﭬ":"ڡۛ","ﭭ":"ڡۛ","ﭫ":"ڡۛ","ﭪ":"ڡۛ","ڨ":"ڡۛ","ࢤ":"ڢۛ","ﭰ":"ڦ","ﭱ":"ڦ","ﭯ":"ڦ","ﭮ":"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق","ﻗ":"ق","ﻘ":"ق","ﻖ":"ق","ﻕ":"ق","ﳂ":"قح","ﰳ":"قح","ﷱ":"قلى","ﳃ":"قم","ﰴ":"قم","ﶴ":"قمح","ﵾ":"قمح","ﵿ":"قمم","ﶲ":"قمى","ﱾ":"قى","ﰵ":"قى","ﱿ":"قى","ﰶ":"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك","ﻛ":"ك","ﻜ":"ك","ﻚ":"ك","ﻙ":"ك","ک":"ك","ﮐ":"ك","ﮑ":"ك","ﮏ":"ك","ﮎ":"ك","ڪ":"ك","ڭ":"كۛ","ﯕ":"كۛ","ﯖ":"كۛ","ﯔ":"كۛ","ﯓ":"كۛ","ݣ":"كۛ","ﲀ":"كl","ﰷ":"كl","ﳄ":"كج","ﰸ":"كج","ﳅ":"كح","ﰹ":"كح","ﳆ":"كخ","ﰺ":"كخ","ﳇ":"كل","ﳫ":"كل","ﲁ":"كل","ﰻ":"كل","ﳈ":"كم","ﳬ":"كم","ﲂ":"كم","ﰼ":"كم","ﷃ":"كمم","ﶻ":"كمم","ﶷ":"كمى","ﲃ":"كى","ﰽ":"كى","ﲄ":"كى","ﰾ":"كى","ݢ":"ڬ","ﮔ":"گ","ﮕ":"گ","ﮓ":"گ","ﮒ":"گ","ࢰ":"گ","ڴ":"گۛ","ﮜ":"ڱ","ﮝ":"ڱ","ﮛ":"ڱ","ﮚ":"ڱ","ﮘ":"ڳ","ﮙ":"ڳ","ﮗ":"ڳ","ﮖ":"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل","ﻟ":"ل","ﻠ":"ل","ﻞ":"ل","ﻝ":"ل","ڷ":"لۛ","ڵ":"ل̆","ﻼ":"لl","ﻻ":"لl","ﻺ":"لlٕ","ﻹ":"لlٕ","ﻸ":"لlٴ","ﻷ":"لlٴ","ﳍ":"لo","ﻶ":"لآ","ﻵ":"لآ","ﳉ":"لج","ﰿ":"لج","ﶃ":"لجج","ﶄ":"لجج","ﶺ":"لجم","ﶼ":"لجم","ﶬ":"لجى","ﳊ":"لح","ﱀ":"لح","ﶵ":"لحم","ﶀ":"لحم","ﶂ":"لحى","ﶁ":"لحى","ﳋ":"لخ","ﱁ":"لخ","ﶆ":"لخم","ﶅ":"لخم","ﳌ":"لم","ﳭ":"لم","ﲅ":"لم","ﱂ":"لم","ﶈ":"لمح","ﶇ":"لمح","ﶭ":"لمى","ﲆ":"لى","ﱃ":"لى","ﲇ":"لى","ﱄ":"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م","ﻣ":"م","ﻤ":"م","ﻢ":"م","ﻡ":"م","ࢧ":"مۛ","۾":"م͈","ﲈ":"مl","ﳎ":"مج","ﱅ":"مج","ﶌ":"مجح","ﶒ":"مجخ","ﶍ":"مجم","ﷀ":"مجى","ﳏ":"مح","ﱆ":"مح","ﶉ":"محج","ﶊ":"محم","ﷴ":"محمد","ﶋ":"محى","ﳐ":"مخ","ﱇ":"مخ","ﶎ":"مخج","ﶏ":"مخم","ﶹ":"مخى","ﳑ":"مم","ﲉ":"مم","ﱈ":"مم","ﶱ":"ممى","ﱉ":"مى","ﱊ":"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن","ﻧ":"ن","ﻨ":"ن","ﻦ":"ن","ﻥ":"ن","ݨ":"نؕ","ݩ":"ن̆","ﳖ":"نo","ﳯ":"نo","ﶸ":"نجح","ﶽ":"نجح","ﶘ":"نجم","ﶗ":"نجم","ﶙ":"نجى","ﷇ":"نجى","ﳓ":"نح","ﱌ":"نح","ﶕ":"نحم","ﶖ":"نحى","ﶳ":"نحى","ﳔ":"نخ","ﱍ":"نخ","ﲊ":"نر","ﲋ":"نز","ﳕ":"نم","ﳮ":"نم","ﲌ":"نم","ﱎ":"نم","ﶛ":"نمى","ﶚ":"نمى","ﲍ":"نن","ﲎ":"نى","ﱏ":"نى","ﲏ":"نى","ﱐ":"نى","ۂ":"ۀ","ﮥ":"ۀ","ﮤ":"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و","ﻮ":"و","ﻭ":"و","ࢱ":"و","ۋ":"وۛ","ﯟ":"وۛ","ﯞ":"وۛ","ۇ":"و̓","ﯘ":"و̓","ﯗ":"و̓","ۆ":"و̆","ﯚ":"و̆","ﯙ":"و̆","ۉ":"و̂","ﯣ":"و̂","ﯢ":"و̂","ۈ":"وٰ","ﯜ":"وٰ","ﯛ":"وٰ","ؤ":"وٴ","ﺆ":"وٴ","ﺅ":"وٴ","ٶ":"وٴ","ٷ":"و̓ٴ","ﯝ":"و̓ٴ","ﷸ":"وسلم","ﯡ":"ۅ","ﯠ":"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى","ں":"ى","𞸝":"ى","𞹝":"ى","ﮟ":"ى","ﮞ":"ى","ࢽ":"ى","ﯨ":"ى","ﯩ":"ى","ﻰ":"ى","ﻯ":"ى","ي":"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى","ﻳ":"ى","ﻴ":"ى","ﻲ":"ى","ﻱ":"ى","ی":"ى","ﯾ":"ى","ﯿ":"ى","ﯽ":"ى","ﯼ":"ى","ے":"ى","ﮯ":"ى","ﮮ":"ى","ٹ":"ىؕ","ﭨ":"ىؕ","ﭩ":"ىؕ","ﭧ":"ىؕ","ﭦ":"ىؕ","ڻ":"ىؕ","ﮢ":"ىؕ","ﮣ":"ىؕ","ﮡ":"ىؕ","ﮠ":"ىؕ","پ":"ىۛ","ﭘ":"ىۛ","ﭙ":"ىۛ","ﭗ":"ىۛ","ﭖ":"ىۛ","ث":"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ","ﺛ":"ىۛ","ﺜ":"ىۛ","ﺚ":"ىۛ","ﺙ":"ىۛ","ڽ":"ىۛ","ۑ":"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆","ێ":"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ","ﲐ":"ىٰ","ﱝ":"ىٰ","ﳞ":"ىo","ﳱ":"ىo","ﳦ":"ىۛo","ئ":"ىٴ","ﺋ":"ىٴ","ﺌ":"ىٴ","ﺊ":"ىٴ","ﺉ":"ىٴ","ٸ":"ىٴ","ﯫ":"ىٴl","ﯪ":"ىٴl","ﲛ":"ىٴo","ﳠ":"ىٴo","ﯭ":"ىٴo","ﯬ":"ىٴo","ﯸ":"ىٴٻ","ﯷ":"ىٴٻ","ﯶ":"ىٴٻ","ﲗ":"ىٴج","ﰀ":"ىٴج","ﲘ":"ىٴح","ﰁ":"ىٴح","ﲙ":"ىٴخ","ﱤ":"ىٴر","ﱥ":"ىٴز","ﲚ":"ىٴم","ﳟ":"ىٴم","ﱦ":"ىٴم","ﰂ":"ىٴم","ﱧ":"ىٴن","ﯯ":"ىٴو","ﯮ":"ىٴو","ﯱ":"ىٴو̓","ﯰ":"ىٴو̓","ﯳ":"ىٴو̆","ﯲ":"ىٴو̆","ﯵ":"ىٴوٰ","ﯴ":"ىٴوٰ","ﯻ":"ىٴى","ﯺ":"ىٴى","ﱨ":"ىٴى","ﯹ":"ىٴى","ﰃ":"ىٴى","ﱩ":"ىٴى","ﰄ":"ىٴى","ﳚ":"ىج","ﱕ":"ىج","ﰑ":"ىۛج","ﶯ":"ىجى","ﳛ":"ىح","ﱖ":"ىح","ﶮ":"ىحى","ﳜ":"ىخ","ﱗ":"ىخ","ﲑ":"ىر","ﱶ":"ىۛر","ﲒ":"ىز","ﱷ":"ىۛز","ﳝ":"ىم","ﳰ":"ىم","ﲓ":"ىم","ﱘ":"ىم","ﲦ":"ىۛم","ﳥ":"ىۛم","ﱸ":"ىۛم","ﰒ":"ىۛم","ﶝ":"ىمم","ﶜ":"ىمم","ﶰ":"ىمى","ﲔ":"ىن","ﱹ":"ىۛن","ﲕ":"ىى","ﱙ":"ىى","ﲖ":"ىى","ﱚ":"ىى","ﱺ":"ىۛى","ﰓ":"ىۛى","ﱻ":"ىۛى","ﰔ":"ىۛى","ﮱ":"ۓ","ﮰ":"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ","Մ":"ሆ","Ռ":"ቡ","Ի":"ኮ","Պ":"ጣ","आ":"अा","ऒ":"अाॆ","ओ":"अाे","औ":"अाै","ऄ":"अॆ","ऑ":"अॉ","ऍ":"एॅ","ऎ":"एॆ","ऐ":"एे","ई":"र्इ","ઽ":"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्","আ":"অা","ৠ":"ঋৃ","ৡ":"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ","ਉ":"ੳੁ","ਊ":"ੳੂ","ਆ":"ਅਾ","ਐ":"ਅੈ","ਔ":"ਅੌ","ਇ":"ੲਿ","ਈ":"ੲੀ","ਏ":"ੲੇ","આ":"અા","ઑ":"અાૅ","ઓ":"અાે","ઔ":"અાૈ","ઍ":"અૅ","એ":"અે","ઐ":"અૈ","ଆ":"ଅା","௮":"அ","ர":"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ","ഉ":"உ","ஊ":"உள","ഊ":"உൗ","௭":"எ","௷":"எவ","ஜ":"ஐ","ജ":"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி","ണ":"ண","௺":"நீ","௴":"மீ","௰":"ய","ഴ":"ழ","ௗ":"ள","ை":"ன","ശ":"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ","ಅ":"అ","ಆ":"ఆ","ಇ":"ఇ","ౠ":"ఋా","ౡ":"ఌా","ಒ":"ఒ","ఔ":"ఒౌ","ಔ":"ఒౌ","ఓ":"ఒౕ","ಓ":"ఒౕ","ಜ":"జ","ಞ":"ఞ","ఢ":"డ̣","ಣ":"ణ","థ":"ధּ","భ":"బ̣","ಯ":"య","ఠ":"రּ","ಱ":"ఱ","ಲ":"ల","ష":"వ̣","హ":"వా","మ":"వు","ూ":"ుా","ౄ":"ృా","ೡ":"ಌಾ","ഈ":"ഇൗ","ഐ":"എെ","ഓ":"ഒാ","ഔ":"ഒൗ","ൡ":"ഞ","൫":"ദ്ര","൹":"നു","ഌ":"നു","ങ":"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ","റ":"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳","ฃ":"ข","ด":"ค","ต":"ค","ม":"ฆ","ຈ":"จ","ซ":"ช","ฏ":"ฎ","ท":"ฑ","ບ":"บ","ປ":"ป","ຝ":"ฝ","ພ":"พ","ຟ":"ฟ","ฦ":"ภ","ຍ":"ย","។":"ฯ","ๅ":"า","ำ":"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู","แ":"เเ","ໜ":"ຫນ","ໝ":"ຫມ","ຳ":"̊າ","༂":"འུྂཿ","༃":"འུྂ༔","ཪ":"ར","ༀ":"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ","က":"ဂာ","ၰ":"ဃှ","ၦ":"ပှ","ဟ":"ပာ","ၯ":"ပာှ","ၾ":"ၽှ","ဩ":"သြ","ဪ":"သြော်","႞":"ႃ̊","ឣ":"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ","ᢖ":"ᡜ","ᡕ":"ᠵ","ῶ":"Ꮿ","ᐍ":"ᐁ·","ᐫ":"ᐁᐠ","ᐑ":"ᐄ·","ᐓ":"ᐅ·","ᐭ":"ᐅᐠ","ᐕ":"ᐆ·","ᐘ":"ᐊ·","ᐮ":"ᐊᐠ","ᐚ":"ᐋ·","ᣝ":"ᐞᣟ","ᓑ":"ᐡ","ᕀ":"ᐩ","ᐿ":"ᐲ·","ᑃ":"ᐴ·","⍩":"ᐵ","ᑇ":"ᐹ·","ᑜ":"ᑏ·","⸧":"ᑐ","⊃":"ᑐ","ᑞ":"ᑐ·","ᑩ":"ᑐ\'","⟉":"ᑐ/","⫗":"ᑐᑕ","ᑠ":"ᑑ·","⸦":"ᑕ","⊂":"ᑕ","ᑢ":"ᑕ·","ᑪ":"ᑕ\'","ᑤ":"ᑖ·","ᑵ":"ᑫ·","ᒅ":"ᑫ\'","ᑹ":"ᑮ·","ᑽ":"ᑰ·","ᘃ":"ᒉ","ᒓ":"ᒉ·","ᒕ":"ᒋ·","ᒗ":"ᒌ·","ᒛ":"ᒎ·","ᘂ":"ᒐ","ᒝ":"ᒐ·","ᒟ":"ᒑ·","ᒭ":"ᒣ·","ᒱ":"ᒦ·","ᒳ":"ᒧ·","ᒵ":"ᒨ·","ᒹ":"ᒫ·","ᓊ":"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·","ᓌ":"ᓇ·","ᓎ":"ᓈ·","ᘄ":"ᓓ","ᓝ":"ᓓ·","ᓟ":"ᓕ·","ᓡ":"ᓖ·","ᓣ":"ᓗ·","ᓥ":"ᓘ·","ᘇ":"ᓚ","ᓧ":"ᓚ·","ᓩ":"ᓛ·","ᓷ":"ᓭ·","ᓹ":"ᓯ·","ᓻ":"ᓰ·","ᓽ":"ᓱ·","ᓿ":"ᓲ·","ᔁ":"ᓴ·","ᔃ":"ᓵ·","ᔌ":"ᔋ<","ᔎ":"ᔋb","ᔍ":"ᔋᑕ","ᔏ":"ᔋᒐ","ᔘ":"ᔐ·","ᔚ":"ᔑ·","ᔜ":"ᔒ·","ᔞ":"ᔓ·","ᔠ":"ᔔ·","ᔢ":"ᔕ·","ᔤ":"ᔖ·","ᔲ":"ᔨ·","ᔴ":"ᔩ·","ᔶ":"ᔪ·","ᔸ":"ᔫ·","ᔺ":"ᔭ·","ᔼ":"ᔮ·","ᘢ":"ᕃ","ᣠ":"ᕃ·","ᘣ":"ᕆ","ᘤ":"ᕊ","ᕏ":"ᕌ·","ᖃ":"ᕐb","ᖄ":"ᕐḃ","ᖁ":"ᕐd","ᕿ":"ᕐP","ᙯ":"ᕐᑫ","ᕾ":"ᕐᑬ","ᖀ":"ᕐᑮ","ᖂ":"ᕐᑰ","ᖅ":"ᕐᒃ","ᕜ":"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·","ᕩ":"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·","ᖑ":"ᖕJ","ᙰ":"ᖕᒉ","ᖎ":"ᖕᒊ","ᖏ":"ᖕᒋ","ᖐ":"ᖕᒌ","ᖒ":"ᖕᒎ","ᖓ":"ᖕᒐ","ᖔ":"ᖕᒑ","ᙳ":"ᖖJ","ᙱ":"ᖖᒋ","ᙲ":"ᖖᒌ","ᙴ":"ᖖᒎ","ᙵ":"ᖖᒐ","ᙶ":"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ","ˡ":"ᣳ","ʳ":"ᣴ","ˢ":"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ","ᛡ":"ᚼ","⍿":"ᚽ","ᛂ":"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥","ㄱ":"ᄀ","ᆨ":"ᄀ","ᄁ":"ᄀᄀ","ㄲ":"ᄀᄀ","ᆩ":"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ","ᇃ":"ᄀᄅ","ᇻ":"ᄀᄇ","ᆪ":"ᄀᄉ","ㄳ":"ᄀᄉ","ᇄ":"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ","ㄴ":"ᄂ","ᆫ":"ᄂ","ᄓ":"ᄂᄀ","ᇅ":"ᄂᄀ","ᄔ":"ᄂᄂ","ㅥ":"ᄂᄂ","ᇿ":"ᄂᄂ","ᄕ":"ᄂᄃ","ㅦ":"ᄂᄃ","ᇆ":"ᄂᄃ","ퟋ":"ᄂᄅ","ᄖ":"ᄂᄇ","ᅛ":"ᄂᄉ","ᇇ":"ᄂᄉ","ㅧ":"ᄂᄉ","ᅜ":"ᄂᄌ","ᆬ":"ᄂᄌ","ㄵ":"ᄂᄌ","ퟌ":"ᄂᄎ","ᇉ":"ᄂᄐ","ᅝ":"ᄂᄒ","ᆭ":"ᄂᄒ","ㄶ":"ᄂᄒ","ᇈ":"ᄂᅀ","ㅨ":"ᄂᅀ","ㄷ":"ᄃ","ᆮ":"ᄃ","ᄗ":"ᄃᄀ","ᇊ":"ᄃᄀ","ᄄ":"ᄃᄃ","ㄸ":"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ","ᇋ":"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ","ㄹ":"ᄅ","ᆯ":"ᄅ","ꥤ":"ᄅᄀ","ᆰ":"ᄅᄀ","ㄺ":"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ","ᇌ":"ᄅᄀᄉ","ㅩ":"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ","ᄘ":"ᄅᄂ","ᇍ":"ᄅᄂ","ꥦ":"ᄅᄃ","ᇎ":"ᄅᄃ","ㅪ":"ᄅᄃ","ꥧ":"ᄅᄃᄃ","ᇏ":"ᄅᄃᄒ","ᄙ":"ᄅᄅ","ᇐ":"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ","ᆱ":"ᄅᄆ","ㄻ":"ᄅᄆ","ᇑ":"ᄅᄆᄀ","ᇒ":"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ","ᆲ":"ᄅᄇ","ㄼ":"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ","ᇓ":"ᄅᄇᄉ","ㅫ":"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ","ᇕ":"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ","ᇔ":"ᄅᄇᄒ","ꥬ":"ᄅᄉ","ᆳ":"ᄅᄉ","ㄽ":"ᄅᄉ","ᇖ":"ᄅᄉᄉ","ᄛ":"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ","ᇘ":"ᄅᄏ","ᆴ":"ᄅᄐ","ㄾ":"ᄅᄐ","ᆵ":"ᄅᄑ","ㄿ":"ᄅᄑ","ᄚ":"ᄅᄒ","ㅀ":"ᄅᄒ","ᄻ":"ᄅᄒ","ᆶ":"ᄅᄒ","ퟲ":"ᄅᄒ","ᇗ":"ᄅᅀ","ㅬ":"ᄅᅀ","ퟛ":"ᄅᅌ","ᇙ":"ᄅᅙ","ㅭ":"ᄅᅙ","ퟜ":"ᄅᅙᄒ","ㅁ":"ᄆ","ᆷ":"ᄆ","ꥯ":"ᄆᄀ","ᇚ":"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ","ᇛ":"ᄆᄅ","ퟠ":"ᄆᄆ","ᄜ":"ᄆᄇ","ㅮ":"ᄆᄇ","ᇜ":"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ","ᇝ":"ᄆᄉ","ㅯ":"ᄆᄉ","ᇞ":"ᄆᄉᄉ","ᄝ":"ᄆᄋ","ㅱ":"ᄆᄋ","ᇢ":"ᄆᄋ","ퟢ":"ᄆᄌ","ᇠ":"ᄆᄎ","ᇡ":"ᄆᄒ","ᇟ":"ᄆᅀ","ㅰ":"ᄆᅀ","ㅂ":"ᄇ","ᆸ":"ᄇ","ᄞ":"ᄇᄀ","ㅲ":"ᄇᄀ","ᄟ":"ᄇᄂ","ᄠ":"ᄇᄃ","ㅳ":"ᄇᄃ","ퟣ":"ᄇᄃ","ᇣ":"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ","ᄈ":"ᄇᄇ","ㅃ":"ᄇᄇ","ퟦ":"ᄇᄇ","ᄬ":"ᄇᄇᄋ","ㅹ":"ᄇᄇᄋ","ᄡ":"ᄇᄉ","ㅄ":"ᄇᄉ","ᆹ":"ᄇᄉ","ᄢ":"ᄇᄉᄀ","ㅴ":"ᄇᄉᄀ","ᄣ":"ᄇᄉᄃ","ㅵ":"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ","ᄤ":"ᄇᄉᄇ","ᄥ":"ᄇᄉᄉ","ᄦ":"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ","ᄫ":"ᄇᄋ","ㅸ":"ᄇᄋ","ᇦ":"ᄇᄋ","ᄧ":"ᄇᄌ","ㅶ":"ᄇᄌ","ퟨ":"ᄇᄌ","ᄨ":"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ","ᄩ":"ᄇᄐ","ㅷ":"ᄇᄐ","ᄪ":"ᄇᄑ","ᇤ":"ᄇᄑ","ꥴ":"ᄇᄒ","ᇥ":"ᄇᄒ","ㅅ":"ᄉ","ᆺ":"ᄉ","ᄭ":"ᄉᄀ","ㅺ":"ᄉᄀ","ᇧ":"ᄉᄀ","ᄮ":"ᄉᄂ","ㅻ":"ᄉᄂ","ᄯ":"ᄉᄃ","ㅼ":"ᄉᄃ","ᇨ":"ᄉᄃ","ᄰ":"ᄉᄅ","ᇩ":"ᄉᄅ","ᄱ":"ᄉᄆ","ퟪ":"ᄉᄆ","ᄲ":"ᄉᄇ","ㅽ":"ᄉᄇ","ᇪ":"ᄉᄇ","ᄳ":"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ","ᄊ":"ᄉᄉ","ㅆ":"ᄉᄉ","ᆻ":"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ","ᄴ":"ᄉᄉᄉ","ᄵ":"ᄉᄋ","ᄶ":"ᄉᄌ","ㅾ":"ᄉᄌ","ퟯ":"ᄉᄌ","ᄷ":"ᄉᄎ","ퟰ":"ᄉᄎ","ᄸ":"ᄉᄏ","ᄹ":"ᄉᄐ","ퟱ":"ᄉᄐ","ᄺ":"ᄉᄑ","ퟮ":"ᄉᅀ","ㅇ":"ᄋ","ᆼ":"ᄋ","ᅁ":"ᄋᄀ","ᇬ":"ᄋᄀ","ᇭ":"ᄋᄀᄀ","ᅂ":"ᄋᄃ","ꥶ":"ᄋᄅ","ᅃ":"ᄋᄆ","ᅄ":"ᄋᄇ","ᅅ":"ᄋᄉ","ᇱ":"ᄋᄉ","ㆂ":"ᄋᄉ","ᅇ":"ᄋᄋ","ㆀ":"ᄋᄋ","ᇮ":"ᄋᄋ","ᅈ":"ᄋᄌ","ᅉ":"ᄋᄎ","ᇯ":"ᄋᄏ","ᅊ":"ᄋᄐ","ᅋ":"ᄋᄑ","ꥷ":"ᄋᄒ","ᅆ":"ᄋᅀ","ᇲ":"ᄋᅀ","ㆃ":"ᄋᅀ","ㅈ":"ᄌ","ᆽ":"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ","ᅍ":"ᄌᄋ","ᄍ":"ᄌᄌ","ㅉ":"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ","ㅊ":"ᄎ","ᆾ":"ᄎ","ᅒ":"ᄎᄏ","ᅓ":"ᄎᄒ","ㅋ":"ᄏ","ᆿ":"ᄏ","ㅌ":"ᄐ","ᇀ":"ᄐ","ꥹ":"ᄐᄐ","ㅍ":"ᄑ","ᇁ":"ᄑ","ᅖ":"ᄑᄇ","ᇳ":"ᄑᄇ","ퟺ":"ᄑᄉ","ᅗ":"ᄑᄋ","ㆄ":"ᄑᄋ","ᇴ":"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ","ㅎ":"ᄒ","ᇂ":"ᄒ","ᇵ":"ᄒᄂ","ᇶ":"ᄒᄅ","ᇷ":"ᄒᄆ","ᇸ":"ᄒᄇ","ꥻ":"ᄒᄉ","ᅘ":"ᄒᄒ","ㆅ":"ᄒᄒ","ᄽ":"ᄼᄼ","ᄿ":"ᄾᄾ","ㅿ":"ᅀ","ᇫ":"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ","ㆁ":"ᅌ","ᇰ":"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ","ᅏ":"ᅎᅎ","ᅑ":"ᅐᅐ","ㆆ":"ᅙ","ᇹ":"ᅙ","ꥼ":"ᅙᅙ","ㅤ":"ᅠ","ㅏ":"ᅡ","ᆣ":"ᅡー","ᅶ":"ᅡᅩ","ᅷ":"ᅡᅮ","ᅢ":"ᅡ丨","ㅐ":"ᅡ丨","ㅑ":"ᅣ","ᅸ":"ᅣᅩ","ᅹ":"ᅣᅭ","ᆤ":"ᅣᅮ","ᅤ":"ᅣ丨","ㅒ":"ᅣ丨","ㅓ":"ᅥ","ᅼ":"ᅥー","ᅺ":"ᅥᅩ","ᅻ":"ᅥᅮ","ᅦ":"ᅥ丨","ㅔ":"ᅥ丨","ㅕ":"ᅧ","ᆥ":"ᅧᅣ","ᅽ":"ᅧᅩ","ᅾ":"ᅧᅮ","ᅨ":"ᅧ丨","ㅖ":"ᅧ丨","ㅗ":"ᅩ","ᅪ":"ᅩᅡ","ㅘ":"ᅩᅡ","ᅫ":"ᅩᅡ丨","ㅙ":"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨","ᅿ":"ᅩᅥ","ᆀ":"ᅩᅥ丨","ힰ":"ᅩᅧ","ᆁ":"ᅩᅧ丨","ᆂ":"ᅩᅩ","ힱ":"ᅩᅩ丨","ᆃ":"ᅩᅮ","ᅬ":"ᅩ丨","ㅚ":"ᅩ丨","ㅛ":"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨","ᆄ":"ᅭᅣ","ㆇ":"ᅭᅣ","ᆆ":"ᅭᅣ","ᆅ":"ᅭᅣ丨","ㆈ":"ᅭᅣ丨","ힴ":"ᅭᅥ","ᆇ":"ᅭᅩ","ᆈ":"ᅭ丨","ㆉ":"ᅭ丨","ㅜ":"ᅮ","ᆉ":"ᅮᅡ","ᆊ":"ᅮᅡ丨","ᅯ":"ᅮᅥ","ㅝ":"ᅮᅥ","ᆋ":"ᅮᅥー","ᅰ":"ᅮᅥ丨","ㅞ":"ᅮᅥ丨","ힵ":"ᅮᅧ","ᆌ":"ᅮᅧ丨","ᆍ":"ᅮᅮ","ᅱ":"ᅮ丨","ㅟ":"ᅮ丨","ힶ":"ᅮ丨丨","ㅠ":"ᅲ","ᆎ":"ᅲᅡ","ힷ":"ᅲᅡ丨","ᆏ":"ᅲᅥ","ᆐ":"ᅲᅥ丨","ᆑ":"ᅲᅧ","ㆊ":"ᅲᅧ","ᆒ":"ᅲᅧ丨","ㆋ":"ᅲᅧ丨","ힸ":"ᅲᅩ","ᆓ":"ᅲᅮ","ᆔ":"ᅲ丨","ㆌ":"ᅲ丨","ㆍ":"ᆞ","ퟅ":"ᆞᅡ","ᆟ":"ᆞᅥ","ퟆ":"ᆞᅥ丨","ᆠ":"ᆞᅮ","ᆢ":"ᆞᆞ","ᆡ":"ᆞ丨","ㆎ":"ᆞ丨","ヘ":"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄","不":"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨","ᅵ":"丨","ㅣ":"丨","⼁":"丨","ᆜ":"丨ー","ᆘ":"丨ᅡ","ᆙ":"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨","ᆚ":"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ","ᆛ":"丨ᅮ","ퟃ":"丨ᅲ","ᆝ":"丨ᆞ","ퟄ":"丨丨","串":"串","丸":"丸","丹":"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀","亂":"亂","㇚":"亅","⼅":"亅","了":"了","ニ":"二","⼆":"二","𠄢":"𠄢","⼇":"亠","亮":"亮","⼈":"人","イ":"亻","⺅":"亻","什":"什","仌":"仌","令":"令","你":"你","倂":"併","倂":"併","侀":"侀","來":"來","例":"例","侮":"侮","侮":"侮","侻":"侻","便":"便","值":"値","倫":"倫","偺":"偺","備":"備","像":"像","僚":"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿","兀":"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全","兩":"兩","ハ":"八","⼋":"八","六":"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况","冷":"冷","凉":"凉","凌":"凌","凜":"凜","凞":"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃","切":"切","切":"切","列":"列","利":"利","㓟":"㓟","刺":"刺","刻":"刻","剆":"剆","割":"割","剷":"剷","劉":"劉","𠠄":"𠠄","カ":"力","力":"力","⼒":"力","劣":"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉","勒":"勒","勞":"勞","勤":"勤","勤":"勤","勵":"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕","北":"北","北":"北","⼕":"匚","⼖":"匸","匿":"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博","ト":"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即","卵":"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶","參":"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣","ロ":"口","⼝":"口","囗":"口","⼞":"口","句":"句","叫":"叫","叱":"叱","吆":"吆","吏":"吏","吝":"吝","吸":"吸","呂":"呂","呈":"呈","周":"周","咞":"咞","咢":"咢","咽":"咽","䎛":"㖈","哶":"哶","唐":"唐","啓":"啓","啟":"啓","啕":"啕","啣":"啣","善":"善","善":"善","喇":"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳","嗀":"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器","囹":"囹","圖":"圖","圗":"圗","⼟":"土","士":"土","⼠":"土","型":"型","城":"城","㦳":"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀","塚":"塚","塚":"塚","塞":"塞","填":"塡","壿":"墫","墬":"墬","墳":"墳","壘":"壘","壟":"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊","タ":"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄","奈":"奈","契":"契","奔":"奔","奢":"奢","女":"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦","嬀":"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀","宅":"宅","𡧈":"𡧈","寃":"寃","寘":"寘","寧":"寧","寧":"寧","寧":"寧","寮":"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸","尿":"尿","屠":"屠","屢":"屢","層":"層","履":"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦","崙":"崙","嵃":"嵃","嵐":"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲","嶺":"嶺","⼮":"巛","巢":"巢","エ":"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾","帲":"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干","年":"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广","度":"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶","廊":"廊","廊":"廊","廉":"廉","廒":"廒","廓":"廓","廙":"廙","廬":"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱","弄":"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳","律":"律","㣣":"㣣","徚":"徚","復":"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志","念":"念","忹":"忹","怒":"怒","怜":"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘","惡":"惡","𢛔":"𢛔","愈":"愈","慨":"慨","慄":"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎","憐":"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲","懶":"懶","懶":"懶","戀":"戀","⼽":"戈","成":"成","戛":"戛","戮":"戮","戴":"戴","⼾":"戶","戸":"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱","拉":"拉","拏":"拏","拓":"拓","拔":"拔","拼":"拼","拾":"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨","捻":"捻","掃":"掃","掠":"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮","搉":"㩁","撚":"撚","撝":"撝","擄":"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬","數":"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗","料":"料","⽄":"斤","⽅":"方","旅":"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日","易":"易","曶":"㫚","㫤":"㫤","晉":"晉","晩":"晚","晴":"晴","晴":"晴","暑":"暑","暑":"暑","暈":"暈","㬈":"㬈","暜":"暜","暴":"暴","曆":"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰","更":"更","書":"書","⽉":"月","𣍟":"𣍟","肦":"朌","胐":"朏","胊":"朐","脁":"朓","胶":"㬵","朗":"朗","朗":"朗","朗":"朗","脧":"朘","望":"望","望":"望","幐":"㬺","䐠":"㬻","𣎓":"𣎓","膧":"朣","𣎜":"𣎜","⽊":"木","李":"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃","柿":"杮","杻":"杻","枅":"枅","林":"林","㭉":"㭉","𣏕":"𣏕","柳":"柳","柺":"柺","栗":"栗","栟":"栟","桒":"桒","𣑭":"𣑭","梁":"梁","梅":"梅","梅":"梅","梎":"梎","梨":"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝","槩":"㮣","樧":"榝","榣":"榣","槪":"槪","樂":"樂","樂":"樂","樂":"樂","樓":"樓","𣚣":"𣚣","檨":"檨","櫓":"櫓","櫛":"櫛","欄":"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲","歷":"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟","殮":"殮","⽎":"殳","殺":"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧","沈":"沈","沿":"沿","泌":"泌","泍":"泍","泥":"泥","𣲼":"𣲼","洛":"洛","洞":"洞","洴":"洴","派":"派","流":"流","流":"流","流":"流","洖":"洖","浩":"浩","浪":"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞","淋":"淋","淚":"淚","淪":"淪","淹":"淹","渚":"渚","港":"港","湮":"湮","潙":"溈","滋":"滋","滋":"滋","溜":"溜","溺":"溺","滇":"滇","滑":"滑","滛":"滛","㴳":"㴳","漏":"漏","漢":"漢","漢":"漢","漣":"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆","濫":"濫","濾":"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災","炙":"炙","炭":"炭","烈":"烈","烙":"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅","煉":"煉","𤋮":"𤋮","熜":"熜","燎":"燎","燐":"燐","𤎫":"𤎫","爐":"爐","爛":"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛","牢":"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯","狀":"狀","𤜵":"𤜵","狼":"狼","猪":"猪","猪":"猪","𤠔":"𤠔","獵":"獵","獺":"獺","⽞":"玄","率":"率","率":"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥","玲":"玲","㺸":"㺸","㺸":"㺸","珞":"珞","琉":"琉","理":"理","琢":"琢","瑇":"瑇","瑜":"瑜","瑩":"瑩","瑱":"瑱","瑱":"瑱","璅":"璅","璉":"璉","璘":"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶","留":"留","略":"略","異":"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒","痢":"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝","療":"療","癩":"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼","益":"益","益":"益","盛":"盛","盧":"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳","省":"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹","晣":"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝","硏":"研","硎":"硎","硫":"硫","碌":"碌","碌":"碌","碑":"碑","磊":"磊","磌":"磌","磌":"磌","磻":"磻","䃣":"䃣","礪":"礪","⽰":"示","⺭":"礻","礼":"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝","神":"神","祥":"祥","視":"視","視":"視","祿":"祿","𥚚":"𥚚","禍":"禍","禎":"禎","福":"福","福":"福","𥛅":"𥛅","禮":"禮","⽱":"禸","⽲":"禾","秊":"秊","䄯":"䄯","秫":"秫","稜":"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱","立":"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹","笠":"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐","簾":"簾","籠":"籠","⽶":"米","类":"类","粒":"粒","精":"精","糒":"糒","糖":"糖","糨":"糨","䊠":"䊠","糣":"糣","糧":"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀","紐":"紐","索":"索","累":"累","絶":"絕","絣":"絣","絛":"絛","綠":"綠","綾":"綾","緇":"緇","練":"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉","縷":"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙","罹":"罹","罺":"罺","羅":"羅","𦌾":"𦌾","⽺":"羊","羕":"羕","羚":"羚","羽":"羽","⽻":"羽","翺":"翺","老":"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳","聆":"聆","聠":"聠","𦖨":"𦖨","聯":"聯","聰":"聰","聾":"聾","⾀":"聿","⺺":"肀","⾁":"肉","肋":"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙","腁":"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵","朦":"䑃","臘":"臘","⾂":"臣","臨":"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮","良":"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽","若":"若","若":"若","苦":"苦","𦬼":"𦬼","茶":"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓","菉":"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華","菱":"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭","落":"落","葉":"葉","蔿":"蒍","𦳕":"𦳕","𦵫":"𦵫","蓮":"蓮","蓱":"蓱","蓳":"蓳","蓼":"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬","藍":"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡","藺":"藺","蘆":"蘆","䕫":"䕫","蘒":"蘒","蘭":"蘭","𧃒":"𧃒","虁":"蘷","蘿":"蘿","⾌":"虍","⻁":"虎","虐":"虐","虜":"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊","螺":"螺","蠁":"蠁","䗹":"䗹","蠟":"蠟","⾎":"血","行":"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤","裂":"裂","𧙧":"𧙧","裏":"裏","裗":"裗","裞":"裞","裡":"裡","裸":"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁","襤":"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆","見":"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦","詽":"訮","訞":"䚶","䚾":"䚾","䛇":"䛇","誠":"誠","說":"說","說":"說","調":"調","請":"請","諒":"諒","論":"論","諭":"諭","諭":"諭","諸":"諸","諸":"諸","諾":"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹","識":"識","讀":"讀","讏":"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆","豈":"豈","豕":"豕","⾗":"豕","豣":"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁","賂":"賂","賈":"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起","趆":"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼","跺":"跥","路":"路","跰":"跰","躛":"躗","⾝":"身","車":"車","⾞":"車","軔":"軔","輧":"軿","輦":"輦","輪":"輪","輸":"輸","輸":"輸","輻":"輻","轢":"轢","⻋":"车","⾟":"辛","辞":"辞","辰":"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡","連":"連","逸":"逸","逸":"逸","遲":"遲","遼":"遼","𨗒":"𨗒","𨗭":"𨗭","邏":"邏","⾢":"邑","邔":"邔","郎":"郎","郞":"郎","郞":"郎","郱":"郱","都":"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉","酪":"酪","醙":"醙","醴":"醴","⾤":"釆","里":"里","⾥":"里","量":"量","金":"金","⾦":"金","鈴":"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼","錄":"錄","鍊":"鍊","鎮":"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕","閭":"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝","阮":"阮","陋":"陋","降":"降","陵":"陵","陸":"陸","陼":"陼","隆":"隆","隣":"隣","䧦":"䧦","⾪":"隶","隷":"隷","隸":"隷","隸":"隷","⾫":"隹","雃":"雃","離":"離","難":"難","難":"難","⾬":"雨","零":"零","雷":"雷","霣":"霣","𩅅":"𩅅","露":"露","靈":"靈","⾭":"靑","⻘":"青","靖":"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋","領":"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻","類":"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢","飯":"飯","飼":"飼","䬳":"䬳","館":"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂","駱":"駱","駾":"駾","驪":"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚","魯":"魯","鱀":"鱀","鱗":"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎","鶴":"鶴","𪄅":"𪄅","䳸":"䳸","鷺":"鷺","𪈎":"𪈎","鸞":"鸞","鹃":"鹂","⿄":"鹵","鹿":"鹿","⿅":"鹿","𪊑":"𪊑","麗":"麗","麟":"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍","黎":"黎","䵖":"䵖","⿊":"黑","黒":"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿","龍":"龍","⿓":"龍","龎":"龎","⻰":"龙","龜":"龜","龜":"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"}')},"6e9e":function(e,t,n){"use strict";n.r(t);var r=n("44c8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"6eca":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"",""]),e.exports=t},"6f2e":function(e,t,n){"use strict";(function(t,r){var i=n("966d");e.exports=x;var o,a=n("e3db");x.ReadableState=w;n("faa1").EventEmitter;var s=function(e,t){return e.listeners(t).length},c=n("2aaa"),l=n("f60b").Buffer,u=t.Uint8Array||function(){};function d(e){return l.from(e)}function f(e){return l.isBuffer(e)||e instanceof u}var h=Object.create(n("3a7c"));h.inherits=n("3fb5");var p=n(2),m=void 0;m=p&&p.debuglog?p.debuglog("stream"):function(){};var v,g=n("9b54"),y=n("c4c0");h.inherits(x,c);var b=["error","close","destroy","pause","resume"];function _(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function w(e,t){o=o||n("d6dd"),e=e||{};var r=t instanceof o;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(v||(v=n("7d72").StringDecoder),this.decoder=new v(e.encoding),this.encoding=e.encoding)}function x(e){if(o=o||n("d6dd"),!(this instanceof x))return new x(e);this._readableState=new w(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function k(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,O(e,a)):(i||(o=E(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=d(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?S(e,a,t,!1):P(e,a)):S(e,a,t,!1))):r||(a.reading=!1));return C(a)}function S(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&M(e)),P(e,t)}function E(e,t){var n;return f(t)||"string"===typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function C(e){return!e.ended&&(e.needReadable||e.length=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=I(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,M(e)}}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){m("emit readable"),e.emit("readable"),U(e)}function P(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=F(e,t.buffer,t.decoder),n);var n}function F(e,t,n){var r;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),e-=a,0===e){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}function q(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;while(r=r.next){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),e-=a,0===e){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function W(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(K,t,e))}function K(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function V(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return m("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?W(this):M(this),null;if(e=R(e,t),0===e&&t.ended)return 0===t.length&&W(this),null;var r,i=t.needReadable;return m("need readable",i),(0===t.length||t.length-e0?B(e,t):null,null===r?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&W(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e);break}o.pipesCount+=1,m("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,c=a?u:w;function l(e,t){m("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function u(){m("onend"),e.end()}o.endEmitted?i.nextTick(c):n.once("end",c),e.on("unpipe",l);var d=D(n);e.on("drain",d);var f=!1;function h(){m("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",d),e.removeListener("error",g),e.removeListener("unpipe",l),n.removeListener("end",u),n.removeListener("end",w),n.removeListener("data",v),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d()}var p=!1;function v(t){m("ondata"),p=!1;var r=e.write(t);!1!==r||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==V(o.pipes,e))&&!f&&(m("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(t){m("onerror",t),w(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),w()}function b(){m("onfinish"),e.removeListener("close",y),w()}function w(){m("unpipe"),n.unpipe(e)}return n.on("data",v),_(e,"error",g),e.once("close",y),e.once("finish",b),e.emit("pipe",n),o.flowing||(m("pipe resume"),n.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o4?h:t+8,a=[],c=0;c4?h:t+8,E(e,o,f-1);case 3:if(1==f)return e.getUint16(t+8,!i);for(o=f>2?h:t+8,a=[],c=0;ce.byteLength)return{};var o=w(e,t,t+i,d,r);if(o["Compression"])switch(o["Compression"]){case 6:if(o.JpegIFOffset&&o.JpegIFByteCount){var a=t+o.JpegIFOffset,s=o.JpegIFByteCount;o["blob"]=new Blob([new Uint8Array(e.buffer,a,s)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",o["Compression"])}else 2==o["PhotometricInterpretation"]&&console.log("Thumbnail image format is RGB, which is not implemented.");return o}function E(e,t,r){var i="";for(n=t;n")+8;c=c.substring(c.indexOf("0){t["@attributes"]={};for(var n=0;n0)for(var r=0;rdiv .icon,.rootcontent.fix.minimized:not(.active) .offline .table>div .icon{font-size:.8em;padding:0}.rootcontent.fix.minimized.active .page .work{padding:0 .25em}.rootcontent.fix.minimized.active .backface{top:0;bottom:0;right:0;left:0}.rootcontent .likeoffline,.rootcontent .offline{color:rgb(var(--neutral-grad-1));background:rgb(var(--background-secondary-theme))}.rootcontent .likeoffline .table,.rootcontent .offline .table{width:100%;height:100%}.rootcontent .likeoffline .table>div,.rootcontent .offline .table>div{vertical-align:middle;text-align:center;padding-bottom:45%}.rootcontent .likeoffline .table>div .icon,.rootcontent .offline .table>div .icon{font-size:2.3em;padding:.5em;color:rgb(var(--color-bg-ac))}.rootcontent .likeoffline .table>div .label,.rootcontent .offline .table>div .label{font-size:1em;padding:0 4em}.rootcontent .likeoffline{background:transparent}.rootcontent .fixedallwrapper,.rootcontent .fixedallwrapperDisplayed,.rootcontent .preloaderWrapper{position:absolute;left:0;right:0;top:0;bottom:0;z-index:998;transition:.3s}.rootcontent .fixedallwrapperDisplayed{background:rgb(var(--background-total-theme))}.rootcontent .fixedOnPageBottom,.rootcontent .fixedOnPageTop{transition:.3s}.rootcontent .fade-in-right-enter-to .fixedallwrapper,.rootcontent .fade-in-right-enter-to .preloaderWrapper,.rootcontent .fade-in-right-enter .fixedallwrapper,.rootcontent .fade-in-right-enter .preloaderWrapper,.rootcontent .fade-in-right-leave-to .fixedallwrapper,.rootcontent .fade-in-right-leave-to .preloaderWrapper{opacity:0}.rootcontent .fade-in-right-enter-to .fixedOnPageBottom,.rootcontent .fade-in-right-enter .fixedOnPageBottom,.rootcontent .fade-in-right-leave-to .fixedOnPageBottom{opacity:0;bottom:-1.5em}.rootcontent .fade-in-right-enter-to .fixedOnPageTop,.rootcontent .fade-in-right-enter .fixedOnPageTop,.rootcontent .fade-in-right-leave-to .fixedOnPageTop{opacity:0;top:-1.5em}.rootcontent .content{padding-top:66px}.rootcontent .work{padding:0 .5em;margin:0 auto;max-width:640px}.rootcontent .pwork{max-width:640px;background:transparent;margin:0 auto;padding:0 4em}.rootcontent .effects{position:fixed;left:0;top:0;bottom:0;right:0;z-index:2020}.rootcontent .speechWrapper{position:fixed;left:0;bottom:0;padding-bottom:2em;right:0;z-index:2000;height:80px}.rootcontent .speechWrapper .speechAbsWrapper{position:relative;width:100%;height:100%}.rootcontent .emptyRec{padding:10em 2em;text-align:center;font-size:.8em}.rootcontent .enablevoice .forbutton{margin-top:2em}.table{display:table;table-layout:fixed;width:100%}.table>div{display:table-cell}.m-message-container.is-bottom-right{padding:0;right:56px;bottom:.75em;width:auto}.m-message-container.is-top-left{top:calc(.5em + var(--app-margin-top))}.notificationWrapper{display:block;max-width:none;font-family:Segoe UI Variable,Segoe UI,SegoeUI,Helvetica Neue,Helvetica,Arial,sans-serif}.notificationWrapper.m-message-wrapper+.m-message-wrapper{margin-top:.5em}.notificationWrapper .m-message{padding:.5em .5em;border:1px solid rgba(var(--neutral-grad-0),.9);border-radius:5px;box-shadow:none;background:rgb(var(--background-secondary-theme));font-size:1em}.notificationWrapper .m-message--title{font-weight:700;color:rgb(var(--color-txt-gray-dark));font-size:.8em}.notificationWrapper .m-message--title:first-letter{text-transform:capitalize}.notificationWrapper .m-message--description{margin-top:0}.notificationWrapper .m-message-content{flex-grow:1}.notificationWrapper .m-message-content .listPreview{cursor:pointer}.notificationWrapper .m-message-content .listPreview .invitedEvent{width:180px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:flex;justify-content:space-between;align-items:center}.notificationWrapper .m-message-content .listPreview .invitedEvent span{display:block;font-size:.8em}.notificationWrapper .m-message-content .listPreview .invitedEvent .txt{color:rgb(var(--color-txt-gray-dark))}.notificationWrapper .m-message-content .listPreview .invitedEvent .txtNew{color:rgb(var(--color-good))}.notificationWrapper .m-message-content .listPreview .linkPreview span:first-letter{text-transform:uppercase}.notificationWrapper .m-message-content .listPreview .linkPreview .senderName{font-weight:700;color:rgb(var(--color-txt-gray-dark))}.notificationWrapper .m-message-content .listPreview .linkPreview .linkTitle{color:#707070}.notificationWrapper .m-message-content .listPreview .linkPreview .pocketnetLink{color:rgb(var(--color-txt-gray-dark))}.notificationWrapper .m-message-content .listPreview .previewMessageList span{color:rgb(var(--color-txt-gray-dark));text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left}.notificationWrapper .m-message-content .listPreview .previewMessage{display:flex;justify-content:flex-start;align-items:center;width:100%}.notificationWrapper .m-message-content .listPreview .previewMessage span{display:block;color:rgb(var(--color-txt-gray-dark));font-size:.8em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:150px}.notificationWrapper .m-message-icons{float:none}.notificationWrapper .m-message--icon{display:block;vertical-align:top}.notificationWrapper .m-message--button.m-message--arrow-down{display:none}.is-top-left{padding:.5em}.is-top-left .notificationWrapper{width:100%;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}@media only screen and (max-width:640px){#app{width:100%}#app .pwork{padding:0 .5em}#app .work{padding:0 .5em 10px}}.collapse{max-width:768px;margin:0 auto;position:relative;z-index:999;padding:.5em 0}.collapse .iconbutton{width:50px;margin-left:auto;color:grey}@media (pointer:fine){.collapse .iconbutton{opacity:.5}.collapse .iconbutton:hover{opacity:1}}.collapsed{display:flex;justify-content:space-between;padding:1em 0;max-width:768px;margin:auto}.angle{display:flex;justify-content:center;width:50px;cursor:pointer}.expand{margin-right:.5em}.bout .collapse{display:none}.resize-observer{position:absolute;right:-20000px}.pswp__img{-o-object-fit:contain;object-fit:contain}.vue-js-switch{display:inline-block;position:relative;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left{left:10px}.vue-js-switch .v-switch-label.v-right{right:10px}.vue-js-switch .v-switch-core{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vue-js-switch .v-switch-core .v-switch-button{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:rgb(var(--background-total-theme));z-index:2}.vue-js-switch.disabled{pointer-events:none;opacity:.6}",""]),e.exports=t},"6ffa":function(e,t,n){"use strict";(function(t,r){var i=n("966d");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){N(t,e)}}e.exports=b;var a,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?setImmediate:i.nextTick;b.WritableState=y;var c=Object.create(n("3a7c"));c.inherits=n("3fb5");var l={deprecate:n("b7d1")},u=n("2aaa"),d=n("f60b").Buffer,f=r.Uint8Array||function(){};function h(e){return d.from(e)}function p(e){return d.isBuffer(e)||e instanceof f}var m,v=n("c4c0");function g(){}function y(e,t){a=a||n("d6dd"),e=e||{};var r=t instanceof a;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,s=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){I(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(a=a||n("d6dd"),!m.call(b,this)&&!(this instanceof a))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),u.call(this)}function w(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}function x(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}function k(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=d.from(t,n)),t}function S(e,t,n,r,i,o){if(!n){var a=k(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||L(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n("4362"),n("c8ba"))},7037:function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports["default"]=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},"703d":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".searchWrapperEA.work[data-v-12492b0b]{margin-bottom:.5em!important;padding-top:.5em!important}#contacts.minimized:not(.active) .inviteUserDiv[data-v-12492b0b]{width:44px}#contacts.minimized:not(.active) .inviteUserDiv .inviteButton[data-v-12492b0b]{height:44px;text-align:center;line-height:44px}#contacts.minimized:not(.active) .inviteUserDiv .inviteButton i[data-v-12492b0b]{width:auto;position:relative}#contacts.minimized:not(.active) .inviteUserDiv span[data-v-12492b0b],#contacts.minimized:not(.active) .titleContacts[data-v-12492b0b]{display:none}.titleContacts[data-v-12492b0b],.titleSearchResult[data-v-12492b0b]{text-align:center}.titleContacts span[data-v-12492b0b],.titleSearchResult span[data-v-12492b0b]{font-size:.8em}.titleContacts.empty[data-v-12492b0b],.titleSearchResult.empty[data-v-12492b0b]{padding:2em;text-align:center}.titleContacts.empty span[data-v-12492b0b],.titleSearchResult.empty span[data-v-12492b0b]{font-size:1.5em;font-weight:100}.searchResult[data-v-12492b0b]{position:relative}.searchResult .linepreloaderWrapper[data-v-12492b0b]{padding:.5em;text-align:center}.searchResult .noSearchResult[data-v-12492b0b]{left:0;right:0;top:50%;padding:3em;text-align:center}.searchResult .noSearchResult i[data-v-12492b0b]{display:block;font-size:1.5em;color:stgb(--neutral-grad-3)}.searchResult .noSearchResult span[data-v-12492b0b]{color:stgb(--neutral-grad-3);display:block;margin:1em 0;font-size:2em;font-weight:100}.groupNameInputCaption[data-v-12492b0b]{padding:.5em 0;text-align:center}.groupNameInputCaption span[data-v-12492b0b]{font-size:.8em}.groupList .groupCaption[data-v-12492b0b]{position:relative;padding:.5em;text-align:center;display:flex;justify-content:space-between;align-items:center}.groupList .groupCaption .label[data-v-12492b0b]{font-size:.8em;font-weight:500}.groupList .groupCaption .selectWrapper[data-v-12492b0b]{position:relative}.groupList .groupCaption .selectWrapper i[data-v-12492b0b]{position:absolute;right:0;top:4px;color:stgb(--color-txt-ac)}.groupList .groupCaption .selectWrapper .selectRoomVisible[data-v-12492b0b]{padding-right:15px;font-size:.8em;cursor:pointer;color:stgb(--color-txt-ac);-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden;position:relative}.groupList .groupCaption .selectWrapper .selectRoomVisible[data-v-12492b0b]::-ms-expand{display:none}.groupList .groupCaption .selectWrapper .selectRoomVisible option[data-v-12492b0b]{font-size:.8em}.participants[data-v-12492b0b]{display:flex;background:rgba(var(--neutral-grad-0),.5);flex-wrap:wrap;border-radius:15px;padding:.5em;margin-bottom:.5em;max-height:123px;overflow-y:auto}.participants>div[data-v-12492b0b]{flex-grow:1}.participants .groupListName[data-v-12492b0b]{margin-bottom:.25em}.participants[data-v-12492b0b] .iconWrapper{width:33px}.participants[data-v-12492b0b] .iconWrapper .userpic{width:33px;height:33px;line-height:33px}.participants[data-v-12492b0b] .summaryLine{font-size:.8em}.participants .groupListName[data-v-12492b0b]{margin-right:1em;margin-top:0;border-radius:1em;display:flex;align-items:center}.participants .groupListName span[data-v-12492b0b]{color:rgb(var(--text-on-bg-ac-color));font-size:.9em;display:block;margin-right:5px}.participants .groupListName i[data-v-12492b0b]{text-align:center;width:33px}.chatBtnWrapper[data-v-12492b0b],.GroupBtnWrapper[data-v-12492b0b],.inviteBtnWrapper[data-v-12492b0b]{z-index:2;padding:.5em;text-align:center;left:0;right:0}.minimized .chatBtnWrapper[data-v-12492b0b],.minimized .GroupBtnWrapper[data-v-12492b0b],.minimized .inviteBtnWrapper[data-v-12492b0b]{position:sticky}#contacts.minimized .inviteUserDiv[data-v-12492b0b]{margin-top:.5em}.unauthorized.minimized[data-v-12492b0b]:not(.active){display:none}.unauthorized[data-v-12492b0b]{padding:3em 0;text-align:center}.unauthorized .buttonWrapper[data-v-12492b0b]{padding:1em}.unauthorized .captionWrapper[data-v-12492b0b]{padding:1em;text-align:center}.unauthorized .captionWrapper span[data-v-12492b0b]{font-size:1.5em;font-weight:100}.groupNameInput[data-v-12492b0b]{padding:.5em 1em}.groupNameInput label[data-v-12492b0b]{display:block}.groupNameInput input[data-v-12492b0b]{height:35px;width:100%;padding-right:0}#contacts .inviteUserDiv[data-v-12492b0b]{margin-top:.4em}#contacts .inviteUserDiv .inviteButton[data-v-12492b0b]{background-color:rgb(var(--color-bg-ac-bright));color:rgb(var(--text-on-bg-ac-color));width:100%;height:34px;font-size:.9em;border-radius:30px;position:relative;cursor:pointer}#contacts .inviteUserDiv .inviteButton i[data-v-12492b0b]{position:absolute;right:0;top:0;line-height:34px;width:50px;text-align:center}#contacts .inviteUserDiv .inviteButton.colored[data-v-12492b0b]{background-color:rgb(var(--color-bg-orange))}",""]),e.exports=t},"704f":function(e,t,n){var r=n("76df");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("63f17088",r,e)}},"706e":function(e,t,n){"use strict";n.r(t);var r=n("cde8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},7156:function(e,t,n){var r=n("1626"),i=n("861d"),o=n("d2bb");e.exports=function(e,t,n){var a,s;return o&&r(a=t.constructor)&&a!==n&&i(s=a.prototype)&&s!==n.prototype&&o(e,s),e}},"71da":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"contacts"}},[e.unauthorized?n("div",{staticClass:"dmdv"}):n("div",["Contacts"===e.mode&&e.window.cordova?n("div",{staticClass:"work"},[n("div",{staticClass:"inviteUserDiv"},[n("router-link",{staticClass:"inviteButton",class:{colored:!0},attrs:{to:"/invite",tag:"button"}},[n("span",[e._v(e._s(e.$i18n.t("caption.inviteFriend")))]),e._v(" "),n("i",{staticClass:"fas fa-address-card"})])],1)]):e._e(),"Contacts"!==e.mode||e.window.cordova?e._e():n("div",{staticClass:"work"},[n("div",{staticClass:"inviteUserDiv"},[n("button",{staticClass:"inviteButton",class:{colored:!0},on:{click:e.invitepnt}},[n("span",[e._v(e._s(e.$i18n.t("caption.inviteFriend")))]),e._v(" "),n("i",{staticClass:"fas fa-address-card"})])])]),n("div",{staticClass:"namebuttoncreate"},["Selectmany"===e.mode&&e.selectedlength?n("div",{},[n("div",{staticClass:"work"},[n("div",{staticClass:"groupList"},[n("div",{staticClass:"groupCaption"},[n("span",{staticClass:"label"},[e._v("Selected ("+e._s(e.selectedlength)+")")])])]),n("div",{staticClass:"participants"},e._l(e.selected,(function(t){return n("div",{key:t.id||t,staticClass:"groupListName"},[n("preview",{attrs:{contact:e.usersinfo[t.id||t],mode:"mini"}}),t.id?e._e():n("i",{staticClass:"far fa-times-circle",on:{click:function(n){return e.toggleUser(t)}}})],1)})),0)])]):e._e()]),n("div",{staticClass:"work searchWrapperEA"},[n("search",{attrs:{minimize:e.minimized},on:{search:e.search}})],1),n("div",{staticClass:"work"},[0!==e.users.contacts.length?n("div",{staticClass:"titleContacts"},[n("span",[e._v(e._s(e.$t("caption.contacts")))])]):e._e(),n("list",{attrs:{mode:e.mode,selected:e.selected,users:e.users.contacts,title:"Contacts"},on:{toggleUser:e.toggleUser,select:e.select}})],1),n("div",{staticClass:"work"},[0!==e.users.contacts.length||e.searching||e.loading||e.inputText?e._e():n("div",{staticClass:"titleContacts empty"},[n("span",[e._v(e._s(e.$t("caption.contactsempty")))])])]),e.inputText.length&&(e.searching||0===e.users.contacts.length||e.users.search.length)?n("div",{staticClass:"searchResult"},[n("div",{staticClass:"work"},[0!==e.users.search.length?n("div",{staticClass:"titleSearchResult"},[n("span",[e._v(e._s(e.$t("caption.searchResult")))])]):e._e(),e.users.search.length?n("list",{attrs:{mode:e.mode,selected:e.selected,users:e.users.search,title:"Search results"},on:{toggleUser:e.toggleUser,select:e.select}}):e._e()],1),e.inputText.length>=3&&!e.users.search.length&&!e.loading&&!e.searching?n("div",{staticClass:"noSearchResult"},[n("span",[e._v(e._s(e.$t("caption.queryNoResults")))]),n("i",{staticClass:"fas fa-search"})]):e._e(),e.searching?n("div",{staticClass:"searching"},[n("div",{staticClass:"linepreloaderWrapper"},[n("linepreloader")],1)]):e._e()]):e._e()])])},i=[],o=n("2f62"),a=n("f978"),s=n("92a6"),c=n("d3ff"),l={name:"contacts",props:{mode:{type:String,default:function(){return""}},chatRoomId:String},components:{list:a["default"],contact:c["default"],preview:s["a"]},data:function(){return{loading:!1,searching:!1,fromSearch:[],inputText:"",groupContacts:[],groupName:"",contact:{},selected:{}}},mounted:function(){this.mode&&this.mode},created:function(){},watch:{},computed:Object(o["c"])({auth:e=>e.auth,window:function(){return window},users:function(){var e={contacts:[],search:[]};return e.contacts=_.filter(this.contactsMap,e=>{if(!this.inputText||e.name.toLowerCase().match(this.inputText.toLowerCase()))return!0}),e.search=_.filter(this.fromSearch,(e,t)=>!this.contactsMap[e.id]),e},...Object(o["c"])(["contactsMap","pocketnet","minimized","active","unauthorized"]),usersinfo:function(){return this.$store.state.users},u:function(){return this.$route.query.u},selectedlength:function(){return _.toArray(this.selected).length},contactsListFiltered(){var e=[],t=this.contactsMap,n=this.inputText;return _.each(t,(function(t,n){t.selected=!1,e.push(t)})),e.filter((function(e){return e.name.match(n)}))},gName:function(){var e=this.groupName;return e.replace(/ /g,"_")}}),methods:{select:function(e){this.$emit("select",e)},toggleUser:function(e){if(this.selected[e])this.$delete(this.selected,e);else{if(this.selectedlength>=11)return void this.$store.commit("icon",{icon:"warning",message:"At the moment, you can add no more than 12 users to the chat"});this.$set(this.selected,e,e)}this.$emit("selectedUsers",this.selected)},search(e){this.inputText=e,this.searching=!0,this.inputText?this.core.user.searchContacts(this.inputText).then(e=>{this.fromSearch=_.filter(e||[],e=>e.id!=this.core.user.userinfo.id)}).finally(()=>{this.searching=!1}):this.fromSearch=[]},invitepnt(){this.core.invitepnt()},inviteUserAction(e){var t=this.core.mtrx.client,n=this.chatRoomId,r=this;_.each(e,e=>{var i="@"+e+":"+r.core.domain;t.invite(n,i).then(e=>{})}),this.$emit("closeModal",!1)}}},u=l,d=n("2877");function f(e){var t=n("b4f6");t.__inject__&&t.__inject__(e)}var h=Object(d["a"])(u,r,i,!1,f,"12492b0b",null,!0);t["a"]=h.exports},"71e5":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".v-spinner{text-align:center}.v-spinner .v-clip{-webkit-animation:v-clipDelay .75s linear 0s infinite;animation:v-clipDelay .75s linear 0s infinite;-webkit-animation-fill-mode:both;animation-fill-mode:both;display:inline-block}@-webkit-keyframes v-clipDelay{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(180deg) scale(.8)}to{transform:rotate(1turn) scale(1)}}@keyframes v-clipDelay{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(180deg) scale(.8)}to{transform:rotate(1turn) scale(1)}}",""]),e.exports=t},7212:function(e,t,n){"use strict";n.r(t);var r=n("b0a4");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"722a":function(t,n,r){var i,o,a;(function(e,r){o=[],i=r,a="function"===typeof i?i.apply(n,o):i,void 0===a||(t.exports=a)})(0,(function(){var t=XMLHttpRequest;if(!t)throw new Error("missing XMLHttpRequest");r.log={trace:s,debug:s,info:s,warn:s,error:s};var n=18e4;function r(e,t){if("function"!==typeof t)throw new Error("Bad callback given: "+t);if(!e)throw new Error("No options given");var n=e.onResponse;if(e="string"===typeof e?{uri:e}:JSON.parse(JSON.stringify(e)),e.onResponse=n,e.verbose&&(r.log=c()),e.url&&(e.uri=e.url,delete e.url),!e.uri&&""!==e.uri)throw new Error("options.uri is a required argument");if("string"!=typeof e.uri)throw new Error("options.uri must be a string");for(var i=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],a=0;a>18&63,o=c>>12&63,a=c>>6&63,s=63&c,h[d++]=l.charAt(i)+l.charAt(o)+l.charAt(a)+l.charAt(s)}while(u299)&&r.error){for(var i in e=new Error("CouchDB error: "+(r.error.reason||r.error.error)),r)e[i]=r[i];return t(e,n,r)}return t(e,n,r)}},r}))},"72a7":function(e,t,n){"use strict";n.r(t);var r=n("de24");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"72aa":function(e,t,n){var r=n("3fb5"),i=n("a255"),o=n("b672"),a=n("8707").Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}r(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},"738c":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".back-icon[data-v-7e97eec1]{cursor:pointer}.backbutton-caption[data-v-7e97eec1]{cursor:pointer;position:relative;left:1em}",""]),e.exports=t},"739c":function(e,t,n){var r=n("377e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("f92d7f0c",r,e)}},"73c2":function(e,t,n){var r=n("0cd0");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("237d0f98",r,e)}},7418:function(e,t){t.f=Object.getOwnPropertySymbols},7608:function(e,t,n){var r=n("8f4c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("8e00a578",r,e)}},"76a3":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".voiceMessage[data-v-0438bc11]{-webkit-tap-highlight-color:transparent;display:flex;contain:strict;width:230px;height:100%}.voiceMessage_wrapper[data-v-0438bc11]{display:flex;justify-content:flex-end;align-items:center;overflow:hidden;min-width:10em;padding:0 .5em;padding-right:1em;border-radius:2em;background:rgb(var(--background-secondary-theme))}.voiceMessage_toggle[data-v-0438bc11]{cursor:pointer;height:33px;width:33px;margin-right:.5em;border-radius:50%;background:rgb(var(--neutral-grad-1));display:flex;align-items:center;justify-content:center;color:rgb(var(--color-bg-ac))}.voiceMessage_toggle i[data-v-0438bc11]{font-size:.5em}.voiceMessage_graph[data-v-0438bc11]{position:relative;cursor:pointer}.voiceMessage_options[data-v-0438bc11]{display:flex;justify-content:center;margin-left:10px;padding:2px 10px;min-width:40px;background:rgb(var(--neutral-grad-1));border-radius:10px}.voiceMessage_options span[data-v-0438bc11]{font-size:.8em;color:rgb(var(--neutral-grad-3))}.voiceMessage.playing .voiceMessage_options span[data-v-0438bc11]{font-size:.8em;color:rgb(var(--color-bg-ac-bright))}.voiceMessage .fa-exclamation-circle[data-v-0438bc11]{font-size:.7em;color:rgb(var(--color-bad));padding:.5em}.voiceMessage .encsign[data-v-0438bc11]{position:absolute;right:0;top:0;bottom:0;display:flex;align-items:center;padding-right:.35em}.voiceMessage .encsign i[data-v-0438bc11]{font-size:.5em;color:rgb(var(--neutral-grad-2));opacity:.6}",""]),e.exports=t},"76df":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".imageWrapper[data-v-756bd822]{margin:0 auto;width:88px}.nameWrapper[data-v-756bd822]{margin-top:.5em;text-align:center}.nameWrapper span[data-v-756bd822]{font-size:2em;font-weight:100}",""]),e.exports=t},7704:function(e){e.exports=JSON.parse('{"caption":{"create":"Создать","addPublicChatName":"Имя Публичной комнаты","addGroupNamePlaceHolder":"Имя Чата","createPublicChat":"Создать публичный чат","chatTopic":"Топик изменён","publicRoomTitle":"Публичная комната","asModerator":"права модерации","marked":"Передал","unmarked":"Снял","removeBan":"Снять Бан","cancelModeration":"Снять модерцию","uploadFiles":"Загрузить файлы","header":"Заголовок","dragAndDropAFile":"Перетятите файл в эту область","chatInvite":"Вы приглашены в чат с","cantJoion":"Вы не можете присоединиться к чату с","chatInviteDecline":"Вы можете присоединиться к чату или отклонить приглашение","creatorLeft":"Так как создатель чата покинул его","encrypted":"Зашифровано ","noImages":"В чате пока нет изображений","noFiles":"В чате пока нет файлов","inviteUser":"Пригласить пользователя","invite":"Пригласить","add":"Добавить","mute":"Отключить звук","unmute":"Включить звук","leave":"Покинуть","Info":"Информация","new":"Новый","typing":"печатает","accNotFound":"Ваш аккаунт находится в процессе регистрации, пожалуйста, подождите...","emptyList":"Список пуст","welcome":"Добро пожаловать в чат!","startNewChat":"Начать новый чат","chats":"Чаты","shareWith":"Поделиться с","newChat":"Новый чат","moveToChat":"Перейти в чат","queryNoResults":"Нет результатов по запросу","needMoreCharacters":"Введите больше символов для поиска","createGroup":"Создать группу","unabletoDecrypt":"* Невозможно расшифровать","messageDeleted":"Сообщение удалено","sentImage":"отправлено изображение","sentVoiceMessage":"отправлено голосовое сообщение","invitationToChat":"Приглашение в чат","invitationToRoom":"Приглашение в комнату","leftChat":"покинул чат","joined":"присоединился","chatRenamed":"Чат переименован в ","recentComment":"Последний комментарий:","share":"Поделиться","followers":"Подписались","reputation":"Репутация","unsubscribe":"Отписаться","following":"Подписан","theme":"Тема:","contacts":"Контакты","phoneContacts":"Телефонные контакты","chooseInviteMedia":"Пожалуйста, выберите, способ приглашения","admin":"Админ","moderator":"Модератор","videocall":"Видеозвонок","call":"Звонок","leaveAndDelete":"Покинуть и удалить чат","donate":"Донат","makeModerator":"Сделать модератором","ban":"Бан","kick":"Исключить","members":"Участники","media":"Медиа","files":"Файлы","contactsList":"Список контактов","send":"Отправить","pageCaption":"Заголовок страницы","caption":"Заголовок","text":"текст","placeholder":"плейсхолдер","sendTransactionTo":"Послать транзакрию","toBePaidByReceiver":"Оплата получателем","toBePaidBySender":"Оплата отправителем","source":"Источник","amount":"Количество","receiver":"Получатель","message":"Сообщение","includeFeesInAmount":"Включить комиссию в сумму","transactionFees":"Комиссия за транзакцию","totalAmount":"Итого","balanceTooLow":"Баланс слишком низкий","transactionError":"Ошибка: нельзя совершить транзакцию","calculateFees":"Подсчитать комиссию","startChatWith":"Начать чат с","searchResult":"Результат поиска","joinedInTheChat":"вошел в чат","invited":"приглашен ","hasInvited":"приглашен ","inTheChat":" в чат","banned":"забанен","andRoom":"и комната","inRoom":"в комнате","left":"покинул","theChat":" чат ","made":"сделал ","aModerator":" модератором","editedChatNameTo ":"изменил имя чата на ","somebody":"Кто-то","sent":"отправлено","PKOINto":" PKOIN для ","response":"Ответ","edited":"Отредактировано","settings":"Настройки","unauthorized":"Неавторизован","search":"Поиск","replyOnMessage":"Ответить на сообщение","editMessage":"Редактировать сообщение","inviteFriend":"Пригласить друзей","emptyContactList":"Ваша книга контактов пуста","joinApp":"Присоединяйтесь ко мне в защищенном чате.","hasInvitedToJoin":"Это зашифрованный чат, который не привязывается к номеру телефона.","messagefrom":"Пересланное сообщение от","usernotgen":"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.","younotgen":"Please wait a minute, Your encryption keys are being generated...","messageRead":"Сообщение прочитано","open":"Открыть","You":"Вы","chatsearchingempty":"Чатов по данному фильтру не найдено","sendmessage":"Отправить сообщение"},"input":{"patientEmailPlaceholder":"Электронная почта","refillNamePlaceholder":"Заполнить имя еще раз"},"message":{},"button":{"starChatButton":"Начать чат","decline":"Отклонить","join":"Присоединиться","ok":"Ок","copy":"Скопировать","forward":"Переслать","delete":"Удалить","save":"Сохранить","reply":"Ответить","share":"Переслать","download":"Загрузить","downloaded":"Загружено","goToPocketnetProfile":"Перейти в профиль","sendFile":"Отправить файл","takePhotoOrVideo":"Отправить фотографию","sendCoins":"Отправить коины","edit":"Редактировать","select":"Выбрать","block":"Заблокировать","unblock":"Разблокировать","blockUser":"Заблокировать пользователя","Complain":"Пожаловаться"},"type":{"publicgroup":"Создать публичную группу","privategroup":"Создать приватную группу","one":"Чат один на один"},"typelabel":{"publicgroup":"Создание публичной группы","privategroup":"Создание приватной группы","one":"Создание чата один на один"},"yes":"Да","cancel":"Отменить","teamMessages":{"1-title":"Добро пожаловать в приватный чат Bastyon!","1-list1":"Личный мессенджер, который НЕ связан с вашим номером телефона","1-list2":"Конечное шифрование каждого разговора 1 на 1 по умолчанию","1-list3":"Все изображения, отправленные или полученные через чат, хранятся в зашифрованном виде","1-list4":"История сообщений сохраняется только в течение 7 дней","2-title":"Огромное объявление! Приложение Pocketnet теперь называется Bastyon!","2-message1":"Домен будет перенесен на Bastyon.com. Недавно мы выпустили следующие крупные обновления:","2-list1":"Частный зашифрованный мессенджер, не связанный с вашим номером телефона","2-list2":"Возможность пожертвовать PKOIN блогерам","2-list3":"Видео и прямая трансляция","2-message2":"Пригласите своих друзей сейчас и станьте частью большого будущего децентрализованного интернета!","2-button":"Пригласите друзей"},"sendingerror":"Возникла ошибка при отправке сообщения","details":"Подробнее","settings_pin":"Закрепить окно чата","checked":"Да","unchecked":"Нет","settings_read":"Отправлять отчёты о прочтении","messagewasburn":"Данное сообщение осталось только лишь в памяти вашего устройства","messagewillburn":"Сообщение скоро будет удалено","micaccessbrowser":"Доступ к микрофону запрещен настройками браузера, пожалуйста проверьте настройки.","micaccesscommonproblem":"Извините, по какой-то причине запись голосовых сообщений невозможна на устройстве.","micaccesscordova":"Доступ к микрофону запрещен настройками устройства, пожалуйста разрешите доступ к микрофону в настройках устройства.","micdevicenotfound":"Устройство для записи звука не найдено"}')},7769:function(e,t,n){"use strict";var r=n("a593");e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},"77ae":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".default .preloader span[data-v-3e6353d6]:nth-child(2){-webkit-animation:circle2-data-v-3e6353d6 1.5s infinite;animation:circle2-data-v-3e6353d6 1.5s infinite;transition-timing-function:ease-in-out;transform:translateX(1px);transform:scale(1.3);transform:translateY(1px)}.default .preloader span[data-v-3e6353d6]:first-child{-webkit-animation:circle1-data-v-3e6353d6 1.5s infinite;animation:circle1-data-v-3e6353d6 1.5s infinite;transition-timing-function:ease-in-out;transform:translateX(1px) translateY(1px) scale(.7)}.default .preloader span[data-v-3e6353d6]:nth-child(3){-webkit-animation:circle3-data-v-3e6353d6 1.5s infinite;animation:circle3-data-v-3e6353d6 1.5s infinite;transition-timing-function:ease-in-out;transform:translateX(1px);transform:scale(.7);transform:translateY(1px)}.spinner-eff.spinner-eff-3 .circle[data-v-3e6353d6]{border-radius:100px;position:absolute;left:0;right:0;margin:auto;transform:scale(1);transform-origin:center center}.spinner-eff.spinner-eff-3 .circle-1[data-v-3e6353d6]{width:100%;height:100%;background-color:#000;top:0;-webkit-animation:pulse-data-v-3e6353d6 1.6s linear 0s infinite;animation:pulse-data-v-3e6353d6 1.6s linear 0s infinite}.spinner-eff.spinner-eff-3 .circle-2[data-v-3e6353d6]{width:66.6%;height:66.6%;background-color:rgba(4,31,104,.4);top:16.5%;-webkit-animation:pulse-2-data-v-3e6353d6 1.6s linear 0s infinite;animation:pulse-2-data-v-3e6353d6 1.6s linear 0s infinite}.spinner-eff.spinner-eff-3 .circle-3[data-v-3e6353d6]{width:33.3%;height:33.3%;background-color:rgba(0,70,128,.6);top:33.3%}@-webkit-keyframes circle1-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@keyframes circle1-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@-webkit-keyframes circle2-data-v-3e6353d6{0%{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}50%{transform:translateY(17px) translateX(0) scale(2);background-color:#041f68}to{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}}@keyframes circle2-data-v-3e6353d6{0%{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}50%{transform:translateY(17px) translateX(0) scale(2);background-color:#041f68}to{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}}@-webkit-keyframes circle3-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(-23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@keyframes circle3-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(-23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@-webkit-keyframes pulse-data-v-3e6353d6{0%{transform:scale(0)}50%{transform:scale(1.3);opacity:0}to{transform:scale(1.3);opacity:0}}@keyframes pulse-data-v-3e6353d6{0%{transform:scale(0)}50%{transform:scale(1.3);opacity:0}to{transform:scale(1.3);opacity:0}}@-webkit-keyframes pulse-2-data-v-3e6353d6{0%{transform:scale(0)}to{transform:scale(1.3);opacity:0}}@keyframes pulse-2-data-v-3e6353d6{0%{transform:scale(0)}to{transform:scale(1.3);opacity:0}}",""]),e.exports=t},"780f":function(e,t,n){"use strict";e.exports=i;var r=n("27bf");function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n("3fb5")(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"788e":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SERVICE_TYPES=void 0;const r=Object.freeze({IS:"SERVICE_TYPE_IS",IM:"SERVICE_TYPE_IM"});t.SERVICE_TYPES=r},"78ad":function(e,t,n){"use strict";n.r(t);var r=n("5faa");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"78db":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit;outline:none}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}",""]),e.exports=t},"790c":function(e,t,n){var r=n("6eca");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("5b848ab6",r,e)}},"79bb":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".namebuttoncreate[data-v-f0734632],.selectedtype[data-v-f0734632],.type[data-v-f0734632]{padding:1em;display:flex;align-items:center;border-bottom:1px solid rgb(var(--neutral-grad-0));white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer}.namebuttoncreate .icon i[data-v-f0734632],.selectedtype .icon i[data-v-f0734632],.type .icon i[data-v-f0734632]{width:30px;opacity:.7;font-size:.8em}.namebuttoncreate span[data-v-f0734632],.selectedtype span[data-v-f0734632],.type span[data-v-f0734632]{font-size:.9em}.namebuttoncreate button[data-v-f0734632],.selectedtype button[data-v-f0734632],.type button[data-v-f0734632]{white-space:nowrap;min-width:0!important}.namebuttoncreate input[data-v-f0734632],.selectedtype input[data-v-f0734632],.type input[data-v-f0734632]{width:auto}.namebuttoncreate .completewrapper[data-v-f0734632],.selectedtype .completewrapper[data-v-f0734632],.type .completewrapper[data-v-f0734632]{flex-grow:1;text-align:right}.namebuttoncreate[data-v-f0734632]{padding-top:0;padding-bottom:0}.namebuttoncreate>div[data-v-f0734632]{flex-grow:1}.namebuttoncreate input[data-v-f0734632]{width:100%;padding-top:1em;padding-bottom:1em}.selectedtype[data-v-f0734632]{background:rgb(var(--background-total-theme));position:sticky;top:-1px;z-index:12}.selectedtype .icon[data-v-f0734632]{cursor:pointer;transition:.3s}.selectedtype .icon[data-v-f0734632]:hover{opacity:.5}.selectedtype .label[data-v-f0734632]{font-weight:700;font-size:.8em}.oneonone[data-v-f0734632] .namebuttoncreate{display:none}.oneonone[data-v-f0734632] .searchWrapperEA{background:rgb(var(--background-total-theme));position:sticky;top:-1px;z-index:12;padding-bottom:.5em}",""]),e.exports=t},"79f0":function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixScheduler=s;var i=r(n("3987")),o=n("63c7");const a=!1;function s(e,t){this.retryAlgorithm=e||s.RETRY_BACKOFF_RATELIMIT,this.queueAlgorithm=t||s.QUEUE_MESSAGES,this._queues={},this._activeQueues=[],this._procFn=null}function c(e){e._procFn&&i.forEach(i.filter(i.keys(e._queues),(function(t){return-1===e._activeQueues.indexOf(t)&&e._queues[t].length>0})),(function(t){e._activeQueues.push(t),f("Spinning up queue: '%s'",t),l(e,t)}))}function l(e,t){const n=u(e,t);if(!n){const n=e._activeQueues.indexOf(t);return n>=0&&e._activeQueues.splice(n,1),void f("Stopping queue '%s' as it is now empty",t)}f("Queue '%s' has %s pending events",t,e._queues[t].length),Promise.resolve().then(()=>e._procFn(n.event)).then((function(r){d(e,t),f("Queue '%s' sent event %s",t,n.event.getId()),n.defer.resolve(r),l(e,t)}),(function(r){n.attempts+=1;const i=e.retryAlgorithm(n.event,n.attempts,r);f("retry(%s) err=%s event_id=%s waitTime=%s",n.attempts,r,n.event.getId(),i),-1===i?(f("Queue '%s' giving up on event %s",t,n.event.getId()),d(e,t),n.defer.reject(r),l(e,t)):setTimeout((function(){l(e,t)}),i)}))}function u(e,t){const n=e._queues[t];return i.isArray(n)?n[0]:null}function d(e,t){const n=e._queues[t];return i.isArray(n)?n.shift():null}function f(){a&&o.logger.log(...arguments)}s.prototype.getQueueForEvent=function(e){const t=this.queueAlgorithm(e);return t&&this._queues[t]?i.map(this._queues[t],(function(e){return e.event})):null},s.prototype.removeEventFromQueue=function(e){const t=this.queueAlgorithm(e);if(!t||!this._queues[t])return!1;let n=!1;return i.removeElement(this._queues[t],(function(t){if(t.event.getId()===e.getId())return n=!0,!0})),n},s.prototype.setProcessFunction=function(e){this._procFn=e,c(this)},s.prototype.queueEvent=function(e){const t=this.queueAlgorithm(e);if(!t)return null;this._queues[t]||(this._queues[t]=[]);const n=i.defer();return this._queues[t].push({event:e,defer:n,attempts:0}),f("Queue algorithm dumped event %s into queue '%s'",e.getId(),t),c(this),n.promise},s.RETRY_BACKOFF_RATELIMIT=function(e,t,n){if(400===n.httpStatus||403===n.httpStatus||401===n.httpStatus)return-1;if("rejected"===n.cors)return-1;if("M_TOO_LARGE"===n.name)return-1;if("M_LIMIT_EXCEEDED"===n.name){const e=n.data.retry_after_ms;if(e>0)return e}return t>4?-1:1e3*Math.pow(2,t)},s.QUEUE_MESSAGES=function(e){return"m.room.message"===e.getType()||e.hasAssocation()?"message":null}},"7a1f":function(e,t,n){"use strict";(function(e){var r=n("4a1e");function i(e){e.component("vue-page-transition",r["a"])}const o={version:1,install:i};t["a"]=o;let a=null;"undefined"!==typeof window?a=window.Vue:"undefined"!==typeof e&&(a=e.Vue),a&&a.use(o)}).call(this,n("c8ba"))},"7a77":function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},"7aac":function(e,t,n){"use strict";var r=n("c532");e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7acf":function(e,t,n){"use strict";n.r(t);var r=n("d3b8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"7b0b":function(e,t,n){var r=n("1d80"),i=Object;e.exports=function(e){return i(r(e))}},"7c16":function(e,t,n){e.exports=n("d6dd")},"7cd7":function(e,t,n){"use strict";n.r(t);var r=n("8713");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"7d2a":function(e,t){var n=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!==typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!==typeof t)throw new TypeError("Key length not a number");if(t<0||t>n||t!==t)throw new TypeError("Bad key length")}},"7d72":function(e,t,n){"use strict";var r=n("62c8").Buffer,i=r.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){if(!e)return"utf8";var t;while(1)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!==typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=p,this.end=m,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=v,this.end=g,t=3;break;default:return this.write=y,void(this.end=b)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function c(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function l(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0))}function u(e,t,n){if(128!==(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){var n=l(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function m(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function v(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function y(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return ndiv[data-v-a8a70f9c]{transition:.3s;opacity:0;color:rgb(var(--text-on-bg-ac-color));vertical-align:middle;text-align:center}#maincontent .expandp[data-v-a8a70f9c]:before{--size:0;content:"";position:absolute;left:var(--x);top:50%;width:var(--size);height:var(--size);background:radial-gradient(circle closest-side,rgba(0,24,48,.34902),transparent);transform:translate(-50%,-50%);transition:.3s}#maincontent .expandp:hover .etable>div[data-v-a8a70f9c]{opacity:1}#maincontent .expandp[data-v-a8a70f9c]:hover:before{--size:400px}#maincontent.bout .expandp[data-v-a8a70f9c]{display:none}#maincontent[data-v-a8a70f9c] .resize-observer{height:1px;overflow:hidden}#maincontent .headerSpacer[data-v-a8a70f9c]{position:static;left:0;right:0;top:0;bottom:0;padding-bottom:0;margin:0 auto;max-width:640px}#maincontent .headerSpacerWrapper[data-v-a8a70f9c]{position:absolute;left:0;right:0;top:calc(65px + var(--app-margin-top));bottom:90px;overflow-y:auto;overflow-x:hidden}#maincontent .headerSpacerWrapperOvf[data-v-a8a70f9c]{position:absolute;left:0;right:0;top:0;bottom:0;overflow-y:scroll;overflow-x:hidden;overscroll-behavior:contain}#maincontent.minimized .headerSpacerWrapper[data-v-a8a70f9c]{top:55px}#maincontent.minimized.fix .headerSpacerWrapper[data-v-a8a70f9c]{overflow-y:inherit;overflow-x:inherit;top:0;bottom:103px;will-change:transform;transition:transform .3s}#maincontent.minimized.fix:not(.active):not(.unauthorized) .headerSpacerWrapperOvf[data-v-a8a70f9c]{-webkit-mask-image:linear-gradient(0deg,transparent 3%,#000 10%);mask-image:linear-gradient(0deg,transparent 3%,#000 10%)}#maincontent.minimized.fix[data-v-a8a70f9c]:not(.active):not(.unauthorized) .maskedtop{-webkit-mask-image:linear-gradient(180deg,transparent 3%,#000 10%);mask-image:linear-gradient(180deg,transparent 3%,#000 10%)}#maincontent.minimized.fix .headerSpacerWrapperOvf[data-v-a8a70f9c]{position:relative;width:344px;height:100%;overflow:visible;will-change:transform;transition:transform .3s}#maincontent.minimized.fix .headerSpacer[data-v-a8a70f9c]{position:absolute;height:100%;left:0;width:344px;padding:0;overflow-x:hidden;will-change:transform;overscroll-behavior:contain}#maincontent.minimized.fix.active .expandp[data-v-a8a70f9c]{display:none}#maincontent.minimized.fix.active .headerSpacerWrapper[data-v-a8a70f9c]{transform:translateZ(0);z-index:130}#maincontent.minimized.fix.active .headerSpacerWrapperOvf[data-v-a8a70f9c]{transform:translate3d(-300px,4px,0)}#maincontent.minimized.fix.active .headerSpacerWrapperOvf .headerSpacer[data-v-a8a70f9c]{border-radius:8px;border-top-left-radius:0;border-top-right-radius:0;background:rgb(var(--background-total-theme));border:1px solid rgba(var(--neutral-grad-2),.2);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7);right:0}.modalcommoncontent[data-v-a8a70f9c] .previewContact{padding-left:.75em}',""]),e.exports=t},"7e78":function(e,t,n){var r=n("3fb5"),i=n("b672"),o=n("8707").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function l(e){return e<<1|e>>>31}function u(e){return e<<5|e>>>27}function d(e){return e<<30|e>>>2}function f(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=l(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var p=~~(h/20),m=u(n)+f(p,r,i,o)+s+t[h]+a[p]|0;s=o,o=i,i=d(r),r=n,n=m}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},"7f9a":function(e,t,n){var r=n("da84"),i=n("1626"),o=n("8925"),a=r.WeakMap;e.exports=i(a)&&/native code/.test(o(a))},"7ffb":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".eventMember[data-v-54a240c2]{display:flex;align-items:center;padding-left:.25em}.eventMember .iconWrapper[data-v-54a240c2]{width:33px;height:33px;margin-right:.5em}.eventMember .labelwrapper[data-v-54a240c2]{line-height:.9em;padding-bottom:7px;max-width:80%}.eventMember .labelwrapper span[data-v-54a240c2]{vertical-align:middle}",""]),e.exports=t},"810b":function(e,t,n){var r=n("d270");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2d214bb3",r,e)}},8157:function(e,t,n){var r=n("7e59");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("6b42ebab",r,e)}},8183:function(e,t,n){var r=n("738c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2aed7758",r,e)}},"81bf":function(e,t,n){"use strict";n.r(t);var r=n("a14c");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"820f":function(e,t,n){"use strict";var r=n("a593");e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},"825a":function(e,t,n){var r=n("861d"),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not an object")}},"826f":function(e,t,n){"use strict";n.r(t);var r=n("0b70");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"827e":function(e,t,n){"use strict";var r=n("480d");function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e,t=new i((function(t){e=t}));return{token:t,cancel:e}},e.exports=i},"83ab":function(e,t,n){var r=n("d039");e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"83b9":function(e,t,n){"use strict";var r=n("d925"),i=n("e683");e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},"848b":function(e,t,n){"use strict";var r=n("4a0c"),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},a=r.version.split(".");function s(e,t){for(var n=t?t.split("."):a,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]0){var o=r[i],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}}i.transitional=function(e,t,n){var i=t&&s(t);function a(e,t){return"[Axios v"+r.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(a(r," has been removed in "+t));return i&&!o[r]&&(o[r]=!0,console.warn(a(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={isOlderVersion:s,assertOptions:c,validators:i}},"85fe":function(e,t,n){"use strict";(function(e){function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},a=function(a){for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u1){var r=e.find((function(e){return e.isIntersecting}));r&&(t=r)}if(n.callback){var i=t.isIntersecting&&t.intersectionRatio>=n.threshold;if(i===n.oldResult)return;n.oldResult=i,n.callback(i,t)}}),this.options.intersection),t.context.$nextTick((function(){n.observer&&n.observer.observe(n.el)}))}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&this.options.intersection.threshold||0}}]),e}();function m(e,t,n){var r=t.value;if(r)if("undefined"===typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new p(e,r,n);e._vue_visibilityState=i}}function v(e,t,n){var r=t.value,i=t.oldValue;if(!h(r,i)){var o=e._vue_visibilityState;r?o?o.createObserver(r,n):m(e,{value:r},n):g(e)}}function g(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var y={bind:m,update:v,unbind:g};function b(e){e.directive("observe-visibility",y)}var _={version:"0.4.6",install:b},w=null;"undefined"!==typeof window?w=window.Vue:"undefined"!==typeof e&&(w=e.Vue),w&&w.use(_)}).call(this,n("c8ba"))},"861d":function(e,t,n){var r=n("1626");e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},8707:function(e,t,n){ + */function yr(e,t){"undefined"!==typeof console&&(console.warn("[vue-i18n] "+e),t&&console.warn(t.stack))}function br(e,t){"undefined"!==typeof console&&(console.error("[vue-i18n] "+e),t&&console.error(t.stack))}var _r=Array.isArray;function wr(e){return null!==e&&"object"===typeof e}function xr(e){return"boolean"===typeof e}function Sr(e){return"string"===typeof e}var kr=Object.prototype.toString,Er="[object Object]";function Cr(e){return kr.call(e)===Er}function Tr(e){return null===e||void 0===e}function Ir(e){return"function"===typeof e}function Rr(){var e=[],t=arguments.length;while(t--)e[t]=arguments[t];var n=null,r=null;return 1===e.length?wr(e[0])||_r(e[0])?r=e[0]:"string"===typeof e[0]&&(n=e[0]):2===e.length&&("string"===typeof e[0]&&(n=e[0]),(wr(e[1])||_r(e[1]))&&(r=e[1])),{locale:n,params:r}}function Or(e){return JSON.parse(JSON.stringify(e))}function Mr(e,t){if(e.delete(t))return e}function Pr(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}function Ar(e,t){return!!~e.indexOf(t)}var jr=Object.prototype.hasOwnProperty;function Dr(e,t){return jr.call(e,t)}function Lr(e){for(var t=arguments,n=Object(e),r=1;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ur(e){return null!=e&&Object.keys(e).forEach((function(t){"string"==typeof e[t]&&(e[t]=$r(e[t]))})),e}function Br(e){e.prototype.hasOwnProperty("$i18n")||Object.defineProperty(e.prototype,"$i18n",{get:function(){return this._i18n}}),e.prototype.$t=function(e){var t=[],n=arguments.length-1;while(n-- >0)t[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[e,r.locale,r._getMessages(),this].concat(t))},e.prototype.$tc=function(e,t){var n=[],r=arguments.length-2;while(r-- >0)n[r]=arguments[r+2];var i=this.$i18n;return i._tc.apply(i,[e,i.locale,i._getMessages(),this,t].concat(n))},e.prototype.$te=function(e,t){var n=this.$i18n;return n._te(e,n.locale,n._getMessages(),t)},e.prototype.$d=function(e){var t,n=[],r=arguments.length-1;while(r-- >0)n[r]=arguments[r+1];return(t=this.$i18n).d.apply(t,[e].concat(n))},e.prototype.$n=function(e){var t,n=[],r=arguments.length-1;while(r-- >0)n[r]=arguments[r+1];return(t=this.$i18n).n.apply(t,[e].concat(n))}}function Fr(t){function n(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return void 0===t&&(t=!1),t?{mounted:n}:{beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n)if(t.i18n instanceof Ui){if(t.__i18nBridge||t.__i18n)try{var n=t.i18n&&t.i18n.messages?t.i18n.messages:{},r=t.__i18nBridge||t.__i18n;r.forEach((function(e){n=Lr(n,JSON.parse(e))})),Object.keys(n).forEach((function(e){t.i18n.mergeLocaleMessage(e,n[e])}))}catch(e){0}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(Cr(t.i18n)){var i=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Ui?this.$root.$i18n:null;if(i&&(t.i18n.root=this.$root,t.i18n.formatter=i.formatter,t.i18n.fallbackLocale=i.fallbackLocale,t.i18n.formatFallbackMessages=i.formatFallbackMessages,t.i18n.silentTranslationWarn=i.silentTranslationWarn,t.i18n.silentFallbackWarn=i.silentFallbackWarn,t.i18n.pluralizationRules=i.pluralizationRules,t.i18n.preserveDirectiveContent=i.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{var o=t.i18n&&t.i18n.messages?t.i18n.messages:{},a=t.__i18nBridge||t.__i18n;a.forEach((function(e){o=Lr(o,JSON.parse(e))})),t.i18n.messages=o}catch(e){0}var s=t.i18n,c=s.sharedMessages;c&&Cr(c)&&(t.i18n.messages=Lr(t.i18n.messages,c)),this._i18n=new Ui(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),i&&i.onComponentInstanceCreated(this._i18n)}else 0;else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Ui?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Ui&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var e=this.$options;e.i18n=e.i18n||(e.__i18nBridge||e.__i18n?{}:null),e.i18n?(e.i18n instanceof Ui||Cr(e.i18n))&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Ui||e.parent&&e.parent.$i18n&&e.parent.$i18n instanceof Ui)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:n,beforeDestroy:function(){if(this._i18n){var e=this;this.$nextTick((function(){e._subscribing&&(e._i18n.unsubscribeDataChanging(e),delete e._subscribing),e._i18nWatcher&&(e._i18nWatcher(),e._i18n.destroyVM(),delete e._i18nWatcher),e._localeWatcher&&(e._localeWatcher(),delete e._localeWatcher)}))}}}}var zr={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(e,t){var n=t.data,r=t.parent,i=t.props,o=t.slots,a=r.$i18n;if(a){var s=i.path,c=i.locale,l=i.places,u=o(),d=a.i(s,c,qr(u)||l?Wr(u.default,l):u),f=i.tag&&!0!==i.tag||!1===i.tag?i.tag:"span";return f?e(f,n,d):d}}};function qr(e){var t;for(t in e)if("default"!==t)return!1;return Boolean(t)}function Wr(e,t){var n=t?Kr(t):{};if(!e)return n;e=e.filter((function(e){return e.tag||""!==e.text.trim()}));var r=e.every(Hr);return e.reduce(r?Vr:Gr,n)}function Kr(e){return Array.isArray(e)?e.reduce(Gr,{}):Object.assign({},e)}function Vr(e,t){return t.data&&t.data.attrs&&t.data.attrs.place&&(e[t.data.attrs.place]=t),e}function Gr(e,t,n){return e[n]=t,e}function Hr(e){return Boolean(e.data&&e.data.attrs&&e.data.attrs.place)}var Yr,Jr={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(e,t){var n=t.props,r=t.parent,i=t.data,o=r.$i18n;if(!o)return null;var a=null,s=null;Sr(n.format)?a=n.format:wr(n.format)&&(n.format.key&&(a=n.format.key),s=Object.keys(n.format).reduce((function(e,t){var r;return Ar(gr,t)?Object.assign({},e,(r={},r[t]=n.format[t],r)):e}),null));var c=n.locale||o.locale,l=o._ntp(n.value,c,a,s),u=l.map((function(e,t){var n,r=i.scopedSlots&&i.scopedSlots[e.type];return r?r((n={},n[e.type]=e.value,n.index=t,n.parts=l,n)):e.value})),d=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return d?e(d,{attrs:i.attrs,class:i["class"],staticClass:i.staticClass},u):u}};function Xr(e,t,n){ei(e,n)&&ni(e,t,n)}function Zr(e,t,n,r){if(ei(e,n)){var i=n.context.$i18n;ti(e,n)&&Nr(t.value,t.oldValue)&&Nr(e._localeMessage,i.getLocaleMessage(i.locale))||ni(e,t,n)}}function Qr(e,t,n,r){var i=n.context;if(i){var o=n.context.$i18n||{};t.modifiers.preserve||o.preserveDirectiveContent||(e.textContent=""),e._vt=void 0,delete e["_vt"],e._locale=void 0,delete e["_locale"],e._localeMessage=void 0,delete e["_localeMessage"]}else yr("Vue instance does not exists in VNode context")}function ei(e,t){var n=t.context;return n?!!n.$i18n||(yr("VueI18n instance does not exists in Vue instance"),!1):(yr("Vue instance does not exists in VNode context"),!1)}function ti(e,t){var n=t.context;return e._locale===n.$i18n.locale}function ni(e,t,n){var r,i,o=t.value,a=ri(o),s=a.path,c=a.locale,l=a.args,u=a.choice;if(s||c||l)if(s){var d=n.context;e._vt=e.textContent=null!=u?(r=d.$i18n).tc.apply(r,[s,u].concat(ii(c,l))):(i=d.$i18n).t.apply(i,[s].concat(ii(c,l))),e._locale=d.$i18n.locale,e._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}else yr("`path` is required in v-t directive");else yr("value type not supported")}function ri(e){var t,n,r,i;return Sr(e)?t=e:Cr(e)&&(t=e.path,n=e.locale,r=e.args,i=e.choice),{path:t,locale:n,args:r,choice:i}}function ii(e,t){var n=[];return e&&n.push(e),t&&(Array.isArray(t)||Cr(t))&&n.push(t),n}function oi(e,t){void 0===t&&(t={bridge:!1}),oi.installed=!0,Yr=e;Yr.version&&Number(Yr.version.split(".")[0]);Br(Yr),Yr.mixin(Fr(t.bridge)),Yr.directive("t",{bind:Xr,update:Zr,unbind:Qr}),Yr.component(zr.name,zr),Yr.component(Jr.name,Jr);var n=Yr.config.optionMergeStrategies;n.i18n=function(e,t){return void 0===t?e:t}}var ai=function(){this._caches=Object.create(null)};ai.prototype.interpolate=function(e,t){if(!t)return[e];var n=this._caches[e];return n||(n=li(e),this._caches[e]=n),ui(n,t)};var si=/^(?:\d)+/,ci=/^(?:\w)+/;function li(e){var t=[],n=0,r="";while(n0)d--,u=bi,f[di]();else{if(d=0,void 0===n)return!1;if(n=Ri(n),!1===n)return!1;f[fi]()}};while(null!==u)if(l++,t=e[l],"\\"!==t||!h()){if(i=Ii(t),s=ki[u],o=s[i]||s["else"]||Si,o===Si)return;if(u=o[0],a=f[o[1]],a&&(r=o[2],r=void 0===r?t:r,!1===a()))return;if(u===xi)return c}}var Mi=function(){this._cache=Object.create(null)};Mi.prototype.parsePath=function(e){var t=this._cache[e];return t||(t=Oi(e),t&&(this._cache[e]=t)),t||[]},Mi.prototype.getPathValue=function(e,t){if(!wr(e))return null;var n=this.parsePath(t);if(0===n.length)return null;var r=n.length,i=e,o=0;while(o/,ji=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|./]+|\([\w\-_|./]+\)))/g,Di=/^@(?:\.([a-z]+))?:/,Li=/[()]/g,Ni={upper:function(e){return e.toLocaleUpperCase()},lower:function(e){return e.toLocaleLowerCase()},capitalize:function(e){return""+e.charAt(0).toLocaleUpperCase()+e.substr(1)}},$i=new ai,Ui=function(e){var t=this;void 0===e&&(e={}),!Yr&&"undefined"!==typeof window&&window.Vue&&oi(window.Vue);var n=e.locale||"en-US",r=!1!==e.fallbackLocale&&(e.fallbackLocale||"en-US"),i=e.messages||{},o=e.dateTimeFormats||e.datetimeFormats||{},a=e.numberFormats||{};this._vm=null,this._formatter=e.formatter||$i,this._modifiers=e.modifiers||{},this._missing=e.missing||null,this._root=e.root||null,this._sync=void 0===e.sync||!!e.sync,this._fallbackRoot=void 0===e.fallbackRoot||!!e.fallbackRoot,this._fallbackRootWithEmptyString=void 0===e.fallbackRootWithEmptyString||!!e.fallbackRootWithEmptyString,this._formatFallbackMessages=void 0!==e.formatFallbackMessages&&!!e.formatFallbackMessages,this._silentTranslationWarn=void 0!==e.silentTranslationWarn&&e.silentTranslationWarn,this._silentFallbackWarn=void 0!==e.silentFallbackWarn&&!!e.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new Mi,this._dataListeners=new Set,this._componentInstanceCreatedListener=e.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==e.preserveDirectiveContent&&!!e.preserveDirectiveContent,this.pluralizationRules=e.pluralizationRules||{},this._warnHtmlInMessage=e.warnHtmlInMessage||"off",this._postTranslation=e.postTranslation||null,this._escapeParameterHtml=e.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in e&&(this.__VUE_I18N_BRIDGE__=e.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(e,n){var r=Object.getPrototypeOf(t);if(r&&r.getChoiceIndex){var i=r.getChoiceIndex;return i.call(t,e,n)}var o=function(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0};return t.locale in t.pluralizationRules?t.pluralizationRules[t.locale].apply(t,[e,n]):o(e,n)},this._exist=function(e,n){return!(!e||!n)&&(!Tr(t._path.getPathValue(e,n))||!!e[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(i).forEach((function(e){t._checkLocaleMessage(e,t._warnHtmlInMessage,i[e])})),this._initVM({locale:n,fallbackLocale:r,messages:i,dateTimeFormats:o,numberFormats:a})},Bi={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};Ui.prototype._checkLocaleMessage=function(e,t,n){var r=[],i=function(e,t,n,r){if(Cr(n))Object.keys(n).forEach((function(o){var a=n[o];Cr(a)?(r.push(o),r.push("."),i(e,t,a,r),r.pop(),r.pop()):(r.push(o),i(e,t,a,r),r.pop())}));else if(_r(n))n.forEach((function(n,o){Cr(n)?(r.push("["+o+"]"),r.push("."),i(e,t,n,r),r.pop(),r.pop()):(r.push("["+o+"]"),i(e,t,n,r),r.pop())}));else if(Sr(n)){var o=Ai.test(n);if(o){var a="Detected HTML in message '"+n+"' of keypath '"+r.join("")+"' at '"+t+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===e?yr(a):"error"===e&&br(a)}}};i(t,e,n,r)},Ui.prototype._initVM=function(e){var t=Yr.config.silent;Yr.config.silent=!0,this._vm=new Yr({data:e,__VUE18N__INSTANCE__:!0}),Yr.config.silent=t},Ui.prototype.destroyVM=function(){this._vm.$destroy()},Ui.prototype.subscribeDataChanging=function(e){this._dataListeners.add(e)},Ui.prototype.unsubscribeDataChanging=function(e){Mr(this._dataListeners,e)},Ui.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",(function(){var t=Pr(e._dataListeners),n=t.length;while(n--)Yr.nextTick((function(){t[n]&&t[n].$forceUpdate()}))}),{deep:!0})},Ui.prototype.watchLocale=function(e){if(e){if(!this.__VUE_I18N_BRIDGE__)return null;var t=this,n=this._vm;return this.vm.$watch("locale",(function(r){n.$set(n,"locale",r),t.__VUE_I18N_BRIDGE__&&e&&(e.locale.value=r),n.$forceUpdate()}),{immediate:!0})}if(!this._sync||!this._root)return null;var r=this._vm;return this._root.$i18n.vm.$watch("locale",(function(e){r.$set(r,"locale",e),r.$forceUpdate()}),{immediate:!0})},Ui.prototype.onComponentInstanceCreated=function(e){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(e,this)},Bi.vm.get=function(){return this._vm},Bi.messages.get=function(){return Or(this._getMessages())},Bi.dateTimeFormats.get=function(){return Or(this._getDateTimeFormats())},Bi.numberFormats.get=function(){return Or(this._getNumberFormats())},Bi.availableLocales.get=function(){return Object.keys(this.messages).sort()},Bi.locale.get=function(){return this._vm.locale},Bi.locale.set=function(e){this._vm.$set(this._vm,"locale",e)},Bi.fallbackLocale.get=function(){return this._vm.fallbackLocale},Bi.fallbackLocale.set=function(e){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",e)},Bi.formatFallbackMessages.get=function(){return this._formatFallbackMessages},Bi.formatFallbackMessages.set=function(e){this._formatFallbackMessages=e},Bi.missing.get=function(){return this._missing},Bi.missing.set=function(e){this._missing=e},Bi.formatter.get=function(){return this._formatter},Bi.formatter.set=function(e){this._formatter=e},Bi.silentTranslationWarn.get=function(){return this._silentTranslationWarn},Bi.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e},Bi.silentFallbackWarn.get=function(){return this._silentFallbackWarn},Bi.silentFallbackWarn.set=function(e){this._silentFallbackWarn=e},Bi.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},Bi.preserveDirectiveContent.set=function(e){this._preserveDirectiveContent=e},Bi.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},Bi.warnHtmlInMessage.set=function(e){var t=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=e,n!==e&&("warn"===e||"error"===e)){var r=this._getMessages();Object.keys(r).forEach((function(e){t._checkLocaleMessage(e,t._warnHtmlInMessage,r[e])}))}},Bi.postTranslation.get=function(){return this._postTranslation},Bi.postTranslation.set=function(e){this._postTranslation=e},Bi.sync.get=function(){return this._sync},Bi.sync.set=function(e){this._sync=e},Ui.prototype._getMessages=function(){return this._vm.messages},Ui.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},Ui.prototype._getNumberFormats=function(){return this._vm.numberFormats},Ui.prototype._warnDefault=function(e,t,n,r,i,o){if(!Tr(n))return n;if(this._missing){var a=this._missing.apply(null,[e,t,r,i]);if(Sr(a))return a}else 0;if(this._formatFallbackMessages){var s=Rr.apply(void 0,i);return this._render(t,o,s.params,t)}return t},Ui.prototype._isFallbackRoot=function(e){return(this._fallbackRootWithEmptyString?!e:Tr(e))&&!Tr(this._root)&&this._fallbackRoot},Ui.prototype._isSilentFallbackWarn=function(e){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(e):this._silentFallbackWarn},Ui.prototype._isSilentFallback=function(e,t){return this._isSilentFallbackWarn(t)&&(this._isFallbackRoot()||e!==this.fallbackLocale)},Ui.prototype._isSilentTranslationWarn=function(e){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(e):this._silentTranslationWarn},Ui.prototype._interpolate=function(e,t,n,r,i,o,a){if(!t)return null;var s,c=this._path.getPathValue(t,n);if(_r(c)||Cr(c))return c;if(Tr(c)){if(!Cr(t))return null;if(s=t[n],!Sr(s)&&!Ir(s))return null}else{if(!Sr(c)&&!Ir(c))return null;s=c}return Sr(s)&&(s.indexOf("@:")>=0||s.indexOf("@.")>=0)&&(s=this._link(e,t,s,r,"raw",o,a)),this._render(s,i,o,n)},Ui.prototype._link=function(e,t,n,r,i,o,a){var s=n,c=s.match(ji);for(var l in c)if(c.hasOwnProperty(l)){var u=c[l],d=u.match(Di),f=d[0],h=d[1],p=u.replace(f,"").replace(Li,"");if(Ar(a,p))return s;a.push(p);var m=this._interpolate(e,t,p,r,"raw"===i?"string":i,"raw"===i?void 0:o,a);if(this._isFallbackRoot(m)){if(!this._root)throw Error("unexpected error");var v=this._root.$i18n;m=v._translate(v._getMessages(),v.locale,v.fallbackLocale,p,r,i,o)}m=this._warnDefault(e,p,m,r,_r(o)?o:[o],i),this._modifiers.hasOwnProperty(h)?m=this._modifiers[h](m):Ni.hasOwnProperty(h)&&(m=Ni[h](m)),a.pop(),s=m?s.replace(u,m):s}return s},Ui.prototype._createMessageContext=function(e,t,n,r){var i=this,o=_r(e)?e:[],a=wr(e)?e:{},s=function(e){return o[e]},c=function(e){return a[e]},l=this._getMessages(),u=this.locale;return{list:s,named:c,values:e,formatter:t,path:n,messages:l,locale:u,linked:function(e){return i._interpolate(u,l[u]||{},e,null,r,void 0,[e])}}},Ui.prototype._render=function(e,t,n,r){if(Ir(e))return e(this._createMessageContext(n,this._formatter||$i,r,t));var i=this._formatter.interpolate(e,n,r);return i||(i=$i.interpolate(e,n,r)),"string"!==t||Sr(i)?i:i.join("")},Ui.prototype._appendItemToChain=function(e,t,n){var r=!1;return Ar(e,t)||(r=!0,t&&(r="!"!==t[t.length-1],t=t.replace(/!/g,""),e.push(t),n&&n[t]&&(r=n[t]))),r},Ui.prototype._appendLocaleToChain=function(e,t,n){var r,i=t.split("-");do{var o=i.join("-");r=this._appendItemToChain(e,o,n),i.splice(-1,1)}while(i.length&&!0===r);return r},Ui.prototype._appendBlockToChain=function(e,t,n){for(var r=!0,i=0;i0)o[a]=arguments[a+4];if(!e)return"";var s=Rr.apply(void 0,o);this._escapeParameterHtml&&(s.params=Ur(s.params));var c=s.locale||t,l=this._translate(n,c,this.fallbackLocale,e,r,"string",s.params);if(this._isFallbackRoot(l)){if(!this._root)throw Error("unexpected error");return(i=this._root).$t.apply(i,[e].concat(o))}return l=this._warnDefault(c,e,l,r,o,"string"),this._postTranslation&&null!==l&&void 0!==l&&(l=this._postTranslation(l,e)),l},Ui.prototype.t=function(e){var t,n=[],r=arguments.length-1;while(r-- >0)n[r]=arguments[r+1];return(t=this)._t.apply(t,[e,this.locale,this._getMessages(),null].concat(n))},Ui.prototype._i=function(e,t,n,r,i){var o=this._translate(n,t,this.fallbackLocale,e,r,"raw",i);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(e,t,i)}return this._warnDefault(t,e,o,r,[i],"raw")},Ui.prototype.i=function(e,t,n){return e?(Sr(t)||(t=this.locale),this._i(e,t,this._getMessages(),null,n)):""},Ui.prototype._tc=function(e,t,n,r,i){var o,a=[],s=arguments.length-5;while(s-- >0)a[s]=arguments[s+5];if(!e)return"";void 0===i&&(i=1);var c={count:i,n:i},l=Rr.apply(void 0,a);return l.params=Object.assign(c,l.params),a=null===l.locale?[l.params]:[l.locale,l.params],this.fetchChoice((o=this)._t.apply(o,[e,t,n,r].concat(a)),i)},Ui.prototype.fetchChoice=function(e,t){if(!e||!Sr(e))return null;var n=e.split("|");return t=this.getChoiceIndex(t,n.length),n[t]?n[t].trim():e},Ui.prototype.tc=function(e,t){var n,r=[],i=arguments.length-2;while(i-- >0)r[i]=arguments[i+2];return(n=this)._tc.apply(n,[e,this.locale,this._getMessages(),null,t].concat(r))},Ui.prototype._te=function(e,t,n){var r=[],i=arguments.length-3;while(i-- >0)r[i]=arguments[i+3];var o=Rr.apply(void 0,r).locale||t;return this._exist(n[o],e)},Ui.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)},Ui.prototype.getLocaleMessage=function(e){return Or(this._vm.messages[e]||{})},Ui.prototype.setLocaleMessage=function(e,t){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,t)},Ui.prototype.mergeLocaleMessage=function(e,t){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,Lr("undefined"!==typeof this._vm.messages[e]&&Object.keys(this._vm.messages[e]).length?Object.assign({},this._vm.messages[e]):{},t))},Ui.prototype.getDateTimeFormat=function(e){return Or(this._vm.dateTimeFormats[e]||{})},Ui.prototype.setDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,t),this._clearDateTimeFormat(e,t)},Ui.prototype.mergeDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,Lr(this._vm.dateTimeFormats[e]||{},t)),this._clearDateTimeFormat(e,t)},Ui.prototype._clearDateTimeFormat=function(e,t){for(var n in t){var r=e+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},Ui.prototype._localizeDateTime=function(e,t,n,r,i){for(var o=t,a=r[o],s=this._getLocaleChain(t,n),c=0;c0)t[n]=arguments[n+1];var r=this.locale,i=null;return 1===t.length?Sr(t[0])?i=t[0]:wr(t[0])&&(t[0].locale&&(r=t[0].locale),t[0].key&&(i=t[0].key)):2===t.length&&(Sr(t[0])&&(i=t[0]),Sr(t[1])&&(r=t[1])),this._d(e,r,i)},Ui.prototype.getNumberFormat=function(e){return Or(this._vm.numberFormats[e]||{})},Ui.prototype.setNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,t),this._clearNumberFormat(e,t)},Ui.prototype.mergeNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,Lr(this._vm.numberFormats[e]||{},t)),this._clearNumberFormat(e,t)},Ui.prototype._clearNumberFormat=function(e,t){for(var n in t){var r=e+"__"+n;this._numberFormatters.hasOwnProperty(r)&&delete this._numberFormatters[r]}},Ui.prototype._getNumberFormatter=function(e,t,n,r,i,o){for(var a=t,s=r[a],c=this._getLocaleChain(t,n),l=0;l0)t[n]=arguments[n+1];var r=this.locale,i=null,o=null;return 1===t.length?Sr(t[0])?i=t[0]:wr(t[0])&&(t[0].locale&&(r=t[0].locale),t[0].key&&(i=t[0].key),o=Object.keys(t[0]).reduce((function(e,n){var r;return Ar(gr,n)?Object.assign({},e,(r={},r[n]=t[0][n],r)):e}),null)):2===t.length&&(Sr(t[0])&&(i=t[0]),Sr(t[1])&&(r=t[1])),this._n(e,r,i,o)},Ui.prototype._ntp=function(e,t,n,r){if(!Ui.availabilities.numberFormat)return[];if(!n){var i=r?new Intl.NumberFormat(t,r):new Intl.NumberFormat(t);return i.formatToParts(e)}var o=this._getNumberFormatter(e,t,this.fallbackLocale,this._getNumberFormats(),n,r),a=o&&o.formatToParts(e);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(e,t,n,r)}return a||[]},Object.defineProperties(Ui.prototype,Bi),Object.defineProperty(Ui,"availabilities",{get:function(){if(!Pi){var e="undefined"!==typeof Intl;Pi={dateTimeFormat:e&&"undefined"!==typeof Intl.DateTimeFormat,numberFormat:e&&"undefined"!==typeof Intl.NumberFormat}}return Pi}}),Ui.install=oi,Ui.version="8.27.0";var Fi=Ui,zi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"m-message-fade",mode:"in-out"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"m-message-wrapper",class:e.wrapperClassName,style:{width:e.width}},[n("mmessage",{class:[e.type&&"m-message--"+e.type,e.className],attrs:{event:e.event,chat:e.chat,closable:e.showClose,"is-collapsed":e.isCollapsed,"close-handler":e.close,"click-handler":e.click,title:e.title,supportHTML:e.supportHTML},nativeOn:{mouseenter:function(t){return e.clearTimer.apply(null,arguments)},mouseleave:function(t){return e.startTimer.apply(null,arguments)}}},[n("template",{slot:"icon"},[e.iconImg?n("img",{staticClass:"m-message--icon",attrs:{src:e.iconImg}}):e.type?n("icon",{staticClass:"m-message--icon",attrs:{name:e.type}}):e._e()],1)],2)],1)])},qi=[],Wi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"m-message"},[e.iconImg||e.$slots.icon?n("div",{staticClass:"m-message-icons",on:{click:e.handleClick}},[e.iconImg?n("img",{staticClass:"m-message--icon",attrs:{src:e.iconImg,alt:"Img"}}):e._t("icon")],2):e._e(),n("div",{staticClass:"m-message-content",on:{click:e.handleClick}},[e.title||e.$slots.title?n("div",{staticClass:"m-message--title"},[e._t("title",(function(){return[e._v(" "+e._s(e.title)+" ")]}))],2):e._e(),e.event&&e.chat?n("event",{attrs:{event:e.event,chat:e.chat,preview:!0}}):n("div",{staticClass:"m-message--body"},[e._t("message")],2)],1)])},Ki=[],Vi={name:"m-mmessage",props:{event:event,iconImg:String,closable:Boolean,closeHandler:Function,clickHandler:Function,chat:{},title:String,supportHTML:Boolean,isCollapsed:{type:Boolean,default:!0}},data(){return{visible:!0,collapsed:this.isCollapsed}},components:{event:()=>Promise.resolve().then(r.bind(null,"6167"))},methods:{triggerCollapse(){this.collapsed=!this.collapsed},handleClick:function(){"function"===typeof this.clickHandler&&this.clickHandler(this.close)},close(){this.visible=!1},handleClose(){"function"===typeof this.closeHandler?this.closeHandler(this.close):this.close()}},mounted(){}},Gi=Vi,Hi=Object(E["a"])(Gi,Wi,Ki,!1,null,null,null,!0),Yi=Hi.exports;const Ji={},Xi=function(e,t){Ji[e]=t},Zi={name:"Icon",props:{name:String,color:String},computed:{svg(){return Ji[this.name]}},render(e){const t=this.svg;if(!t)return console.warn(`The name of '${this.name}' could not be found.`),'';this.color?this.color:t.fill&&t.fill;return'\n \n { svg.defs && }\n { svg.path && }\n { svg.html && }\n {this.$slots.default}\n \n '}};Zi.add=Xi;var Qi=Zi,eo={name:"info",fill:"#1CADF2",viewBox:"0 0 1024 1024",path:"M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z"},to={name:"success",fill:"#17B77E",viewBox:"0 0 1024 1024",path:"M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z"},no={name:"error",fill:"#F56C6C",viewBox:"0 0 1024 1024",path:"M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z"},ro={name:"warning",fill:"#FFC603",viewBox:"0 0 1024 1024",path:"M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z"},io={name:"loading",viewBox:"0 0 50 50",class:"m-loading-icon m-loading-wipe",defs:"",html:''};Qi.add(eo.name,eo),Qi.add(to.name,to),Qi.add(no.name,no),Qi.add(ro.name,ro),Qi.add(io.name,io);var oo=Qi,ao={components:{Icon:oo,mmessage:Yi},data(){return{show:!1,type:"info",iconImg:"",title:"",message:{},roomId:"",event:null,chat:null,duration:3e3,showClose:!1,isCollapsed:!1,width:"",className:"",wrapperClassName:"",supportHTML:!1,onClose:null,onClick:null,timer:null,closed:!1}},watch:{closed(e){e&&(this.show=!1,this.$el.addEventListener("animationend",this.destroyElement))}},methods:{close(){this.closed=!0,"function"===typeof this.onClose&&this.onClose(this)},click(){"function"===typeof this.onClick&&this.onClick(this)},clearTimer(){clearTimeout(this.timer)},startTimer(){this.duration>0&&"loading"!==this.type&&(this.timer=setTimeout(()=>{this.closed||this.close()},this.duration))},destroyElement(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)}},mounted(){"loading"!==this.type&&(this.startTimer(),this.duration<=0&&(this.showClose=!0))}},so=ao,co=Object(E["a"])(so,zi,qi,!1,null,null,null,!0),lo=co.exports;const uo=s["default"].extend(lo),fo=[];let ho=1;const po={},mo=function(e){let t=e.onClose,n=e.onClick;const r=e.position||"top-center",i=e.hasMask||!1,o=r+(i?"-mask":"");let a=po[o];a||(a=po[o]=document.createElement("div"),a.className=["m-message-container","is-"+r,i?"has-mask":""].filter((function(e){return!!e})).join(" "),document.body.appendChild(a)),e.zIndex&&(a.style.zIndex=e.zIndex);const s=ho++;e.onClose=function(){mo.close(s,t)},e.onClick=function(){mo.click(s,n,t)};const c=new uo({el:document.createElement("div"),data:e});return c.id=s,c.containerKey=o,0===r.indexOf("bottom")&&a.firstChild?a.insertBefore(c.$el,a.firstChild):a.appendChild(c.$el),c.show=!0,fo.push(c),c};mo.click=function(e,t,n){for(let r=0,i=fo.length;r=0;e--)fo[e].close()};const vo=["info","success","error","warning","loading"];vo.forEach(e=>{mo[e]=function(t){return t="string"===typeof t?{message:t}:t,mo({...t,type:e})}});var go=mo;r("a45a");go.install=function(e,t){t&&t.name?e.prototype["$"+t.name]=go:e.prototype.$message=go};var yo=go,bo=(r("2e4b"),r("0086")),_o=r.n(bo),wo=r("03a5"),xo=r.n(wo),So=r("f206"),ko=r.n(So),Eo=r("6167"),Co=(r("c5c5"),r("1da1")),To=r("ade3"),Io=(r("907a"),{});class Ro{constructor(e,t){t||(t={}),this.core=e}tetatetchat(e){if(!e)return!1;if("undefined"!=typeof e.tetatet)return e.tetatet;var t=this.core.mtrx.chatUsersInfo(e.roomId),n=!1;return 2==t.length&&(n=e.name=="#"+this.tetatetid(t[0],t[1])),t.length>1&&(e.tetatet=n),n}tetatetid(e,t){var n=2;if(e.id==t.id)return null;var r=parseInt(e.id,16)*parseInt(t.id,16)*n;if(Io[r])return Io[r];var i=re["a"].sha224(r.toString()).toString("hex");return Io[r]=i,i}unknowngroupusers(e){return e&&"invite"===e._selfMembership&&!e.summary.members&&!this.tetatetchat(this.m_chat)}usersFromChats(e){var t={};return _.each(e,e=>{t[e.roomId]=_.map(_.uniq([].concat(_.toArray(e.currentState.members),e.summary.members||[]),e=>e.userId),(function(e){return{userId:re["a"].getmatrixid(e.userId),membership:e.membership,powerLevel:e.powerLevel}}))}),t}prepareChat(e){return this.usersInfoForChatsStore([e]).then(()=>this.core.pcrypto.addroom(e))}fillContacts(e){return e=_.filter(e,e=>"join"==e._selfMembership&&57==e.name.length),this.usersInfoForChatsStore(e).then(e=>{this.core.store.commit("SET_CONTACTS_FROM_MATRIX",_.filter(e,e=>!this.core.user.userinfo||e.id!==this.core.user.userinfo.id))})}usersInfoForChatsStore(e,t){return this.usersInfoForChats(e,t).then(t=>(this.core.store.commit("SET_CHATS_USERS",this.usersFromChats(e)),Promise.resolve(t))).catch(e=>Promise.resolve())}allchatmembers(e,t,n){var r=[],i=[];if(n)i=_.map(e,e=>"invite"!==e._selfMembership||e.summary.members&&!t||e.summary.membersloading?Promise.resolve():(e.summary.membersloading=!0,e._loadMembersFromServer().then(t=>(e.summary.membersloading=!1,e.summary.members=_.map(t,e=>({name:re["a"].getmatrixid(e.state_key),membership:e.content.membership,user:e,userId:e.state_key,powerLevel:e.content.powerLevel||0})),"invite"===e._selfMembership&&this.core.user.userinfo&&(_.find(e.summary.members,e=>e.userId==this.core.user.matrixId(this.core.user.userinfo.id))||e.summary.members.push({name:this.core.user.userinfo.id,membership:"invite",user:this.core.user.userinfo,userId:this.core.user.matrixId(this.core.user.userinfo.id),powerLevel:0})),Promise.resolve())).catch(t=>(e.summary.membersloading=!1,Promise.resolve()))));return Promise.all(i).then(t=>(_.each(e,e=>{r=r.concat(_.toArray(e.currentState.members),e.summary.members||[])}),r=_.uniq(r,(function(e){return e.userId})),Promise.resolve(r)))}usersInfoForChats(e,t){return this.allchatmembers(e,t).then(e=>this.usersInfo(e,t))}usersInfoById(e){var t=[re["a"].getmatrixid(e)];return this.core.user.usersInfo(t,!1).then(e=>Promise.resolve(e[0]))}usersInfo(e,t){var n=_.map(e,(function(e){return re["a"].getmatrixid(e.userId)}));return n=_.uniq(n),this.core.user.usersInfo(n,!1,t)}groupId(e){let t=[],n=[];e.forEach(e=>{n.push(this.core.user.matrixId(e.id))}),e.forEach((function(e){let n=parseInt(e.id,16);t.push(n)}));const r=t.reduce((e,t)=>e*t,1),i=re["a"].makeid(r);let o=re["a"].sha224(i.toString()).toString("hex");return{hash:o,idForInviting:n}}groupIdLight(e){let t=[],n=[];var r=[null];window.chatinvitedomains&&(r=[].concat(r,window.chatinvitedomains)),_.each(r,t=>{_.each(e,e=>{n.push(this.core.user.matrixId(e,t))})}),_.each(e,e=>{let n=parseInt(e,16);t.push(n)});const i=t.reduce((e,t)=>e*t,1),o=re["a"].makeid(i);let a=re["a"].sha224(o.toString()).toString("hex");return{hash:a,idForInviting:n}}chatIsPublic(e){var t=e.currentState.getStateEvents("m.room.join_rules");return!!_.find(t,e=>"public"==re["a"].deep(e,"event.content.join_rule"))}}var Oo=Ro,Mo=r("5059");var Po=function(){return Po=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=r+n?(r=o,[4,No(0)]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++i,[3,1];case 4:return[2]}}))}))}function zo(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function qo(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Wo(e,t){return t%=64,32===t?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function Ko(e,t){return t%=64,0===t?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=qo(e,[4283543511,3981806797]),e=Vo(e,[0,e[0]>>>1]),e=qo(e,[3301882366,444984403]),e=Vo(e,[0,e[0]>>>1]),e}function Ho(e,t){e=e||"",t=t||0;var n,r=e.length%16,i=e.length-r,o=[0,t],a=[0,t],s=[0,0],c=[0,0],l=[2277735313,289559509],u=[1291169091,658871167];for(n=0;n>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function Yo(e){var t;return Po({name:e.name,message:e.message,stack:null===(t=e.stack)||void 0===t?void 0:t.split("\n")},e)}function Jo(e,t){for(var n=0,r=e.length;n=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function ra(e){for(var t,n,r="Unexpected syntax '"+e+"'",i=/^\s*([a-z-]*)(.*)$/i.exec(e),o=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var l=s.exec(i[2]);if(!l)break;var u=l[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(r);c(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[o,a]}function ia(e){return e&&"object"===typeof e&&"message"in e?e:{message:e}}function oa(e,t){var n=function(e){return"function"!==typeof e},r=new Promise((function(r){var i=Date.now();Bo(e.bind(null,t),(function(){for(var e=[],t=0;t=4}function ca(){var e=window,t=navigator;return ta(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!sa()}function la(){var e=window,t=navigator;return ta(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function ua(){var e=window,t=navigator;return ta(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function da(){var e=window;return ta(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function fa(){var e,t,n=window;return ta(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function ha(){var e=window;return ta([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl==="[object Intl]",""+e.Reflect==="[object Reflect]"])>=3}function pa(){var e=window;return ta(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function ma(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return ta(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function va(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function ga(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function ya(){var e=la(),t=fa();if(!e&&!t)return!1;var n=window;return ta(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function ba(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(_a())return-1;var n=4500,r=5e3,i=new t(1,r,44100),o=i.createOscillator();o.type="triangle",o.frequency.value=1e4;var a=i.createDynamicsCompressor();a.threshold.value=-50,a.knee.value=40,a.ratio.value=12,a.attack.value=0,a.release.value=.25,o.connect(a),a.connect(i.destination),o.start(0);var s=wa(i),c=s[0],l=s[1],u=c.then((function(e){return xa(e.getChannelData(0).subarray(n))}),(function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return u.catch((function(){})),function(){return l(),u}}function _a(){return ua()&&!da()&&!pa()}function wa(e){var t=3,n=500,r=500,i=5e3,o=function(){},a=new Promise((function(a,s){var c=!1,l=0,u=0;e.oncomplete=function(e){return a(e.renderedBuffer)};var d=function(){setTimeout((function(){return s(Sa("timeout"))}),Math.min(r,u+i-Date.now()))},f=function(){try{switch(e.startRendering(),e.state){case"running":u=Date.now(),c&&d();break;case"suspended":document.hidden||l++,c&&l>=t?s(Sa("suspended")):setTimeout(f,n);break}}catch(r){s(r)}};f(),o=function(){c||(c=!0,u>0&&d())}}));return[a,o]}function xa(e){for(var t=0,n=0;n=0?"+":"")+Math.abs(r)}function ns(){var e=(new Date).getFullYear();return Math.max(Qo(new Date(e,0,1).getTimezoneOffset()),Qo(new Date(e,6,1).getTimezoneOffset()))}function rs(){try{return!!window.sessionStorage}catch(e){return!0}}function is(){try{return!!window.localStorage}catch(e){return!0}}function os(){if(!sa()&&!ca())try{return!!window.indexedDB}catch(e){return!0}}function as(){return!!window.openDatabase}function ss(){return navigator.cpuClass}function cs(){var e=navigator.platform;return"MacIntel"===e&&ua()&&!da()?ma()?"iPad":"iPhone":e}function ls(){return navigator.vendor||""}function us(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t.6*t.length})),i.sort(),[2,i]}}))}))}function ps(){return ua()||ya()}function ms(e){var t;return Ao(this,void 0,void 0,(function(){var n,r,i,o,a,s,c;return jo(this,(function(l){switch(l.label){case 0:for(n=document,r=n.createElement("div"),i=new Array(e.length),o={},vs(r),c=0;c')}var $s={fonts:Oa,domBlockers:hs,fontPreferences:Ls,audio:ba,screenFrame:Xa,osCpu:Ba,languages:Fa,colorDepth:za,deviceMemory:qa,screenResolution:Wa,hardwareConcurrency:es,timezone:ts,sessionStorage:rs,localStorage:is,indexedDB:os,openDatabase:as,cpuClass:ss,platform:cs,plugins:Ma,canvas:Pa,touchSupport:Ua,vendor:ls,vendorFlavors:us,cookiesEnabled:ds,colorGamut:ys,invertedColors:bs,forcedColors:ws,monochrome:ks,contrast:Es,reducedMotion:Ts,hdr:Rs,math:As};function Us(e){return aa($s,e,[])}var Bs="$ if upgrade to Pro: https://fpjs.dev/pro";function Fs(e){var t=zs(e),n=qs(t);return{score:t,comment:Bs.replace(/\$/g,""+n)}}function zs(e){if(ya())return.4;if(ua())return da()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function qs(e){return na(.99+.01*e,1e-4)}function Ws(e){for(var t="",n=0,r=Object.keys(e).sort();n=.01))try{var e=new XMLHttpRequest;e.open("get","https://openfpcdn.io/fingerprintjs/v"+Lo+"/npm-monitoring",!0),e.send()}catch(t){console.error(t)}}function Xs(e){var t=void 0===e?{}:e,n=t.delayFallback,r=t.debug,i=t.monitoring,o=void 0===i||i;return Ao(this,void 0,void 0,(function(){var e;return jo(this,(function(t){switch(t.label){case 0:return o&&Js(),[4,Hs(n)];case 1:return t.sent(),e=Us({debug:r}),[2,Ys(e,r)]}}))}))}var Zs={load:Xs,hashComponents:Vs,componentsToDebugString:Ks},Qs=Zs,ec=r("4328"),tc=r.n(ec),nc=r("21a6"),rc=r.n(nc),ic=r("6129");const oc=r("0a00");var ac=r("bc3a");class sc{constructor(e,t){Object(To["a"])(this,"fastsync",(function(){var e=this.client.getSyncState();if("PREPARED"!==e&&"SYNCING"!==e)return this.client.retryImmediately().catch(e=>{console.log("fastsyncerror",e)})})),t||(t={}),this.core=e,this.baseUrl=t.baseUrl,this.ready=!1,this.error=!1,this.kit=new Oo(this.core,t),this.sdk=oc,this.sync="",this.nd=!1,this.version=4,this.dversion="2",this.backup={},this.db=null,this.customrequest=!0,this.devicekey="m8_device"}setCredentials(){var e=this;return Object(Co["a"])((function*(){return e.core.user.matrixCredentials().then(t=>(e.credentials=t,Promise.resolve(t)))}))()}getDevices(){var t=localStorage[this.devicekey]||"";if(t)try{var n=JSON.parse(t);return n}catch(e){}return{}}setDevice(e,t){var n=this.getDevices();n[t]=e,localStorage[this.devicekey]=JSON.stringify(n),localStorage.device_=JSON.stringify(e)}getDevice(e){}request(t,n){var r=null,i=null;const o=ac.CancelToken.source();var a={url:t.uri,params:t.qs,data:JSON.parse(t.body||"{}"),timeout:t.timeout,headers:t.headers,json:t.json,method:t.method,withCredentials:t.withCredentials,_matrix_opts:t,cancelToken:o.token,paramsSerializer:function(e){return tc.a.stringify(e,t.qsStringifyOptions)}},s=ac(a).then(e=>Promise.resolve(e)).catch(e=>(i=e,r=e.response,Promise.resolve(r))).then(t=>{var r=i;if(i)try{r=JSON.parse(re["a"].deep(t,"request.responseText")),i=new oc.MatrixError(r)}catch(e){}n(i,t,re["a"].deep(t,"request.responseText")||"")});return s.abort=function(){o.cancel()},s}getFingerprint(){var e=this;return Object(Co["a"])((function*(){var t=yield Qs.load(),n=yield t.get();return n.visitorId+e.dversion}))()}createMtrxClient(e){var t=oc.createClient(e);return t.getProfileInfo=function(){return Promise.resolve({avatar_url:"",displayname:"test"})},t}getClient(){var t=this;return Object(Co["a"])((function*(){yield t.setCredentials();var n={baseUrl:t.baseUrl},r={baseUrl:t.baseUrl};t.customrequest&&(r.request=t.request);var i=t.createMtrxClient(r);try{var o=yield i.login("m.login.password",{user:t.credentials.username,password:t.credentials.password})}catch(e){if(e&&e.indexOf&&e.indexOf("M_USER_DEACTIVATED")>-1)return t.error="M_USER_DEACTIVATED",null;if(!(yield i.isUsernameAvailable(t.credentials.username)))throw"Signup error, username is not available: "+e;o=yield i.register(t.credentials.username,t.credentials.password,null,{type:"m.login.dummy"})}localStorage.accessToken=o.access_token;var a=new oc.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-js-sdk:"+t.credentials.username});yield a.startup(),Object.assign(n,{userId:o.user_id,accessToken:o.access_token,unstableClientRelationAggregation:!0,timelineSupport:!0,store:a}),t.customrequest&&(n.request=t.request);var s=t.createMtrxClient(n);return window.client=s,window.core=t.core,yield s.startClient({pollTimeout:6e4,resolveInvitesToProfiles:!0}),t.access=n,t.client=s,s}))()}clearstorage(e){var t=Object.keys(localStorage),n=t.length;while(n--)t[n]&&0==t[n].indexOf(e)&&localStorage.removeItem(t[n])}clearstore(){var e=Number(localStorage.matrixversion||"0");if(ethis.ready).then(()=>this.error?Promise.reject(this.error):Promise.resolve())}waitchats(){return re["a"].pretry(()=>this.chatsready).then(()=>this.error?Promise.reject(this.error):Promise.resolve())}me(e){var t;return re["a"].getmatrixid(e)==(null===(t=this.core.user.userinfo)||void 0===t?void 0:t.id)}reciepts(e){var t=null;return re["a"].pretry(()=>{var n=this.core.mtrx.store.rooms;return t=n[e.getRoomId()],t}).then(()=>t.getReceiptsForEvent(e))}storeFileLocal(e,t){return t.arrayBuffer().then(n=>{const r=new Blob([new Uint8Array(n)],{type:t.type});return window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.storage&&window.cordova?window.POCKETNETINSTANCE.storage.saveFile(e,r):this.db?this.db.set(e,r):void 0})}download(e){var t=()=>re["a"].fetchLocal(e).then(t=>(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.storage&&window.cordova?window.POCKETNETINSTANCE.storage.saveFile(e,t.data):this.db&&this.db.set(e,t.data),Promise.resolve(t.data)));return window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.storage&&window.cordova?window.POCKETNETINSTANCE.storage.loadFile(e).then(e=>Promise.resolve(e),e=>t()):this.db?this.db.get(e).then(e=>Promise.resolve(e)).catch(()=>t()):t()}customRoomType(e){var t,n=this.core.mtrx.client.getRoom(e);if(!n)return null;var r=n.currentState.getStateEvents("m.room.custom","")||{};return null===(t=r.event)||void 0===t?void 0:t.content.type}isReaded(e,t){return this.reciepts(e).then(e=>Promise.resolve(_.find(e,e=>{var n=this.me(e.userId);return"m.read"==e.type&&(t&&n||!n&&!t)})))}initEvents(){let e=this.core.mtrx.client.credentials.userId;this.client.on("RoomMember.membership",(t,n)=>{this.chatsready&&("invite"!==n.membership&&"join"!==n.membership||t.getSender()===e||this.core.notifier.event(t))}),this.client.on("Room.timeline",(t,n)=>{if(this.chatsready&&t.event.content&&("m.file"===t.event.content.msgtype&&(t.event.content.pbody=JSON.parse(t.event.content.body)),t.getSender()!==e)){var r=this.core.mtrx.client.getRoom(t.event.room_id);if(t.event.content["m.relates_to"]&&"m.replace"==t.event.content["m.relates_to"]["rel_type"])return!1;r&&this.core.pcrypto.rooms[t.event.room_id]&&this.core.notifier.event(t,r)}}),this.client.on("RoomMember.typing",(e,t)=>{this.core.store.dispatch("TYPING_EVENT",t)}),this.client.on("sync",(e,t,n)=>{"PREPARED"===e&&this.setready(),this.core.store.dispatch("FETCH_CHATS").then(e=>{this.core.store.dispatch("FETCH_EVENTS"),this.core.store.commit("ALL_NOTIFICATIONS_COUNT",this.client.getRooms())})})}setready(){this.chatsready||(this.chatsready=!0,this.core.store.commit("SET_CHATS_READY",!0))}initdb(){return Object(ic["a"])("files",1).then(e=>(this.db=e,Promise.resolve())).catch(()=>Promise.resolve())}init(){return this.createClient().then(()=>this.error?Promise.reject(this.error):this.initdb()).then(()=>(this.initEvents(),Promise.resolve()))}deactivateAccount(){return this.client?this.client.deactivateAccount(this.credentials,!0):Promise.reject("noclient")}destroy(){this.client&&(window.cordova&&this.deletePusher(),this.client.stopClient()),this.chatsready=!1,this.ready=!1,this.error=!1}deletePusher(){var e;if(window.cordova&&(localStorage&&(e=localStorage.getItem("fcmtoken5")),e&&this.client.setPusher)){var t="pocketnet",n={app_display_name:t,app_id:t+window.cordova.platformId,data:{url:this.core.mtrx.baseUrl+"/_matrix/push/v1/notify",default_payload:{aps:{sound:"default","content-available":1}}},device_display_name:window.device.manufacturer+" "+window.device.model,kind:null,lang:localStorage.getItem("loc")||"en",pushkey:e};this.core.mtrx.client.setPusher(n).then(()=>{localStorage.removeItem("fcmtoken5")},e=>{console.log(e)})}}uploadContent(e,t){return this.client.uploadContent(e).then(e=>Promise.resolve(this.core.mtrx.client.mxcUrlToHttp(e))).then(n=>t?this.storeFileLocal(n,e).then(()=>Promise.resolve(n)).catch(e=>Promise.resolve(n)):Promise.resolve())}originalEvent(t,n){var r=n._timelineSet.getRelationsForEvent(e.event.event_id,"m.reference","m.room.message");if(r){var i=r.getRelations();return i[0]}}clearEventId(e){var t=null;return e.event.content["m.relates_to"]&&"m.replace"==e.event.content["m.relates_to"]["rel_type"]&&(t=e.event.content["m.relates_to"]["event_id"]),t||e.getId()}textEvent(e,t){return e.pcrypto.canBeEncrypt()?e.pcrypto.encryptEvent(t):Promise.resolve(this.sdk.ContentHelpers.makeTextMessage(t))}sendtext(e,t,n){let{relation:r,from:i}=n;return this.textEvent(e,t).then(t=>(r&&(t["m.relates_to"]={rel_type:r.type,event_id:this.clearEventId(r.event)}),i&&(t["from"]=i),e.pcrypto.canBeEncrypt()?this.client.sendEvent(e.roomId,"m.room.message",t):this.client.sendMessage(e.roomId,t)))}sendFile(e,t,n,r,i){let{relation:o,from:a}=r;n||(n={});var s={};s.name=t.name,s.size=t.size;var c=(()=>Promise.resolve(t))(),l=null;return e.pcrypto.canBeEncrypt()&&!i&&(c=e.pcrypto.encryptFile(t).then(e=>(s.secrets=e.secrets,Promise.resolve(e.file)))),c.then(e=>(l=this.client.uploadContent(e),l.abort&&(n.abort=l.abort),l)).then(e=>n.aborted?Promise.reject("aborted"):Promise.resolve(this.client.mxcUrlToHttp(e))).then(t=>{s.url=t;let n=JSON.stringify(s);var r={body:n,msgtype:"m.file"};return o&&(r["m.relates_to"]={rel_type:o.type,event_id:this.clearEventId(o.event)}),a&&(r["from"]=a),this.client.sendMessage(e.roomId,r)})}sendImageBase64(e,t,n,r){var i="toFileFetch";return t.indexOf("data:")>-1&&(i="toFile"),re["a"].Base64[i](t).then(i=>this.sendImage(e,t,i,n,r))}sendAudioBase64(e,t,n,r){var i="toFileFetch";return t.indexOf("data:")>-1&&(i="toFile"),re["a"].Base64[i](t).then(i=>this.sendAudio(e,t,i,n,r))}sendImage(e,t,n,r){let{relation:i,from:o}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!n)return this.sendImageBase64(e,t,r);var a=new Mo["a"],s={};return r||(r={}),a.wh(t).then(t=>(s=t,o&&(s.from=o),e.pcrypto.canBeEncrypt()?e.pcrypto.encryptFile(n).then(e=>(s.secrets=e.secrets,Promise.resolve(e.file))):Promise.resolve(n))).then(e=>{var t=this.core.mtrx.uploadContent(e,!0);return t.abort&&(r.abort=t.abort),t}).then(t=>r.aborted?Promise.reject("aborted"):this.client.sendImageMessage(e.roomId,t,s,"Image"))}sendAudio(e,t,n,r){let{relation:i,from:o}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!n)return this.sendAudioBase64(e,t,r);let a={};return a.from=o,new Promise(t=>{if(e.pcrypto.canBeEncrypt())return e.pcrypto.encryptFile(n).then(e=>(a.secrets=e.secrets,t(e.file)));t(n)}).then(e=>{let t=this.core.mtrx.uploadContent(e,!0);return t.abort&&(r.abort=t.abort),t}).then(t=>r.aborted?Promise.reject("aborted"):this.client.sendAudioMessage(e.roomId,t,a,"Audio"))}getFile(t,n){var r=this;return Object(Co["a"])((function*(){try{var i=yield t.pcrypto.decryptKey(n.event);n.event.decryptKey=i}catch(e){return Promise.reject(e)}return r.download(n.event.content.pbody.url).then(e=>t.pcrypto.decryptFile(e,i)).then(e=>Promise.resolve({file:e,name:n.event.content.pbody.name})).catch(e=>Promise.reject(e))}))()}downloadFile(e,t){var n=this;return Object(Co["a"])((function*(){return n.getFile(e,t).then(e=>window.cordova&&re["a"].saveFileCordova?new Promise((t,n)=>{re["a"].saveFileCordova(e.file,e.name,(function(e,r){r&&console.error(r),r?n("unable"):t()}))}):rc.a.saveAs(e.file,e.name)).catch(e=>(console.error(e),Promise.reject(e)))}))()}getAudioUnencrypt(e,t){var n=this;return Object(Co["a"])((function*(){return t.event.content.audioData?Promise.resolve(t.event.content.audioData):n.download(t.event.content.url,!0).then(e=>re["a"].readFile(e)).then(e=>(t.event.content.audioData=e,Promise.resolve(e)))}))()}getAudio(t,n){var r=this;return Object(Co["a"])((function*(){if(n.event.decryptedAudio)return Promise.resolve(n.event.decryptedAudio);try{var i=yield t.pcrypto.decryptKey(n.event);return n.event.decryptKey=i,r.download(n.event.content.url,!0).then(e=>t.pcrypto.decryptFile(e,i)).then(e=>re["a"].readFile(e)).then(e=>(n.event.decryptedAudio=e,Promise.resolve(n.event.decryptedAudio))).catch(e=>Promise.reject(e))}catch(e){return Promise.reject(e)}}))()}getImage(t,n){var r=this;return Object(Co["a"])((function*(){if(n.event.decryptedImage)return Promise.resolve(n.event.decryptedImage);try{var i=yield t.pcrypto.decryptKey(n.event);return n.event.decryptKey=i,r.download(n.event.content.url,!0).then(e=>t.pcrypto.decryptFile(e,i)).then(e=>re["a"].Base64.fromFile(e)).then(e=>(n.event.decryptedImage=e.replace("data:file;","data:image/jpeg;"),Promise.resolve(n.event.decryptedImage))).catch(e=>Promise.reject(e))}catch(e){return Promise.reject(e)}}))()}shareInChat(e,t){var n=this.client.getRoom(e);return this.core.mtrx.kit.prepareChat(n).then(e=>{var r=[];return _.each(t.images,e=>{var i=this.sendImageBase64(n,e,{},{from:t.from});r.push(i)}),_.each(t.files,e=>{r.push(this.sendFile(n,e,{},{from:t.from}))}),_.each(t.urls,e=>{r.push(this.sendtext(n,e,{from:t.from}))}),_.each(t.messages,e=>{r.push(this.sendtext(n,e,{from:t.from}))}),_.each(t.audio,e=>{var i="data:audio/mpeg;base64,"+re["a"]._arrayBufferToBase64(e);r.push(this.sendAudioBase64(n,i,{},{from:t.from}))}),Promise.all(r)})}opencontact(e){this.core.store.commit("setmodal",{caption:e.name,type:"contact",data:{contact:e}})}complain(e,t){this.core.store.commit("setmodal",{caption:e,type:"complain",data:t})}blockeduser(e){if(this.core.mtrx.client)return this.core.mtrx.client.isUserIgnored(this.core.user.matrixId(e))}blockUser(e){if(e=this.core.user.matrixId(e),this.client.isUserIgnored(e))return Promise.resolve();var t=this.client.getIgnoredUsers();return t.push(e),this.client.setIgnoredUsers(t).then(e=>Promise.resolve(e))}unblockUser(e){if(e=this.core.user.matrixId(e),!this.client.isUserIgnored(e))return Promise.resolve();var t=this.client.getIgnoredUsers();return t=_.filter(t,(function(t){return e!=t})),this.client.setIgnoredUsers(t).then(e=>Promise.resolve(e))}chatUsersInfo(e,t){t||(t="chatUsers");var n=this.core.store.state.users;return _.filter(_.map(this[t](e),e=>n[e.userId]),(function(e){return e}))}chatUsers(e){return this.core.store.state.chatusers[e]||[]}anotherChatUsers(e){return _.filter(this.chatUsers(e),e=>e.userId!=this.core.user.userinfo.id)}}var cc=sc;class lc{constructor(e,t){Object(To["a"])(this,"key","showednotifications"),Object(To["a"])(this,"showed",{}),Object(To["a"])(this,"show",(function(e,t){if("function"!=typeof t){var n=t;t=()=>{this.core.vm.$router.push(n).catch(e=>{}),this.core.apptochat&&this.core.apptochat()}}var r="bottom-right";this.core.vm.$store.state.mobile&&(r="top-left"),this.core.vm.$message({event:e.event,title:e.title,message:e.message,roomId:e.roomId,iconImg:e.icon||null,onClick:t,zIndex:999,supportHTML:!0,wrapperClassName:"notificationWrapper",position:r,type:"info",chat:e.chat,duration:5e3})})),t||(t={}),this.core=e,this.showed=JSON.parse(localStorage[this.key]||"{}"),this.ion=null,"undefined"!=typeof ion&&(this.ion=ion)}addshowed(e){this.showed=JSON.parse(localStorage[this.key]||"{}"),this.showed[e]=!0,localStorage[this.key]=JSON.stringify(this.showed)}clearshowed(){this.showed={},localStorage[this.key]=JSON.stringify(this.showed)}playsound(){if(window.Media&&window.cordova&&window.cordova.file&&window.cordova.file.applicationDirectory){var e=window.cordova.file.applicationDirectory+"www/sounds/glass.mp3";e.startsWith("file://")&&(e=e.substring(7));var t=new Media(e);t.play()}else window.ion&&ion.sound.play("glass")}notifySoundOrAction(){var e=localStorage["lastsounddate"]||null;e&&(e=new Date(e),re["a"].date.addseconds(e,10)>new Date)||(localStorage["lastsounddate"]=new Date,window.cordova&&window.POCKETNETINSTANCE?window.POCKETNETINSTANCE.mobile.vibration.small():this.playsound())}decrypt(e,t){return this.core.mtrx.kit.prepareChat(t).then(n=>e.event.decrypted?Promise.resolve():t.pcrypto.decryptEvent(e.event)).catch(e=>Promise.resolve())}message(e,t,n){var r=this.core.vm.$store.state;if(!this.showed[e.event.event_id]){this.addshowed(e.event.event_id);var i=re["a"].deep(this,"core.external.clbks.NOTIFICATION")||{},o="",a=re["a"].deep(e,"event.type");["m.room.member"].indexOf(a)>-1&&(o="invite"),["m.room.message"].indexOf(a)>-1&&(o="message"),["m.room.name"].indexOf(a)>-1&&(o=""),["m.room.power_levels"].indexOf(a)>-1&&(o="moder"),["m.room.redaction"].indexOf(a)>-1&&(o="redaction"),"m.encrypted"==re["a"].deep(e,"event.content.msgtype")&&(o="encrypted");var s=()=>{var a={title:t.name,event:e,message:"m.encrypted"==e.event.content.type?"***":e.event.content.body,roomId:e.event.room_id,icon:t.image,chat:n,ctype:o};_.each(i,(function(e){e(a)})),(r.currentRoom!==e.event.room_id||this.core.hiddenInParent)&&(this.notifySoundOrAction(),this.show(a,"/chat?id="+e.event.room_id))};"encrypted"==o?this.decrypt(e,n).then(s):s()}}event(e,t){let n=this.core.mtrx.client.getPushActionsForEvent(e);if(n.notify){var r=moment(moment.utc(e.event.origin_server_ts).toDate()).local().toDate(),i=re["a"].date.addseconds(r,10)>moment().toDate();i&&this.core.mtrx.isReaded(e,!0).then(n=>{n||!this.core.mtrx.me(e.getSender())&&e.getSender()&&e.getSender()!==this.core.mtrx.client.credentials.userId&&this.core.user.usersInfo([re["a"].getmatrixid(e.getSender())]).then(n=>{n&&n[0]&&this.message(e,n[0],t)})})}}}var uc=lc,dc=r("e7f6"),fc=r("6967"),hc=r.n(fc),pc=r("bc3a"),{error:mc,byError:vc}=r("d854"),gc=(pc=function(){var t=["data.result"],n=["data.error"];function r(e){return i.apply(this,arguments)}function i(){return i=Object(Co["a"])((function*(r){let{to:i,data:o}=r;o||(o={}),_.each(o,(e,t)=>{(_.isArray(e)||_.isObject(e))&&(o[t]=JSON.stringify(e))});var a=null;try{a=yield hc()({method:"post",headers:{"content-type":"application/x-www-form-urlencoded"},url:i,data:tc.a.stringify(o),timeout:35e3})}catch(e){a=e.response}if(!a)return Promise.reject("noresponse");var s=_.find(n,(function(e){return re["a"].deep(a.data,e)}));if(s)return Promise.reject(vc(re["a"].deep(a.data,s)));var c=_.find(t,(function(e){return re["a"].deep(a.data,e)}));return c?Promise.resolve(re["a"].deep(a.data,c)):Promise.reject("error")})),i.apply(this,arguments)}return{axios:r}},pc),{error:yc}=r("d854"),bc=function(e){var t=this,n=new gc,r={},i={},o={},a={pocketnet:null},s=function(){return Promise.resolve()},c=function(e){return o[e.storage]?Promise.resolve(o[e.storage]):Object(ic["a"])(e.storage,e.version||1,e.time).then(t=>(o[e.storage]=t,Promise.resolve(t)))},l=function(e,t,n,o,a){_.isArray(e)||(e=[e]);var l={};return n||(n=t),r[t]||(r[t]={}),i[t]||(i[t]={}),(a?c(a):s()).then(i=>i?Promise.all(_.map(e,e=>r[t][e]?Promise.resolve():i.get(e).then(e=>(r[t][e[n]]=e,Promise.resolve())).catch(e=>Promise.resolve()))):Promise.resolve()).then(u=>{var d=_.uniq(_.filter(e,(function(e){return o||!r[t][e]||r[t][e].nocache}))),f=_.filter(d,(function(e){if(!i[t][e])return i[t][e]=!0,!0;l[e]=!0})),h=function(o,u){return(a?c(a):s()).then(e=>e?Promise.all(_.map(o,t=>t[n]?e.set(t[n],t):Promise.resolve())):Promise.resolve()).then(()=>{_.each(o,(function(e){e[n]&&(r[t][e[n]]=e)})),_.each(u,(function(e){delete i[t][e],delete l[e],r[t][e]||(r[t][e]="error")}));var a={};return re["a"].pretry(()=>(_.each(e,(function(e){r[t][e]&&("error"!=r[t][e]&&(a[e]=r[t][e]),delete i[t][e],delete l[e])})),0==_.toArray(l).length)).then(()=>Promise.resolve(a))})};return Promise.resolve({id:f,handle:h})})},u=function(){return e&&e.waitonline?e.waitonline():Promise.resolve()},d=function(e,t,n,r,i){return l(e,t,n,r,i).then(e=>e.id.length?Promise.reject(e):e.handle([]))},f=function(e,t){return u().then(()=>(e||(e={}),n.axios({to:t,data:e}).then(e=>Promise.resolve(e)).catch(n=>"noresponse"==n?new Promise((n,r)=>{setTimeout((function(){f(e,t).then(e=>n(e)).catch(e=>r(e))}),3e3)}):Promise.reject(n))))};return t.clearCache=function(e){e?delete r[e]:r={}},t.pocketnet={common:(t,n)=>(t||(t={}),a.pocketnet||(a.pocketnet=re["a"].deep(window,"POCKETNETINSTANCE.api")),a.pocketnet||"undefined"==typeof Api||(a.pocketnet=new Api(e)),a.pocketnet?a.pocketnet.initIf().then(()=>a.pocketnet.wait.ready("use",3e3)).then(e=>a.pocketnet.rpc(n,t.parameters)).catch(e=>({error:e})):(t.method=n,t.node="185.148.147.15",t.parameters=re["a"].hexEncode(JSON.stringify(t.parameters||"")),f(t,servers.pocketnet+"/rpc-"+(n||"common")))),userState:e=>{_.isArray(e)||(e=[e]);var n=[e.join(",")];return t.pocketnet.common({parameters:n},"getuserstate")},userStateMe:e=>{var n=re["a"].deep(window,"POCKETNETINSTANCE.platform.sdk.ustate.storage."+e);return n?Promise.resolve(n):t.pocketnet.userState(e)},userInfoCached:(e,n)=>{var r=[];return n||(r=_.filter(_.map(e,e=>re["a"].deep(window,"POCKETNETINSTANCE.platform.sdk.userscl.storage."+e)||null),e=>e),e=_.filter(e,e=>!_.find(r,t=>t.address==e))),t.pocketnet.userInfo(e,n).then(e=>(e=_.toArray(e),_.each(r,t=>{e.push(t)}),Promise.resolve(e)))},search:e=>{var n=[e,"users"];return t.pocketnet.common({parameters:n},"searchusers").then(e=>Promise.resolve(e||[]))},userInfo:(e,n)=>e.length?d(e,"pocketnet_userInfo","address",n,{storage:"userInfo",time:86400}).catch(e=>{if(!e||!e.id)return Promise.reject(e);var n=[e.id,"1"];return t.pocketnet.common({parameters:n},"getuserprofile").then(t=>e.handle(t,e.id))}):Promise.resolve([]),postInfo:e=>{var n=[[e.parameters]];return t.pocketnet.common({parameters:n},"getrawtransactionwithmessagebyid").then(e=>Promise.resolve(e))},pocketNetProfileAddress:e=>{var n=[[e.parameters]];return t.pocketnet.common({parameters:n},"getuseraddress").then(e=>Promise.resolve(e))},pocketNetProfileInfo:e=>{var n=[[e.parameters]];return t.pocketnet.common({parameters:n},"getuserprofile").then(e=>Promise.resolve(e))}},t},_c=bc,wc=r("9c21"),xc=r("ebaa"),Sc=function(){var e=this;e.gettingmedia=!1;var t={ios:{audio:function(){return new Promise((e,t)=>{window.audioinput.checkMicrophonePermission((function(n){n?e():window.audioinput.getMicrophonePermission((function(n,r){n?e():t("permissions")}))}))})},video:function(){return new Promise((e,t)=>{var n=!0,r=!0;cordova.plugins.iosrtc.requestPermission(n,r,(function(n){n?e():t("permissions")}))})}},audio:function(){var e=window.cordova.plugins.permissions;return new Promise((t,n)=>{if(e){var r=function(){e.requestPermission(e.RECORD_AUDIO,e=>{e.hasPermission?t():n("permissions")},e=>{console.error(e),n("permissions")})};e.checkPermission(e.RECORD_AUDIO,e=>{e.hasPermission?t():r()},e=>{console.error(e),r()})}else n("permissions")})},video:function(){var e=window.cordova.plugins.permissions;return new Promise((t,n)=>{e?e.hasPermission(e.CAMERA,r=>{r.hasPermission?t():e.requestPermission(e.CAMERA,()=>{t()},()=>{n("permissions")})}):n("permissions")})}},n=function(e){var n=function(e,t){return t?e():Promise.resolve()};if(window.cordova&&window.device){var r=re["a"].isios();return n(r?t.ios.audio:t.audio,e.audio).then(()=>n(r?t.ios.video:t.video,e.video)).catch(e=>(console.error("E",e),Promise.reject(e)))}return Promise.resolve()},r=function(e){return new Promise((t,r)=>{n(e).then(()=>{navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(e).then(t).catch(r):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,t,r)}).catch(r)})};e.get=function(e){return r(e)},e.permissions=n},kc=Sc,Ec=()=>{let e=2,t=[];function n(n){let r=n.length,i=new Uint8Array(r*e);for(let t=0;t1?o=1:o<-1&&(o=-1),o*=32768,i[r]=o,i[r+1]=o>>8}t.push(i)}function r(n){let r=t.length?t[0].length:0,i=t.length*r,o=new Uint8Array(44+i),a=new DataView(o.buffer);a.setUint32(0,1380533830,!1),a.setUint32(4,36+i,!0),a.setUint32(8,1463899717,!1),a.setUint32(12,1718449184,!1),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,n,!0),a.setUint32(28,n*e,!0),a.setUint16(32,e,!0),a.setUint16(34,8*e,!0),a.setUint32(36,1684108385,!1),a.setUint32(40,i,!0);for(let e=0;e{"encode"===e.data[0]?n(e.data[1]):"dump"===e.data[0]&&r(e.data[1])}};let Cc,Tc=window.AudioContext||window.webkitAudioContext,Ic=e=>{let t=e.toString().replace(/^(\(\)\s*=>|function\s*\(\))\s*{/,"").replace(/}$/,""),n=new Blob([t]);return new Worker(URL.createObjectURL(n))},Rc=e=>{let t=new Event("error");return t.data=new Error("Wrong state for "+e),t};class Oc{constructor(e,t=null){this.stream=e,this.config=t,this.state="inactive",this.em=document.createDocumentFragment(),this.encoder=Ic(Oc.encoder);let n=this;this.encoder.addEventListener("message",e=>{let t=new Event("dataavailable");t.data=new Blob([e.data],{type:n.mimeType}),n.em.dispatchEvent(t),"inactive"===n.state&&n.em.dispatchEvent(new Event("stop"))})}start(e){if("inactive"!==this.state)return this.em.dispatchEvent(Rc("start"));this.state="recording",Cc||(Cc=new Tc(this.config)),this.clone=this.stream.clone(),this.input=Cc.createMediaStreamSource(this.clone),this.processor=Cc.createScriptProcessor(2048,1,1),this.encoder.postMessage(["init",Cc.sampleRate]),this.processor.onaudioprocess=e=>{"recording"===this.state&&this.encoder.postMessage(["encode",e.inputBuffer.getChannelData(0)])},this.input.connect(this.processor),this.processor.connect(Cc.destination),this.em.dispatchEvent(new Event("start")),e&&(this.slicing=setInterval(()=>{"recording"===this.state&&this.requestData()},e))}stop(){return"inactive"===this.state?this.em.dispatchEvent(Rc("stop")):(this.requestData(),this.state="inactive",this.clone.getTracks().forEach(e=>{e.stop()}),this.processor.disconnect(),this.input.disconnect(),clearInterval(this.slicing))}pause(){return"recording"!==this.state?this.em.dispatchEvent(Rc("pause")):(this.state="paused",this.em.dispatchEvent(new Event("pause")))}resume(){return"paused"!==this.state?this.em.dispatchEvent(Rc("resume")):(this.state="recording",this.em.dispatchEvent(new Event("resume")))}requestData(){return"inactive"===this.state?this.em.dispatchEvent(Rc("requestData")):this.encoder.postMessage(["dump",Cc.sampleRate])}addEventListener(...e){this.em.addEventListener(...e)}removeEventListener(...e){this.em.removeEventListener(...e)}dispatchEvent(...e){this.em.dispatchEvent(...e)}}Oc.prototype.mimeType="audio/wav",Oc.isTypeSupported=e=>Oc.prototype.mimeType===e,Oc.notSupported=!navigator.mediaDevices||!Tc,Oc.encoder=Ec;var Mc=Oc,Pc=()=>{importScripts("https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js");let e,t=1,n=128,r=44100,i=new Int8Array;function o(e,t){if(0===t.length)return e;let n=new Int8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function a(i){e=new lamejs.Mp3Encoder(t,i||r,n)}function s(t){for(let e=0;e{"init"===e.data[0]?a(e.data[1]):"encode"===e.data[0]?s(e.data[1]):c(e.data[1])}};Mc.encoder=Pc,Mc.prototype.mimeType="audio/mpeg";class Ac{constructor(e,t){Object(To["a"])(this,"hideOptimization",(function(e){this.store.commit("hideOptimization",e)})),Object(To["a"])(this,"hideInParent",(function(e){this.hiddenInParent=e,this.store.commit("hiddenInParent",e)})),Object(To["a"])(this,"canback",(function(){return!this.store.state.gallery})),Object(To["a"])(this,"update",(function(e){let{block:t}=e;this.pcrypto.set.block(t)})),Object(To["a"])(this,"logerror",(function(e,t){window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.Logger.error({err:e,payload:t,code:402})})),Object(To["a"])(this,"destroy",(function(){this.store.commit("clearall"),this.removeEvents(),"chats"!=!this.vm.$route.name&&this.vm.$router.push("/chats").catch(e=>{}),this.user.destroy(),this.mtrx.destroy(),this.pcrypto.destroy(),window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform.matrixchat.unlink(this),this.vm.$destroy()})),Object(To["a"])(this,"init",(function(){this.focusListener.init(),this.onlineListener.init(),this.initEvents(),window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform.matrixchat.link(this)})),Object(To["a"])(this,"setUnauthorized",(function(e){this.unauthorized=e,this.store.commit("SET_UNAUTHORIZED",e)})),Object(To["a"])(this,"initWithUserBase",(function(){return this.loading=!0,this.user.checkCredentials().then(e=>this.user.userInfo()).then(e=>e?e.deleted?Promise.reject("deleted"):this.pcrypto.prepare():Promise.reject("unknown")).then(e=>this.mtrx.init()).then(e=>(this.loading=!1,this.setUnauthorized(null),this.pcrypto.helpers.checkuser(),re["a"].deep(this.user,"userinfo.name")&&this.mtrx.client.setDisplayName(re["a"].deep(this.user,"userinfo.name")),Promise.resolve())).catch(e=>(console.log("E",e),this.loading=!1,"unauthorized"!=e&&"unknown"!=e&&"deleted"!=e||this.setUnauthorized(e),Promise.resolve()))})),Object(To["a"])(this,"initWithUser",(function(e){return this.user.setCredentials(e),this.initWithUserBase().then(()=>this.user.initKeysProcess()).catch(e=>Promise.resolve())})),Object(To["a"])(this,"waitonline",(function(){return this.online?Promise.resolve():new Promise((e,t)=>{re["a"].retry(()=>this.online,(function(){e()}),5)})})),Object(To["a"])(this,"removeEvents",(function(){delete this.focusListener.clbks.resume.core,delete this.focusListener.clbks.pause.core,delete this.onlineListener.clbks.online.core,delete this.onlineListener.clbks.offline.core})),Object(To["a"])(this,"initEvents",(function(){this.focusListener.clbks.resume.core=e=>{this.focus=this.focusListener.focus},this.focusListener.clbks.pause.core=()=>{this.focus=this.focusListener.focus},this.onlineListener.clbks.online.core=e=>{this.online=this.onlineListener.online},this.onlineListener.clbks.offline.core=()=>{this.online=this.onlineListener.online}})),Object(To["a"])(this,"externalLink",(function(e){this.external=e})),Object(To["a"])(this,"destroyExternalLink",(function(){this.external={}})),Object(To["a"])(this,"currentTime",(function(){var e=Math.floor((new Date).getTime()/1e3);return this.timeDifference&&(e+=this.timeDifference),e})),Object(To["a"])(this,"wait",(function(){return re["a"].pretry(()=>!this.loading).then(()=>Promise.resolve())})),t||(t={}),this.options={listofproxies:t.listofproxies},t.mtrx||(t.mtrx={}),t.mtrx.baseUrl="https://"+t.domain,"https://test.matrix.pocketnet.app"==t.mtrx.baseUrl?this.options.burn={v:"minutes",w:120,m:30,b:15}:this.options.burn={v:"days",w:7,m:2,b:1},this.apiHandlers={error:function(){},success:function(){}},this.domain=t.domain,this.vm=e,this.mtrx=new cc(this,t.mtrx),this.user=new dc["a"](this,t.user||{}),this.notifier=new uc(this,t.notifier||{}),this.pcrypto=new wc["a"](this,t.pcrypto||{}),this.api=new _c(this,t.servers),this.onlineListener=new xc["a"].online(this),this.focusListener=new xc["a"].focus(this),this.online=!0,this.focus=!0,this.store=e.$store,this.loading=!0,this.external={},this.hiddenInParent=!1,this.customRecorderConnected=!1,this.pcrypto.init(this.user),this.media=new kc,this.audioContext=null}joinRoom(e){return this.wait().then(()=>this.mtrx.wait()).then(()=>this.unauthorized?(this.store.commit("JOINROOM",e),Promise.reject(this.unauthorized)):Promise.resolve()).then(t=>(this.store.state.chatsMap[e]?this.vm.$router.push("/chat?id="+e).catch(e=>{}):(this.store.commit("JOINROOM",e),this.vm.$router.push("/publicPreview?id="+e).catch(e=>{})),Promise.resolve()))}connect(e){return this.wait().then(()=>this.mtrx.wait()).then(()=>this.unauthorized?(this.store.commit("CONNECT",re["a"].hexEncode(e)),Promise.reject(this.unauthorized)):this.user.usersInfo([e],!0)).then(t=>{var n=this.mtrx.kit.tetatetid(t[0],this.user.userinfo);return n?(this.store.state.chatsMap[n]?this.gotoRoute("/chat?id="+n):this.gotoRoute("/contact?id="+re["a"].hexEncode(e)),Promise.resolve()):Promise.reject("roomId")})}cancelshare(){return this.store.commit("SHARE",null),Promise.resolve()}share(e){return this.store.commit("SHARE",e),this.vm.$router.push("/chats").catch(e=>{}),Promise.resolve()}goto(e){this.cancelDefaultRoute=!0,this.mtrx.wait().then(()=>{this.vm.$router.push("/chat?id="+e).catch(e=>{})})}gotoRoute(e){this.cancelDefaultRoute=!0,this.mtrx.wait().then(()=>{this.vm.$router.push(e).catch(e=>{})})}updateUser(){return this.user.userInfo(!0).then(e=>{})}isactive(){return this.vm.$store.state.minimized&&this.vm.$store.state.active&&this.vm.$store.state.pocketnet}sitemessage(e){var t="bottom-right";this.vm.$store.state.mobile&&(t="top-left"),this.vm.$message({title:e,zIndex:999,supportHTML:!0,wrapperClassName:"notificationWrapper",position:t,type:"info",duration:2e3})}menu(e){this.store.commit("SET_MENU",e?{items:e.items,item:e.item,handler:e.handler}:null)}invitepnt(){var e=re["a"].deep(this,"user.userinfo.source");if(e)if(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform)this.backtoapp&&this.backtoapp(),window.POCKETNETINSTANCE.platform.ui.socialshare("welcome?connect="+e.address,{sharing:{image:"",images:[e.i],title:this.vm.$i18n.t("caption.joinApp"),html:{body:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin"),preview:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin")},text:{body:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin"),preview:this.vm.$i18n.t("caption.joinApp")+" "+this.vm.$i18n.t("caption.hasInvitedToJoin")}},embedding:{type:"connect",id:e.address}});else{var t="https://bastyon.com/welcome?connect="+e.address;re["a"].copytext(t),this.sitemessage("The link was copied successfully")}else this.sitemessage("The error was occuried")}convertAudioToBase64(e){return Object(Co["a"])((function*(){const t=new FileReader;return t.readAsDataURL(e),new Promise(e=>{t.onloadend=()=>{e(t.result)}})}))()}initMediaRecorder(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?this.media.get({audio:!0}).then(e=>{let t=new Mc(e,{audioBitsPerSecond:32e3});return t}).catch((function(e){return Promise.reject(e)})):Promise.reject()}getAudioContext(){return this.audioContext&&"closed"!=this.audioContext.state?("suspended"===this.audioContext.state&&this.audioContext.resume(),this.audioContext):(this.audioContext=new(window.AudioContext||window.webkitAudioContext)||null,re["a"].isios()&&window.unmute&&unmute(this.audioContext,!1,!1),this.audioContext)}}var jc=Ac,Dc=r("e508"),Lc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"preloader",platform:e.platform}},[e._m(0)])},Nc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"variant "},[n("div",{staticClass:"iospreloadercenter"},[n("div",{staticClass:"spinner-eff spinner-eff-3"},[n("div",{staticClass:"circle circle-1"}),n("div",{staticClass:"circle circle-2"}),n("div",{staticClass:"circle circle-3"})])])])}],$c={name:"preloader",props:{},computed:Object(P["c"])({pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active,platform:function(){return re["a"].deep(window,"device.platform")||"browser"}})},Uc=$c;function Bc(e){var t=r("4578");t.__inject__&&t.__inject__(e);var n=r("3f02");n.__inject__&&n.__inject__(e)}var Fc=Object(E["a"])(Uc,Lc,Nc,!1,Bc,"3e6353d6",null,!0),zc=Fc.exports,qc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"wai-fixedmessageicon"}},[n("div",{staticClass:"wrapper"},[n("div",{staticClass:"table"},[n("div",{staticClass:"cell"},[e.icon?n("div",{staticClass:"iconWrapper"},[n("sweetalert",{attrs:{icon:e.icon}})],1):e._e(),e.message?n("div",{staticClass:"message"},[n("div",[e._v(e._s(e.message))])]):e._e()])])])])},Wc=[],Kc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sa",style:e.cssVars},[e.isIcon("error")?n("div",{staticClass:"sa-error"},[e._m(0),n("div",{staticClass:"sa-error-placeholder"}),n("div",{staticClass:"sa-error-fix"})]):e.isIcon("warning")?n("div",{staticClass:"sa-warning"},[n("div",{staticClass:"sa-warning-body"}),n("div",{staticClass:"sa-warning-dot"})]):e.isIcon("info")?n("div",{staticClass:"sa-info"},[n("div",{staticClass:"sa-info-body"}),n("div",{staticClass:"sa-info-dot"})]):e.isIcon("loading")?n("div",{staticClass:"sa-loading"},[n("div",{staticClass:"sa-loading-body"})]):n("div",{staticClass:"sa-success"},[n("div",{staticClass:"sa-success-tip"}),n("div",{staticClass:"sa-success-long"}),n("div",{staticClass:"sa-success-placeholder"}),n("div",{staticClass:"sa-success-fix"})])])},Vc=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sa-error-x"},[n("div",{staticClass:"sa-error-left"}),n("div",{staticClass:"sa-error-right"})])}],Gc=r("5b1b"),Hc=r.n(Gc),Yc=r("6929"),Jc=r.n(Yc);const Xc=["success","warning","error","info","loading"],Zc={success:"#007d09",warning:"#ff7800",error:"#ff007e",info:"#0600ff",loading:"#0600ff"};var Qc={name:"sweetalert-icon",props:{icon:{type:String,default:"success",validator:e=>-1!==Xc.indexOf(e)},color:{type:String,validator:Hc.a}},computed:{cssVars(){const e=Hc()(this.color)?this.color:Zc[this.icon];return{"--icon-color":e,"--icon-color-alpha":Jc()(e).alpha(.25)}}},methods:{isIcon(e){return e===this.icon}}},el=Qc;function tl(e){var t=r("826f");t.__inject__&&t.__inject__(e)}var nl=Object(E["a"])(el,Kc,Vc,!1,tl,"0635047f",null,!0),rl=nl.exports,il={name:"fixedmessageicon",props:{},components:{sweetalert:rl},data:function(){return{loading:!1}},created:()=>{},watch:{icon:{immediate:!0,handler(){this.init()}}},computed:Object(P["c"])({auth:e=>e.auth,icon:function(){return this.$store.state.icon?this.$store.state.icon.icon:null},message:function(){return this.$store.state.icon?this.$store.state.icon.message:null},pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active}),methods:{init:function(){var e,t=this;const n=null===(e=this.$store.state.icon)||void 0===e?void 0:e.timeout;this.$store.state.icon.manual||setTimeout((function(){t.$store.commit("icon",null)}),n||2e3)}}},ol=il;function al(e){var t=r("17e1");t.__inject__&&t.__inject__(e)}var sl=Object(E["a"])(ol,qc,Wc,!1,al,"1cf419f0",null,!0),cl=sl.exports,ll=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{attrs:{id:"wai-date"}},[e._v(e._s(e.label))])},ul=[],dl={name:"date",props:["date"],computed:Object(P["c"])({auth:e=>e.auth,label:function(){return moment.locale(this.$i18n.locale),moment(moment.utc(this.date).toDate()).local().fromNow()}})},fl=dl;function hl(e){var t=r("4382");t.__inject__&&t.__inject__(e)}var pl=Object(E["a"])(fl,ll,ul,!1,hl,"eb4df516",null,!0),ml=pl.exports,vl=function(e,t){var n=t._c;return n("div",{staticClass:"userpic"},[n("div",{staticClass:"userpicSquareWrapper"},[n("div",{staticClass:"userpicSquareInnerWrapper"},[n("div",{staticClass:"userpicSquareInnerWrapper",class:t.props.status},[t.props.userinfo.image?n("bgimage",{attrs:{src:t.props.userinfo.image}}):t._e(),!t.props.userinfo.image&&t.props.userinfo.name&&"blocked"!=t.props.status&&"invite"!=t.props.status&&"ban"!=t.props.status?n("div",{staticClass:"charAvatar"},[n("span",[t._v(t._s(t.props.userinfo.name.charAt(0)))])]):t._e(),n("div",{staticClass:"statusIcon"},["blocked"==t.props.status||"ban"==t.props.status?n("i",{staticClass:"fas fa-ban"}):t._e(),"invite"==t.props.status?n("i",{staticClass:"fas fa-user-plus"}):t._e()])],1)])])])},gl=[],yl={name:"userpic",props:{userinfo:{type:Object,default:{}},status:""}},bl=yl;function _l(e){var t=r("b93b");t.__inject__&&t.__inject__(e)}var wl=Object(E["a"])(bl,vl,gl,!0,_l,"5034d1e2",null,!0),xl=wl.exports,Sl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.users?n("div",{staticClass:"userspic",class:{oneuser:e.users&&1===e.users.length}},[0===e.users.length?n("userpic",{attrs:{userinfo:e.single,status:e.single.status}}):e._e(),1===e.users.length?n("userpic",{attrs:{status:e.status[e.users[0].id],userinfo:e.users[0],unseen:e.unseen}}):e._e(),e.users.length>1?n("many",{attrs:{slidesPerView:e.slidesPerView,status:e.status,userinfo:e.users,unseen:e.unseen}}):e._e(),e.unseen?n("div",{staticClass:"unseen"},[e._v(" "+e._s(e.unseen>99?"99":e.unseen)+" ")]):e._e()],1):e._e()},kl=[],El=r("ecec"),Cl={name:"userspic",props:{users:Array,single:{},unseen:Number,slidesPerView:Number,status:{type:Object,default:{}}},data:function(){return{}},components:{many:El["a"]}},Tl=Cl;function Il(e){var t=r("4606");t.__inject__&&t.__inject__(e)}var Rl=Object(E["a"])(Tl,Sl,kl,!1,Il,"792279b0",null,!0),Ol=Rl.exports,Ml=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bgimage",class:{loaded:e.loaded,hasimage:e.src},style:"background-image:url("+e.imageSrc+"); background-size: cover; background-position: center center; background-repeat: no-repeat"},[e._t("cnt")],2)},Pl=[],Al={name:"bgimage",directives:{},props:{src:String},watch:{src:{immediate:!0,handler:function(){this.load()}}},data:function(){return{loaded:!1,imageSrc:""}},methods:{load:function(){if(this.src){this.imageSrc=this.src;var e=new Image;e.src=this.src,e.onload=()=>{this.loaded=!0}}else this.loaded=!0}}},jl=Al;function Dl(e){var t=r("f0bc");t.__inject__&&t.__inject__(e)}var Ll=Object(E["a"])(jl,Ml,Pl,!1,Dl,"5d20f73c",null,!0),Nl=Ll.exports,$l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"wai-logotype"}},[n("div",{staticClass:"items"},[n("div",{staticClass:"item"},[n("div",{staticClass:"logo"},[n("img",{attrs:{src:"img/ldpiwide-"+e.themeL+".png"}})])])])])},Ul=[],Bl={black:"black",white:"white",classic:"white"},Fl={name:"wai-logotype",props:{},data:function(){return{loading:!1}},created:()=>{},watch:{},computed:Object(P["c"])({auth:e=>e.auth,themeL:function(e){return Bl[e.theme]||"white"}}),methods:{}},zl=Fl;function ql(e){var t=r("d6cc");t.__inject__&&t.__inject__(e)}var Wl=Object(E["a"])(zl,$l,Ul,!1,ql,"e33cd7cc",null,!0),Kl=Wl.exports,Vl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"outer-div",class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,active:e.active,mobile:e.mobile},on:{click:function(e){e.stopPropagation()}}},[e.menuIsVisible&&!e.hiddenInParent?n("div",{staticClass:"dropdown",class:{visible:e.menuIsVisible}},[n("div",{staticClass:"backgr",on:{click:function(t){return e.hidePopup()}}}),n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hidePopup,expression:"hidePopup"}],staticClass:"menuwrapper"},[n("simpleMenu",{attrs:{items:e.menuItems},scopedSlots:e._u([{key:"default",fn:function(t){return[e._t("default",(function(){return[n("div",{staticClass:"menu-item",on:{click:function(n){return e.menuItemClick(t.item)}}},[n("div",{staticClass:"iconWrapper"},[t.item.icon?n("i",{class:t.item.icon}):e._e()]),n("div",{staticClass:"title"},[e._v(" "+e._s(t.item.title)+" ")])])]}),{item:t.item})]}}],null,!0)}),n("div",{staticClass:"cancelWrapper"},[n("div",{staticClass:"menu-item",on:{click:function(t){return e.hidePopup()}}},[n("div",{staticClass:"iconWrapper"}),n("div",{staticClass:"title"},[e._v(e._s(e.$t("cancel")))])])])],1)]):e._e(),n("div",{staticClass:"dropDownIcon",on:{click:e.onClickHandler}},[n("i",{class:"icon "+(e.icon||"fas fa-ellipsis-h")})])])},Gl=[],Hl={name:"dropdownMenu",props:{menuItems:{type:Array,required:!0},rowObject:{type:Object},icon:String},components:{simpleMenu:Yn},data:function(){return{loading:!1,menuIsVisible:!1}},watch:{menuIsVisible:function(e){this.$emit("menuIsVisible",e)}},computed:{dropdownWidthInner(){return this.dropdownWidth},...Object(P["c"])({pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,mobile:e=>e.mobile,active:e=>e.active,hiddenInParent:e=>e.hiddenInParent})},methods:{menuItemClick(e){this.$emit("itemClicked",e,this.rowObject,{hidePopup:this.hidePopup,showPopup:this.showPopup})},onClickHandler(){this.menuIsVisible=!this.menuIsVisible},hidePopup(){this.menuIsVisible=!1},showPopup(){this.menuIsVisible=!0}}},Yl=Hl;function Jl(e){var t=r("5722");t.__inject__&&t.__inject__(e)}var Xl=Object(E["a"])(Yl,Vl,Gl,!1,Jl,"e4f39dca",null,!0),Zl=Xl.exports,Ql=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"back",on:{click:e.click}},[n("div",{staticClass:"iconbutton"},[n("i",{class:e.icon||"fas fa-angle-left"})])])},eu=[],tu={name:"backButton",props:{icon:String,action:{type:String,default:"/"},caption:{type:String,default:""}},methods:{click:function(){"back"==this.action?this.$router.go(-1):this.$router.push(this.action).catch(e=>{})}}},nu=tu;function ru(e){var t=r("b215");t.__inject__&&t.__inject__(e)}var iu=Object(E["a"])(nu,Ql,eu,!1,ru,"7e97eec1",null,!0),ou=iu.exports,au=r("08da"),su=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"fixedOnPageTop",class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active,unauthorized:e.unauthorized,modalShowed:!!e.modalShowed,mobile:e.mobile},attrs:{id:"maincontent"},on:{mouseenter:e.mouseenter,mouseleave:e.mouseleave}},[n("div",{staticClass:"headerSpacerWrapper"},[n("div",{staticClass:"headerSpacerWrapperOvf"},[n("div",{ref:"scrollable",staticClass:"headerSpacer"},[e._t("content",(function(){return[e._v("   ")]}))],2)]),n("pmenu"),e.modalShowed&&e.modalShowed.data&&!e.hiddenInParent?n("modal",{on:{close:e.closeModal},scopedSlots:e._u([{key:"header",fn:function(){return[e._v(e._s(e.modalShowed.caption))]},proxy:!0},{key:"body",fn:function(){return[n("div",{staticClass:"modalcommoncontent"},["complain"==e.modalShowed.type?n("complain",{attrs:{p:e.modalShowed.data}}):e._e(),"contact"==e.modalShowed.type?n("contact",{attrs:{contact:e.modalShowed.data.contact}}):e._e(),"showuserselect"==e.modalShowed.type?n("contacts",{attrs:{users:e.modalShowed.data.users,mode:"Select"},on:{close:e.closeModal,select:function(t){e.modalShowed.data.userselected(t),e.closeModal()}}}):e._e()],1)]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,3972288297)}):e._e(),!e.unauthorized&&e.rbackexp?n("div",{staticClass:"expandp",on:{click:e.setactive,mousemove:e.effect}},[e._m(0)]):e._e()],1),e.iconshow?n("transition",{attrs:{name:"fade"}},[n("fixedmessageicon")],1):e._e()],1)},cu=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"etablew"},[n("div",{staticClass:"etable table"},[n("div",[n("i",{staticClass:"fas fa-expand-arrows-alt"})])])])}],lu={name:"maincontent",props:{rbackexp:Boolean},components:{contact:()=>Promise.resolve().then(r.bind(null,"d3ff")),contacts:()=>Promise.resolve().then(r.bind(null,"f978")),complain:()=>r.e(14).then(r.bind(null,"c27d"))},data:function(){return{loading:!1}},created:()=>{},watch:{},computed:Object(P["c"])({auth:e=>e.auth,iconshow:function(){return!!this.$store.state.icon},pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active,modalShowed:e=>e.modalShowed,hiddenInParent:e=>e.hiddenInParent,mobile:e=>e.mobile,unauthorized:e=>e.unauthorized}),methods:{setactive:function(){this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"main"}),this.$store.commit("setiteraction",!0)},mouseenter:function(){},mouseleave:function(){this.$store.state.autohide&&this.$store.commit("active",!1),this.$store.commit("blockactive",{value:!1,item:"main"})},effect:function(e){},closeModal:function(){this.$store.commit("setmodal",null)},scroll:function(e){this.$refs["scrollable"].scrollTop=e||0}}},uu=lu;function du(e){var t=r("52ce");t.__inject__&&t.__inject__(e)}var fu=Object(E["a"])(uu,su,cu,!1,du,"a8a70f9c",null,!0),hu=fu.exports,pu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"search"}},[n("div",{staticClass:"searchWrapper"},[n("div",{staticClass:"inputWrapper"},[n("input",{ref:"input",attrs:{placeholder:e.placeholder||this.$i18n.t("caption.search"),type:"text"},domProps:{value:e.searchTxt},on:{keyup:e.change,input:e.change,focus:e.focused,blur:e.blured}})]),e.searchTxt?e._e():n("div",{staticClass:"iconWrapper"},[n("i",{staticClass:"fas fa-search"})]),e.searchTxt?n("div",{staticClass:"iconWrapper",on:{click:e.clear}},[n("i",{staticClass:"fas fa-times"})]):e._e()])])},mu=[],vu={name:"search",props:{placeholder:String,minimize:{type:Boolean,default:!1}},data:function(){return{loading:!1,isTyping:!1,searchTxt:""}},created:()=>{},watch:{searchTxt:{handler:_.debounce((function(){var e=this.searchTxt.toLowerCase();this.$emit("search",e)}),500)}},computed:Object(P["c"])({auth:e=>e.auth,pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:function(e){return e.active||!this.minimize}}),methods:{change:function(e){this.searchTxt=e.target.value},clear:function(e){this.searchTxt=""},clickicon:function(){this.$refs["input"].focus()},blured:function(){this.$store.commit("blockactive",{value:!1,item:"input"})},focused:function(){this.$store.commit("blockactive",{value:!0,item:"input"})}}},gu=vu;function yu(e){var t=r("6bfd");t.__inject__&&t.__inject__(e)}var bu=Object(E["a"])(gu,pu,mu,!1,yu,"1774f2a8",null,!0),_u=bu.exports,wu=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},xu=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"linepreloader"}},[n("span"),n("span"),n("span")])}],Su={name:"linepreloader",props:{}},ku=Su;function Eu(e){var t=r("0095");t.__inject__&&t.__inject__(e)}var Cu=Object(E["a"])(ku,wu,xu,!1,Eu,"bcf20e38",null,!0),Tu=Cu.exports,Iu=r("9a41");function Ru(){const e=r("2db5"),t=e.keys().map(e=>({key:e,locale:e.match(/[a-z0-9-_]+/i)[0]})).reduce((t,n)=>{let{key:r,locale:i}=n;return{...t,[i]:e(r)}},{});return{context:e,messages:t}}s["default"].use(xo.a),s["default"].component("eventsEvent",Eo["default"]),s["default"].use(yo),s["default"].use(vr),s["default"].use(tr["a"]),s["default"].use(Fi),s["default"].use(_o.a),s["default"].use(ko.a),s["default"].config.productionTip=!1,s["default"].prototype.$f=re["a"],s["default"].component("pmenu",er),s["default"].component("modal",Bn),s["default"].component("preloader",zc),s["default"].component("date",ml),s["default"].component("userpic",xl),s["default"].component("userspic",Ol),s["default"].component("fixedmessageicon",cl),s["default"].component("bgimage",Nl),s["default"].component("logotype",Kl),s["default"].component("dropdownMenu",Zl),s["default"].component("backButton",ou),s["default"].component("topheader",au["a"]),s["default"].component("maincontent",hu),s["default"].component("search",_u),s["default"].component("linepreloader",Tu),s["default"].use(Dc["a"]),s["default"].directive("click-outside",{bind:function(e,t,n){e.clickOutsideEvent=function(r){e==r.target||e.contains(r.target)||n.context[t.expression](r)},document.body.addEventListener("click",e.clickOutsideEvent)},unbind:function(e){document.body.removeEventListener("click",e.clickOutsideEvent)}});const{context:Ou,messages:Mu}=Ru(),Pu=new Fi({locale:"en",messages:Mu,silentTranslationWarn:!0});var Au=null,ju={install:function(e){Object.defineProperty(e.prototype,"core",{get(){return Au}})}};s["default"].use(ju);var Du={de:!0,ru:!0,en:!0,fr:!0,cmn:!0,it:!0,es:!0,kr:!0},Lu={i18n:Pu,store:ce,router:An,name:"App",components:{MainWrapper:H,chats:Iu["default"],userUnauthorized:ne},props:{address:{type:String,default:""},privatekey:{type:String,defautt:""},pocketnet:{type:String,default:""},mobile:{type:String,default:""},recording:{type:String,default:""},pkoindisabled:{type:String,default:""},ctheme:String,fcmtoken:String,localization:String,pip:{type:Boolean,default:!1}},watch:{fcmtoken:function(){this.setPusher(this.fcmtoken)},localization:{immediate:!0,handler:function(){Du[this.localization]?Pu.locale=this.localization:Pu.locale="en",this.generateTeamroomMessages()}},mobile:function(){this.$store.commit("setMobile",this.mobile),this.$store.commit("minimize")},pocketnet:function(){this.$store.commit("setPocketnet",this.pocketnet),this.$store.commit("minimize")}},computed:{statetheme:function(){return this.$store.state.theme},theme:function(){return this.ctheme||this.statetheme},unauthorized:function(){return this.$store.state.unauthorized},online:function(){return this.$store.state.online},loading:function(){return this.$store.state.loading},minimized:function(){return!this.mobile&&this.$store.state.minimized},active:function(){return!this.mobile&&this.$store.state.active},globalpreloader:function(){return this.$store.state.globalpreloader},share:function(){if(!this.unauthorized)return this.$store.state.share},closebybg:function(){return!this.$store.state.pinchat},unselect:function(){return this.$store.state.voicerecording}},methods:{hide:function(){this.$store.commit("minimize",!0),setTimeout(()=>{"chats"!==this.$route.name&&"contact"!==this.$route.name&&"publicPreview"!==this.$route.name&&"chatSettings"!==this.$route.name&&!0!==Au.cancelDefaultRoute&&this.$router.push("/chats").catch(e=>{})},500)},iteraction:function(){this.$store.commit("setiteraction",!0)},importInitialScripts(){},setPusher(e){var t;localStorage&&(t=localStorage.getItem("fcmtoken5")),t!=e&&this.core.mtrx.wait().then(t=>{this.core.mtrx.deletePusher();var n={url:this.core.mtrx.baseUrl+"/_matrix/push/v1/notify"},r="pocketnet",i={app_display_name:r,app_id:r+window.cordova.platformId,data:n,user_id:this.core.mtrx.client.credentials.userId,device_display_name:window.device.manufacturer+" "+window.device.model,kind:"http",lang:localStorage.getItem("loc")||"en",pushkey:e};this.core.mtrx.client.setPusher(i).then(()=>{localStorage.setItem("fcmtoken5",e)},e=>{console.log(e)})})},generateTeamroomMessages(){this.$store.commit("SET_POCKETTEAMMESSAGES",[{id:1,text:`\n\t\t\t\t\t\t\t

${this.$i18n.t("teamMessages.1-title")}

\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t
  • ${this.$i18n.t("teamMessages.1-list1")}
  • \n\t\t\t\t\t\t\t\t
  • ${this.$i18n.t("teamMessages.1-list2")}
  • \n\t\t\t\t\t\t\t\t
  • ${this.$i18n.t("teamMessages.1-list3")}
  • \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t`,previewText:this.$i18n.t("teamMessages.1-title")}])}},beforeCreate(){this.$store.commit("init")},created(){this.$store.commit("setPocketnet",this.pocketnet),this.$store.commit("setMobile",this.mobile),this.$store.commit("setVoiceMessagesEnabled",this.recording),this.$store.commit("pkoindisabled",this.pkoindisabled),this.$store.commit("clearall"),this.$store.commit("ls"),this.importInitialScripts(),this.generateTeamroomMessages(),setTimeout(()=>{this.fcmtoken&&window.cordova&&this.setPusher(this.fcmtoken)},5e3);var e={matrixMan:{address:re["a"].hexEncode("PToMRMsMVh9dj4Cpa7yu1pB5iq65g4jrVC"),privateKey:"510aa931cdee36b9ac467ad04a2619f46be88815812b46e976e36bc8dbcdc41b"},ltme:{address:re["a"].hexEncode("PKszvjHwMWubQpeEKnQhRonGBVFWcJDbNJ"),privateKey:"513bc6a5014e7dd203537227fb0a78f7b974853478fcf95103125f6d793a5f8b"},travisnoscot1:{address:re["a"].hexEncode("PDjvHUQjcDX8Vq6rtpKveUDPtwPVUZEW7m"),privateKey:"63d91d001f7b5167a707dd4ee7e2638fc13e1fa3ff7171b040b432bcd1054e28"},mobRoocky:{address:re["a"].hexEncode("PCMnk8T3Edu81iGcTEpVCFq8FQd6UBXi2y"),privateKey:"0bbf6fb0dbf78a26f00345f6f96d4f76f52e0093417c51a1b7bccb7ca92e55df"},user1:{address:re["a"].hexEncode("PKxqtUuK3B6qwAxs6HLhvxrQVExuMwKWd5"),privateKey:"28f0fdc30094d517bc08abca3f219d77fc32230e313bbf0b699ecd42f80de82a0"},user2:{address:re["a"].hexEncode("PGe4xVAJRJtbD8swPipE2ug9Zk1rhSTa1y"),privateKey:"0b4562275da7e60a57e10432bdc7e3318dd9699b8b928224ba360b9fb951c77b"},FakeBadash:{address:re["a"].hexEncode("PDWPDFikMhLJHtiKLLXZGzfgphRcd19eHe"),privateKey:"99d8ce99383ccc5d6404535b98f2b43ce5ab939a28bfc52a442565b2351039fa"},Faketravis:{address:re["a"].hexEncode("PGURYzvoXuSvuwCuDty2wW37omjiKgzV5a"),privateKey:"93641f20095aa15b89b78d395ebe0a5a9b149ea2b54c57d896091c0ea9b86dfd"},fakeRocky:{address:re["a"].hexEncode("PRDKVP4yvF2wW8p5FUVkzrCvXYE8SMGkQK"),privateKey:"80d213d272405d4ff51752f91e79c639919f5f9f302583bdaa1c767b044ce2c0"},fakeFuture2:{address:"PBHvKTH5TGQYDbRHgQHTTvaBf7tuww6ho7",privateKey:"71cacb25f90b18e356e33bc12c428c2e8b6b7c6e2950ab6344412f226aab0b2c"},fakeFuture:{address:re["a"].hexEncode("PBHvKTH5TGQYDbRHgQHTTvaBf7tuww6ho7"),privateKey:"71cacb25f90b18e356e33bc12c428c2e8b6b7c6e2950ab6344412f226aab0b2c"},encMan:{address:re["a"].hexEncode("PEkKrb7WJgfU3rCkkU9JYT8jbGiQsw8Qy8"),privateKey:"616fd57f7610288978f4c01797a90d56b0c30392e598a2504b98c7a7246569a5"},harisCalvin:{address:re["a"].hexEncode("PXEWRce8siwbQWArQWyjnooogAEieHwhVd"),privateKey:"218bcb76df20438c1431c0394a42947f78f279bea987d7b238bfbd1cb1533b62"},oneSomeoneNigga:{address:re["a"].hexEncode("PGyjEoqmmK2tm6xmg69hGoSNM6hUrc4VfE"),privateKey:"254f5b9394f0490e78b41c6bf615bfd8e290fde3fb6d862f166b181b35764b06"},gomer:{address:re["a"].hexEncode("PVSdoFQqAg86p6tbAW8Y6CGGGjhiXkr4qh"),privateKey:"105de1935fa665bdc23b1b02bcdb3f62e01a3ad48823d5348edb5b94ec1b4526"},bart:{address:re["a"].hexEncode("PWioUw52q4iNpMQUauNYaWg9JpsPE1u9Ut"),privateKey:"a74bc4ee63290dd051d659fe46962176d2b9193e04104dea63116d25703bad72"},edSheeran:{address:re["a"].hexEncode("PVeqjqJk2GthxBK6QdhCCfQVEX1SAK92As"),privateKey:"d89952018721e6762de13fa2f1891b0dc2d1f1e75402ba483251086b2ba181ac"},duftPunkMan:{address:re["a"].hexEncode("PFnN8SExxLsUjMKzs2avdvBdcA3ZKXPPkF"),privateKey:"7d1a31cc49a05692cfd992359cd27e8b3783cd186d98053ea0b9307b00a19018"},jcole:{address:re["a"].hexEncode("P93cWU7X31wqn3R9GcUZ7c3fD11asXum5y"),privateKey:"900099127ad048d64523c4701d72d67b5b7f2afb18debbfdc53587f04a29c808"},flowMan:{address:re["a"].hexEncode("PM4gVCcWnTmysUXhMukoQA2mT7GpfWQvck"),privateKey:"12d28e4c950193665dcaaa32129c061b2213e736ffe20918f0f13b6a2857cc32"},JokeMan:{address:re["a"].hexEncode("PMSULgjrsCsEnWgNigCga5jSjhCvYBFSA8"),privateKey:"f7a2518393db3779a4394f4084473847bc4260a5aad20859eff9d32ab03c310e"},omgMan:{address:re["a"].hexEncode("P9R3aNvyjRbqTWfy5q1h5qvXFYaDtqaRi2"),privateKey:"80b4350df8c033a63fd7c6b71516ae05ab3a23a604a39afba5874b87b4effbf8"},nineBot:{address:re["a"].hexEncode("PNcvYsMXzf4RVmS9AjRYEqeeGjk1PiDjvF"),privateKey:"447554f94a3512a420ef6d089411dff3bc6d170f65e246cc52fc30aa9ed2216c"},tenBot:{address:re["a"].hexEncode("PS9F8hzGSxeL1Lc2VGvPoqXHotZvpoVkkX"),privateKey:"659bd118d33e541bb042015723cab1e6b644a9d330a988b10e6d593f9abe3542"},bikeBot:{address:re["a"].hexEncode("PBK1GDpiLNVFrKsPVAaNLU92byFY5P5KBr"),privateKey:"4c1ee4ae821a1ca885d77db84518b4dcbcd4efbed69603c8706b9557618529f9"},angryBot:{address:re["a"].hexEncode("PBMcLRBQNWtNQZYUbRZZAd5FuZ8yb7HMX2"),privateKey:"87bec25e930671a06e032dca484083d4b79e23aa985781995882d5d4594f8d8d"},test099090:{address:re["a"].hexEncode("PP582V47P8vCvXjdV3inwYNgxScZCuTWsq"),privateKey:"14ede296d13f8111c77a1da82519939329ee1b81ab23203da48df3f5e52fee3d"},tony:{address:re["a"].hexEncode("TLENU8HFyz8PqzpKBDWeN6Xix6rM8wjYKd"),privateKey:"8cf816c1c7a51cbc114db9aac8896b8654260f9b3a985232f27cf32823c7f45f"},invoker:{address:re["a"].hexEncode("TPjN8Dy4BpGDezMNw2ePuEdHiHetTvR3Mb"),privateKey:"a7ded16bd9d3350d6c3d233e6905b51e61bd879ba152ae24d0f8def76c4581c7"},drowRanger:{address:re["a"].hexEncode("TU8fAf96kSfQzmxmpjRDSSqvCiPWzWt67J"),privateKey:"38484a2047b5c8170847a97fc5cddf3d485c934c6532a51a73f64ec7e4659891"},nevermore:{address:re["a"].hexEncode("TKJ7xAC18XC4zQBvkNAWhkr3i7cARu11Uv"),privateKey:"8ec7f71d16b07d29bb49b3bc3054b5a4d2e65fb559e0ae695503568227584f53"},stormSpirit:{address:re["a"].hexEncode("TZBHmnZwLedPtHcJfJnFsbxobGuDKGf9uA"),privateKey:"642aaa706fe94ea77239468cb9aad6b463472793a2c4e1f60acf22078770c45f"},morph:{address:re["a"].hexEncode("TXyieuLsCntT1p4ougtiKURtYTxcdvWN1L"),privateKey:"8f59a6a6b7b8c1f63be47a6f571a11d726e9d7cde2baff52a51dc72326b6abb4"},alchemist:{address:re["a"].hexEncode("TT2CeQuHiM8E8hG4rkJcaMKQ8gWqhZmNUH"),privateKey:"957ad5e2a009e4c0f06f0ae2737ea4c36c48fa8312555fcd104ca9cff7db6848"},public_user_test:{address:re["a"].hexEncode("TLMXdC2UYSfMVbLzKtmJJTi4oK9LNHNVju"),privateKey:"509b219c5cead9545039ae38d428813af6671dbee3e37cadd2cd22f152013f2a"},cleanUser:{address:re["a"].hexEncode("THCRHFtVAoeDGLg548C4bQxXeDg9bwrs5K"),privateKey:"666919a742eb63bededea3fddc44b526148d8b0eb1126b0aaff480a2af888d92"},userwithoutavatar:{address:re["a"].hexEncode("TVcPMgVQ9TxgpzNrQyEAei5cnnR9jzXtzE"),privateKey:"2a3e96562c23a40e3d439b823453fb8fe6f8fb2c0267e8d2411734b3bdff90dd"},unnamed:{address:re["a"].hexEncode("THsA8rwdeAkq5bePA71Nw5CGtFg2duyDSq"),privateKey:"27b42dfba3d20ae7a945e09dd0688137fa7963fd48b94f7b4027dc4eed874a96"}},t={address:this.address?re["a"].hexEncode(this.address):"",privateKey:this.privatekey},n="nevermore",r=this.address&&this.privatekey?t:e[""+n],i=re["a"].deep(window,"window.POCKETNETINSTANCE.options.listofproxies")||[{host:"test.pocketnet.app",port:8899,wss:8099}],o=re["a"].deep(window,"window.POCKETNETINSTANCE.options.matrix")||"test.matrix.pocketnet.app";Au=new jc(this,{domain:o,mtrx:{logger:function(){}},listofproxies:i,servers:{pocketnet:"https://pocketnet.app:8888"}}),Au.init(),Au.initWithUser(r).then(e=>Au.mtrx.wait().then(()=>{Au.user.getContacts(),setTimeout(()=>{"chats"!==this.$route.name&&"publicPreview"!==this.$route.name&&"chatSettings"!==this.$route.name&&"contact"!==this.$route.name&&!0!==Au.cancelDefaultRoute&&this.$router.push("/chats").catch(e=>{})},100)})).catch(e=>{}),setInterval(()=>{!this.$store.state.autohide&&this.$store.state.iteraction||this.$store.commit("active",!1)},3e3),window.matrixchat=Au}};var Nu=Lu;function $u(e){var t=r("c934");t.__inject__&&t.__inject__(e);var n=r("fca4");n.__inject__&&n.__inject__(e);var i=r("7cd7");i.__inject__&&i.__inject__(e)}var Uu=Object(E["a"])(Nu,C,T,!1,$u,null,null,!0),Bu=Uu.exports;window.customElements.define("matrix-element",k(s["default"],Bu))},"5a76":function(e,t,n){var r=n("f576");e.exports=function(e){return(new r).update(e).digest()}},"5b1b":function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"validateHTMLColorName",(function(){return a})),n.d(t,"validateHTMLColorSpecialName",(function(){return s})),n.d(t,"validateHTMLColorHex",(function(){return c})),n.d(t,"validateHTMLColorRgb",(function(){return l})),n.d(t,"validateHTMLColorHsl",(function(){return f})),n.d(t,"validateHTMLColorHwb",(function(){return h})),n.d(t,"validateHTMLColorLab",(function(){return p})),n.d(t,"validateHTMLColor",(function(){return m}));const r=e=>e&&"string"==typeof e,i=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],o=["currentColor","inherit","transparent"],a=e=>{let t=!1;return r(e)&&i.map(n=>(e.toLowerCase()===n.toLowerCase()&&(t=!0),null)),t},s=e=>{let t=!1;return r(e)&&o.map(n=>(e.toLowerCase()===n.toLowerCase()&&(t=!0),null)),t},c=e=>{if(r(e)){const t=/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i;return e&&t.test(e)}},l=e=>{if(r(e)){const t=/(rgb)a?\((\s*\d+%?\s*?,?\s*){2}(\s*\d+%?\s*?,?\s*\)?)(\s*,?\s*\/?\s*(0?\.?\d+%?\s*)?|1|0)?\)$/i;return e&&t.test(e)}},u="(([0-9]|[1-9][0-9]|100)%)",d=`\\s*?\\)?)(\\s*?(\\/?)\\s+(((${u}))|(0?(\\.\\d+)?)|1))?\\s*?\\)$`,f=e=>{if(r(e)){const t=new RegExp(`(hsl)a?\\((\\s*?((-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)gra)|((([0-5])?\\.\\d+|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?(\\.\\d+)?|1)turn))((\\s*,\\s*)|(\\s+)))(\\s*?(0|${u})((\\s*,\\s*)|(\\s+)))(\\s*?(0|${u})\\s*?\\)?)(\\s*?(\\/?|,?)\\s*?(((${u}))|(0?(\\.\\d+)?)|1))?\\)$`);return e&&t.test(e)}},h=e=>{if(r(e)){const t=new RegExp(`(hwb\\(\\s*?(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\\s+)((0|${u})\\s+)((0|${u})${d}`);return e&&t.test(e)}},p=e=>{if(r(e)){const t="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])(\\.\\d+)??|160))",n=new RegExp(`(lab\\(\\s*?((\\d*(\\.\\d+)?)%)\\s+${t}\\s+${t}${d}`);return e&&n.test(e)}},m=e=>!!(e&&c(e)||l(e)||f(e)||h(e)||p(e));t.default=e=>!!(e&&c(e)||a(e)||s(e)||l(e)||f(e)||h(e)||p(e))}])},"5b2d":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"#teamroom.mobile[data-v-9b340a7a]{margin-bottom:10px}#teamroom[data-v-9b340a7a]:hover{cursor:pointer}#teamroom .teamChatWrapper[data-v-9b340a7a]{padding:.5em .25em;display:flex;align-items:center;transition:.3s}#teamroom .teamChatWrapper .iconWrapper[data-v-9b340a7a]{width:44px;display:flex;align-items:center;min-width:44px;height:44px;position:relative}#teamroom .teamChatWrapper .iconWrapper .logo[data-v-9b340a7a]{background-size:cover;background-position:50%;background-repeat:no-repeat;height:44px;width:44px;margin-left:0;margin-top:0;position:absolute;background:rgb(var(--text-on-bg-ac-color));border-radius:50%;padding-top:8px;text-align:center}#teamroom .teamChatWrapper .iconWrapper .logo img[data-v-9b340a7a]{width:28px;height:28px;margin:0 auto}#teamroom .teamChatWrapper .iconWrapper .unseen[data-v-9b340a7a]{background:rgba(var(--color-bg-ac),.9);color:rgb(var(--text-on-bg-ac-color));position:absolute;width:22px;height:22px;right:-10%;top:-10%;line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em}#teamroom .teamChatWrapper .infoWrapper[data-v-9b340a7a]{padding-left:.5em}#teamroom .teamChatWrapper .infoWrapper>div[data-v-9b340a7a]{display:flex;align-content:center}#teamroom .teamChatWrapper .infoWrapper .infoName span[data-v-9b340a7a]{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;display:inline-block;max-width:190px;color:rgb(var(--text-color))}#teamroom .teamChatWrapper .infoWrapper .previewMessage[data-v-9b340a7a]{display:flex;justify-content:flex-start;align-items:center;width:100%}#teamroom .teamChatWrapper .infoWrapper .previewMessage span[data-v-9b340a7a]{display:block;color:rgb(var(--color-txt-gray));font-size:.9em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:210px}#teamroom.minimized:not(.active) .teamChatWrapper[data-v-9b340a7a]{padding:.5em 0}",""]),e.exports=t},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5c7d":function(t,n,r){var i,o;(function(e,a){"use strict";i=a,o="function"===typeof i?i.call(n,r,n,t):i,void 0===o||(t.exports=o)})(0,(function(){"use strict";var t=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function o(t,n){var r=t[n];if("function"===typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(e){return"debug"===e&&(e="log"),typeof console!==n&&("trace"===e&&r?a:void 0!==console[e]?o(console,e):void 0!==console.log?o(console,"log"):t)}function c(e,n){for(var r=0;r=0&&t<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(o=t,!1!==r&&l(t),c.call(a,t,e),typeof console===n&&t0;return u(e,a,s,(function(e){r||(r=e),e&&o.forEach(d),a||(o.forEach(d),i(r))}))}));return t.reduce(f)}e.exports=p},"5e55":function(e,t,n){var r=n("eb93");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("052ddcf1",r,e)}},"5e77":function(e,t,n){var r=n("83ab"),i=n("1a2d"),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},"5f02":function(e,t,n){"use strict";e.exports=function(e){return"object"===typeof e&&!0===e.isAxiosError}},"5f05":function(e,t,n){"use strict";var r=n("c973").default;Object.defineProperty(t,"__esModule",{value:!0}),t.RoomList=void 0;var i=n("b503");class o{constructor(e){this._cryptoStore=e,this._roomEncryption={}}init(){var e=this;return r((function*(){yield e._cryptoStore.doTxn("readwrite",[i.IndexedDBCryptoStore.STORE_ROOMS],t=>{e._cryptoStore.getEndToEndRooms(t,t=>{e._roomEncryption=t})})}))()}getRoomEncryption(e){return this._roomEncryption[e]||null}isRoomEncrypted(e){return Boolean(this.getRoomEncryption(e))}setRoomEncryption(e,t){var n=this;return r((function*(){n._roomEncryption[e]=t,yield n._cryptoStore.doTxn("readwrite",[i.IndexedDBCryptoStore.STORE_ROOMS],r=>{n._cryptoStore.storeEndToEndRoom(e,t,r)})}))()}}t.RoomList=o},"5faa":function(e,t,n){var r=n("4b1c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("7b306284",r,e)}},"60b9":function(e,t,n){"use strict";n.r(t);var r=n("8056");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},6129:function(e,t,n){"use strict";var r=n("1da1");n("d9e2");const i=function(e,t,n){const i=!1,o=!1;let a=()=>{};i&&(a=console.log);const s=3600,c=24*s,l=30*c;var u=n||l,d={};function f(){const e=Math.floor(Date.now()/1e3),t=e-e%s;return t}function h(){let n,r=indexedDB.open(e,t);function i(){const e=s("items"),t=e.objectStore("items"),n=t.getAll();return new Promise((e,t)=>{n.onsuccess=t=>{const n=t.target.result;n&&_.each(n,e=>{d[e.id]=e.message}),e()},n.onerror=t=>{a("PCryptoStorage CLEAR OUTDATED error",t),e()}})}function o(){const e=f()-u,t=n.transaction("items","readwrite"),r=t.objectStore("items"),i=r.openCursor();return new Promise((t,n)=>{i.onsuccess=n=>{const r=n.target.result;r&&(e>=r.value.cachedAt&&(a("PCryptoStorage CLEAR OUTDATED log",n),r.delete()),r.continue()),t()},i.onerror=e=>{a("PCryptoStorage CLEAR OUTDATED error",e),t()}})}function s(e){const t=n.transaction("items","readwrite");return t.onsuccess=function(e){a("PCryptoStorage TRANSACTION finished",e)},t.onabort=function(e){a("PCryptoStorage TRANSACTION abort",e.target.error)},t.onerror=function(e){a("PCryptoStorage TRANSACTION error",e.target.error)},t}r.onupgradeneeded=function(e){let t=r.result;const n=e.oldVersion!==e.newVersion,i=0===e.oldVersion;n&&!i&&(t.objectStoreNames.contains("items")||t.deleteObjectStore("items")),t.objectStoreNames.contains("items")||t.createObjectStore("items",{keyPath:"id"})};const c={clear:e=>{function t(t,n){const r=s("items",!0),i=r.objectStore("items"),o=i.delete(e);delete d[e],o.onsuccess=e=>{a("PCryptoStorage CLEAR log",e),t(!0)},o.onerror=e=>{a("PCryptoStorage CLEAR error",e.target.error),n(e.target.error)}}return a("PCryptoStorage clearing",e),new Promise(t)},set:(e,t)=>{function n(n,r){const i=s("items",!0),o=i.objectStore("items"),c=f(),l={id:e,message:t,cachedAt:c};d[e]=t;const u=o.put(l);u.onsuccess=function(e){a("PCryptoStorage SET log",e),n(!0)},u.onerror=function(e){a("PCryptoStorage SET error",e.target.error),r(e.target.error)}}return a("PCryptoStorage writing",e),new Promise(n)},get:e=>{function t(t,n){if(d[e])return t(d[e]);const r=s("items"),i=r.objectStore("items"),o=i.get(e);o.onsuccess=r=>{if(a("PCryptoStorage GET log",r,o.result),!o.result)return void n("Data does not exist");const i="message"in o.result;i?(d[e]=o.result.message,t(o.result.message)):n("Message property does not exist")},o.onerror=e=>{n(e.target.error)}}return a("PCryptoStorage reading",e),new Promise(t)}};function l(e,t){r.onerror=function(e){a("PCryptoStorage error occurred:",e),t("PCryptoStorage error initiating IndexedDB")},r.onsuccess=function(){n=r.result,o().then(e=>i()).then(t=>{e(c)})}}return new Promise(l)}function p(){function t(){const t=f()-7*c;let n=Object.keys(localStorage),r=n.filter(t=>t.includes(e));r.forEach(e=>{const n=JSON.parse(localStorage[e]);t>=n.cachedAt&&delete localStorage[e]})}const n={clear:function(){var t=Object(r["a"])((function*(t){a("PCryptoStorage clearing localstorage",t);const n=`${e}_${t}`,r=n in localStorage;if(!r)throw Error("Data does not exist");const i="message"in localStorage[n];if(!i)throw Error("Message property does not exist");return delete localStorage[n],new Promise(executor)}));return function(e){return t.apply(this,arguments)}}(),set:function(){var t=Object(r["a"])((function*(t,n){a("PCryptoStorage writing localstorage",t);const r=`${e}_${t}`,i=f(),o={message:n,cachedAt:i};localStorage[r]=JSON.stringify(o)}));return function(e,n){return t.apply(this,arguments)}}(),get:function(){var t=Object(r["a"])((function*(t){a("PCryptoStorage reading",t);const n=`${e}_${t}`,r=n in localStorage;if(!r)throw Error("Data does not exist");return localStorage[n]}));return function(e){return t.apply(this,arguments)}}()};return t(),n}return!window.indexedDB||o?(a("PCryptoStorage LOCALSTORAGE_FALLBACK"),p()):h()};t["a"]=i},6146:function(e,t,n){"use strict";function r(e,t){return new Promise((n,r)=>{let i=!0;const o=e.open(t);o.onupgradeneeded=()=>{i=!1},o.onblocked=()=>r(),o.onsuccess=()=>{const r=o.result;r.close(),i||e.deleteDatabase(t),n(i)},o.onerror=e=>r(e.target.error)})}Object.defineProperty(t,"__esModule",{value:!0}),t.exists=r},6167:function(t,n,r){"use strict";r.r(n);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.event.localRedactionEvent()||e.event.getRedactionEvent()||e.removed?n("div",{staticClass:"deletedMessage"},[n("i",{staticClass:"fas fa-eraser"}),e._v(" "+e._s(e.$t("caption.messageDeleted"))+" ")]):n("div",{ref:"msgElement",staticClass:"event",class:{readyToRender:e.readyToRender,my:e.my}},["member"!==e.type||e.preview?e._e():n("member",{attrs:{chat:e.chat,event:e.event,userinfo:e.userinfo,readed:e.readed,preview:e.preview||!1},on:{readyToRender:e.setReadyToRender}}),"message"===e.type||e.preview?n("message",{attrs:{chat:e.chat,event:e.event,prevevent:e.prevevent,origin:e.event,decryptEvent:e.decryptEvent,decryptedInfo:e.decryptedInfo,encryptedData:e.encryptedData,imgEvent:e.galleryData,userinfo:e.userinfo,readed:e.readed,preview:e.preview||!1,withImage:e.withImage||!1,clientWidth:e.clientWidth,encrypted:e.encrypted,subtype:e.subtype,error:e.error,reference:e.reference,downloaded:e.downloaded,last:e.last,showmyicontrue:e.showmyicontrue,fromreference:e.fromreference,multiSelect:e.multiSelect,selectedMessages:e.selectedMessages,audioBuffer:e.audioBuffer,isRemoveSelectedMessages:e.isRemoveSelectedMessages},on:{openGalleryImg:e.openImage,readyToRender:e.setReadyToRender,remove:e.removeEvent,download:e.downloadFile,decryptagain:e.decryptAgain,showMultiSelect:function(t){return e.$emit("showMultiSelect")},selectMessage:e.selectMessage,removeMessage:e.removeMessage,messagesIsDeleted:e.messagesIsDeleted,editing:e.editing,reply:e.reply,share:e.share,menuIsVisible:e.menuIsVisibleHandler}}):e._e(),"common"===e.type?n("common",{attrs:{event:e.event,userinfo:e.userinfo,readed:e.readed,preview:e.preview||!1}}):e._e(),e.downloading?n("div",{staticClass:"loading"},[n("linepreloader")],1):e._e()],1)},o=[],a=r("1da1"),s=r("a54c"),c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"eventsCommon"})},l=[],u=r("2f62"),d={name:"eventsCommon",props:{event:Object,preview:Boolean,userinfo:Object},data:function(){return{loading:!1}},computed:Object(u["c"])({auth:e=>e.auth}),methods:{}},f=d,h=r("2877");function p(e){var t=r("78ad");t.__inject__&&t.__inject__(e)}var m=Object(h["a"])(f,c,l,!1,p,"52fddf5e",null,!0),v=m.exports,g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"eventMember"},[e.preview?e._e():n("div",{staticClass:"iconWrapper",on:{click:function(t){return e.core.mtrx.opencontact(e.userinfo)}}},[n("userpic",{attrs:{userinfo:e.userinfo}})],1),n("div",{staticClass:"labelwrapper"},[n("span",{staticClass:"label"},[n("b",[e._v(e._s(e.userinfo.name||"Somebody"))]),e._v(" "+e._s(e.keyword))])])])},y=[],b=r("3139"),w={name:"eventsMember",props:{event:Object,preview:Boolean,userinfo:Object},data:function(){return{loading:!1,pName:Object,membership:"",moder:!1}},mounted:function(){this.$emit("readyToRender")},computed:Object(u["c"])({auth:e=>e.auth,keyword:function(){var e,t=this.$store.state.users,n=null===(e=this.event.event)||void 0===e?void 0:e.content.membership,r=b["a"].getmatrixid(b["a"].deep(this.event,"event.state_key")||this.event.getSender()),i="";if("join"===n)return this.$i18n.t("caption.joinedInTheChat");if("invite"===n)return _.find(t,(e,t)=>{if(e.id===r)return i=e.name}),this.$i18n.t("caption.hasInvited")+""+i+this.$i18n.t("caption.inTheChat");if("ban"===n)return _.find(t,(e,t)=>{if(e.id===r)return i=e.name}),this.$i18n.t("caption.banned")+` ${i} `+this.$i18n.t("caption.andRoom");if("leave"===n){let e=this.$store.state.users[b["a"].getmatrixid(this.event.target.userId)];if(e)return e.name+" "+this.$i18n.t("caption.left")+this.$i18n.t("caption.theChat")}if("m.room.power_levels"===this.event.event.type&&this.event.event.unsigned.prev_content){let e=Object.keys(b["a"].ObjDiff(this.event.event.content.users,this.event.event.unsigned.prev_content.users)),t=this.$store.state.users[""+b["a"].getmatrixid(e[0])],n=this.event.event.content.users[""+e[0]];if(!_.isEmpty(t)&&e[0]){if(0===n)return this.$i18n.t("caption.unmarked")+` ${t.name} `+this.$i18n.t("caption.asModerator");if(50===n)return this.$i18n.t("caption.marked")+` ${t.name} `+this.$i18n.t("caption.asModerator")}}return this.event.event.type,"m.room.name"===this.event.event.type?this.$i18n.t("caption.editedChatNameTo")+`"${this.event.event.content.name}"`:void 0}}),methods:{}},x=w;function S(e){var t=r("00e4");t.__inject__&&t.__inject__(e)}var k=Object(h["a"])(x,g,y,!1,S,"54a240c2",null,!0),E=k.exports,C=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"eventsMessage"},[e.referenceshowed&&e.reference&&!e.preview&&!e.fromreference?n("div",{staticClass:"reference referenceTop",class:{my:e.my}},[n("eventsEvent",{attrs:{event:e.reference,chat:e.chat,preview:!1,fromreference:!0}})],1):e._e(),e.preview||"m.notice"===e.content.msgtype?e._e():n("div",{directives:[{name:"touch",rawName:"v-touch:touchhold",value:e.dropDownMenuShow,expression:"dropDownMenuShow",arg:"touchhold"}],class:{referenceshowed:e.referenceshowed,showmeta:e.showmeta,my:e.my,messageRow:"messageRow",urlpreview:e.urlpreview,allscreen:e.urlpreview||"m.image"===e.content.msgtype||e.file,aligncenter:"m.audio"===e.content.msgtype},attrs:{my:e.my}},[e.urlpreview||e.imageUrl||"m.image"===e.content.msgtype||e.showmeta&&e.my||e.file?n("div",{staticClass:"timeWrapper"},[e.showburn?n("i",{class:"fas fa-fire burn "+e.showburn,on:{click:e.showwhenburn}}):e._e(),n("span",[e._v(" "+e._s(e.format_date(e.origin._localTimestamp)||"Now")+" ")])]):e._e(),"m.file"!==e.content.msgtype?n("div",{staticClass:"actionsWrapper"},[e.multiSelect?n("div",{staticClass:"multiSelect",on:{click:function(t){return e.eventMessage(e.selectedMessage)}}},[e.selectedMessage?n("i",{staticClass:"far fa-check-circle"}):n("i",{staticClass:"far fa-circle"})]):n("div",{staticClass:"mnwrapper"},[n("i",{staticClass:"fas fa-ellipsis-h",on:{click:e.setmenu}})])]):e._e(),!e.my||e.showmyicon?n("div",{staticClass:"iconWrapper",on:{click:function(t){return e.core.mtrx.opencontact(e.userinfo)}}},[n("userpic",{attrs:{userinfo:e.userinfo}})],1):e._e(),(e.content.from||e.imageFrom)&&(e.file||"m.image"===e.content.msgtype&&e.imageUrl||"m.audio"===e.content.msgtype&&e.audioUrl)?n("div",{staticClass:"fromimagesfiles"},[n("div",{staticClass:"fromCaption"},[n("i",{staticClass:"fas fa-share-alt"}),e._v(" "),n("span",[e._v(e._s(e.$t("caption.messagefrom")))])])]):e._e(),"m.image"===e.content.msgtype?n("div",{staticClass:"messageImg"},[e.imageUrl?n("div",{},[e.encryptedData?n("div",{staticClass:"encryptedDataIcon"},[n("i",{staticClass:"fas fa-lock"})]):e._e(),n("div",{staticClass:"imgMsg"},[n("div",{staticClass:"showImage",style:e.imagePaddingStyle(e.content),on:{click:function(t){return e.openImageGallery(e.origin)}}},[n("div",{staticClass:"abswrapper"},[n("img",{directives:[{name:"images-loaded",rawName:"v-images-loaded:on.loaded",value:e.imagesLoaded,expression:"imagesLoaded",arg:"on",modifiers:{loaded:!0}}],attrs:{src:e.imageUrl,alt:""}})])])])]):n("div",{staticClass:"preloaderImage",style:e.imagePaddingStyle(e.content)},[n("div",{staticClass:"abswrapper"},[n("linepreloader")],1)])]):e._e(),"m.audio"===e.content.msgtype?n("div",{staticClass:"messageAudio"},[e.audioUrl?n("VoiceMessage",{attrs:{audioBuffer:e.audioUrl,decryptedInfo:e.decryptedInfo,id:e.event._localTimestamp||Date.now()}}):e._e()],1):e._e(),"m.encrypted"===e.content.msgtype&&!e.textWithoutLinks&&e.badenctypted?n("div",{staticClass:"maxcontent",class:{my:e.my}},[n("div",{staticClass:"badenctyptedText"},[n("span",[e._v(e._s(e.$t("caption.unabletoDecrypt")))]),e._v(" "),n("i",{staticClass:"fas fa-undo decryptagain",on:{click:e.decryptagain}})])]):e._e(),"m.text"!==e.content.msgtype&&"m.encrypted"!==e.content.msgtype||!e.textWithoutLinks?e._e():n("div",{staticClass:"maxcontent",class:{my:e.my}},[n("div",{staticClass:"messageText"},[e.edited?n("div",{staticClass:"edited"},[n("i",{staticClass:"fas fa-pen"}),e._v(" "+e._s(e.$t("caption.edited"))+" ")]):e._e(),n("div",{staticClass:"msgtext"},[n("IncomingMessage",{attrs:{message:e.textWithoutLinks}})],1),!e.content.from&&!e.my&&e.showmeta||e.showmyicon&&!e.my?n("div",{staticClass:"sendername"},[n("span",[n("b",[e._v(e._s(e.userinfo.name))])]),e._v(" · "),n("span",[e._v(" "+e._s(e.format_date(e.origin._localTimestamp)||"Now")+" ")])]):e._e(),!e.reference||e.preview||e.fromreference?e._e():n("div",{staticClass:"reference showreference",on:{click:e.showreference}},[e.referenceshowed?e._e():n("eventsEvent",{attrs:{event:e.reference,chat:e.chat,preview:!0}}),n("div",{staticClass:"referenceCaption"},[e.referenceshowed?n("button",{staticClass:"button ghost small"},[e._v("Hide")]):n("span",[n("i",{staticClass:"fas fa-share"})])])],1),e.content.from?n("div",{staticClass:"from"},[n("div",{staticClass:"fromCaption"},[n("i",{staticClass:"fas fa-share-alt"}),n("span",[e._v(e._s(e.$t("caption.messagefrom"))+" "+e._s(this.userinfo.name))])])]):e._e()])]),e.file?n("div",{staticClass:"filePreview"},[n("fileMessage",{attrs:{encryptedData:e.encryptedData,file:e.file,downloaded:e.downloaded},on:{download:e.download}}),e.encryptedData?n("div",{staticClass:"encryptedDataIcon"},[n("i",{staticClass:"fas fa-lock"})]):e._e(),e.error?n("div",{staticClass:"badencrypted"},[n("span",[e._v(e._s(e.$t("caption.unabletoDecrypt")))])]):e._e()],1):e._e(),e.urlpreview?n("div",{staticClass:"linkPreview"},[e.sending?n("div",[n("linepreloader")],1):n("div",{staticClass:"pr"},[e.origin.localRedactionEvent()||e.origin.getRedactionEvent()?e._e():n("url",{attrs:{url:e.urlpreview,urllink:e.urlpreview,preview:!0},on:{updatedSize:e.updatedSize}})],1)]):e._e()]),e.preview?n("div",{staticClass:"messagePreview"},[n("listPreview",{attrs:{my:e.my,event:e.origin,decryptEvent:e.decryptEvent,userinfo:e.userinfo,chat:e.chat,readed:e.readed}})],1):e._e(),e.my&&e.readed&&!e.preview&&!e.fromreference?n("div",{staticClass:"statusWrapper"},[n("div",{staticClass:"my"},[n("i",{staticClass:"fas fa-check-double"}),e._v(" "),n("span",[e._v(e._s(e.$t("caption.messageRead")))])])]):e._e()])},T=[],I=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"msgAction"},[n("div",{staticClass:"contentAction",style:{margin:e.position}},[n("ul",[n("li",[n("a",{attrs:{href:"google.com"}},[e._v(e._s(e.$t("button.reply"))+" "),n("i",{staticClass:"fas fa-reply"})])]),n("li",[e._v(e._s(e.$t("button.copy"))+" "),n("i",{staticClass:"far fa-copy"})]),n("li",[e._v(e._s(e.$t("button.select"))+" "),n("i",{staticClass:"far fa-check-circle"})]),n("li",[e._v(e._s(e.$t("button.forward"))+" "),n("i",{staticClass:"fas fa-share"})]),n("li",[e._v(e._s(e.$t("button.delete"))+" "),n("i",{staticClass:"far fa-trash-alt"})])])])])},R=[],O={name:"msgActions",props:{position:String},data:function(){return{loading:!1,actionMessage:!1}},computed:Object(u["c"])({auth:e=>e.auth}),methods:{}},M=O;function P(e){var t=r("7acf");t.__inject__&&t.__inject__(e)}var A=Object(h["a"])(M,I,R,!1,P,"9d2b1700",null,!0),j=A.exports,D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("clip-loader",{staticClass:"clipLoader",attrs:{size:"25px",color:"#0035a8",loading:!0}}),n("p",[e._v(e._s(e.preview.name))]),n("p",[e._v(e._s(e.preview.size))])],1)},L=[],N=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"v-spinner"},[n("div",{staticClass:"v-clip",style:e.spinnerStyle})])},$=[],U={name:"ClipLoader",props:{loading:{type:Boolean,default:!0},color:{type:String,default:"#5dc596"},size:{type:String,default:"35px"},radius:{type:String,default:"100%"}},computed:{spinnerStyle(){return{height:this.size,width:this.size,borderWidth:"2px",borderStyle:"solid",borderColor:this.color+" "+this.color+" transparent",borderRadius:this.radius,background:"transparent"}}}},B=U;function F(e){var t=r("c337");t.__inject__&&t.__inject__(e)}var z=Object(h["a"])(B,N,$,!1,F,null,null,!0),q=z.exports,W={props:{preview:Object},components:{clipLoader:q}},K=W,V=Object(h["a"])(K,D,L,!1,null,null,null,!0),G=V.exports,H=r("696c2"),Y=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"listPreview"},[e.urlpreview&&e.metaPreviewLink?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"sname txt"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"linkTitle txt"},[e._v("sent link: "+e._s(e.meta["og:title"])+" ")]),"Pocketnet"===e.meta["og:site_name"]?n("span",{staticClass:"pocketnetLink"},[e._v(" "+e._s(e.meta["og:site_name"])+" ")]):n("span",[e._v(" "+e._s(e.meta["og:site_name"])+" ")])]):e._e(),"m.file"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"sname txt"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(" sent file: "+e._s(JSON.parse(e.content.body).name)+" ")])]):e._e(),"m.bad.encrypted"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[n("span",[e._v(" "+e._s(e.$t("caption.unabletoDecrypt"))+" ")])]):e._e(),"m.room.redaction"===e.event.event.type?n("div",{staticClass:"previewMessage"},[n("span",{staticClass:"txt"},[n("i",{staticClass:"fas fa-eraser"}),e._v(" "+e._s(e.$t("caption.messageDeleted"))+" ")])]):e._e(),"m.room.power_levels"===e.event.event.type?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(" "+e._s(e.powerLevels)+" ")])]):e._e(),"m.image"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.sentImage")))])]):e._e(),"m.audio"===e.content.msgtype?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.sentVoiceMessage")))])]):e._e(),"m.text"!==e.content.msgtype||e.urlpreview?e._e():n("div",{staticClass:"previewMessage"},[e.senderName&&"You"!=e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+": ")]):e._e(),n("span",{staticClass:"txt"},[n("IncomingMessage",{attrs:{message:e.content.body}})],1)]),"m.encrypted"!==e.content.msgtype||e.urlpreview?e._e():n("div",{staticClass:"previewMessage"},[e.senderName&&"You"!=e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+": ")]):e._e(),n("span",{staticClass:"txt"},[n("IncomingMessage",{attrs:{message:e.decryptEvent.body}})],1)]),"invite"===e.content.membership?n("div",{staticClass:"invitedEvent"},[e.tetatetchat?n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.invitationToChat")))]):e._e(),e.tetatetchat?e._e():n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.invitationToRoom")))])]):e._e(),"leave"===e.content.membership?n("div",{staticClass:"previewMessage"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+": ")]):e._e(),n("span",{staticClass:"txt sname"},[e._v(" "+e._s(e.name)+" ")]),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.leftChat")))])]):e._e(),"ban"===e.content.membership?n("div",[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),e._v(" "),n("span",{staticClass:"txt"},[e._v("banned "+e._s(e.content.displayname))])]):e._e(),"join"===e.content.membership&&e.event.getSender()!==e.userId?n("div",{staticClass:"invitedEvent"},[e.senderName?n("span",{staticClass:"txt sname"},[e._v(e._s(e.senderName)+" ")]):e._e(),n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.joined")))])]):e._e(),e.content.name?n("div",[n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.chatRenamed"))+" "),n("b",[e._v(e._s(e.content.name))])])]):e._e(),e.content.topic?n("div",[n("span",{staticClass:"txt"},[e._v(e._s(e.$t("caption.chatTopic"))+" "),n("b",[e._v(e._s(e.content.topic.replace(/_/g," ")))])])]):e._e(),e.readed?n("div",{staticClass:"statusWrapper"},[e.my?n("div",{staticClass:"my"},[n("i",{staticClass:"fas fa-check-double"})]):e._e()]):e._e()])},J=[],X=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",e._l(e.chunks,(function(t,r){return n("label",{key:r,attrs:{chunks:e.chunks}},[t.id?n("label",{staticClass:"likelink",on:{click:function(n){return e.show(t)}}},[e._v("@"+e._s(t.name))]):n("label",[e._v(e._s(t))])])})),0)},Z=[],Q={name:"IncomingMessage",props:{message:{type:String,default:""}},data(){return{user_id:/\w{68}:/,userCalled:/@\w{68}:\w{1,50}/g}},computed:{chunks:function(){if(-1==this.message.indexOf("@"))return[this.message];var e=this.message.split(this.userCalled),t=Array.from(this.message.matchAll(this.userCalled),e=>e[0]),n=[];return _.each(e,(function(e,r){if(n.push(e),t[r]){var i=t[r].replace("@","").split(":");2==i.length?n.push({id:i[0],name:i[1]}):n.push(t[r])}})),n}},methods:{show:function(e){this.core.mtrx.kit.usersInfoById(e.id).then(e=>{core.mtrx.opencontact(e)})}}},ee=Q;function te(e){var t=r("de56");t.__inject__&&t.__inject__(e)}var ne=Object(h["a"])(ee,X,Z,!1,te,"6b3704ba",null,!0),re=ne.exports,ie={props:{event:{},chat:{},decryptEvent:{},notificationPreview:!1,userinfo:Object,readed:Object,my:Boolean},components:{IncomingMessage:re},data:function(){return{meta:{}}},computed:{userId:function(){var e;return null===(e=this.core.user.userinfo)||void 0===e?void 0:e.id},countMembers:function(){var e;return _.size(null===(e=this.chat)||void 0===e?void 0:e.currentState.members)},urlpreview:function(){if("m.file"!==this.content.msgtype)return""},tetatetchat:function(){return this.core.mtrx.kit.tetatetchat(this.chat)},unknowngroupusers:function(){return this.core.mtrx.kit.unknowngroupusers(this.m_chat)},senderName:function(){return this.userinfo.id==this.userId?"You":this.userinfo.name||""},metaPreviewLink:function(){return this.core.mtrx.client.getUrlPreview(this.urlpreview,0).then(e=>this.meta=e),this.meta},ev:function(){return this.event._clearEvent||this.event},content:function(){return this.event.event.content},name:function(){var e=this.$store.state.users[""+b["a"].getmatrixid(this.event.event.state_key)].name;return e==this.senderName?"":e},powerLevels:function(){if("m.room.power_levels"===this.event.event.type&&this.event.event.unsigned.prev_content){let e=Object.keys(b["a"].ObjDiff(this.event.event.content.users,this.event.event.unsigned.prev_content.users)),t=this.$store.state.users[""+b["a"].getmatrixid(e[0])],n=this.event.event.content.users[""+e[0]];if(!_.isEmpty(t)&&e[0]){if(0===n&&t.name)return"unmarked "+t.name+" as moderator";if(50===n&&t.name)return"marked "+t.name+" as moderator"}}}}},oe=ie;function ae(e){var t=r("9801");t.__inject__&&t.__inject__(e)}var se=Object(h["a"])(oe,Y,J,!1,ae,"ba5ac396",null,!0),ce=se.exports,le=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"urlMessage",attrs:{id:"url"}},["impty"==e.urltype||e.error?e._e():n("div",{staticClass:"urlwrapper"},[e.loading?n("div",[n("div",{staticClass:"preloaderWrapperLocal"},[n("linepreloader")],1)]):n("metaMessage",{ref:"metamessage",attrs:{type:e.urltype,name:e.meta["og:site_name"],title:e.meta["og:title"],description:e.meta["og:description"],image:e.previewImageUrl,url:e.url,h:e.meta["og:image:height"],w:e.meta["og:image:width"]},on:{updatedSize:e.updatedSize}})],1)])},ue=[],de={name:"eventsurl",props:{url:String,preview:Boolean,data:Object},components:{metaMessage:()=>r.e(3).then(r.bind(null,"dacd"))},data:function(){return{meta:{},loading:!0,error:!1,groups:{p:["pocketnet.app","bastyon.com"],pt:["test.pocketnet.app","test.bastyon.com"]}}},computed:Object(u["c"])({auth:e=>e.auth,clearurl:function(){var e=this.url||"";return e=e.replace("http://","https://"),-1==e.indexOf("https://")&&(e="https://"+e),e},previewImageUrl(){if(this.meta["og:image"])return this.core.mtrx.client.mxcUrlToHttp(this.meta["og:image"])},urltype:function(){if(!this.url)return"empty";if(this.url.indexOf("embedVideo.php")>-1)return"video";var t={};try{t=new URL(this.url)}catch(e){this.error=e}if(!t.pathname||"/"==t.pathname)return"custom";var n=window.pocketnetdomain||"pocketnet.app";if(this.url.indexOf("publicroom=")>-1)return"matrix";if(this.url.indexOf("connect=")>-1)return"matrix";if(this.url.indexOf("bastyon://")>-1)return"pocketnet";if(this.url.indexOf("pocketnet://")>-1)return"pocketnet";var r=_.find(this.groups,(function(e){return _.indexOf(e,t.host)>-1&&_.indexOf(e,n)>-1}));return r&&-1==this.url.indexOf("embedVideo.php")?"pocketnet":"custom"}}),mounted:function(){"custom"==this.urltype?this.geturl():this.loading=!1},methods:{updatedSize:function(e){this.$emit("updatedSize",e)},geturl:function(){this.loading=!0,this.core.mtrx.client.getUrlPreview(this.clearurl,0).then(e=>{this.loading=!1,this.meta=e}).catch(e=>{this.meta={},this.loading=!1})}}},fe=de;function he(e){var t=r("fdca");t.__inject__&&t.__inject__(e)}var pe=Object(h["a"])(fe,le,ue,!1,he,"791cf1f7",null,!0),me=pe.exports,ve=r("8ff0"),ge=r.n(ve),ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"voiceMessage",class:{playing:e.isPlaying}},[n("div",{staticClass:"voiceMessage_wrapper"},[n("button",{staticClass:"voiceMessage_toggle",class:{encrypted:e.encrypted},on:{touchend:e.audioToggle,click:e.audioToggleClick}},[n("i",{class:e.isPlaying?"fas fa-pause":"fas fa-play"})]),n("div",{staticClass:"voiceMessage_graph"},[n("canvas",{ref:"canvas",attrs:{width:"100",height:"50"},on:{mousedown:e.goTo}})]),n("div",{staticClass:"voiceMessage_options"},[e.error?e._e():n("span",[e._v(e._s(e.getDurationString))]),e.error?n("i",{staticClass:"fas fa-exclamation-circle"}):e._e()]),e.encrypted&&!e.error?n("div",{staticClass:"encsign"},[n("i",{staticClass:"fas fa-lock"})]):e._e()])])},be=[],_e={name:"VoiceMessage",props:{decryptedInfo:Object,audioBuffer:{type:null|String,required:!0},id:{type:Number}},data(){return{voiceMessage:null,isPlaying:!1,interval:null,audioContext:null,audio:null,duration:null,currentTime:null,signal:null,audiobuffer:null,error:null}},inject:["addToQueue","playNext"],mounted(){this.initVoiceMessage()},beforeDestroy(){this.isPlaying&&this.pause(),this.interval&&(clearInterval(this.interval),this.interval=null)},watch:{isPlaying:function(e){this.isPlaying}},computed:{encrypted(){return!!this.decryptedInfo},...Object(u["c"])({mobile:e=>e.mobile}),getDurationString(){if(this.duration){let e,t;return this.currentTime?(e=Math.floor(this.currentTime),t=Math.floor(this.currentTime/60),`${t}:${e<10?"0"+e:e}`):(e=Math.floor(this.duration),t=Math.floor(this.duration/60),`${t}:${e<10?"0"+e:e}`)}return"0:00"},percentPlayed(){return this.currentTime/this.duration},localBuffer(){return b["a"].copyArrayBuffer(this.audioBuffer)}},methods:{goTo(e){if(this.$refs.canvas){var t=e.offsetX/this.$refs.canvas.width*this.duration;this.isPlaying?(this.pause(),setTimeout(()=>{this.setTime(t),this.play()},20)):(this.setTime(t),this.play())}},audioToggleClick(){this.mobile||this.audioToggle()},audioToggle(){this.isPlaying?this.pause():this.play()},pause(){this.audio&&(this.audio.stop(),this.audio.disconnect()),this.isPlaying=!1,this.draw();let e=this.$store.state.currentPlayingVoiceMessage;e&&e.id==this.id&&this.$store.commit("SET_CURRENT_PLAYING_VOICE_MESSAGE",null),this.interval&&(clearInterval(this.interval),this.interval=null)},play(){if(!this.audiobuffer)return;if(this.error)return void this.playNext(this.id);this.audioContext=this.core.getAudioContext(),this.isPlaying=!0,this.audio=this.initAudioNode(),this.currentTime>=this.duration&&this.setTime(0),this.audio.start?this.audio.start(0,this.currentTime):this.audio.play?this.audio.play(0,this.currentTime):this.audio.noteOn&&this.audio.noteOn(0,this.currentTime);let e=this.$store.state.currentPlayingVoiceMessage;e&&e.id!==this.id&&e.pause(),this.$store.commit("SET_CURRENT_PLAYING_VOICE_MESSAGE",this),this.interval&&clearInterval(this.interval);var t=50;this.interval=setInterval(()=>{var e=this.currentTime+t/1e3;this.duration-t/1e3this.duration&&this.pause(),this.draw(),this.setTime(e)},t)},draw(){const e=this.$refs.canvas;if(!this.signal)return;if(!e)return;const t=this.signal;var n=e.width,r=e.height,i=t.length,o=this.percentPlayed;const a=e.getContext("2d");a.clearRect(0,0,n,r);var s=Math.floor(i/20);for(let c=0;c{this.audio=null,this.isPlaying&&setTimeout(()=>{this.playNext(this.id)},300),this.duration-1000&&void 0!==arguments[0]?arguments[0]:0;this.currentTime=e},initVoiceMessage(){var t=this;return Object(a["a"])((function*(){try{t.audioContext=t.core.getAudioContext()}catch(e){t.error=e}if(!t.error){t.addToQueue(t,t.id),t.duration=0,t.setTime(0);try{yield t.audioContext.decodeAudioData(t.localBuffer,e=>{t.audiobuffer=e,t.duration=e.duration,t.setTime(0),t.signal=e.getChannelData(0),t.draw()})}catch(e){t.error=e}}}))()}}},we=_e;function xe(e){var t=r("e86a");t.__inject__&&t.__inject__(e)}var Se=Object(h["a"])(we,ye,be,!1,xe,"0438bc11",null,!0),ke=Se.exports,Ee={name:"eventsMessage",props:{decryptEvent:{},origin:Object,prevevent:Object,event:Object,preview:Boolean,userinfo:Object,readed:Object,downloaded:Boolean,baseImg:{type:String,default:"empty"},filePreview:Object,imgEvent:{},add_image:Function,goToGallery:Function,chat:Object,encrypted:!1,encryptedData:Boolean,decryptedInfo:null,error:String,withImage:Boolean,reference:Object,last:Boolean,showmyicontrue:!1,fromreference:Boolean,multiSelect:{default:!1,type:Boolean},selectedMessages:{default:[],type:Array},isRemoveSelectedMessages:!1,audioBuffer:null},directives:{imagesLoaded:ge.a},data:function(){return{referenceshowed:!1}},components:{actions:j,filePreview:G,fileMessage:H["a"],listPreview:ce,url:me,dummypreviews:s["a"],IncomingMessage:re,VoiceMessage:ke},watch:{isRemoveSelectedMessages:{immediate:!0,handler:function(){if(this.isRemoveSelectedMessages){for(let e=0;e0&&e.indexOf(this.urlpreview)+this.urlpreview.lengthe.message_id===this.origin.event.event_id);return(null===(e=t[0])||void 0===e?void 0:e.message_id)===this.origin.event.event_id}},mounted(){},methods:{gotoreference:function(){var e=this.reference.getId();this.$emit("gotoreference",e)},showwhenburn:function(){var e="";e=this.willburn.toDate(){this.setmenu()},200)},setmenu:function(){this.core.menu({items:this.menuItems,handler:this.menuItemClickHandler,item:{}})},menushare:function(){var e={},t=this.$f.trim(this.body);return"m.image"===this.content.msgtype&&this.imageUrl&&(e.images=[this.imageUrl]),"m.audio"===this.content.msgtype&&this.audioUrl&&(e.audio=[this.audioUrl]),"m.text"!==this.content.msgtype&&"m.encrypted"!==this.content.msgtype||!t||(e.messages=[t]),this.file&&(e.download=!0),e.from=this.userinfo.id,this.$emit("share",e),Promise.resolve()},menuedit:function(){return this.$emit("editing",this.body),Promise.resolve()},menushowMultiSelect:function(){return this.$emit("showMultiSelect"),this.selectMessage(),Promise.resolve()},menureply:function(){return this.$emit("reply"),Promise.resolve()},menucopy:function(){return this.$f.copytext(this.replacedmintionsbody),Promise.resolve()},menudelete:function(){return this.$dialog.confirm("Do you really want to delete message?",{okText:this.$i18n.t("yes"),cancelText:this.$i18n.t("cancel")}).then(e=>(this.$emit("remove"),this.core.mtrx.client.redactEvent(this.chat.roomId,this.origin.event.event_id,null,{reason:"messagedeleting"}))).catch(e=>Promise.resolve())},menuItemClickHandler:function(e,t,n){n.hidePopup(),this["menu"+e.click]().then(e=>{}).catch(e=>{n.showPopup()})},imagePaddingStyle:function(e){if(e.info&&e.info.h&&e.info.w){var t=e.info.h/e.info.w;t>1.7&&(t=1.7);var n="padding-bottom:"+100*t+"%";return n}return""},parser(e){return JSON.parse(e)["og:title"]},openImage(e){this.$emit("openImg",e)},format_date(e){if(e)return 0===moment().diff(e,"days")?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}):moment().year()===moment(e).year()?moment(e).locale(this.$i18n.locale).format("D MMMM"):moment(e).locale(this.$i18n.locale).format("D MMMM YYYY")},download:function(){this.$emit("download")},decryptagain:function(){this.$emit("decryptagain")},openImageGallery(e){this.$emit("openGalleryImg",e)},reshareKeys(){this.chat.roomId},textDonation:function(){var e=this.$i18n.t("caption.somebody"),t="";try{e=this.$f.deep(this,"$store.state.users."+this.content.from).name}catch(r){}var n=this.$i18n.t("caption.somebody");try{n=this.$f.deep(this,"$store.state.users."+this.content.to).name}catch(r){}return t+=e+this.$i18n.t("caption.sent")+this.content.amount+this.$i18n.t("caption.sent")+n,t},menuIsVisibleHandler(e){this.$emit("menuIsVisible",e)},showreference:function(){this.referenceshowed=!this.referenceshowed},selectMessage:function(){var e={},t=this.$f.trim(this.body);"m.image"===this.content.msgtype&&this.imageUrl&&(e.images=[this.imageUrl]),"m.audio"===this.content.msgtype&&this.decryptedInfo&&(e.audio=[this.decryptedInfo]),"m.text"!==this.content.msgtype&&"m.encrypted"!==this.content.msgtype||!t||(e.messages=[t]),this.file&&(e.download=!0),e.from=this.userinfo.id,this.$emit("selectMessage",{message_id:this.origin.event.event_id,...e})},removeMessage:function(){this.$emit("removeMessage",{message_id:this.origin.event.event_id})},eventMessage:function(e){e?this.removeMessage():this.selectMessage()}}},Ce=Ee;function Te(e){var t=r("dd47");t.__inject__&&t.__inject__(e)}var Ie=Object(h["a"])(Ce,C,T,!1,Te,"c8f458dc",null,!0),Re=Ie.exports,Oe={name:"eventsEvent",components:{common:v,member:E,message:Re,dummypreviews:s["a"]},data:function(){return{readed:null,decryptEvent:{},decryptedInfo:null,decryptReady:"",readyEvent:!1,downloading:!1,error:null,reference:null,removed:!1,downloaded:!1,readedInterval:null,audioBuffer:null,readyToRender:!1}},props:{event:Object,prevevent:Object,preview:Boolean,withImage:Boolean,timeline:Object,last:Boolean,chat:Object,showmyicontrue:Boolean,metaUrl:String,galleryData:{},goToGallery:Function,clientWidth:Number,fromreference:Boolean,multiSelect:{default:!1,type:Boolean},selectedMessages:{type:Array,default:()=>[]},isRemoveSelectedMessages:!1},computed:{type:function(){var e=b["a"].deep(this,"event.event.type");return["m.room.member"].indexOf(e)>-1?"member":["m.room.message"].indexOf(e)>-1?"message":["m.room.name"].indexOf(e)>-1||["m.room.power_levels"].indexOf(e)>-1?"member":["m.room.redaction"].indexOf(e)>-1?"message":["m.room.topic"].indexOf(e)>-1?"member":""},subtype:function(){return b["a"].deep(this,"event.event.content.msgtype")},encryptedData:function(){return!(!b["a"].deep(this,"event.event.content.info.secrets")&&!b["a"].deep(this,"event.event.content.pbody.secrets"))},userinfo:function(){return this.$f.deep(this,"$store.state.users."+this.$f.getmatrixid(this.event.getSender()))||{}},encrypted:function(){return!(!this.chat||!this.chat.roomId)&&this.core.mtrx.client.isRoomEncrypted(this.chat.roomId)},my:function(){var e;return this.userinfo.id===(null===(e=this.core.user.userinfo)||void 0===e?void 0:e.id)}},beforeDestroy:function(){this.readedInterval&&(clearInterval(this.readedInterval),this.readedInterval=null)},mounted:function(){this.$emit("mounted")},watch:{readed:{immediate:!0,handler:function(){this.manageReadedInterval()}},last:{handler:function(){this.manageReadedInterval()}},event:{immediate:!0,handler:function(){this.decryptEvent={},this.checkReaded(),this.relations(),this.encryptedData||"m.encrypted"==this.subtype?b["a"].pretry(()=>this.chat.pcrypto,20,1e4).then(()=>{this.encryptedData&&"m.image"==this.subtype&&this.decryptImage(),this.encryptedData&&"m.audio"==this.subtype&&this.decryptAudio(),"m.encrypted"==this.subtype&&this.decrypt()}):"m.audio"==this.subtype&&this.getAudioUnencrypt()}}},methods:{setReadyToRender(){setTimeout(()=>{this.readyToRender=!0},20)},manageReadedInterval(){!this.preview&&this.my&&(this.last||this.readed?this.readedInterval||(this.readedInterval=setInterval(()=>{this.checkReaded()},500)):this.readedInterval&&(clearInterval(this.readedInterval),this.readedInterval=null))},relations(){if(this.timeline){var e=this.timeline._timelineSet,t=this.event;if(!this.reference&&t.event.content["m.relates_to"]&&t.event.content["m.relates_to"]&&"m.reference"==t.event.content["m.relates_to"]["rel_type"]){var n=t.event.content["m.relates_to"]["event_id"];n&&this.core.mtrx.client.getEventTimeline(e,n).then(r=>{var i=_.find(r.getEvents(),e=>{if(e.getId()==n)return!0});if(i){this.reference=t.event.content.reference=i;var o=e.getRelationsForEvent(this.core.mtrx.clearEventId(i),"m.replace","m.room.message");if(o){var a=o.getLastReplacement();a&&(i.event.content.body=a.event.content.body,i.event.content.edited=a.event.event_id)}}})}}},editing(e){this.$emit("editing",e)},reply(){this.$emit("reply")},share(e){var t=Promise.resolve();return e.download&&(t=this.core.mtrx.getFile(this.chat,this.event).then(e=>b["a"].Base64.fromFile(e.file)).then(t=>(e.files=[t],Promise.resolve()))),t.then(()=>this.core.share(e))},downloadFile(){this.downloading=!0,this.core.mtrx.downloadFile(this.chat,this.event).catch(e=>(this.error=e.toString(),Promise.resolve(e))).then(e=>{this.downloading=!1,this.downloaded=!0,this.$store.commit("icon",{icon:"success",message:"Downloaded"})}).catch(e=>{this.$store.commit("icon",{icon:"error",message:"Downloading Failed"})})},getAudioUnencrypt(){this.core.mtrx.getAudioUnencrypt(this.chat,this.event).then(e=>{this.audioBuffer=e}).catch(e=>{})},decryptAudio(){var e=this;return Object(a["a"])((function*(){e.core.mtrx.getAudio(e.chat,e.event).then(t=>{e.decryptedInfo=t}).catch(t=>{e.event.event.decryptKey=e.decryptKey={msgtype:"m.bad.encrypted"}})}))()},decryptImage(){var e=this;return Object(a["a"])((function*(){e.core.mtrx.getImage(e.chat,e.event).then(t=>{e.decryptedInfo=t}).catch(t=>{e.event.event.decryptKey=e.decryptKey={msgtype:"m.bad.encrypted"}})}))()},decryptAgain(){var e=this;return Object(a["a"])((function*(){return e.event.event.decrypted=null,e.decrypt()}))()},decrypt(){var t=this;return Object(a["a"])((function*(){if(t.event.event.decrypted)return t.decryptEvent=t.event.event.decrypted,Promise.resolve();try{var n=yield t.chat.pcrypto.decryptEvent(t.event.event);t.decryptEvent=n,t.event.event.decrypted=t.decryptEvent}catch(e){console.error(e),t.event.event.decrypted=t.decryptEvent={msgtype:"m.bad.encrypted"}}}))()},checkReaded:function(){this.event&&this.core.mtrx.isReaded(this.event).then(e=>{this.readed=e||null})},openImage:function(){this.$emit("openImageEvent",this.event)},removeEvent:function(e){this.$emit("removeEvent",e),this.removed=!0},menuIsVisibleHandler:function(e){this.$emit("menuIsVisible",e)},selectMessage:function(e){this.$emit("selectMessage",e)},removeMessage:function(e){this.$emit("removeMessage",e)},shareManyMessages:function(e){this.$emit("shareManyMessages",e)},messagesIsDeleted:function(e){this.$emit("messagesIsDeleted",e)}}},Me=Oe;function Pe(e){var t=r("60b9");t.__inject__&&t.__inject__(e)}var Ae=Object(h["a"])(Me,i,o,!1,Pe,"72e46191",null,!0);n["default"]=Ae.exports},"62c8":function(e,t,n){var r=n("b639"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},"62d6":function(e,t,n){"use strict";n.r(t);var r=n("96c4");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"62e4":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},6374:function(e,t,n){var r=n("da84"),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},6386:function(e,t,n){"use strict";n("d9e2");var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.EventTimelineSet=f;var i=n("faa1"),o=n("e685"),a=n("a120"),s=r(n("3987")),c=n("63c7"),l=n("3ed0");const u=!0;let d;function f(e,t){this.room=e,this._timelineSupport=Boolean(t.timelineSupport),this._liveTimeline=new o.EventTimeline(this),this._unstableClientRelationAggregation=!!t.unstableClientRelationAggregation,this._timelines=[this._liveTimeline],this._eventIdToTimeline={},this._filter=t.filter||null,this._unstableClientRelationAggregation&&(this._relations={})}d=u?c.logger.log.bind(c.logger):function(){},s.inherits(f,i.EventEmitter),f.prototype.getTimelines=function(){return this._timelines},f.prototype.getFilter=function(){return this._filter},f.prototype.setFilter=function(e){this._filter=e},f.prototype.getPendingEvents=function(){return this.room?this._filter?this._filter.filterRoomTimeline(this.room.getPendingEvents()):this.room.getPendingEvents():[]},f.prototype.getLiveTimeline=function(){return this._liveTimeline},f.prototype.eventIdToTimeline=function(e){return this._eventIdToTimeline[e]},f.prototype.replaceEventId=function(e,t){const n=this._eventIdToTimeline[e];n&&(delete this._eventIdToTimeline[e],this._eventIdToTimeline[t]=n)},f.prototype.resetLiveTimeline=function(e,t){const n=!this._timelineSupport||!t,r=this._liveTimeline,i=n?r.forkLive(o.EventTimeline.FORWARDS):r.fork(o.EventTimeline.FORWARDS);n?(this._timelines=[i],this._eventIdToTimeline={}):this._timelines.push(i),t&&r.setPaginationToken(t,o.EventTimeline.FORWARDS),i.setPaginationToken(e,o.EventTimeline.BACKWARDS),this._liveTimeline=i,this.emit("Room.timelineReset",this.room,this,n)},f.prototype.getTimelineForEvent=function(e){const t=this._eventIdToTimeline[e];return void 0===t?null:t},f.prototype.findEventById=function(e){const t=this.getTimelineForEvent(e);if(t)return s.findElement(t.getEvents(),(function(t){return t.getId()==e}))},f.prototype.addTimeline=function(){if(!this._timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");const e=new o.EventTimeline(this);return this._timelines.push(e),e},f.prototype.addEventsToTimeline=function(e,t,n,r){if(!n)throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");if(!t&&n==this._liveTimeline)throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");if(this._filter&&(e=this._filter.filterRoomTimeline(e),!e.length))return;const i=t?o.EventTimeline.BACKWARDS:o.EventTimeline.FORWARDS,a=t?o.EventTimeline.FORWARDS:o.EventTimeline.BACKWARDS;let s=!1,l=!1;for(let u=0;u{this.aggregateRelations(e)});const t=e.getRelation();if(!t)return;const n=t.event_id,r=t.rel_type,i=e.getType();let o=this._relations[n];o||(o=this._relations[n]={});let s=o[r];s||(s=o[r]={});let c,u=s[i],d=!1;u||(u=s[i]=new l.Relations(r,i,this.room),d=!0,c=this.findEventById(n)||this.room.getPendingEvent(n),c&&u.setTargetEvent(c)),u.addEvent(e),d&&c&&c.emit("Event.relationsCreated",r,i)}},"63c7":function(e,t,n){"use strict";var r=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.logger=void 0;var i=r(n("5c7d"));const o="matrix";i.default.methodFactory=function(e,t,n){return function(){for(var e=arguments.length,t=new Array(e),n=0;n{e.messages=e.messages||{},e.messages.chunk=e.messages.chunk||[],e.state=e.state||[];const n=l.map(l.deepCopy(e.state),t.getEventMapper()),r=l.map(e.state,t.getEventMapper()),i=l.map(e.messages.chunk,t.getEventMapper());return e.presence&&l.isArray(e.presence)&&e.presence.map(t.getEventMapper()).forEach((function(e){let n=t.store.getUser(e.getContent().user_id);n?n.setPresenceEvent(e):(n=w(t,e.getContent().user_id),n.setPresenceEvent(e),t.store.storeUser(n)),t.emit("event",e)})),e.messages.start&&(this._peekRoom.oldState.paginationToken=e.messages.start),this._peekRoom.oldState.setStateEvents(n),this._peekRoom.currentState.setStateEvents(r),this._resolveInvites(this._peekRoom),this._peekRoom.recalculate(),this._peekRoom.addEventsToTimeline(i.reverse(),!0,this._peekRoom.getLiveTimeline(),e.messages.start),t.store.storeRoom(this._peekRoom),t.emit("Room",this._peekRoom),this._peekPoll(this._peekRoom),this._peekRoom})},_.prototype.stopPeeking=function(){this._peekRoom=null},_.prototype._peekPoll=function(e,t){if(this._peekRoom!==e)return void b("Stopped peeking in room %s",e.roomId);const n=this;this.client._http.authedRequest(void 0,"GET","/events",{room_id:e.roomId,timeout:3e4,from:t},void 0,5e4).then((function(t){if(n._peekRoom!==e)return void b("Stopped peeking in room %s",e.roomId);t.chunk.filter((function(e){return"m.presence"===e.type})).map(n.client.getEventMapper()).forEach((function(e){let t=n.client.store.getUser(e.getContent().user_id);t?t.setPresenceEvent(e):(t=w(n.client,e.getContent().user_id),t.setPresenceEvent(e),n.client.store.storeUser(t)),n.client.emit("event",e)}));const r=t.chunk.filter((function(t){return t.room_id===e.roomId&&t.event_id})).map(n.client.getEventMapper());e.addLiveEvents(r),n._peekPoll(e,t.end)}),(function(r){h.logger.error("[%s] Peek poll failed: %s",e.roomId,r),setTimeout((function(){n._peekPoll(e,t)}),3e4)}))},_.prototype.getSyncState=function(){return this._syncState},_.prototype.getSyncStateData=function(){return this._syncStateData},_.prototype.recoverFromSyncStartupError=function(){var e=i((function*(e,t){yield e;const n=this._startKeepAlives();this._updateSyncState("ERROR",{error:t}),yield n}));return function(t,n){return e.apply(this,arguments)}}(),_.prototype._wasLazyLoadingToggled=function(){var e=i((function*(e){e=!!e;let t=!1;const n=yield this.client.store.isNewlyCreated();if(!n){const n=yield this.client.store.getClientOptions();return n&&(t=!!n.lazyLoadMembers),t!==e}return!1}));return function(t){return e.apply(this,arguments)}}(),_.prototype._shouldAbortSync=function(e){return"M_UNKNOWN_TOKEN"===e.errcode&&(h.logger.warn("Token no longer valid - assuming logout"),this.stop(),!0)},_.prototype.sync=function(){var e=this;const n=this.client,r=this;this._running=!0,t.window&&t.window.addEventListener&&(this._onOnlineBound=this._onOnline.bind(this),t.window.addEventListener("online",this._onOnlineBound,!1));let o=Promise.resolve(),a=null;function s(){return c.apply(this,arguments)}function c(){return c=i((function*(){try{b("Getting push rules...");const e=yield n.getPushRules();b("Got push rules"),n.pushRules=e}catch(e){if(h.logger.error("Getting push rules failed",e),r._shouldAbortSync(e))return;return b("Waiting for saved sync before retrying push rules..."),yield r.recoverFromSyncStartupError(o,e),void s()}d()})),c.apply(this,arguments)}function l(){const e=new u.Filter(n.credentials.userId);return e.setTimelineLimit(r.opts.initialSyncLimit),e}const d=function(){var t=i((function*(){if(b("Checking lazy load status..."),e.opts.lazyLoadMembers&&n.isGuest()&&(e.opts.lazyLoadMembers=!1),e.opts.lazyLoadMembers){b("Checking server lazy load support...");const t=yield n.doesServerSupportLazyLoading();t?(b("Enabling lazy load on sync filter..."),e.opts.filter||(e.opts.filter=l()),e.opts.filter.setLazyLoadMembers(!0)):(b("LL: lazy loading requested but not supported by server, so disabling"),e.opts.lazyLoadMembers=!1)}b("Checking whether lazy loading has changed in store...");const t=yield e._wasLazyLoadingToggled(e.opts.lazyLoadMembers);if(t){e._storeIsInvalid=!0;const t=p.InvalidStoreError.TOGGLED_LAZY_LOADING,n=new p.InvalidStoreError(t,!!e.opts.lazyLoadMembers);return e._updateSyncState("ERROR",{error:n}),void h.logger.warn("InvalidStoreError: store is not usable: stopping sync.")}e.opts.lazyLoadMembers&&e.opts.crypto&&e.opts.crypto.enableLazyLoading();try{b("Storing client options..."),yield e.client._storeClientOptions(),b("Stored client options")}catch(r){throw h.logger.error("Storing client options failed",r),r}f()}));return function(){return t.apply(this,arguments)}}();function f(){return m.apply(this,arguments)}function m(){return m=i((function*(){let e,t;b("Getting filter..."),e=r.opts.filter?r.opts.filter:l();try{t=yield n.getOrCreateFilter(y(n.credentials.userId),e)}catch(i){if(h.logger.error("Getting filter failed",i),r._shouldAbortSync(i))return;return b("Waiting for saved sync before retrying filter..."),yield r.recoverFromSyncStartupError(o,i),void f()}n.resetNotifTimelineSet(),null===r._currentSyncRequest&&(b("Sending first sync request..."),r._currentSyncRequest=r._doSyncRequest({filterId:t},a)),b("Waiting for saved sync before starting sync processing..."),yield o,r._sync({filterId:t})})),m.apply(this,arguments)}n.isGuest()?r._sync({}):(b("Getting saved sync token..."),o=n.store.getSavedSyncToken().then(e=>(b("Got saved sync token"),a=e,b("Getting saved sync..."),n.store.getSavedSync())).then(e=>{if(b("Got reply from saved sync, exists? "+!!e),e)return r._syncFromCache(e)}).catch(e=>{h.logger.error("Getting saved sync failed",e)}),s())},_.prototype.stop=function(){b("SyncApi.stop"),t.window&&(t.window.removeEventListener("online",this._onOnlineBound,!1),this._onOnlineBound=void 0),this._running=!1,this._currentSyncRequest&&this._currentSyncRequest.abort(),this._keepAliveTimer&&(clearTimeout(this._keepAliveTimer),this._keepAliveTimer=null)},_.prototype.retryImmediately=function(){return!!this._connectionReturnedDefer&&(this._startKeepAlives(0),!0)},_.prototype._syncFromCache=function(){var t=i((function*(t){b("sync(): not doing HTTP hit, instead returning stored /sync data");const n=t.nextBatch;this.client.store.setSyncToken(n);const r={oldSyncToken:null,nextSyncToken:n,catchingUp:!1,fromCache:!0},i={next_batch:n,rooms:t.roomsData,groups:t.groupsData,account_data:{events:t.accountData}};try{yield this._processSyncResponse(r,i)}catch(e){h.logger.error("Error processing cached sync",e.stack||e)}this._storeIsInvalid||this._updateSyncState("PREPARED",r)}));return function(e){return t.apply(this,arguments)}}(),_.prototype._sync=function(){var t=i((function*(t){const n=this.client;if(!this._running)return b("Sync no longer running: exiting."),this._connectionReturnedDefer&&(this._connectionReturnedDefer.reject(),this._connectionReturnedDefer=null),void this._updateSyncState("STOPPED");const r=n.store.getSyncToken();let i;try{null===this._currentSyncRequest&&(this._currentSyncRequest=this._doSyncRequest(t,r)),i=yield this._currentSyncRequest}catch(e){return void this._onSyncError(e,t)}finally{this._currentSyncRequest=null}n.store.setSyncToken(i.next_batch),this._failedSyncCount=0,yield n.store.setSyncData(i);const o={oldSyncToken:r,nextSyncToken:i.next_batch,catchingUp:this._catchingUp};this.opts.crypto&&(yield this.opts.crypto.onSyncWillProcess(o));try{yield this._processSyncResponse(o,i)}catch(e){h.logger.error("Caught /sync error",e.stack||e),this.client.emit("sync.unexpectedError",e)}o.catchingUp=this._catchingUp,t.hasSyncedBefore||(this._updateSyncState("PREPARED",o),t.hasSyncedBefore=!0),this.opts.crypto&&(yield this.opts.crypto.onSyncCompleted(o)),this._updateSyncState("SYNCING",o),n.store.wantsSave()&&(this.opts.crypto&&(yield this.opts.crypto.saveDeviceList(0)),n.store.save()),this._sync(t)}));return function(e){return t.apply(this,arguments)}}(),_.prototype._doSyncRequest=function(e,t){const n=this._getSyncParams(e,t);return this.client._http.authedRequest(void 0,"GET","/sync",n,void 0,n.timeout+v)},_.prototype._getSyncParams=function(e,t){let n=this.opts.pollTimeout;("SYNCING"!==this.getSyncState()||this._catchingUp)&&(this._catchingUp=!0,n=0);let r=e.filterId;this.client.isGuest()&&!r&&(r=this._getGuestFilter());const i={filter:r,timeout:n};return this.opts.disablePresence&&(i.set_presence="offline"),t?i.since=t:i._cacheBuster=Date.now(),"ERROR"!=this.getSyncState()&&"RECONNECTING"!=this.getSyncState()||(i.timeout=0),i},_.prototype._onSyncError=function(e,t){if(!this._running)return b("Sync no longer running: exiting"),this._connectionReturnedDefer&&(this._connectionReturnedDefer.reject(),this._connectionReturnedDefer=null),void this._updateSyncState("STOPPED");h.logger.error("/sync error %s",e),h.logger.error(e),this._shouldAbortSync(e)||(this._failedSyncCount++,h.logger.log("Number of consecutive failed sync requests:",this._failedSyncCount),b("Starting keep-alive"),this._startKeepAlives().then(e=>{e&&"ERROR"===this.getSyncState()&&this._updateSyncState("CATCHUP",{oldSyncToken:null,nextSyncToken:null,catchingUp:!0}),this._sync(t)}),this._currentSyncRequest=null,this._updateSyncState(this._failedSyncCount>=g?"ERROR":"RECONNECTING",{error:e}))},_.prototype._processSyncResponse=function(){var e=i((function*(e,t){const n=this.client,r=this;if(t.presence&&l.isArray(t.presence.events)&&t.presence.events.map(n.getEventMapper()).forEach((function(e){let t=n.store.getUser(e.getSender());t?t.setPresenceEvent(e):(t=w(n,e.getSender()),t.setPresenceEvent(e),n.store.storeUser(t)),n.emit("event",e)})),t.account_data&&l.isArray(t.account_data.events)){const e=t.account_data.events.map(n.getEventMapper()),r=e.reduce((e,t)=>(e[t.getId()]=n.store.getAccountData(t.getType()),e),{});n.store.storeAccountDataEvents(e),e.forEach((function(e){if("m.push_rules"===e.getType()){const t=e.getContent();n.pushRules=f.PushProcessor.rewriteDefaultRules(t)}const t=r[e.getId()];return n.emit("accountData",e,t),e}))}if(t.to_device&&l.isArray(t.to_device.events)&&t.to_device.events.length>0){const e=[];t.to_device.events.map(n.getEventMapper()).map(t=>{if("m.key.verification.cancel"===t.getType()){const n=t.getContent()["transaction_id"];n&&e.push(n)}return t}).forEach((function(t){const r=t.getContent();if("m.room.message"!=t.getType()||"m.bad.encrypted"!=r.msgtype){if("m.key.verification.start"===t.getType()||"m.key.verification.request"===t.getType()){const n=r["transaction_id"];e.includes(n)&&t.flagCancelled()}n.emit("toDeviceEvent",t)}else h.logger.log("Ignoring undecryptable to-device event from "+t.getSender())}))}else this._catchingUp=!1;t.groups&&(t.groups.invite&&this._processGroupSyncEntry(t.groups.invite,"invite"),t.groups.join&&this._processGroupSyncEntry(t.groups.join,"join"),t.groups.leave&&this._processGroupSyncEntry(t.groups.leave,"leave"));let o=[],a=[],s=[];if(t.rooms&&(t.rooms.invite&&(o=this._mapSyncResponseToRoomArray(t.rooms.invite)),t.rooms.join&&(a=this._mapSyncResponseToRoomArray(t.rooms.join)),t.rooms.leave&&(s=this._mapSyncResponseToRoomArray(t.rooms.leave))),this._notifEvents=[],o.forEach((function(e){const t=e.room,i=r._mapSyncEventsFormat(e.invite_state,t);r._processRoomEvents(t,i),e.isBrandNewRoom&&(t.recalculate(),n.store.storeRoom(t),n.emit("Room",t)),i.forEach((function(e){n.emit("event",e)})),t.updateMyMembership("invite")})),yield l.promiseMapSeries(a,function(){var t=i((function*(t){const o=t.room,a=r._mapSyncEventsFormat(t.state,o),s=r._mapSyncEventsFormat(t.timeline,o),c=r._mapSyncEventsFormat(t.ephemeral),u=r._mapSyncEventsFormat(t.account_data);if(t.unread_notifications){o.setUnreadNotificationCount("total",t.unread_notifications.notification_count);const e=n.isRoomEncrypted(o.roomId);(!e||e&&o.getUnreadNotificationCount("highlight")<=0)&&o.setUnreadNotificationCount("highlight",t.unread_notifications.highlight_count)}if(t.timeline=t.timeline||{},t.isBrandNewRoom)o.getLiveTimeline().setPaginationToken(t.timeline.prev_batch,d.EventTimeline.BACKWARDS);else if(t.timeline.limited){let i=!0;for(let e=s.length-1;e>=0;e--){const t=s[e].getId();if(o.getTimelineForEvent(t)){b("Already have event "+t+" in limited sync - not resetting"),i=!1,s.splice(0,e);break}}i&&(r._deregisterStateListeners(o),o.resetLiveTimeline(t.timeline.prev_batch,r.opts.canResetEntireTimeline(o.roomId)?null:e.oldSyncToken),n.resetNotifTimelineSet(),r._registerStateListeners(o))}function f(e){return h.apply(this,arguments)}function h(){return h=i((function*(e){if(n.emit("event",e),e.isState()&&"m.room.encryption"==e.getType()&&r.opts.crypto&&(yield r.opts.crypto.onCryptoEvent(e)),e.isState()&&"im.vector.user_status"===e.getType()){let t=n.store.getUser(e.getStateKey());t?t._unstable_updateStatusMessage(e):(t=w(n,e.getStateKey()),t._unstable_updateStatusMessage(e),n.store.storeUser(t))}})),h.apply(this,arguments)}r._processRoomEvents(o,a,s,e.fromCache),t.summary&&o.setSummary(t.summary),o.addEphemeralEvents(c),o.addAccountData(u),o.recalculate(),t.isBrandNewRoom&&(n.store.storeRoom(o),n.emit("Room",o)),r._processEventsForNotifs(o,s),yield l.promiseMapSeries(a,f),yield l.promiseMapSeries(s,f),c.forEach((function(e){n.emit("event",e)})),u.forEach((function(e){n.emit("event",e)})),o.updateMyMembership("join")}));return function(e){return t.apply(this,arguments)}}()),s.forEach((function(e){const t=e.room,i=r._mapSyncEventsFormat(e.state,t),o=r._mapSyncEventsFormat(e.timeline,t),a=r._mapSyncEventsFormat(e.account_data);r._processRoomEvents(t,i,o),t.addAccountData(a),t.recalculate(),e.isBrandNewRoom&&(n.store.storeRoom(t),n.emit("Room",t)),r._processEventsForNotifs(t,o),i.forEach((function(e){n.emit("event",e)})),o.forEach((function(e){n.emit("event",e)})),a.forEach((function(e){n.emit("event",e)})),t.updateMyMembership("leave")})),e.oldSyncToken&&this._notifEvents.length&&(this._notifEvents.sort((function(e,t){return e.getTs()-t.getTs()})),this._notifEvents.forEach((function(e){n.getNotifTimelineSet().addLiveEvent(e)}))),t.device_lists&&this.opts.crypto&&(yield this.opts.crypto.handleDeviceListChanges(e,t.device_lists)),this.opts.crypto&&t.device_one_time_keys_count){const e=t.device_one_time_keys_count.signed_curve25519||0;this.opts.crypto.updateOneTimeKeyCount(e)}if(this.opts.crypto&&t["org.matrix.msc2732.device_unused_fallback_key_types"]){const e=t["org.matrix.msc2732.device_unused_fallback_key_types"];this.opts.crypto.setNeedsNewFallback(e instanceof Array&&!e.includes("signed_curve25519"))}}));return function(t,n){return e.apply(this,arguments)}}(),_.prototype._startKeepAlives=function(e){void 0===e&&(e=2e3+Math.floor(5e3*Math.random())),null!==this._keepAliveTimer&&clearTimeout(this._keepAliveTimer);const t=this;return e>0?t._keepAliveTimer=setTimeout(t._pokeKeepAlive.bind(t),e):t._pokeKeepAlive(),this._connectionReturnedDefer||(this._connectionReturnedDefer=l.defer()),this._connectionReturnedDefer.promise},_.prototype._pokeKeepAlive=function(e){void 0===e&&(e=!1);const t=this;function n(){clearTimeout(t._keepAliveTimer),t._connectionReturnedDefer&&(t._connectionReturnedDefer.resolve(e),t._connectionReturnedDefer=null)}this.client._http.request(void 0,"GET","/_matrix/client/versions",void 0,void 0,{prefix:"",localTimeoutMs:15e3}).then((function(){n()}),(function(r){400==r.httpStatus||404==r.httpStatus?t._keepAliveTimer=setTimeout(n,2e3):(e=!0,t._keepAliveTimer=setTimeout(t._pokeKeepAlive.bind(t,e),5e3+Math.floor(5e3*Math.random())),t._updateSyncState("ERROR",{error:r}))}))},_.prototype._processGroupSyncEntry=function(e,t){for(const n of Object.keys(e)){const r=e[n];let i=this.client.store.getGroup(n);const o=null===i;null===i&&(i=this.createGroup(n)),r.profile&&i.setProfile(r.profile.name,r.profile.avatar_url),r.inviter&&i.setInviter({userId:r.inviter}),i.setMyMembership(t),o&&this.client.emit("Group",i)}},_.prototype._mapSyncResponseToRoomArray=function(e){const t=this.client,n=this;return l.keys(e).map((function(r){const i=e[r];let o=t.store.getRoom(r),a=!1;return o||(o=n.createRoom(r),a=!0),i.room=o,i.isBrandNewRoom=a,i}))},_.prototype._mapSyncEventsFormat=function(e,t){if(!e||!l.isArray(e.events))return[];const n=this.client.getEventMapper();return e.events.map((function(e){return t&&(e.room_id=t.roomId),n(e)}))},_.prototype._resolveInvites=function(e){if(!e||!this.opts.resolveInvitesToProfiles)return;const t=this.client;e.getMembersWithMembership("invite").forEach((function(n){if(n._requestedProfileInfo)return;n._requestedProfileInfo=!0;const r=t.getUser(n.userId);let i;i=r?Promise.resolve({avatar_url:r.avatarUrl,displayname:r.displayName}):t.getProfileInfo(n.userId),i.then((function(t){const r=n.events.member;"invite"===r.getContent().membership&&(r.getContent().avatar_url=t.avatar_url,r.getContent().displayname=t.displayname,n.setMembershipEvent(r,e.currentState))}),(function(e){}))}))},_.prototype._processRoomEvents=function(e,t,n,r){const i=e.getLiveTimeline(),o=0==i.getEvents().length;if(o){for(const e of t)this.client.getPushActionsForEvent(e);i.initialiseState(t)}this._resolveInvites(e),e.recalculate(),o||(e.oldState.setStateEvents(t||[]),e.currentState.setStateEvents(t||[])),e.addLiveEvents(n||[],null,r)},_.prototype._processEventsForNotifs=function(e,t){if(this.client.getNotifTimelineSet())for(let n=0;n>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var h=Object.keys(e);"alpha"in e&&(h.splice(h.indexOf("alpha"),1),this.valpha="number"===typeof e.alpha?e.alpha:0);var p=h.sort().join("");if(!(p in s))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=s[p];var v=i[this.model].labels,g=[];for(n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color,t=(299*e[0]+587*e[1]+114*e[2])/1e3;return t<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return l.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,c=1-s;return l.rgb(s*n.red()+c*r.red(),s*n.green()+c*r.green(),s*n.blue()+c*r.blue(),n.alpha()*i+r.alpha()*(1-i))}},Object.keys(i).forEach((function(e){if(-1===a.indexOf(e)){var t=i[e].channels;l.prototype[e]=function(){if(this.model===e)return new l(this);if(arguments.length)return new l(arguments,e);var n="number"===typeof arguments[t]?t:this.valpha;return new l(p(i[this.model][e].raw(this.color)).concat(n),e)},l[e]=function(n){return"number"===typeof n&&(n=m(o.call(arguments),t)),new l(n,e)}}})),e.exports=l},6967:function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))},o=this&&this.__generator||function(t,n){var r,i,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s)try{if(r=1,i&&(o=2&a[0]?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=0;t--){const n=this.data[t]>>>7&255;this.data[t]=this.data[t]<<1|e,e=n}this.data[o.SIZE-1]^=r.select(e,o.R,0),e=0}}o.SIZE=16,o.R=135,t.default=o},"6a45":function(e,t,n){var r=n("76a3");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("0017b470",r,e)}},"6b38":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".main-wrapper.minimized[data-v-c44504aa]:not(.active) .topheader{opacity:0}.main-wrapper.minimized[data-v-c44504aa]:not(.active) .encrypted{display:none}",""]),e.exports=t},"6beb":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".preloaderWrapperLocal[data-v-791cf1f7]{padding:.5em 0;text-align:center}.urlwrapper[data-v-791cf1f7]{margin-top:.25em}",""]),e.exports=t},"6bfd":function(e,t,n){"use strict";n.r(t);var r=n("94bc");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"6ce2":function(e){e.exports=JSON.parse('{"caption":{"create":"Create","addPublicChatName":"Add Public Chat Name","addGroupNamePlaceHolder":"Add Group Name","createPublicChat":"Create public chat","chatTopic":"Topic renamed","asModerator":"as moderator","marked":"marked","unmarked":"unmarked","removeBan":"Remove Ban","cancelModeration":"Remove moderation","uploadFiles":"Herunterladen von Dateien","header":"Header","dragAndDropAFile":"Drag & Drop-Datei","chatInvite":"Sie wurden eingeladen mit Benutzer zu chatten:","cantJoion":"Sie können den Chat mit dem Benutzer nicht beitreten:","chatInviteDecline":"Sie können im Chat teilnehmen oder Einladung ablehnen","creatorLeft":"Weil der Schöpfer den Raum verlassen hat","encrypted":"Verschlüssel","noImages":"Es gibt noch keine Bilder in diesem Chat","noFiles":"There are no files in this chat yet","inviteUser":"Benutzer einladen","invite":"Einladen","add":"Hinzufügen","mute":"Stumm","unmute":"Ton aktivieren","leave":"Verlassen","Info":"Info","new":"Neue","typing":"Tippt","accNotFound":"Ihr Konto wurde nicht in der Blockchain gefunden. Vielleicht müssen Sie warten","emptyList":"liste ist leer ( gefiltert oder nur leer )","welcome":"Willkommen bei Pocketnet Chat","startNewChat":"Fangen Sie einen neuen chat an","chats":"Chats","shareWith":"Teilen mit","newChat":"Neuer Chat","moveToChat":"Zum Chat wechseln","queryNoResults":"Abfrage meldet keine Ergebnisse","needMoreCharacters":"Benötigen Sie mehr Zeichen für das Ergebnis","createGroup":"Gruppe erstellen","unabletoDecrypt":"* Kann nicht entschlüsselnt","messageDeleted":"Nachricht gelöscht","sentImage":"gesendetes Bild","sentVoiceMessage":"eine Sprachnachricht gesendet","invitationToChat":"Einladung zum Chat","invitationToRoom":"Invitation to room","leftChat":"Hat den chat verlasst","joined":"beitretet","chatRenamed":"Chat umbenannt in","recentComment":"Letzter Kommentar:","share":"AKTIE","followers":"Anhänger:","reputation":"Reputation:","following":"Folgen:","theme":"Thema:","contacts":"Kontakte","phoneContacts":"Telefonische Kontakte","chooseInviteMedia":"Bitte wählen Sie, wie Sie einladen möchten","admin":"Admin","moderator":"Moderator","videocall":"Videoanrufe","call":"Anruf","leaveAndDelete":"Verlassen und Löschen","donate":"Donate","makeModerator":"Als Moderator ernennen","ban":"Ban","kick":"Kick","members":"Mitglieds","media":"Media","files":"Datei","contactsList":"Kontaktliste","send":"Senden","pageCaption":"Seite Beschriftung","caption":"Beschriftung","text":"Text","placeholder":"Platzhalter","sendTransactionTo":"Transaktion senden an","toBePaidByReceiver":"Zahlung durch den Empfänger","toBePaidBySender":"Zahlung durch Absender","source":"Quelle","amount":"Anzahl","receiver":"Empfänger","message":"Nachricht","includeFeesInAmount":"Gebühren in den Betrag einbeziehen","transactionFees":"Gebühren pro Transaktion","totalAmount":"Insgesamt","balanceTooLow":"Bilanz zu niedrig","transactionError":"Fehler: Transaktion kann nicht ausgeführt werden","calculateFees":"Gebühren berechnen","startChatWith":"Chat anfangen mit","searchResult":"Ergebnis der Suche","joinedInTheChat":"in den Chat eingeloggt","invited":"eingeladet ","hasInvited":"eingeladen ","inTheChat":" in den chat","banned":"banned","andRoom":"und Zimmer","left":"verließt","theChat":" Chat ","made":"Gemacht ","aModerator":" Moderator","editedChatNameTo ":"änderte den Chat-Namen in ","somebody":"Jemand","sent":"gesendet","PKOINto":" PKOIN für ","response":"Antwort","edited":"Bearbeitet","settings":"Einstellungen","unauthorized":"Nicht autorisiert","search":"Suche","replyOnMessage":"Antwort auf Nachricht","editMessage":"Nachricht bearbeiten","inviteFriend":"Пригласите друзей","emptyContactList":"Список контактов пуст","joinApp":"Pocketnet beitreten","hasInvitedToJoin":"hat Sie eingeladen, Pocketnet beizutreten","messagefrom":"Forwarded message from","usernotgen":"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.","younotgen":"Please wait a minute, Your encryption keys are being generated...","chatsearchingempty":"No chats found for the specified filter","sendmessage":"Send message"},"input":{"patientEmailPlaceholder":"Email","refillNamePlaceholder":"Den Namen Nachfüllen"},"message":{},"button":{"starChatButton":"Chat anfangen","decline":"Ablehnen","join":"Beitreten","ok":"Ok","copy":"Kopieren","forward":"Weiterleiten","delete":"Löschen","save":"Speichern","reply":"Antworten","share":"Share","download":"Herunterladen","downloaded":"Herunterladen","goToPocketnetProfile":"Zum Pocketnet Profil","sendFile":"Datai senden","takePhotoOrVideo":"Foto machen","sendCoins":"Münzen senden","edit":"Bearbeiten","select":"Auswählen","block":"Sperren","unblock":"Entsperren","blockUser":"Benutzer sperren"},"yes":"Ja","cancel":"Abbrechen","teamMessages":{"1-title":"Willkommen beim privaten Bastyon-Chat!","1-list1":"Privater Messenger, der NICHT mit Ihrer Telefonnummer verbunden ist.","1-list2":"Standardmäßig Ende-zu-Ende-Verschlüsselung jedes 1-zu-1-Gesprächs","1-list3":"Alle per Chat gesendeten oder empfangenen Bilder werden verschlüsselt gespeichert","1-list4":"Der Nachrichtenverlauf wird nur 7 Tage lang gespeichert","2-title":"Eine riesige Ankündigung! Die Pocketnet-Anwendung heißt jetzt Bastyon!","2-message1":"Die Domain wird auf Bastyon.com verschoben. Wir haben kürzlich die folgenden wichtigen Updates veröffentlicht:","2-list1":"Privater verschlüsselter Messenger, der nicht mit Ihrer Telefonnummer verbunden ist","2-list2":"Möglichkeit, PKOIN an Blogger zu spenden","2-list3":"Video- und Live-Streaming","2-message2":"Laden Sie jetzt Ihre Freunde ein und werden Sie Teil der großen Zukunft des dezentralen Internets!","2-button":"Freunde einladen"},"sendingerror":"An error occurred while sending the message","details":"Details","settings_pin":"Pin chat window","checked":"Yes","unchecked":"No","settings_read":"Send read receipts","messagewasburn":"This message remains only in the memory of your device","messagewillburn":"The message will be deleted soon","micaccessbrowser":"Access to the microphone is restricted, please check your browser settings.","micaccesscommonproblem":"Sorry, for some reason it is not possible to record voice messages on the device","micaccesscordova":"Access to the microphone is restricted, please check your device settings.","micdevicenotfound":"Audio recording device not found"}')},"6de4":function(e){e.exports=JSON.parse('{"0":"O","1":"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ","ﱞ":"ﹲّ","ࣲ":"ٍ","ﱟ":"ﹴّ","ﳲ":"ﹷّ","ﱠ":"ﹶّ","ﳳ":"ﹹّ","ﱡ":"ﹸّ","ؚ":"ِ","̗":"ِ","ﳴ":"ﹻّ","ﱢ":"ﹺّ","ﱣ":"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\\u2028":" ","\\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":","ː":":","ꓽ":":","⩴":"::=","⧴":":→","!":"!","ǃ":"!","ⵑ":"!","‼":"!!","⁉":"!?","ʔ":"?","Ɂ":"?","ॽ":"?","Ꭾ":"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·","ᐧ":"·","⋯":"···","ⵈ":"···","ᑄ":"·<","⋗":"·>","ᐷ":"·>","ᑀ":"·>","ᔯ":"·4","ᑾ":"·b","ᒀ":"·ḃ","ᑺ":"·d","ᒘ":"·J","ᒶ":"·L","ᑶ":"·P","ᑗ":"·U","ᐺ":"·V","ᐼ":"·Ʌ","ᒮ":"·Γ","ᐎ":"·Δ","ᑙ":"·Ո","ᐌ":"·ᐁ","ᐐ":"·ᐄ","ᐒ":"·ᐅ","ᐔ":"·ᐆ","ᐗ":"·ᐊ","ᐙ":"·ᐋ","ᐾ":"·ᐲ","ᑂ":"·ᐴ","ᑆ":"·ᐹ","ᑛ":"·ᑏ","ᑔ":"·ᑐ","ᑝ":"·ᑐ","ᑟ":"·ᑑ","ᑡ":"·ᑕ","ᑣ":"·ᑖ","ᑴ":"·ᑫ","ᑸ":"·ᑮ","ᑼ":"·ᑰ","ᒒ":"·ᒉ","ᒔ":"·ᒋ","ᒖ":"·ᒌ","ᒚ":"·ᒎ","ᒜ":"·ᒐ","ᒞ":"·ᒑ","ᒬ":"·ᒣ","ᒰ":"·ᒦ","ᒲ":"·ᒧ","ᒴ":"·ᒨ","ᒸ":"·ᒫ","ᓉ":"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ","ᓋ":"·ᓇ","ᓍ":"·ᓈ","ᓜ":"·ᓓ","ᓞ":"·ᓕ","ᓠ":"·ᓖ","ᓢ":"·ᓗ","ᓤ":"·ᓘ","ᓦ":"·ᓚ","ᓨ":"·ᓛ","ᓶ":"·ᓭ","ᓸ":"·ᓯ","ᓺ":"·ᓰ","ᓼ":"·ᓱ","ᓾ":"·ᓲ","ᔀ":"·ᓴ","ᔂ":"·ᓵ","ᔗ":"·ᔐ","ᔙ":"·ᔑ","ᔛ":"·ᔒ","ᔝ":"·ᔓ","ᔟ":"·ᔔ","ᔡ":"·ᔕ","ᔣ":"·ᔖ","ᔱ":"·ᔨ","ᔳ":"·ᔩ","ᔵ":"·ᔪ","ᔷ":"·ᔫ","ᔹ":"·ᔭ","ᔻ":"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ","ᕎ":"·ᕌ","ᕛ":"·ᕚ","ᕨ":"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"\'","'":"\'","‘":"\'","’":"\'","‛":"\'","′":"\'","‵":"\'","՚":"\'","׳":"\'","`":"\'","`":"\'","`":"\'","´":"\'","΄":"\'","´":"\'","᾽":"\'","᾿":"\'","῾":"\'","ʹ":"\'","ʹ":"\'","ˈ":"\'","ˊ":"\'","ˋ":"\'","˴":"\'","ʻ":"\'","ʽ":"\'","ʼ":"\'","ʾ":"\'","ꞌ":"\'","י":"\'","ߴ":"\'","ߵ":"\'","ᑊ":"\'","ᛌ":"\'","𖽑":"\'","𖽒":"\'","᳓":"\'\'","\\"":"\'\'",""":"\'\'","“":"\'\'","”":"\'\'","‟":"\'\'","″":"\'\'","‶":"\'\'","〃":"\'\'","״":"\'\'","˝":"\'\'","ʺ":"\'\'","˶":"\'\'","ˮ":"\'\'","ײ":"\'\'","‴":"\'\'\'","‷":"\'\'\'","⁗":"\'\'\'\'","Ɓ":"\'B","Ɗ":"\'D","ʼn":"\'n","Ƥ":"\'P","Ƭ":"\'T","Ƴ":"\'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬","く":"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/","〳":"/","Ⳇ":"/","ノ":"/","丿":"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\\\","﹨":"\\\\","∖":"\\\\","⟍":"\\\\","⧵":"\\\\","⧹":"\\\\","𝈏":"\\\\","𝈻":"\\\\","㇔":"\\\\","丶":"\\\\","⼂":"\\\\","⳹":"\\\\\\\\","⑊":"\\\\\\\\","⟈":"\\\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ","ъ":"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵","ð":"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<","ᐸ":"<","ᚲ":"<","⋖":"<·","Ⲵ":"<·","ᑅ":"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">","ᐳ":">","𖼿":">","ᑁ":">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー","ᅳ":"ー","ㅡ":"ー","一":"ー","⼀":"ー","ᆖ":"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ","ᆕ":"ーᅮ","ᅴ":"ー丨","ㅢ":"ー丨","ᆗ":"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2","Ƨ":"2","Ϩ":"2","Ꙅ":"2","ᒿ":"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁","ƻ":"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3","Ȝ":"3","Ʒ":"3","Ꝫ":"3","Ⳍ":"3","З":"3","Ӡ":"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂","Ҙ":"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4","Ꮞ":"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.","ᔰ":"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5","Ƽ":"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6","б":"6","Ꮾ":"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8","ȣ":"8","Ȣ":"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a","a":"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a","ɑ":"a","α":"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a","а":"a","ⷶ":"ͣ","A":"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A","Α":"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A","А":"A","Ꭺ":"A","ᗅ":"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲","ǎ":"ă","Ǎ":"Ă","ȧ":"å","Ȧ":"Å","ẚ":"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA","æ":"ae","ӕ":"ae","Æ":"AE","Ӕ":"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ","ᗄ":"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b","Ƅ":"b","Ь":"b","Ꮟ":"b","ᑲ":"b","ᖯ":"b","B":"B","ℬ":"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B","Β":"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B","В":"B","Ᏼ":"B","ᗷ":"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B","ɓ":"b̔","ᑳ":"ḃ","ƃ":"b̄","Ƃ":"b̄","Б":"b̄","ƀ":"b̵","ҍ":"b̵","Ҍ":"b̵","ѣ":"b̵","Ѣ":"b̵","ᑿ":"b·","ᒁ":"ḃ·","ᒈ":"b\'","Ы":"bl","в":"ʙ","ᏼ":"ʙ","c":"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c","ϲ":"c","ⲥ":"c","с":"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C","C":"C","Ⅽ":"C","ℂ":"C","ℭ":"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C","С":"C","Ꮯ":"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠","ç":"c̦","ҫ":"c̦","Ç":"C̦","Ҫ":"C̦","Ƈ":"C\'","℅":"c/o","℆":"c/u","🅭":"㏄\\t⃝","⋴":"ꞓ","ɛ":"ꞓ","ε":"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ","є":"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ","Є":"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d","Ꮷ":"d","ᑯ":"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D","Ꭰ":"D","ᗞ":"D","ᗪ":"D","ꓓ":"D","ɗ":"d̔","ɖ":"d̨","ƌ":"d̄","đ":"d̵","Đ":"D̵","Ð":"D̵","Ɖ":"D̵","₫":"ḏ̵","ꝺ":"Ꝺ","ᑻ":"d·","ᒇ":"d\'","ʤ":"dȝ","dz":"dz","ʣ":"dz","Dz":"Dz","DZ":"DZ","dž":"dž","Dž":"Dž","DŽ":"DŽ","ʥ":"dʑ","ꭰ":"ᴅ","⸹":"ẟ","δ":"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ","ծ":"ẟ","ᕷ":"ẟ","℮":"e","e":"e","ℯ":"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e","е":"e","ҽ":"e","ⷷ":"ͤ","⋿":"E","E":"E","ℰ":"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E","Ε":"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E","Е":"E","ⴹ":"E","Ꭼ":"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E","ě":"ĕ","Ě":"Ĕ","ɇ":"e̸","Ɇ":"E̸","ҿ":"ę","ꭼ":"ᴇ","ə":"ǝ","ә":"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ","ɚ":"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵","Ә":"Ə","𝈡":"Ɛ","ℇ":"Ɛ","Ԑ":"Ɛ","Ꮛ":"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ","з":"ɜ","ҙ":"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f","ſ":"f","ẝ":"f","ք":"f","𝈓":"F","ℱ":"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F","Ϝ":"F","𝟊":"F","ᖴ":"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F","ƒ":"f̦","Ƒ":"F̦","ᵮ":"f̴","℻":"FAX","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ʩ":"fŋ","ᖵ":"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ","ᖷ":"ꟻ","g":"g","ℊ":"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g","ɡ":"g","ᶃ":"g","ƍ":"g","ց":"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G","Ꮐ":"G","Ᏻ":"G","ꓖ":"G","ᶢ":"ᵍ","ɠ":"g̔","ǧ":"ğ","Ǧ":"Ğ","ǵ":"ģ","ǥ":"g̵","Ǥ":"G̵","Ɠ":"G\'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ","h":"h","ℎ":"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h","һ":"h","հ":"h","Ꮒ":"h","H":"H","ℋ":"H","ℌ":"H","ℍ":"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H","Η":"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H","Н":"H","Ꮋ":"H","ᕼ":"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ","ɦ":"h̔","ꚕ":"h̔","Ᏺ":"h̔","Ⱨ":"H̩","Ң":"H̩","ħ":"h̵","ℏ":"h̵","ћ":"h̵","Ħ":"H̵","Ӊ":"H̦","Ӈ":"H̦","н":"ʜ","ꮋ":"ʜ","ң":"ʜ̩","ӊ":"ʜ̦","ӈ":"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ","Ꭸ":"Ⱶ","Ꮀ":"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i","i":"i","ⅰ":"i","ℹ":"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i","ı":"i","𝚤":"i","ɪ":"i","ɩ":"i","ι":"i","ι":"i","ͺ":"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i","і":"i","ꙇ":"i","ӏ":"i","ꭵ":"i","Ꭵ":"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲","ǐ":"ĭ","Ǐ":"Ĭ","ɨ":"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii","ij":"ij","ⅳ":"iv","ⅸ":"ix","j":"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j","ϳ":"j","ј":"j","J":"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J","Ј":"J","Ꭻ":"J","ᒍ":"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵","ᒙ":"J·","𝚥":"ȷ","յ":"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k","K":"K","K":"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K","Κ":"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K","К":"K","Ꮶ":"K","ᛕ":"K","ꓗ":"K","𐔘":"K","ƙ":"k̔","Ⱪ":"K̩","Қ":"K̩","₭":"K̵","Ꝁ":"K̵","Ҟ":"K̵","Ƙ":"K\'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l","I":"l","I":"l","Ⅰ":"l","ℐ":"l","ℑ":"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l","Ɩ":"l","l":"l","ⅼ":"l","ℓ":"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l","ǀ":"l","Ι":"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l","І":"l","Ӏ":"l","ו":"l","ן":"l","ا":"l","𞸀":"l","𞺀":"l","ﺎ":"l","ﺍ":"l","ߊ":"l","ⵏ":"l","ᛁ":"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L","ℒ":"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L","Ꮮ":"L","ᒪ":"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L","ﴼ":"l̋","ﴽ":"l̋","ł":"l̸","Ł":"L̸","ɭ":"l̨","Ɨ":"l̵","ƚ":"l̵","ɫ":"l̴","إ":"lٕ","ﺈ":"lٕ","ﺇ":"lٕ","ٳ":"lٕ","ŀ":"l·","Ŀ":"l·","ᒷ":"l·","🄂":"l,","⒈":"l.","ױ":"l\'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点","lj":"lj","IJ":"lJ","Lj":"Lj","LJ":"LJ","‖":"ll","∥":"ll","Ⅱ":"ll","ǁ":"ll","װ":"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点","Ю":"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点","ʪ":"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX","ɮ":"lȝ","ʫ":"lz","أ":"lٴ","ﺄ":"lٴ","ﺃ":"lٴ","ٲ":"lٴ","ٵ":"lٴ","ﷳ":"lكبر","ﷲ":"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ","M":"M","Ⅿ":"M","ℳ":"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M","Μ":"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M","М":"M","Ꮇ":"M","ᗰ":"M","ᛖ":"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"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","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊","ɳ":"n̨","ƞ":"n̩","η":"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩","Ɲ":"N̦","ᵰ":"n̴","nj":"nj","Nj":"Nj","NJ":"NJ","№":"No","ͷ":"ᴎ","и":"ᴎ","𐑍":"ᴎ","ņ":"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o","o":"o","ℴ":"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o","ο":"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o","σ":"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o","о":"o","ჿ":"o","օ":"o","ס":"o","ه":"o","𞸤":"o","𞹤":"o","𞺄":"o","ﻫ":"o","ﻬ":"o","ﻪ":"o","ﻩ":"o","ھ":"o","ﮬ":"o","ﮭ":"o","ﮫ":"o","ﮪ":"o","ہ":"o","ﮨ":"o","ﮩ":"o","ﮧ":"o","ﮦ":"o","ە":"o","ഠ":"o","ဝ":"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O","O":"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O","Ο":"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O","О":"O","Օ":"O","ⵔ":"O","ዐ":"O","ଠ":"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º","ǒ":"ŏ","Ǒ":"Ŏ","ۿ":"ô","Ő":"Ö","ø":"o̸","ꬾ":"o̸","Ø":"O̸","ⵁ":"O̸","Ǿ":"Ó̸","ɵ":"o̵","ꝋ":"o̵","ө":"o̵","ѳ":"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵","Ɵ":"O̵","Ꝋ":"O̵","θ":"O̵","ϑ":"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵","Θ":"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵","Ө":"O̵","Ѳ":"O̵","ⴱ":"O̵","Ꮎ":"O̵","Ꮻ":"O̵","ꭴ":"ơ","ﳙ":"oٰ","🄁":"O,","🄀":"O.","ơ":"o\'","Ơ":"O\'","Ꭴ":"O\'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀","œ":"oe","Œ":"OE","ɶ":"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO","ﳗ":"oج","ﱑ":"oج","ﳘ":"oم","ﱒ":"oم","ﶓ":"oمج","ﶔ":"oمم","ﱓ":"oى","ﱔ":"oى","ൟ":"oരo","တ":"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p","p":"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p","ρ":"p","ϱ":"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p","р":"p","P":"P","ℙ":"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P","Ρ":"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P","Р":"P","Ꮲ":"P","ᑭ":"P","ꓑ":"P","𐊕":"P","ƥ":"p̔","ᵽ":"p̵","ᑷ":"p·","ᒆ":"P\'","ᴩ":"ᴘ","ꮲ":"ᴘ","φ":"ɸ","ϕ":"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ","ф":"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q","գ":"q","զ":"q","ℚ":"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q","ʠ":"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ","κ":"ĸ","ϰ":"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ","к":"ĸ","ꮶ":"ĸ","қ":"ĸ̩","ҟ":"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r","г":"r","ꮁ":"r","𝈖":"R","ℛ":"R","ℜ":"R","ℝ":"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R","Ʀ":"R","Ꭱ":"R","Ꮢ":"R","𐒴":"R","ᖇ":"R","ꓣ":"R","𖼵":"R","ɽ":"r̨","ɼ":"r̩","ɍ":"r̵","ғ":"r̵","ᵲ":"r̴","ґ":"r\'","𑣣":"rn","m":"rn","ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸","ɱ":"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ","я":"ᴙ","ᵳ":"ɾ̴","℩":"ɿ","s":"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s","ƽ":"s","ѕ":"s","ꮪ":"s","𑣁":"s","𐑈":"s","S":"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S","Ѕ":"S","Տ":"S","Ꮥ":"S","Ꮪ":"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S","ʂ":"s̨","ᵴ":"s̴","ꞵ":"ß","β":"ß","ϐ":"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß","Ᏸ":"ß","🝜":"sss","st":"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ","Σ":"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T","T":"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T","Τ":"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T","Т":"T","Ꭲ":"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T","ƭ":"t̔","⍡":"T̈","Ⱦ":"T̸","Ț":"Ţ","Ʈ":"T̨","Ҭ":"T̩","₮":"T⃫","ŧ":"t̵","Ŧ":"T̵","ᵵ":"t̴","Ⴀ":"Ꞇ","Ꜩ":"T3","ʨ":"tɕ","℡":"TEL","ꝷ":"tf","ʦ":"ts","ʧ":"tʃ","ꜩ":"tȝ","τ":"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ","т":"ᴛ","ꭲ":"ᴛ","ҭ":"ᴛ̩","ţ":"ƫ","ț":"ƫ","Ꮏ":"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u","ʋ":"u","υ":"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u","ս":"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U","Ս":"U","ሀ":"U","𐓎":"U","ᑌ":"U","ꓴ":"U","𖽂":"U","𑢸":"U","ǔ":"ŭ","Ǔ":"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵","Ꮜ":"U̵","ᑘ":"U·","ᑧ":"U\'","ᵫ":"ue","ꭣ":"uo","ṃ":"ꭑ","պ":"ɰ","ሣ":"ɰ","℧":"Ʊ","ᘮ":"Ʊ","ᘴ":"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v","v":"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v","ν":"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v","ѵ":"v","ט":"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V","Ѵ":"V","ⴸ":"V","Ꮩ":"V","ᐯ":"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵","ᐻ":"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ","Λ":"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ","Л":"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ","ᐱ":"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦","ᐽ":"Ʌ·","ɯ":"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w","ѡ":"w","ԝ":"w","ա":"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W","Ꮃ":"W","Ꮤ":"W","ꓪ":"W","ѽ":"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ","м":"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x","x":"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x","х":"x","ᕁ":"x","ᕽ":"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X","X":"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X","Χ":"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X","Х":"X","ⵝ":"X","ᚷ":"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ","Ҳ":"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll","ɣ":"y","ᶌ":"y","y":"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y","ʏ":"y","ỿ":"y","ꭚ":"y","γ":"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y","у":"y","ү":"y","ყ":"y","𑣜":"y","Y":"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y","Υ":"Y","ϒ":"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y","У":"Y","Ү":"Y","Ꭹ":"Y","Ꮍ":"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y","ƴ":"y̔","ɏ":"y̵","ұ":"y̵","¥":"Y̵","Ɏ":"Y̵","Ұ":"Y̵","ʒ":"ȝ","ꝫ":"ȝ","ⳍ":"ȝ","ӡ":"ȝ","ჳ":"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z","Z":"Z","ℤ":"Z","ℨ":"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z","Ζ":"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z","Ꮓ":"Z","ꓜ":"Z","𑢩":"Z","ʐ":"z̨","ƶ":"z̵","Ƶ":"Z̵","ȥ":"z̦","Ȥ":"Z̦","ᵶ":"z̴","ƿ":"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ","ϩ":"ƨ","ꙅ":"ƨ","ь":"ƅ","ꮟ":"ƅ","ы":"ƅi","ꭾ":"ɂ","ˤ":"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ","Г":"Γ","Ꮁ":"Γ","ᒥ":"Γ","𖼇":"Γ","Ғ":"Γ̵","ᒯ":"Γ·","Ґ":"Γ\'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ","ᐃ":"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲","ᐏ":"Δ·","ᐬ":"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ","µ":"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ","ϖ":"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π","п":"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π","П":"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ","ϛ":"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ","Ф":"Φ","Փ":"Φ","ቀ":"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ","ѱ":"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ","Ѱ":"Ψ","𐓑":"Ψ","ᛘ":"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω","Ω":"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω","ᘯ":"Ω","ᘵ":"Ω","𐊶":"Ω","⍹":"ω̲","ώ":"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ","җ":"ж̩","Җ":"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И","Й":"Ѝ","Ҋ":"Ѝ̦","ѝ":"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ","Ꮗ":"Ѡ","ᗯ":"Ѡ","Ѽ":"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ","ӌ":"ҷ","Ӌ":"Ҷ","Ҿ":"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ","և":"եւ","ኔ":"ձ","ﬔ":"մե","ﬕ":"մի","ﬗ":"մխ","ﬓ":"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո","በ":"Ո","ᑎ":"Ո","ꓵ":"Ո","ᑚ":"Ո·","ᑨ":"Ո\'","ﬖ":"վն","₽":"Ք","˓":"ՙ","ʿ":"ՙ","ℵ":"א","ﬡ":"א","אָ":"אַ","אּ":"אַ","ﭏ":"אל","ℶ":"ב","ℷ":"ג","ℸ":"ד","ﬢ":"ד","ﬣ":"ה","יּ":"יִ","ﬤ":"כ","ﬥ":"ל","ﬦ":"ם","ﬠ":"ע","ﬧ":"ר","שׂ":"שׁ","שּ":"שׁ","שּׂ":"שּׁ","ﬨ":"ת","ﺀ":"ء","۽":"ء͈","ﺂ":"آ","ﺁ":"آ","ﭑ":"ٱ","ﭐ":"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب","ﺑ":"ب","ﺒ":"ب","ﺐ":"ب","ﺏ":"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ","ﲠ":"بo","ﳢ":"بo","ﲜ":"بج","ﰅ":"بج","ﲝ":"بح","ﰆ":"بح","ﷂ":"بحى","ﲞ":"بخ","ﰇ":"بخ","ﳒ":"بخ","ﱋ":"بخ","ﶞ":"بخى","ﱪ":"بر","ﱫ":"بز","ﲟ":"بم","ﳡ":"بم","ﱬ":"بم","ﰈ":"بم","ﱭ":"بن","ﱮ":"بى","ﰉ":"بى","ﱯ":"بى","ﰊ":"بى","ﭔ":"ٻ","ﭕ":"ٻ","ﭓ":"ٻ","ﭒ":"ٻ","ې":"ٻ","ﯦ":"ٻ","ﯧ":"ٻ","ﯥ":"ٻ","ﯤ":"ٻ","ﭜ":"ڀ","ﭝ":"ڀ","ﭛ":"ڀ","ﭚ":"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة","ö":"ة","ﺔ":"ة","ﺓ":"ة","ۃ":"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت","ﺗ":"ت","ﺘ":"ت","ﺖ":"ت","ﺕ":"ت","ﲥ":"تo","ﳤ":"تo","ﲡ":"تج","ﰋ":"تج","ﵐ":"تجم","ﶠ":"تجى","ﶟ":"تجى","ﲢ":"تح","ﰌ":"تح","ﵒ":"تحج","ﵑ":"تحج","ﵓ":"تحم","ﲣ":"تخ","ﰍ":"تخ","ﵔ":"تخم","ﶢ":"تخى","ﶡ":"تخى","ﱰ":"تر","ﱱ":"تز","ﲤ":"تم","ﳣ":"تم","ﱲ":"تم","ﰎ":"تم","ﵕ":"تمج","ﵖ":"تمح","ﵗ":"تمخ","ﶤ":"تمى","ﶣ":"تمى","ﱳ":"تن","ﱴ":"تى","ﰏ":"تى","ﱵ":"تى","ﰐ":"تى","ﭠ":"ٺ","ﭡ":"ٺ","ﭟ":"ٺ","ﭞ":"ٺ","ﭤ":"ٿ","ﭥ":"ٿ","ﭣ":"ٿ","ﭢ":"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج","ﺟ":"ج","ﺠ":"ج","ﺞ":"ج","ﺝ":"ج","ﲧ":"جح","ﰕ":"جح","ﶦ":"جحى","ﶾ":"جحى","ﷻ":"جل جلlلo","ﲨ":"جم","ﰖ":"جم","ﵙ":"جمح","ﵘ":"جمح","ﶧ":"جمى","ﶥ":"جمى","ﴝ":"جى","ﴁ":"جى","ﴞ":"جى","ﴂ":"جى","ﭸ":"ڃ","ﭹ":"ڃ","ﭷ":"ڃ","ﭶ":"ڃ","ﭴ":"ڄ","ﭵ":"ڄ","ﭳ":"ڄ","ﭲ":"ڄ","ﭼ":"چ","ﭽ":"چ","ﭻ":"چ","ﭺ":"چ","ﮀ":"ڇ","ﮁ":"ڇ","ﭿ":"ڇ","ﭾ":"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح","ﺣ":"ح","ﺤ":"ح","ﺢ":"ح","ﺡ":"ح","څ":"حۛ","ځ":"حٔ","ݲ":"حٔ","ﲩ":"حج","ﰗ":"حج","ﶿ":"حجى","ﲪ":"حم","ﰘ":"حم","ﵛ":"حمى","ﵚ":"حمى","ﴛ":"حى","ﳿ":"حى","ﴜ":"حى","ﴀ":"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ","ﺧ":"خ","ﺨ":"خ","ﺦ":"خ","ﺥ":"خ","ﲫ":"خج","ﰙ":"خج","ﰚ":"خح","ﲬ":"خم","ﰛ":"خم","ﴟ":"خى","ﴃ":"خى","ﴠ":"خى","ﴄ":"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د","ﺪ":"د","ﺩ":"د","ڈ":"دؕ","ﮉ":"دؕ","ﮈ":"دؕ","ڎ":"دۛ","ﮇ":"دۛ","ﮆ":"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ","ﺬ":"ذ","ﺫ":"ذ","ﱛ":"ذٰ","ڋ":"ڊؕ","ﮅ":"ڌ","ﮄ":"ڌ","ﮃ":"ڍ","ﮂ":"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر","ﺮ":"ر","ﺭ":"ر","ڑ":"رؕ","ﮍ":"رؕ","ﮌ":"رؕ","ژ":"رۛ","ﮋ":"رۛ","ﮊ":"رۛ","ڒ":"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ","ﱜ":"رٰ","ﷶ":"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز","ﺰ":"ز","ﺯ":"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س","ﺳ":"س","ﺴ":"س","ﺲ":"س","ﺱ":"س","ش":"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ","ﺷ":"سۛ","ﺸ":"سۛ","ﺶ":"سۛ","ﺵ":"سۛ","ݾ":"س̂","ﴱ":"سo","ﳨ":"سo","ﴲ":"سۛo","ﳪ":"سۛo","ﲭ":"سج","ﴴ":"سج","ﰜ":"سج","ﴭ":"سۛج","ﴷ":"سۛج","ﴥ":"سۛج","ﴉ":"سۛج","ﵝ":"سجح","ﵞ":"سجى","ﵩ":"سۛجى","ﲮ":"سح","ﴵ":"سح","ﰝ":"سح","ﴮ":"سۛح","ﴸ":"سۛح","ﴦ":"سۛح","ﴊ":"سۛح","ﵜ":"سحج","ﵨ":"سۛحم","ﵧ":"سۛحم","ﶪ":"سۛحى","ﲯ":"سخ","ﴶ":"سخ","ﰞ":"سخ","ﴯ":"سۛخ","ﴹ":"سۛخ","ﴧ":"سۛخ","ﴋ":"سۛخ","ﶨ":"سخى","ﷆ":"سخى","ﴪ":"سر","ﴎ":"سر","ﴩ":"سۛر","ﴍ":"سۛر","ﲰ":"سم","ﳧ":"سم","ﰟ":"سم","ﴰ":"سۛم","ﳩ":"سۛم","ﴨ":"سۛم","ﴌ":"سۛم","ﵡ":"سمج","ﵠ":"سمح","ﵟ":"سمح","ﵫ":"سۛمخ","ﵪ":"سۛمخ","ﵣ":"سمم","ﵢ":"سمم","ﵭ":"سۛمم","ﵬ":"سۛمم","ﴗ":"سى","ﳻ":"سى","ﴘ":"سى","ﳼ":"سى","ﴙ":"سۛى","ﳽ":"سۛى","ﴚ":"سۛى","ﳾ":"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص","ﺻ":"ص","ﺼ":"ص","ﺺ":"ص","ﺹ":"ص","ڞ":"صۛ","ࢯ":"ص̤̣","ﲱ":"صح","ﰠ":"صح","ﵥ":"صحح","ﵤ":"صحح","ﶩ":"صحى","ﲲ":"صخ","ﴫ":"صر","ﴏ":"صر","ﷵ":"صلعم","ﷹ":"صلى","ﷰ":"صلى","ﷺ":"صلى lللo علىo وسلم","ﲳ":"صم","ﰡ":"صم","ﷅ":"صمم","ﵦ":"صمم","ﴡ":"صى","ﴅ":"صى","ﴢ":"صى","ﴆ":"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض","ﺿ":"ض","ﻀ":"ض","ﺾ":"ض","ﺽ":"ض","ﲴ":"ضج","ﰢ":"ضج","ﲵ":"ضح","ﰣ":"ضح","ﵮ":"ضحى","ﶫ":"ضحى","ﲶ":"ضخ","ﰤ":"ضخ","ﵰ":"ضخم","ﵯ":"ضخم","ﴬ":"ضر","ﴐ":"ضر","ﲷ":"ضم","ﰥ":"ضم","ﴣ":"ضى","ﴇ":"ضى","ﴤ":"ضى","ﴈ":"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط","ﻃ":"ط","ﻄ":"ط","ﻂ":"ط","ﻁ":"ط","ڟ":"طۛ","ﲸ":"طح","ﰦ":"طح","ﴳ":"طم","ﴺ":"طم","ﰧ":"طم","ﵲ":"طمح","ﵱ":"طمح","ﵳ":"طمم","ﵴ":"طمى","ﴑ":"طى","ﳵ":"طى","ﴒ":"طى","ﳶ":"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ","ﻇ":"ظ","ﻈ":"ظ","ﻆ":"ظ","ﻅ":"ظ","ﲹ":"ظم","ﴻ":"ظم","ﰨ":"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع","ﻋ":"ع","ﻌ":"ع","ﻊ":"ع","ﻉ":"ع","ﲺ":"عج","ﰩ":"عج","ﷄ":"عجم","ﵵ":"عجم","ﷷ":"علىo","ﲻ":"عم","ﰪ":"عم","ﵷ":"عمم","ﵶ":"عمم","ﵸ":"عمى","ﶶ":"عمى","ﴓ":"عى","ﳷ":"عى","ﴔ":"عى","ﳸ":"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ","ﻏ":"غ","ﻐ":"غ","ﻎ":"غ","ﻍ":"غ","ﲼ":"غج","ﰫ":"غج","ﲽ":"غم","ﰬ":"غم","ﵹ":"غمم","ﵻ":"غمى","ﵺ":"غمى","ﴕ":"غى","ﳹ":"غى","ﴖ":"غى","ﳺ":"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف","ﻓ":"ف","ﻔ":"ف","ﻒ":"ف","ﻑ":"ف","ڧ":"ف","ﲾ":"فج","ﰭ":"فج","ﲿ":"فح","ﰮ":"فح","ﳀ":"فخ","ﰯ":"فخ","ﵽ":"فخم","ﵼ":"فخم","ﳁ":"فم","ﰰ":"فم","ﷁ":"فمى","ﱼ":"فى","ﰱ":"فى","ﱽ":"فى","ﰲ":"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ","ڤ":"ڡۛ","ﭬ":"ڡۛ","ﭭ":"ڡۛ","ﭫ":"ڡۛ","ﭪ":"ڡۛ","ڨ":"ڡۛ","ࢤ":"ڢۛ","ﭰ":"ڦ","ﭱ":"ڦ","ﭯ":"ڦ","ﭮ":"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق","ﻗ":"ق","ﻘ":"ق","ﻖ":"ق","ﻕ":"ق","ﳂ":"قح","ﰳ":"قح","ﷱ":"قلى","ﳃ":"قم","ﰴ":"قم","ﶴ":"قمح","ﵾ":"قمح","ﵿ":"قمم","ﶲ":"قمى","ﱾ":"قى","ﰵ":"قى","ﱿ":"قى","ﰶ":"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك","ﻛ":"ك","ﻜ":"ك","ﻚ":"ك","ﻙ":"ك","ک":"ك","ﮐ":"ك","ﮑ":"ك","ﮏ":"ك","ﮎ":"ك","ڪ":"ك","ڭ":"كۛ","ﯕ":"كۛ","ﯖ":"كۛ","ﯔ":"كۛ","ﯓ":"كۛ","ݣ":"كۛ","ﲀ":"كl","ﰷ":"كl","ﳄ":"كج","ﰸ":"كج","ﳅ":"كح","ﰹ":"كح","ﳆ":"كخ","ﰺ":"كخ","ﳇ":"كل","ﳫ":"كل","ﲁ":"كل","ﰻ":"كل","ﳈ":"كم","ﳬ":"كم","ﲂ":"كم","ﰼ":"كم","ﷃ":"كمم","ﶻ":"كمم","ﶷ":"كمى","ﲃ":"كى","ﰽ":"كى","ﲄ":"كى","ﰾ":"كى","ݢ":"ڬ","ﮔ":"گ","ﮕ":"گ","ﮓ":"گ","ﮒ":"گ","ࢰ":"گ","ڴ":"گۛ","ﮜ":"ڱ","ﮝ":"ڱ","ﮛ":"ڱ","ﮚ":"ڱ","ﮘ":"ڳ","ﮙ":"ڳ","ﮗ":"ڳ","ﮖ":"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل","ﻟ":"ل","ﻠ":"ل","ﻞ":"ل","ﻝ":"ل","ڷ":"لۛ","ڵ":"ل̆","ﻼ":"لl","ﻻ":"لl","ﻺ":"لlٕ","ﻹ":"لlٕ","ﻸ":"لlٴ","ﻷ":"لlٴ","ﳍ":"لo","ﻶ":"لآ","ﻵ":"لآ","ﳉ":"لج","ﰿ":"لج","ﶃ":"لجج","ﶄ":"لجج","ﶺ":"لجم","ﶼ":"لجم","ﶬ":"لجى","ﳊ":"لح","ﱀ":"لح","ﶵ":"لحم","ﶀ":"لحم","ﶂ":"لحى","ﶁ":"لحى","ﳋ":"لخ","ﱁ":"لخ","ﶆ":"لخم","ﶅ":"لخم","ﳌ":"لم","ﳭ":"لم","ﲅ":"لم","ﱂ":"لم","ﶈ":"لمح","ﶇ":"لمح","ﶭ":"لمى","ﲆ":"لى","ﱃ":"لى","ﲇ":"لى","ﱄ":"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م","ﻣ":"م","ﻤ":"م","ﻢ":"م","ﻡ":"م","ࢧ":"مۛ","۾":"م͈","ﲈ":"مl","ﳎ":"مج","ﱅ":"مج","ﶌ":"مجح","ﶒ":"مجخ","ﶍ":"مجم","ﷀ":"مجى","ﳏ":"مح","ﱆ":"مح","ﶉ":"محج","ﶊ":"محم","ﷴ":"محمد","ﶋ":"محى","ﳐ":"مخ","ﱇ":"مخ","ﶎ":"مخج","ﶏ":"مخم","ﶹ":"مخى","ﳑ":"مم","ﲉ":"مم","ﱈ":"مم","ﶱ":"ممى","ﱉ":"مى","ﱊ":"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن","ﻧ":"ن","ﻨ":"ن","ﻦ":"ن","ﻥ":"ن","ݨ":"نؕ","ݩ":"ن̆","ﳖ":"نo","ﳯ":"نo","ﶸ":"نجح","ﶽ":"نجح","ﶘ":"نجم","ﶗ":"نجم","ﶙ":"نجى","ﷇ":"نجى","ﳓ":"نح","ﱌ":"نح","ﶕ":"نحم","ﶖ":"نحى","ﶳ":"نحى","ﳔ":"نخ","ﱍ":"نخ","ﲊ":"نر","ﲋ":"نز","ﳕ":"نم","ﳮ":"نم","ﲌ":"نم","ﱎ":"نم","ﶛ":"نمى","ﶚ":"نمى","ﲍ":"نن","ﲎ":"نى","ﱏ":"نى","ﲏ":"نى","ﱐ":"نى","ۂ":"ۀ","ﮥ":"ۀ","ﮤ":"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و","ﻮ":"و","ﻭ":"و","ࢱ":"و","ۋ":"وۛ","ﯟ":"وۛ","ﯞ":"وۛ","ۇ":"و̓","ﯘ":"و̓","ﯗ":"و̓","ۆ":"و̆","ﯚ":"و̆","ﯙ":"و̆","ۉ":"و̂","ﯣ":"و̂","ﯢ":"و̂","ۈ":"وٰ","ﯜ":"وٰ","ﯛ":"وٰ","ؤ":"وٴ","ﺆ":"وٴ","ﺅ":"وٴ","ٶ":"وٴ","ٷ":"و̓ٴ","ﯝ":"و̓ٴ","ﷸ":"وسلم","ﯡ":"ۅ","ﯠ":"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى","ں":"ى","𞸝":"ى","𞹝":"ى","ﮟ":"ى","ﮞ":"ى","ࢽ":"ى","ﯨ":"ى","ﯩ":"ى","ﻰ":"ى","ﻯ":"ى","ي":"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى","ﻳ":"ى","ﻴ":"ى","ﻲ":"ى","ﻱ":"ى","ی":"ى","ﯾ":"ى","ﯿ":"ى","ﯽ":"ى","ﯼ":"ى","ے":"ى","ﮯ":"ى","ﮮ":"ى","ٹ":"ىؕ","ﭨ":"ىؕ","ﭩ":"ىؕ","ﭧ":"ىؕ","ﭦ":"ىؕ","ڻ":"ىؕ","ﮢ":"ىؕ","ﮣ":"ىؕ","ﮡ":"ىؕ","ﮠ":"ىؕ","پ":"ىۛ","ﭘ":"ىۛ","ﭙ":"ىۛ","ﭗ":"ىۛ","ﭖ":"ىۛ","ث":"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ","ﺛ":"ىۛ","ﺜ":"ىۛ","ﺚ":"ىۛ","ﺙ":"ىۛ","ڽ":"ىۛ","ۑ":"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆","ێ":"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ","ﲐ":"ىٰ","ﱝ":"ىٰ","ﳞ":"ىo","ﳱ":"ىo","ﳦ":"ىۛo","ئ":"ىٴ","ﺋ":"ىٴ","ﺌ":"ىٴ","ﺊ":"ىٴ","ﺉ":"ىٴ","ٸ":"ىٴ","ﯫ":"ىٴl","ﯪ":"ىٴl","ﲛ":"ىٴo","ﳠ":"ىٴo","ﯭ":"ىٴo","ﯬ":"ىٴo","ﯸ":"ىٴٻ","ﯷ":"ىٴٻ","ﯶ":"ىٴٻ","ﲗ":"ىٴج","ﰀ":"ىٴج","ﲘ":"ىٴح","ﰁ":"ىٴح","ﲙ":"ىٴخ","ﱤ":"ىٴر","ﱥ":"ىٴز","ﲚ":"ىٴم","ﳟ":"ىٴم","ﱦ":"ىٴم","ﰂ":"ىٴم","ﱧ":"ىٴن","ﯯ":"ىٴو","ﯮ":"ىٴو","ﯱ":"ىٴو̓","ﯰ":"ىٴو̓","ﯳ":"ىٴو̆","ﯲ":"ىٴو̆","ﯵ":"ىٴوٰ","ﯴ":"ىٴوٰ","ﯻ":"ىٴى","ﯺ":"ىٴى","ﱨ":"ىٴى","ﯹ":"ىٴى","ﰃ":"ىٴى","ﱩ":"ىٴى","ﰄ":"ىٴى","ﳚ":"ىج","ﱕ":"ىج","ﰑ":"ىۛج","ﶯ":"ىجى","ﳛ":"ىح","ﱖ":"ىح","ﶮ":"ىحى","ﳜ":"ىخ","ﱗ":"ىخ","ﲑ":"ىر","ﱶ":"ىۛر","ﲒ":"ىز","ﱷ":"ىۛز","ﳝ":"ىم","ﳰ":"ىم","ﲓ":"ىم","ﱘ":"ىم","ﲦ":"ىۛم","ﳥ":"ىۛم","ﱸ":"ىۛم","ﰒ":"ىۛم","ﶝ":"ىمم","ﶜ":"ىمم","ﶰ":"ىمى","ﲔ":"ىن","ﱹ":"ىۛن","ﲕ":"ىى","ﱙ":"ىى","ﲖ":"ىى","ﱚ":"ىى","ﱺ":"ىۛى","ﰓ":"ىۛى","ﱻ":"ىۛى","ﰔ":"ىۛى","ﮱ":"ۓ","ﮰ":"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ","Մ":"ሆ","Ռ":"ቡ","Ի":"ኮ","Պ":"ጣ","आ":"अा","ऒ":"अाॆ","ओ":"अाे","औ":"अाै","ऄ":"अॆ","ऑ":"अॉ","ऍ":"एॅ","ऎ":"एॆ","ऐ":"एे","ई":"र्इ","ઽ":"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्","আ":"অা","ৠ":"ঋৃ","ৡ":"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ","ਉ":"ੳੁ","ਊ":"ੳੂ","ਆ":"ਅਾ","ਐ":"ਅੈ","ਔ":"ਅੌ","ਇ":"ੲਿ","ਈ":"ੲੀ","ਏ":"ੲੇ","આ":"અા","ઑ":"અાૅ","ઓ":"અાે","ઔ":"અાૈ","ઍ":"અૅ","એ":"અે","ઐ":"અૈ","ଆ":"ଅା","௮":"அ","ர":"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ","ഉ":"உ","ஊ":"உள","ഊ":"உൗ","௭":"எ","௷":"எவ","ஜ":"ஐ","ജ":"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி","ണ":"ண","௺":"நீ","௴":"மீ","௰":"ய","ഴ":"ழ","ௗ":"ள","ை":"ன","ശ":"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ","ಅ":"అ","ಆ":"ఆ","ಇ":"ఇ","ౠ":"ఋా","ౡ":"ఌా","ಒ":"ఒ","ఔ":"ఒౌ","ಔ":"ఒౌ","ఓ":"ఒౕ","ಓ":"ఒౕ","ಜ":"జ","ಞ":"ఞ","ఢ":"డ̣","ಣ":"ణ","థ":"ధּ","భ":"బ̣","ಯ":"య","ఠ":"రּ","ಱ":"ఱ","ಲ":"ల","ష":"వ̣","హ":"వా","మ":"వు","ూ":"ుా","ౄ":"ృా","ೡ":"ಌಾ","ഈ":"ഇൗ","ഐ":"എെ","ഓ":"ഒാ","ഔ":"ഒൗ","ൡ":"ഞ","൫":"ദ്ര","൹":"നു","ഌ":"നു","ങ":"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ","റ":"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳","ฃ":"ข","ด":"ค","ต":"ค","ม":"ฆ","ຈ":"จ","ซ":"ช","ฏ":"ฎ","ท":"ฑ","ບ":"บ","ປ":"ป","ຝ":"ฝ","ພ":"พ","ຟ":"ฟ","ฦ":"ภ","ຍ":"ย","។":"ฯ","ๅ":"า","ำ":"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู","แ":"เเ","ໜ":"ຫນ","ໝ":"ຫມ","ຳ":"̊າ","༂":"འུྂཿ","༃":"འུྂ༔","ཪ":"ར","ༀ":"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ","က":"ဂာ","ၰ":"ဃှ","ၦ":"ပှ","ဟ":"ပာ","ၯ":"ပာှ","ၾ":"ၽှ","ဩ":"သြ","ဪ":"သြော်","႞":"ႃ̊","ឣ":"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ","ᢖ":"ᡜ","ᡕ":"ᠵ","ῶ":"Ꮿ","ᐍ":"ᐁ·","ᐫ":"ᐁᐠ","ᐑ":"ᐄ·","ᐓ":"ᐅ·","ᐭ":"ᐅᐠ","ᐕ":"ᐆ·","ᐘ":"ᐊ·","ᐮ":"ᐊᐠ","ᐚ":"ᐋ·","ᣝ":"ᐞᣟ","ᓑ":"ᐡ","ᕀ":"ᐩ","ᐿ":"ᐲ·","ᑃ":"ᐴ·","⍩":"ᐵ","ᑇ":"ᐹ·","ᑜ":"ᑏ·","⸧":"ᑐ","⊃":"ᑐ","ᑞ":"ᑐ·","ᑩ":"ᑐ\'","⟉":"ᑐ/","⫗":"ᑐᑕ","ᑠ":"ᑑ·","⸦":"ᑕ","⊂":"ᑕ","ᑢ":"ᑕ·","ᑪ":"ᑕ\'","ᑤ":"ᑖ·","ᑵ":"ᑫ·","ᒅ":"ᑫ\'","ᑹ":"ᑮ·","ᑽ":"ᑰ·","ᘃ":"ᒉ","ᒓ":"ᒉ·","ᒕ":"ᒋ·","ᒗ":"ᒌ·","ᒛ":"ᒎ·","ᘂ":"ᒐ","ᒝ":"ᒐ·","ᒟ":"ᒑ·","ᒭ":"ᒣ·","ᒱ":"ᒦ·","ᒳ":"ᒧ·","ᒵ":"ᒨ·","ᒹ":"ᒫ·","ᓊ":"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·","ᓌ":"ᓇ·","ᓎ":"ᓈ·","ᘄ":"ᓓ","ᓝ":"ᓓ·","ᓟ":"ᓕ·","ᓡ":"ᓖ·","ᓣ":"ᓗ·","ᓥ":"ᓘ·","ᘇ":"ᓚ","ᓧ":"ᓚ·","ᓩ":"ᓛ·","ᓷ":"ᓭ·","ᓹ":"ᓯ·","ᓻ":"ᓰ·","ᓽ":"ᓱ·","ᓿ":"ᓲ·","ᔁ":"ᓴ·","ᔃ":"ᓵ·","ᔌ":"ᔋ<","ᔎ":"ᔋb","ᔍ":"ᔋᑕ","ᔏ":"ᔋᒐ","ᔘ":"ᔐ·","ᔚ":"ᔑ·","ᔜ":"ᔒ·","ᔞ":"ᔓ·","ᔠ":"ᔔ·","ᔢ":"ᔕ·","ᔤ":"ᔖ·","ᔲ":"ᔨ·","ᔴ":"ᔩ·","ᔶ":"ᔪ·","ᔸ":"ᔫ·","ᔺ":"ᔭ·","ᔼ":"ᔮ·","ᘢ":"ᕃ","ᣠ":"ᕃ·","ᘣ":"ᕆ","ᘤ":"ᕊ","ᕏ":"ᕌ·","ᖃ":"ᕐb","ᖄ":"ᕐḃ","ᖁ":"ᕐd","ᕿ":"ᕐP","ᙯ":"ᕐᑫ","ᕾ":"ᕐᑬ","ᖀ":"ᕐᑮ","ᖂ":"ᕐᑰ","ᖅ":"ᕐᒃ","ᕜ":"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·","ᕩ":"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·","ᖑ":"ᖕJ","ᙰ":"ᖕᒉ","ᖎ":"ᖕᒊ","ᖏ":"ᖕᒋ","ᖐ":"ᖕᒌ","ᖒ":"ᖕᒎ","ᖓ":"ᖕᒐ","ᖔ":"ᖕᒑ","ᙳ":"ᖖJ","ᙱ":"ᖖᒋ","ᙲ":"ᖖᒌ","ᙴ":"ᖖᒎ","ᙵ":"ᖖᒐ","ᙶ":"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ","ˡ":"ᣳ","ʳ":"ᣴ","ˢ":"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ","ᛡ":"ᚼ","⍿":"ᚽ","ᛂ":"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥","ㄱ":"ᄀ","ᆨ":"ᄀ","ᄁ":"ᄀᄀ","ㄲ":"ᄀᄀ","ᆩ":"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ","ᇃ":"ᄀᄅ","ᇻ":"ᄀᄇ","ᆪ":"ᄀᄉ","ㄳ":"ᄀᄉ","ᇄ":"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ","ㄴ":"ᄂ","ᆫ":"ᄂ","ᄓ":"ᄂᄀ","ᇅ":"ᄂᄀ","ᄔ":"ᄂᄂ","ㅥ":"ᄂᄂ","ᇿ":"ᄂᄂ","ᄕ":"ᄂᄃ","ㅦ":"ᄂᄃ","ᇆ":"ᄂᄃ","ퟋ":"ᄂᄅ","ᄖ":"ᄂᄇ","ᅛ":"ᄂᄉ","ᇇ":"ᄂᄉ","ㅧ":"ᄂᄉ","ᅜ":"ᄂᄌ","ᆬ":"ᄂᄌ","ㄵ":"ᄂᄌ","ퟌ":"ᄂᄎ","ᇉ":"ᄂᄐ","ᅝ":"ᄂᄒ","ᆭ":"ᄂᄒ","ㄶ":"ᄂᄒ","ᇈ":"ᄂᅀ","ㅨ":"ᄂᅀ","ㄷ":"ᄃ","ᆮ":"ᄃ","ᄗ":"ᄃᄀ","ᇊ":"ᄃᄀ","ᄄ":"ᄃᄃ","ㄸ":"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ","ᇋ":"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ","ㄹ":"ᄅ","ᆯ":"ᄅ","ꥤ":"ᄅᄀ","ᆰ":"ᄅᄀ","ㄺ":"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ","ᇌ":"ᄅᄀᄉ","ㅩ":"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ","ᄘ":"ᄅᄂ","ᇍ":"ᄅᄂ","ꥦ":"ᄅᄃ","ᇎ":"ᄅᄃ","ㅪ":"ᄅᄃ","ꥧ":"ᄅᄃᄃ","ᇏ":"ᄅᄃᄒ","ᄙ":"ᄅᄅ","ᇐ":"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ","ᆱ":"ᄅᄆ","ㄻ":"ᄅᄆ","ᇑ":"ᄅᄆᄀ","ᇒ":"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ","ᆲ":"ᄅᄇ","ㄼ":"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ","ᇓ":"ᄅᄇᄉ","ㅫ":"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ","ᇕ":"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ","ᇔ":"ᄅᄇᄒ","ꥬ":"ᄅᄉ","ᆳ":"ᄅᄉ","ㄽ":"ᄅᄉ","ᇖ":"ᄅᄉᄉ","ᄛ":"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ","ᇘ":"ᄅᄏ","ᆴ":"ᄅᄐ","ㄾ":"ᄅᄐ","ᆵ":"ᄅᄑ","ㄿ":"ᄅᄑ","ᄚ":"ᄅᄒ","ㅀ":"ᄅᄒ","ᄻ":"ᄅᄒ","ᆶ":"ᄅᄒ","ퟲ":"ᄅᄒ","ᇗ":"ᄅᅀ","ㅬ":"ᄅᅀ","ퟛ":"ᄅᅌ","ᇙ":"ᄅᅙ","ㅭ":"ᄅᅙ","ퟜ":"ᄅᅙᄒ","ㅁ":"ᄆ","ᆷ":"ᄆ","ꥯ":"ᄆᄀ","ᇚ":"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ","ᇛ":"ᄆᄅ","ퟠ":"ᄆᄆ","ᄜ":"ᄆᄇ","ㅮ":"ᄆᄇ","ᇜ":"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ","ᇝ":"ᄆᄉ","ㅯ":"ᄆᄉ","ᇞ":"ᄆᄉᄉ","ᄝ":"ᄆᄋ","ㅱ":"ᄆᄋ","ᇢ":"ᄆᄋ","ퟢ":"ᄆᄌ","ᇠ":"ᄆᄎ","ᇡ":"ᄆᄒ","ᇟ":"ᄆᅀ","ㅰ":"ᄆᅀ","ㅂ":"ᄇ","ᆸ":"ᄇ","ᄞ":"ᄇᄀ","ㅲ":"ᄇᄀ","ᄟ":"ᄇᄂ","ᄠ":"ᄇᄃ","ㅳ":"ᄇᄃ","ퟣ":"ᄇᄃ","ᇣ":"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ","ᄈ":"ᄇᄇ","ㅃ":"ᄇᄇ","ퟦ":"ᄇᄇ","ᄬ":"ᄇᄇᄋ","ㅹ":"ᄇᄇᄋ","ᄡ":"ᄇᄉ","ㅄ":"ᄇᄉ","ᆹ":"ᄇᄉ","ᄢ":"ᄇᄉᄀ","ㅴ":"ᄇᄉᄀ","ᄣ":"ᄇᄉᄃ","ㅵ":"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ","ᄤ":"ᄇᄉᄇ","ᄥ":"ᄇᄉᄉ","ᄦ":"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ","ᄫ":"ᄇᄋ","ㅸ":"ᄇᄋ","ᇦ":"ᄇᄋ","ᄧ":"ᄇᄌ","ㅶ":"ᄇᄌ","ퟨ":"ᄇᄌ","ᄨ":"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ","ᄩ":"ᄇᄐ","ㅷ":"ᄇᄐ","ᄪ":"ᄇᄑ","ᇤ":"ᄇᄑ","ꥴ":"ᄇᄒ","ᇥ":"ᄇᄒ","ㅅ":"ᄉ","ᆺ":"ᄉ","ᄭ":"ᄉᄀ","ㅺ":"ᄉᄀ","ᇧ":"ᄉᄀ","ᄮ":"ᄉᄂ","ㅻ":"ᄉᄂ","ᄯ":"ᄉᄃ","ㅼ":"ᄉᄃ","ᇨ":"ᄉᄃ","ᄰ":"ᄉᄅ","ᇩ":"ᄉᄅ","ᄱ":"ᄉᄆ","ퟪ":"ᄉᄆ","ᄲ":"ᄉᄇ","ㅽ":"ᄉᄇ","ᇪ":"ᄉᄇ","ᄳ":"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ","ᄊ":"ᄉᄉ","ㅆ":"ᄉᄉ","ᆻ":"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ","ᄴ":"ᄉᄉᄉ","ᄵ":"ᄉᄋ","ᄶ":"ᄉᄌ","ㅾ":"ᄉᄌ","ퟯ":"ᄉᄌ","ᄷ":"ᄉᄎ","ퟰ":"ᄉᄎ","ᄸ":"ᄉᄏ","ᄹ":"ᄉᄐ","ퟱ":"ᄉᄐ","ᄺ":"ᄉᄑ","ퟮ":"ᄉᅀ","ㅇ":"ᄋ","ᆼ":"ᄋ","ᅁ":"ᄋᄀ","ᇬ":"ᄋᄀ","ᇭ":"ᄋᄀᄀ","ᅂ":"ᄋᄃ","ꥶ":"ᄋᄅ","ᅃ":"ᄋᄆ","ᅄ":"ᄋᄇ","ᅅ":"ᄋᄉ","ᇱ":"ᄋᄉ","ㆂ":"ᄋᄉ","ᅇ":"ᄋᄋ","ㆀ":"ᄋᄋ","ᇮ":"ᄋᄋ","ᅈ":"ᄋᄌ","ᅉ":"ᄋᄎ","ᇯ":"ᄋᄏ","ᅊ":"ᄋᄐ","ᅋ":"ᄋᄑ","ꥷ":"ᄋᄒ","ᅆ":"ᄋᅀ","ᇲ":"ᄋᅀ","ㆃ":"ᄋᅀ","ㅈ":"ᄌ","ᆽ":"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ","ᅍ":"ᄌᄋ","ᄍ":"ᄌᄌ","ㅉ":"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ","ㅊ":"ᄎ","ᆾ":"ᄎ","ᅒ":"ᄎᄏ","ᅓ":"ᄎᄒ","ㅋ":"ᄏ","ᆿ":"ᄏ","ㅌ":"ᄐ","ᇀ":"ᄐ","ꥹ":"ᄐᄐ","ㅍ":"ᄑ","ᇁ":"ᄑ","ᅖ":"ᄑᄇ","ᇳ":"ᄑᄇ","ퟺ":"ᄑᄉ","ᅗ":"ᄑᄋ","ㆄ":"ᄑᄋ","ᇴ":"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ","ㅎ":"ᄒ","ᇂ":"ᄒ","ᇵ":"ᄒᄂ","ᇶ":"ᄒᄅ","ᇷ":"ᄒᄆ","ᇸ":"ᄒᄇ","ꥻ":"ᄒᄉ","ᅘ":"ᄒᄒ","ㆅ":"ᄒᄒ","ᄽ":"ᄼᄼ","ᄿ":"ᄾᄾ","ㅿ":"ᅀ","ᇫ":"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ","ㆁ":"ᅌ","ᇰ":"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ","ᅏ":"ᅎᅎ","ᅑ":"ᅐᅐ","ㆆ":"ᅙ","ᇹ":"ᅙ","ꥼ":"ᅙᅙ","ㅤ":"ᅠ","ㅏ":"ᅡ","ᆣ":"ᅡー","ᅶ":"ᅡᅩ","ᅷ":"ᅡᅮ","ᅢ":"ᅡ丨","ㅐ":"ᅡ丨","ㅑ":"ᅣ","ᅸ":"ᅣᅩ","ᅹ":"ᅣᅭ","ᆤ":"ᅣᅮ","ᅤ":"ᅣ丨","ㅒ":"ᅣ丨","ㅓ":"ᅥ","ᅼ":"ᅥー","ᅺ":"ᅥᅩ","ᅻ":"ᅥᅮ","ᅦ":"ᅥ丨","ㅔ":"ᅥ丨","ㅕ":"ᅧ","ᆥ":"ᅧᅣ","ᅽ":"ᅧᅩ","ᅾ":"ᅧᅮ","ᅨ":"ᅧ丨","ㅖ":"ᅧ丨","ㅗ":"ᅩ","ᅪ":"ᅩᅡ","ㅘ":"ᅩᅡ","ᅫ":"ᅩᅡ丨","ㅙ":"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨","ᅿ":"ᅩᅥ","ᆀ":"ᅩᅥ丨","ힰ":"ᅩᅧ","ᆁ":"ᅩᅧ丨","ᆂ":"ᅩᅩ","ힱ":"ᅩᅩ丨","ᆃ":"ᅩᅮ","ᅬ":"ᅩ丨","ㅚ":"ᅩ丨","ㅛ":"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨","ᆄ":"ᅭᅣ","ㆇ":"ᅭᅣ","ᆆ":"ᅭᅣ","ᆅ":"ᅭᅣ丨","ㆈ":"ᅭᅣ丨","ힴ":"ᅭᅥ","ᆇ":"ᅭᅩ","ᆈ":"ᅭ丨","ㆉ":"ᅭ丨","ㅜ":"ᅮ","ᆉ":"ᅮᅡ","ᆊ":"ᅮᅡ丨","ᅯ":"ᅮᅥ","ㅝ":"ᅮᅥ","ᆋ":"ᅮᅥー","ᅰ":"ᅮᅥ丨","ㅞ":"ᅮᅥ丨","ힵ":"ᅮᅧ","ᆌ":"ᅮᅧ丨","ᆍ":"ᅮᅮ","ᅱ":"ᅮ丨","ㅟ":"ᅮ丨","ힶ":"ᅮ丨丨","ㅠ":"ᅲ","ᆎ":"ᅲᅡ","ힷ":"ᅲᅡ丨","ᆏ":"ᅲᅥ","ᆐ":"ᅲᅥ丨","ᆑ":"ᅲᅧ","ㆊ":"ᅲᅧ","ᆒ":"ᅲᅧ丨","ㆋ":"ᅲᅧ丨","ힸ":"ᅲᅩ","ᆓ":"ᅲᅮ","ᆔ":"ᅲ丨","ㆌ":"ᅲ丨","ㆍ":"ᆞ","ퟅ":"ᆞᅡ","ᆟ":"ᆞᅥ","ퟆ":"ᆞᅥ丨","ᆠ":"ᆞᅮ","ᆢ":"ᆞᆞ","ᆡ":"ᆞ丨","ㆎ":"ᆞ丨","ヘ":"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄","不":"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨","ᅵ":"丨","ㅣ":"丨","⼁":"丨","ᆜ":"丨ー","ᆘ":"丨ᅡ","ᆙ":"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨","ᆚ":"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ","ᆛ":"丨ᅮ","ퟃ":"丨ᅲ","ᆝ":"丨ᆞ","ퟄ":"丨丨","串":"串","丸":"丸","丹":"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀","亂":"亂","㇚":"亅","⼅":"亅","了":"了","ニ":"二","⼆":"二","𠄢":"𠄢","⼇":"亠","亮":"亮","⼈":"人","イ":"亻","⺅":"亻","什":"什","仌":"仌","令":"令","你":"你","倂":"併","倂":"併","侀":"侀","來":"來","例":"例","侮":"侮","侮":"侮","侻":"侻","便":"便","值":"値","倫":"倫","偺":"偺","備":"備","像":"像","僚":"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿","兀":"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全","兩":"兩","ハ":"八","⼋":"八","六":"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况","冷":"冷","凉":"凉","凌":"凌","凜":"凜","凞":"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃","切":"切","切":"切","列":"列","利":"利","㓟":"㓟","刺":"刺","刻":"刻","剆":"剆","割":"割","剷":"剷","劉":"劉","𠠄":"𠠄","カ":"力","力":"力","⼒":"力","劣":"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉","勒":"勒","勞":"勞","勤":"勤","勤":"勤","勵":"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕","北":"北","北":"北","⼕":"匚","⼖":"匸","匿":"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博","ト":"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即","卵":"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶","參":"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣","ロ":"口","⼝":"口","囗":"口","⼞":"口","句":"句","叫":"叫","叱":"叱","吆":"吆","吏":"吏","吝":"吝","吸":"吸","呂":"呂","呈":"呈","周":"周","咞":"咞","咢":"咢","咽":"咽","䎛":"㖈","哶":"哶","唐":"唐","啓":"啓","啟":"啓","啕":"啕","啣":"啣","善":"善","善":"善","喇":"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳","嗀":"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器","囹":"囹","圖":"圖","圗":"圗","⼟":"土","士":"土","⼠":"土","型":"型","城":"城","㦳":"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀","塚":"塚","塚":"塚","塞":"塞","填":"塡","壿":"墫","墬":"墬","墳":"墳","壘":"壘","壟":"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊","タ":"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄","奈":"奈","契":"契","奔":"奔","奢":"奢","女":"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦","嬀":"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀","宅":"宅","𡧈":"𡧈","寃":"寃","寘":"寘","寧":"寧","寧":"寧","寧":"寧","寮":"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸","尿":"尿","屠":"屠","屢":"屢","層":"層","履":"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦","崙":"崙","嵃":"嵃","嵐":"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲","嶺":"嶺","⼮":"巛","巢":"巢","エ":"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾","帲":"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干","年":"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广","度":"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶","廊":"廊","廊":"廊","廉":"廉","廒":"廒","廓":"廓","廙":"廙","廬":"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱","弄":"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳","律":"律","㣣":"㣣","徚":"徚","復":"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志","念":"念","忹":"忹","怒":"怒","怜":"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘","惡":"惡","𢛔":"𢛔","愈":"愈","慨":"慨","慄":"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎","憐":"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲","懶":"懶","懶":"懶","戀":"戀","⼽":"戈","成":"成","戛":"戛","戮":"戮","戴":"戴","⼾":"戶","戸":"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱","拉":"拉","拏":"拏","拓":"拓","拔":"拔","拼":"拼","拾":"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨","捻":"捻","掃":"掃","掠":"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮","搉":"㩁","撚":"撚","撝":"撝","擄":"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬","數":"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗","料":"料","⽄":"斤","⽅":"方","旅":"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日","易":"易","曶":"㫚","㫤":"㫤","晉":"晉","晩":"晚","晴":"晴","晴":"晴","暑":"暑","暑":"暑","暈":"暈","㬈":"㬈","暜":"暜","暴":"暴","曆":"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰","更":"更","書":"書","⽉":"月","𣍟":"𣍟","肦":"朌","胐":"朏","胊":"朐","脁":"朓","胶":"㬵","朗":"朗","朗":"朗","朗":"朗","脧":"朘","望":"望","望":"望","幐":"㬺","䐠":"㬻","𣎓":"𣎓","膧":"朣","𣎜":"𣎜","⽊":"木","李":"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃","柿":"杮","杻":"杻","枅":"枅","林":"林","㭉":"㭉","𣏕":"𣏕","柳":"柳","柺":"柺","栗":"栗","栟":"栟","桒":"桒","𣑭":"𣑭","梁":"梁","梅":"梅","梅":"梅","梎":"梎","梨":"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝","槩":"㮣","樧":"榝","榣":"榣","槪":"槪","樂":"樂","樂":"樂","樂":"樂","樓":"樓","𣚣":"𣚣","檨":"檨","櫓":"櫓","櫛":"櫛","欄":"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲","歷":"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟","殮":"殮","⽎":"殳","殺":"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧","沈":"沈","沿":"沿","泌":"泌","泍":"泍","泥":"泥","𣲼":"𣲼","洛":"洛","洞":"洞","洴":"洴","派":"派","流":"流","流":"流","流":"流","洖":"洖","浩":"浩","浪":"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞","淋":"淋","淚":"淚","淪":"淪","淹":"淹","渚":"渚","港":"港","湮":"湮","潙":"溈","滋":"滋","滋":"滋","溜":"溜","溺":"溺","滇":"滇","滑":"滑","滛":"滛","㴳":"㴳","漏":"漏","漢":"漢","漢":"漢","漣":"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆","濫":"濫","濾":"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災","炙":"炙","炭":"炭","烈":"烈","烙":"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅","煉":"煉","𤋮":"𤋮","熜":"熜","燎":"燎","燐":"燐","𤎫":"𤎫","爐":"爐","爛":"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛","牢":"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯","狀":"狀","𤜵":"𤜵","狼":"狼","猪":"猪","猪":"猪","𤠔":"𤠔","獵":"獵","獺":"獺","⽞":"玄","率":"率","率":"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥","玲":"玲","㺸":"㺸","㺸":"㺸","珞":"珞","琉":"琉","理":"理","琢":"琢","瑇":"瑇","瑜":"瑜","瑩":"瑩","瑱":"瑱","瑱":"瑱","璅":"璅","璉":"璉","璘":"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶","留":"留","略":"略","異":"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒","痢":"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝","療":"療","癩":"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼","益":"益","益":"益","盛":"盛","盧":"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳","省":"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹","晣":"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝","硏":"研","硎":"硎","硫":"硫","碌":"碌","碌":"碌","碑":"碑","磊":"磊","磌":"磌","磌":"磌","磻":"磻","䃣":"䃣","礪":"礪","⽰":"示","⺭":"礻","礼":"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝","神":"神","祥":"祥","視":"視","視":"視","祿":"祿","𥚚":"𥚚","禍":"禍","禎":"禎","福":"福","福":"福","𥛅":"𥛅","禮":"禮","⽱":"禸","⽲":"禾","秊":"秊","䄯":"䄯","秫":"秫","稜":"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱","立":"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹","笠":"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐","簾":"簾","籠":"籠","⽶":"米","类":"类","粒":"粒","精":"精","糒":"糒","糖":"糖","糨":"糨","䊠":"䊠","糣":"糣","糧":"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀","紐":"紐","索":"索","累":"累","絶":"絕","絣":"絣","絛":"絛","綠":"綠","綾":"綾","緇":"緇","練":"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉","縷":"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙","罹":"罹","罺":"罺","羅":"羅","𦌾":"𦌾","⽺":"羊","羕":"羕","羚":"羚","羽":"羽","⽻":"羽","翺":"翺","老":"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳","聆":"聆","聠":"聠","𦖨":"𦖨","聯":"聯","聰":"聰","聾":"聾","⾀":"聿","⺺":"肀","⾁":"肉","肋":"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙","腁":"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵","朦":"䑃","臘":"臘","⾂":"臣","臨":"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮","良":"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽","若":"若","若":"若","苦":"苦","𦬼":"𦬼","茶":"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓","菉":"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華","菱":"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭","落":"落","葉":"葉","蔿":"蒍","𦳕":"𦳕","𦵫":"𦵫","蓮":"蓮","蓱":"蓱","蓳":"蓳","蓼":"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬","藍":"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡","藺":"藺","蘆":"蘆","䕫":"䕫","蘒":"蘒","蘭":"蘭","𧃒":"𧃒","虁":"蘷","蘿":"蘿","⾌":"虍","⻁":"虎","虐":"虐","虜":"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊","螺":"螺","蠁":"蠁","䗹":"䗹","蠟":"蠟","⾎":"血","行":"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤","裂":"裂","𧙧":"𧙧","裏":"裏","裗":"裗","裞":"裞","裡":"裡","裸":"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁","襤":"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆","見":"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦","詽":"訮","訞":"䚶","䚾":"䚾","䛇":"䛇","誠":"誠","說":"說","說":"說","調":"調","請":"請","諒":"諒","論":"論","諭":"諭","諭":"諭","諸":"諸","諸":"諸","諾":"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹","識":"識","讀":"讀","讏":"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆","豈":"豈","豕":"豕","⾗":"豕","豣":"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁","賂":"賂","賈":"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起","趆":"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼","跺":"跥","路":"路","跰":"跰","躛":"躗","⾝":"身","車":"車","⾞":"車","軔":"軔","輧":"軿","輦":"輦","輪":"輪","輸":"輸","輸":"輸","輻":"輻","轢":"轢","⻋":"车","⾟":"辛","辞":"辞","辰":"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡","連":"連","逸":"逸","逸":"逸","遲":"遲","遼":"遼","𨗒":"𨗒","𨗭":"𨗭","邏":"邏","⾢":"邑","邔":"邔","郎":"郎","郞":"郎","郞":"郎","郱":"郱","都":"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉","酪":"酪","醙":"醙","醴":"醴","⾤":"釆","里":"里","⾥":"里","量":"量","金":"金","⾦":"金","鈴":"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼","錄":"錄","鍊":"鍊","鎮":"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕","閭":"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝","阮":"阮","陋":"陋","降":"降","陵":"陵","陸":"陸","陼":"陼","隆":"隆","隣":"隣","䧦":"䧦","⾪":"隶","隷":"隷","隸":"隷","隸":"隷","⾫":"隹","雃":"雃","離":"離","難":"難","難":"難","⾬":"雨","零":"零","雷":"雷","霣":"霣","𩅅":"𩅅","露":"露","靈":"靈","⾭":"靑","⻘":"青","靖":"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋","領":"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻","類":"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢","飯":"飯","飼":"飼","䬳":"䬳","館":"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂","駱":"駱","駾":"駾","驪":"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚","魯":"魯","鱀":"鱀","鱗":"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎","鶴":"鶴","𪄅":"𪄅","䳸":"䳸","鷺":"鷺","𪈎":"𪈎","鸞":"鸞","鹃":"鹂","⿄":"鹵","鹿":"鹿","⿅":"鹿","𪊑":"𪊑","麗":"麗","麟":"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍","黎":"黎","䵖":"䵖","⿊":"黑","黒":"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿","龍":"龍","⿓":"龍","龎":"龎","⻰":"龙","龜":"龜","龜":"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"}')},"6e9e":function(e,t,n){"use strict";n.r(t);var r=n("44c8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"6eca":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"",""]),e.exports=t},"6f2e":function(e,t,n){"use strict";(function(t,r){var i=n("966d");e.exports=x;var o,a=n("e3db");x.ReadableState=w;n("faa1").EventEmitter;var s=function(e,t){return e.listeners(t).length},c=n("2aaa"),l=n("f60b").Buffer,u=t.Uint8Array||function(){};function d(e){return l.from(e)}function f(e){return l.isBuffer(e)||e instanceof u}var h=Object.create(n("3a7c"));h.inherits=n("3fb5");var p=n(2),m=void 0;m=p&&p.debuglog?p.debuglog("stream"):function(){};var v,g=n("9b54"),y=n("c4c0");h.inherits(x,c);var b=["error","close","destroy","pause","resume"];function _(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function w(e,t){o=o||n("d6dd"),e=e||{};var r=t instanceof o;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(v||(v=n("7d72").StringDecoder),this.decoder=new v(e.encoding),this.encoding=e.encoding)}function x(e){if(o=o||n("d6dd"),!(this instanceof x))return new x(e);this._readableState=new w(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function S(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,O(e,a)):(i||(o=E(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=d(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):k(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):A(e,a)):k(e,a,t,!1))):r||(a.reading=!1));return C(a)}function k(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&M(e)),A(e,t)}function E(e,t){var n;return f(t)||"string"===typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function C(e){return!e.ended&&(e.needReadable||e.length=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=I(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,M(e)}}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(P,e):P(e))}function P(e){m("emit readable"),e.emit("readable"),U(e)}function A(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=F(e,t.buffer,t.decoder),n);var n}function F(e,t,n){var r;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),e-=a,0===e){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}function q(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;while(r=r.next){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),e-=a,0===e){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function W(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(K,t,e))}function K(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function V(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return m("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?W(this):M(this),null;if(e=R(e,t),0===e&&t.ended)return 0===t.length&&W(this),null;var r,i=t.needReadable;return m("need readable",i),(0===t.length||t.length-e0?B(e,t):null,null===r?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&W(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e);break}o.pipesCount+=1,m("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,c=a?u:w;function l(e,t){m("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function u(){m("onend"),e.end()}o.endEmitted?i.nextTick(c):n.once("end",c),e.on("unpipe",l);var d=D(n);e.on("drain",d);var f=!1;function h(){m("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",d),e.removeListener("error",g),e.removeListener("unpipe",l),n.removeListener("end",u),n.removeListener("end",w),n.removeListener("data",v),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d()}var p=!1;function v(t){m("ondata"),p=!1;var r=e.write(t);!1!==r||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==V(o.pipes,e))&&!f&&(m("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(t){m("onerror",t),w(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),w()}function b(){m("onfinish"),e.removeListener("close",y),w()}function w(){m("unpipe"),n.unpipe(e)}return n.on("data",v),_(e,"error",g),e.once("close",y),e.once("finish",b),e.emit("pipe",n),o.flowing||(m("pipe resume"),n.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o4?h:t+8,a=[],c=0;c4?h:t+8,E(e,o,f-1);case 3:if(1==f)return e.getUint16(t+8,!i);for(o=f>2?h:t+8,a=[],c=0;ce.byteLength)return{};var o=w(e,t,t+i,d,r);if(o["Compression"])switch(o["Compression"]){case 6:if(o.JpegIFOffset&&o.JpegIFByteCount){var a=t+o.JpegIFOffset,s=o.JpegIFByteCount;o["blob"]=new Blob([new Uint8Array(e.buffer,a,s)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",o["Compression"])}else 2==o["PhotometricInterpretation"]&&console.log("Thumbnail image format is RGB, which is not implemented.");return o}function E(e,t,r){var i="";for(n=t;n")+8;c=c.substring(c.indexOf("0){t["@attributes"]={};for(var n=0;n0)for(var r=0;rdiv .icon,.rootcontent.fix.minimized:not(.active) .offline .table>div .icon{font-size:.8em;padding:0}.rootcontent.fix.minimized.active .page .work{padding:0 .25em}.rootcontent.fix.minimized.active .backface{top:0;bottom:0;right:0;left:0}.rootcontent .likeoffline,.rootcontent .offline{color:rgb(var(--neutral-grad-1));background:rgb(var(--background-secondary-theme))}.rootcontent .likeoffline .table,.rootcontent .offline .table{width:100%;height:100%}.rootcontent .likeoffline .table>div,.rootcontent .offline .table>div{vertical-align:middle;text-align:center;padding-bottom:45%}.rootcontent .likeoffline .table>div .icon,.rootcontent .offline .table>div .icon{font-size:2.3em;padding:.5em;color:rgb(var(--color-bg-ac))}.rootcontent .likeoffline .table>div .label,.rootcontent .offline .table>div .label{font-size:1em;padding:0 4em}.rootcontent .likeoffline{background:transparent}.rootcontent .fixedallwrapper,.rootcontent .fixedallwrapperDisplayed,.rootcontent .preloaderWrapper{position:absolute;left:0;right:0;top:0;bottom:0;z-index:998;transition:.3s}.rootcontent .fixedallwrapperDisplayed{background:rgb(var(--background-total-theme))}.rootcontent .fixedOnPageBottom,.rootcontent .fixedOnPageTop{transition:.3s}.rootcontent .fade-in-right-enter-to .fixedallwrapper,.rootcontent .fade-in-right-enter-to .preloaderWrapper,.rootcontent .fade-in-right-enter .fixedallwrapper,.rootcontent .fade-in-right-enter .preloaderWrapper,.rootcontent .fade-in-right-leave-to .fixedallwrapper,.rootcontent .fade-in-right-leave-to .preloaderWrapper{opacity:0}.rootcontent .fade-in-right-enter-to .fixedOnPageBottom,.rootcontent .fade-in-right-enter .fixedOnPageBottom,.rootcontent .fade-in-right-leave-to .fixedOnPageBottom{opacity:0;bottom:-1.5em}.rootcontent .fade-in-right-enter-to .fixedOnPageTop,.rootcontent .fade-in-right-enter .fixedOnPageTop,.rootcontent .fade-in-right-leave-to .fixedOnPageTop{opacity:0;top:-1.5em}.rootcontent .content{padding-top:66px}.rootcontent .work{padding:0 .5em;margin:0 auto;max-width:640px}.rootcontent .pwork{max-width:640px;background:transparent;margin:0 auto;padding:0 4em}.rootcontent .effects{position:fixed;left:0;top:0;bottom:0;right:0;z-index:2020}.rootcontent .speechWrapper{position:fixed;left:0;bottom:0;padding-bottom:2em;right:0;z-index:2000;height:80px}.rootcontent .speechWrapper .speechAbsWrapper{position:relative;width:100%;height:100%}.rootcontent .emptyRec{padding:10em 2em;text-align:center;font-size:.8em}.rootcontent .enablevoice .forbutton{margin-top:2em}.table{display:table;table-layout:fixed;width:100%}.table>div{display:table-cell}.m-message-container.is-bottom-right{padding:0;right:56px;bottom:.75em;width:auto}.m-message-container.is-top-left{top:calc(.5em + var(--app-margin-top))}.notificationWrapper{display:block;max-width:none;font-family:Segoe UI Variable,Segoe UI,SegoeUI,Helvetica Neue,Helvetica,Arial,sans-serif}.notificationWrapper.m-message-wrapper+.m-message-wrapper{margin-top:.5em}.notificationWrapper .m-message{padding:.5em .5em;border:1px solid rgba(var(--neutral-grad-0),.9);border-radius:5px;box-shadow:none;background:rgb(var(--background-secondary-theme));font-size:1em}.notificationWrapper .m-message--title{font-weight:700;color:rgb(var(--color-txt-gray-dark));font-size:.8em}.notificationWrapper .m-message--title:first-letter{text-transform:capitalize}.notificationWrapper .m-message--description{margin-top:0}.notificationWrapper .m-message-content{flex-grow:1}.notificationWrapper .m-message-content .listPreview{cursor:pointer}.notificationWrapper .m-message-content .listPreview .invitedEvent{width:180px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:flex;justify-content:space-between;align-items:center}.notificationWrapper .m-message-content .listPreview .invitedEvent span{display:block;font-size:.8em}.notificationWrapper .m-message-content .listPreview .invitedEvent .txt{color:rgb(var(--color-txt-gray-dark))}.notificationWrapper .m-message-content .listPreview .invitedEvent .txtNew{color:rgb(var(--color-good))}.notificationWrapper .m-message-content .listPreview .linkPreview span:first-letter{text-transform:uppercase}.notificationWrapper .m-message-content .listPreview .linkPreview .senderName{font-weight:700;color:rgb(var(--color-txt-gray-dark))}.notificationWrapper .m-message-content .listPreview .linkPreview .linkTitle{color:#707070}.notificationWrapper .m-message-content .listPreview .linkPreview .pocketnetLink{color:rgb(var(--color-txt-gray-dark))}.notificationWrapper .m-message-content .listPreview .previewMessageList span{color:rgb(var(--color-txt-gray-dark));text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left}.notificationWrapper .m-message-content .listPreview .previewMessage{display:flex;justify-content:flex-start;align-items:center;width:100%}.notificationWrapper .m-message-content .listPreview .previewMessage span{display:block;color:rgb(var(--color-txt-gray-dark));font-size:.8em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:150px}.notificationWrapper .m-message-icons{float:none}.notificationWrapper .m-message--icon{display:block;vertical-align:top}.notificationWrapper .m-message--button.m-message--arrow-down{display:none}.is-top-left{padding:.5em}.is-top-left .notificationWrapper{width:100%;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}@media only screen and (max-width:640px){#app{width:100%}#app .pwork{padding:0 .5em}#app .work{padding:0 .5em 10px}}.collapse{max-width:768px;margin:0 auto;position:relative;z-index:999;padding:.5em 0}.collapse .iconbutton{width:50px;margin-left:auto;color:grey}@media (pointer:fine){.collapse .iconbutton{opacity:.5}.collapse .iconbutton:hover{opacity:1}}.collapsed{display:flex;justify-content:space-between;padding:1em 0;max-width:768px;margin:auto}.angle{display:flex;justify-content:center;width:50px;cursor:pointer}.expand{margin-right:.5em}.bout .collapse{display:none}.resize-observer{position:absolute;right:-20000px}.pswp__img{-o-object-fit:contain;object-fit:contain}.vue-js-switch{display:inline-block;position:relative;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left{left:10px}.vue-js-switch .v-switch-label.v-right{right:10px}.vue-js-switch .v-switch-core{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vue-js-switch .v-switch-core .v-switch-button{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:rgb(var(--background-total-theme));z-index:2}.vue-js-switch.disabled{pointer-events:none;opacity:.6}",""]),e.exports=t},"6ffa":function(e,t,n){"use strict";(function(t,r){var i=n("966d");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){N(t,e)}}e.exports=b;var a,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?setImmediate:i.nextTick;b.WritableState=y;var c=Object.create(n("3a7c"));c.inherits=n("3fb5");var l={deprecate:n("b7d1")},u=n("2aaa"),d=n("f60b").Buffer,f=r.Uint8Array||function(){};function h(e){return d.from(e)}function p(e){return d.isBuffer(e)||e instanceof f}var m,v=n("c4c0");function g(){}function y(e,t){a=a||n("d6dd"),e=e||{};var r=t instanceof a;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,s=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){I(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(a=a||n("d6dd"),!m.call(b,this)&&!(this instanceof a))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),u.call(this)}function w(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}function x(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}function S(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=d.from(t,n)),t}function k(e,t,n,r,i,o){if(!n){var a=S(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||L(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n("4362"),n("c8ba"))},7037:function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports["default"]=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},"703d":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".searchWrapperEA.work[data-v-12492b0b]{margin-bottom:.5em!important;padding-top:.5em!important}#contacts.minimized:not(.active) .inviteUserDiv[data-v-12492b0b]{width:44px}#contacts.minimized:not(.active) .inviteUserDiv .inviteButton[data-v-12492b0b]{height:44px;text-align:center;line-height:44px}#contacts.minimized:not(.active) .inviteUserDiv .inviteButton i[data-v-12492b0b]{width:auto;position:relative}#contacts.minimized:not(.active) .inviteUserDiv span[data-v-12492b0b],#contacts.minimized:not(.active) .titleContacts[data-v-12492b0b]{display:none}.titleContacts[data-v-12492b0b],.titleSearchResult[data-v-12492b0b]{text-align:center}.titleContacts span[data-v-12492b0b],.titleSearchResult span[data-v-12492b0b]{font-size:.8em}.titleContacts.empty[data-v-12492b0b],.titleSearchResult.empty[data-v-12492b0b]{padding:2em;text-align:center}.titleContacts.empty span[data-v-12492b0b],.titleSearchResult.empty span[data-v-12492b0b]{font-size:1.5em;font-weight:100}.searchResult[data-v-12492b0b]{position:relative}.searchResult .linepreloaderWrapper[data-v-12492b0b]{padding:.5em;text-align:center}.searchResult .noSearchResult[data-v-12492b0b]{left:0;right:0;top:50%;padding:3em;text-align:center}.searchResult .noSearchResult i[data-v-12492b0b]{display:block;font-size:1.5em;color:stgb(--neutral-grad-3)}.searchResult .noSearchResult span[data-v-12492b0b]{color:stgb(--neutral-grad-3);display:block;margin:1em 0;font-size:2em;font-weight:100}.groupNameInputCaption[data-v-12492b0b]{padding:.5em 0;text-align:center}.groupNameInputCaption span[data-v-12492b0b]{font-size:.8em}.groupList .groupCaption[data-v-12492b0b]{position:relative;padding:.5em;text-align:center;display:flex;justify-content:space-between;align-items:center}.groupList .groupCaption .label[data-v-12492b0b]{font-size:.8em;font-weight:500}.groupList .groupCaption .selectWrapper[data-v-12492b0b]{position:relative}.groupList .groupCaption .selectWrapper i[data-v-12492b0b]{position:absolute;right:0;top:4px;color:stgb(--color-txt-ac)}.groupList .groupCaption .selectWrapper .selectRoomVisible[data-v-12492b0b]{padding-right:15px;font-size:.8em;cursor:pointer;color:stgb(--color-txt-ac);-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:hidden;position:relative}.groupList .groupCaption .selectWrapper .selectRoomVisible[data-v-12492b0b]::-ms-expand{display:none}.groupList .groupCaption .selectWrapper .selectRoomVisible option[data-v-12492b0b]{font-size:.8em}.participants[data-v-12492b0b]{display:flex;background:rgba(var(--neutral-grad-0),.5);flex-wrap:wrap;border-radius:15px;padding:.5em;margin-bottom:.5em;max-height:123px;overflow-y:auto}.participants>div[data-v-12492b0b]{flex-grow:1}.participants .groupListName[data-v-12492b0b]{margin-bottom:.25em}.participants[data-v-12492b0b] .iconWrapper{width:33px}.participants[data-v-12492b0b] .iconWrapper .userpic{width:33px;height:33px;line-height:33px}.participants[data-v-12492b0b] .summaryLine{font-size:.8em}.participants .groupListName[data-v-12492b0b]{margin-right:1em;margin-top:0;border-radius:1em;display:flex;align-items:center}.participants .groupListName span[data-v-12492b0b]{color:rgb(var(--text-on-bg-ac-color));font-size:.9em;display:block;margin-right:5px}.participants .groupListName i[data-v-12492b0b]{text-align:center;width:33px}.chatBtnWrapper[data-v-12492b0b],.GroupBtnWrapper[data-v-12492b0b],.inviteBtnWrapper[data-v-12492b0b]{z-index:2;padding:.5em;text-align:center;left:0;right:0}.minimized .chatBtnWrapper[data-v-12492b0b],.minimized .GroupBtnWrapper[data-v-12492b0b],.minimized .inviteBtnWrapper[data-v-12492b0b]{position:sticky}#contacts.minimized .inviteUserDiv[data-v-12492b0b]{margin-top:.5em}.unauthorized.minimized[data-v-12492b0b]:not(.active){display:none}.unauthorized[data-v-12492b0b]{padding:3em 0;text-align:center}.unauthorized .buttonWrapper[data-v-12492b0b]{padding:1em}.unauthorized .captionWrapper[data-v-12492b0b]{padding:1em;text-align:center}.unauthorized .captionWrapper span[data-v-12492b0b]{font-size:1.5em;font-weight:100}.groupNameInput[data-v-12492b0b]{padding:.5em 1em}.groupNameInput label[data-v-12492b0b]{display:block}.groupNameInput input[data-v-12492b0b]{height:35px;width:100%;padding-right:0}#contacts .inviteUserDiv[data-v-12492b0b]{margin-top:.4em}#contacts .inviteUserDiv .inviteButton[data-v-12492b0b]{background-color:rgb(var(--color-bg-ac-bright));color:rgb(var(--text-on-bg-ac-color));width:100%;height:34px;font-size:.9em;border-radius:30px;position:relative;cursor:pointer}#contacts .inviteUserDiv .inviteButton i[data-v-12492b0b]{position:absolute;right:0;top:0;line-height:34px;width:50px;text-align:center}#contacts .inviteUserDiv .inviteButton.colored[data-v-12492b0b]{background-color:rgb(var(--color-bg-orange))}",""]),e.exports=t},"704f":function(e,t,n){var r=n("76df");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("63f17088",r,e)}},"706e":function(e,t,n){"use strict";n.r(t);var r=n("cde8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},7156:function(e,t,n){var r=n("1626"),i=n("861d"),o=n("d2bb");e.exports=function(e,t,n){var a,s;return o&&r(a=t.constructor)&&a!==n&&i(s=a.prototype)&&s!==n.prototype&&o(e,s),e}},"71da":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active},attrs:{id:"contacts"}},[e.unauthorized?n("div",{staticClass:"dmdv"}):n("div",["Contacts"===e.mode&&e.window.cordova?n("div",{staticClass:"work"},[n("div",{staticClass:"inviteUserDiv"},[n("router-link",{staticClass:"inviteButton",class:{colored:!0},attrs:{to:"/invite",tag:"button"}},[n("span",[e._v(e._s(e.$i18n.t("caption.inviteFriend")))]),e._v(" "),n("i",{staticClass:"fas fa-address-card"})])],1)]):e._e(),"Contacts"!==e.mode||e.window.cordova?e._e():n("div",{staticClass:"work"},[n("div",{staticClass:"inviteUserDiv"},[n("button",{staticClass:"inviteButton",class:{colored:!0},on:{click:e.invitepnt}},[n("span",[e._v(e._s(e.$i18n.t("caption.inviteFriend")))]),e._v(" "),n("i",{staticClass:"fas fa-address-card"})])])]),n("div",{staticClass:"namebuttoncreate"},["Selectmany"===e.mode&&e.selectedlength?n("div",{},[n("div",{staticClass:"work"},[n("div",{staticClass:"groupList"},[n("div",{staticClass:"groupCaption"},[n("span",{staticClass:"label"},[e._v("Selected ("+e._s(e.selectedlength)+")")])])]),n("div",{staticClass:"participants"},e._l(e.selected,(function(t){return n("div",{key:t.id||t,staticClass:"groupListName"},[n("preview",{attrs:{contact:e.usersinfo[t.id||t],mode:"mini"}}),t.id?e._e():n("i",{staticClass:"far fa-times-circle",on:{click:function(n){return e.toggleUser(t)}}})],1)})),0)])]):e._e()]),n("div",{staticClass:"work searchWrapperEA"},[n("search",{attrs:{minimize:e.minimized},on:{search:e.search}})],1),n("div",{staticClass:"work"},[0!==e.users.contacts.length?n("div",{staticClass:"titleContacts"},[n("span",[e._v(e._s(e.$t("caption.contacts")))])]):e._e(),n("list",{attrs:{mode:e.mode,selected:e.selected,users:e.users.contacts,title:"Contacts"},on:{toggleUser:e.toggleUser,select:e.select}})],1),n("div",{staticClass:"work"},[0!==e.users.contacts.length||e.searching||e.loading||e.inputText?e._e():n("div",{staticClass:"titleContacts empty"},[n("span",[e._v(e._s(e.$t("caption.contactsempty")))])])]),e.inputText.length&&(e.searching||0===e.users.contacts.length||e.users.search.length)?n("div",{staticClass:"searchResult"},[n("div",{staticClass:"work"},[0!==e.users.search.length?n("div",{staticClass:"titleSearchResult"},[n("span",[e._v(e._s(e.$t("caption.searchResult")))])]):e._e(),e.users.search.length?n("list",{attrs:{mode:e.mode,selected:e.selected,users:e.users.search,title:"Search results"},on:{toggleUser:e.toggleUser,select:e.select}}):e._e()],1),e.inputText.length>=3&&!e.users.search.length&&!e.loading&&!e.searching?n("div",{staticClass:"noSearchResult"},[n("span",[e._v(e._s(e.$t("caption.queryNoResults")))]),n("i",{staticClass:"fas fa-search"})]):e._e(),e.searching?n("div",{staticClass:"searching"},[n("div",{staticClass:"linepreloaderWrapper"},[n("linepreloader")],1)]):e._e()]):e._e()])])},i=[],o=n("2f62"),a=n("f978"),s=n("92a6"),c=n("d3ff"),l={name:"contacts",props:{mode:{type:String,default:function(){return""}},chatRoomId:String},components:{list:a["default"],contact:c["default"],preview:s["a"]},data:function(){return{loading:!1,searching:!1,fromSearch:[],inputText:"",groupContacts:[],groupName:"",contact:{},selected:{}}},mounted:function(){this.mode&&this.mode},created:function(){},watch:{},computed:Object(o["c"])({auth:e=>e.auth,window:function(){return window},users:function(){var e={contacts:[],search:[]};return e.contacts=_.filter(this.contactsMap,e=>{if(!this.inputText||e.name.toLowerCase().match(this.inputText.toLowerCase()))return!0}),e.search=_.filter(this.fromSearch,(e,t)=>!this.contactsMap[e.id]),e},...Object(o["c"])(["contactsMap","pocketnet","minimized","active","unauthorized"]),usersinfo:function(){return this.$store.state.users},u:function(){return this.$route.query.u},selectedlength:function(){return _.toArray(this.selected).length},contactsListFiltered(){var e=[],t=this.contactsMap,n=this.inputText;return _.each(t,(function(t,n){t.selected=!1,e.push(t)})),e.filter((function(e){return e.name.match(n)}))},gName:function(){var e=this.groupName;return e.replace(/ /g,"_")}}),methods:{select:function(e){this.$emit("select",e)},toggleUser:function(e){if(this.selected[e])this.$delete(this.selected,e);else{if(this.selectedlength>=11)return void this.$store.commit("icon",{icon:"warning",message:"At the moment, you can add no more than 12 users to the chat"});this.$set(this.selected,e,e)}this.$emit("selectedUsers",this.selected)},search(e){this.inputText=e,this.searching=!0,this.inputText?this.core.user.searchContacts(this.inputText).then(e=>{this.fromSearch=_.filter(e||[],e=>e.id!=this.core.user.userinfo.id)}).finally(()=>{this.searching=!1}):this.fromSearch=[]},invitepnt(){this.core.invitepnt()},inviteUserAction(e){var t=this.core.mtrx.client,n=this.chatRoomId,r=this;_.each(e,e=>{var i="@"+e+":"+r.core.domain;t.invite(n,i).then(e=>{})}),this.$emit("closeModal",!1)}}},u=l,d=n("2877");function f(e){var t=n("b4f6");t.__inject__&&t.__inject__(e)}var h=Object(d["a"])(u,r,i,!1,f,"12492b0b",null,!0);t["a"]=h.exports},"71e5":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".v-spinner{text-align:center}.v-spinner .v-clip{-webkit-animation:v-clipDelay .75s linear 0s infinite;animation:v-clipDelay .75s linear 0s infinite;-webkit-animation-fill-mode:both;animation-fill-mode:both;display:inline-block}@-webkit-keyframes v-clipDelay{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(180deg) scale(.8)}to{transform:rotate(1turn) scale(1)}}@keyframes v-clipDelay{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(180deg) scale(.8)}to{transform:rotate(1turn) scale(1)}}",""]),e.exports=t},7212:function(e,t,n){"use strict";n.r(t);var r=n("b0a4");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"722a":function(t,n,r){var i,o,a;(function(e,r){o=[],i=r,a="function"===typeof i?i.apply(n,o):i,void 0===a||(t.exports=a)})(0,(function(){var t=XMLHttpRequest;if(!t)throw new Error("missing XMLHttpRequest");r.log={trace:s,debug:s,info:s,warn:s,error:s};var n=18e4;function r(e,t){if("function"!==typeof t)throw new Error("Bad callback given: "+t);if(!e)throw new Error("No options given");var n=e.onResponse;if(e="string"===typeof e?{uri:e}:JSON.parse(JSON.stringify(e)),e.onResponse=n,e.verbose&&(r.log=c()),e.url&&(e.uri=e.url,delete e.url),!e.uri&&""!==e.uri)throw new Error("options.uri is a required argument");if("string"!=typeof e.uri)throw new Error("options.uri must be a string");for(var i=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],a=0;a>18&63,o=c>>12&63,a=c>>6&63,s=63&c,h[d++]=l.charAt(i)+l.charAt(o)+l.charAt(a)+l.charAt(s)}while(u299)&&r.error){for(var i in e=new Error("CouchDB error: "+(r.error.reason||r.error.error)),r)e[i]=r[i];return t(e,n,r)}return t(e,n,r)}},r}))},"72aa":function(e,t,n){var r=n("3fb5"),i=n("a255"),o=n("b672"),a=n("8707").Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}r(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},"738c":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".back-icon[data-v-7e97eec1]{cursor:pointer}.backbutton-caption[data-v-7e97eec1]{cursor:pointer;position:relative;left:1em}",""]),e.exports=t},"739c":function(e,t,n){var r=n("377e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("f92d7f0c",r,e)}},"73c2":function(e,t,n){var r=n("0cd0");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("237d0f98",r,e)}},7418:function(e,t){t.f=Object.getOwnPropertySymbols},7608:function(e,t,n){var r=n("8f4c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("8e00a578",r,e)}},"76a3":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".voiceMessage[data-v-0438bc11]{-webkit-tap-highlight-color:transparent;display:flex;contain:strict;width:230px;height:100%}.voiceMessage_wrapper[data-v-0438bc11]{display:flex;justify-content:flex-end;align-items:center;overflow:hidden;min-width:10em;padding:0 .5em;padding-right:1em;border-radius:2em;background:rgb(var(--background-secondary-theme))}.voiceMessage_toggle[data-v-0438bc11]{cursor:pointer;height:33px;width:33px;margin-right:.5em;border-radius:50%;background:rgb(var(--neutral-grad-1));display:flex;align-items:center;justify-content:center;color:rgb(var(--color-bg-ac))}.voiceMessage_toggle i[data-v-0438bc11]{font-size:.5em}.voiceMessage_graph[data-v-0438bc11]{position:relative;cursor:pointer}.voiceMessage_options[data-v-0438bc11]{display:flex;justify-content:center;margin-left:10px;padding:2px 10px;min-width:40px;background:rgb(var(--neutral-grad-1));border-radius:10px}.voiceMessage_options span[data-v-0438bc11]{font-size:.8em;color:rgb(var(--neutral-grad-3))}.voiceMessage.playing .voiceMessage_options span[data-v-0438bc11]{font-size:.8em;color:rgb(var(--color-bg-ac-bright))}.voiceMessage .fa-exclamation-circle[data-v-0438bc11]{font-size:.7em;color:rgb(var(--color-bad));padding:.5em}.voiceMessage .encsign[data-v-0438bc11]{position:absolute;right:0;top:0;bottom:0;display:flex;align-items:center;padding-right:.35em}.voiceMessage .encsign i[data-v-0438bc11]{font-size:.5em;color:rgb(var(--neutral-grad-2));opacity:.6}",""]),e.exports=t},"76df":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".imageWrapper[data-v-756bd822]{margin:0 auto;width:88px}.nameWrapper[data-v-756bd822]{margin-top:.5em;text-align:center}.nameWrapper span[data-v-756bd822]{font-size:2em;font-weight:100}",""]),e.exports=t},7704:function(e){e.exports=JSON.parse('{"caption":{"create":"Создать","addPublicChatName":"Имя Публичной комнаты","addGroupNamePlaceHolder":"Имя Чата","createPublicChat":"Создать публичный чат","chatTopic":"Топик изменён","publicRoomTitle":"Публичная комната","asModerator":"права модерации","marked":"Передал","unmarked":"Снял","removeBan":"Снять Бан","cancelModeration":"Снять модерцию","uploadFiles":"Загрузить файлы","header":"Заголовок","dragAndDropAFile":"Перетятите файл в эту область","chatInvite":"Вы приглашены в чат с","cantJoion":"Вы не можете присоединиться к чату с","chatInviteDecline":"Вы можете присоединиться к чату или отклонить приглашение","creatorLeft":"Так как создатель чата покинул его","encrypted":"Зашифровано ","noImages":"В чате пока нет изображений","noFiles":"В чате пока нет файлов","inviteUser":"Пригласить пользователя","invite":"Пригласить","add":"Добавить","mute":"Отключить звук","unmute":"Включить звук","leave":"Покинуть","Info":"Информация","new":"Новый","typing":"печатает","accNotFound":"Ваш аккаунт находится в процессе регистрации, пожалуйста, подождите...","emptyList":"Список пуст","welcome":"Добро пожаловать в чат!","startNewChat":"Начать новый чат","chats":"Чаты","shareWith":"Поделиться с","newChat":"Новый чат","moveToChat":"Перейти в чат","queryNoResults":"Нет результатов по запросу","needMoreCharacters":"Введите больше символов для поиска","createGroup":"Создать группу","unabletoDecrypt":"* Невозможно расшифровать","messageDeleted":"Сообщение удалено","sentImage":"отправлено изображение","sentVoiceMessage":"отправлено голосовое сообщение","invitationToChat":"Приглашение в чат","invitationToRoom":"Приглашение в комнату","leftChat":"покинул чат","joined":"присоединился","chatRenamed":"Чат переименован в ","recentComment":"Последний комментарий:","share":"Поделиться","followers":"Подписались","reputation":"Репутация","unsubscribe":"Отписаться","following":"Подписан","theme":"Тема:","contacts":"Контакты","phoneContacts":"Телефонные контакты","chooseInviteMedia":"Пожалуйста, выберите, способ приглашения","admin":"Админ","moderator":"Модератор","videocall":"Видеозвонок","call":"Звонок","leaveAndDelete":"Покинуть и удалить чат","donate":"Донат","makeModerator":"Сделать модератором","ban":"Бан","kick":"Исключить","members":"Участники","media":"Медиа","files":"Файлы","contactsList":"Список контактов","send":"Отправить","pageCaption":"Заголовок страницы","caption":"Заголовок","text":"текст","placeholder":"плейсхолдер","sendTransactionTo":"Послать транзакрию","toBePaidByReceiver":"Оплата получателем","toBePaidBySender":"Оплата отправителем","source":"Источник","amount":"Количество","receiver":"Получатель","message":"Сообщение","includeFeesInAmount":"Включить комиссию в сумму","transactionFees":"Комиссия за транзакцию","totalAmount":"Итого","balanceTooLow":"Баланс слишком низкий","transactionError":"Ошибка: нельзя совершить транзакцию","calculateFees":"Подсчитать комиссию","startChatWith":"Начать чат с","searchResult":"Результат поиска","joinedInTheChat":"вошел в чат","invited":"приглашен ","hasInvited":"приглашен ","inTheChat":" в чат","banned":"забанен","andRoom":"и комната","inRoom":"в комнате","left":"покинул","theChat":" чат ","made":"сделал ","aModerator":" модератором","editedChatNameTo ":"изменил имя чата на ","somebody":"Кто-то","sent":"отправлено","PKOINto":" PKOIN для ","response":"Ответ","edited":"Отредактировано","settings":"Настройки","unauthorized":"Неавторизован","search":"Поиск","replyOnMessage":"Ответить на сообщение","editMessage":"Редактировать сообщение","inviteFriend":"Пригласить друзей","emptyContactList":"Ваша книга контактов пуста","joinApp":"Присоединяйтесь ко мне в защищенном чате.","hasInvitedToJoin":"Это зашифрованный чат, который не привязывается к номеру телефона.","messagefrom":"Пересланное сообщение от","usernotgen":"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.","younotgen":"Please wait a minute, Your encryption keys are being generated...","messageRead":"Сообщение прочитано","open":"Открыть","You":"Вы","chatsearchingempty":"Чатов по данному фильтру не найдено","sendmessage":"Отправить сообщение"},"input":{"patientEmailPlaceholder":"Электронная почта","refillNamePlaceholder":"Заполнить имя еще раз"},"message":{},"button":{"starChatButton":"Начать чат","decline":"Отклонить","join":"Присоединиться","ok":"Ок","copy":"Скопировать","forward":"Переслать","delete":"Удалить","save":"Сохранить","reply":"Ответить","share":"Переслать","download":"Загрузить","downloaded":"Загружено","goToPocketnetProfile":"Перейти в профиль","sendFile":"Отправить файл","takePhotoOrVideo":"Отправить фотографию","sendCoins":"Отправить коины","edit":"Редактировать","select":"Выбрать","block":"Заблокировать","unblock":"Разблокировать","blockUser":"Заблокировать пользователя","Complain":"Пожаловаться"},"type":{"publicgroup":"Создать публичную группу","privategroup":"Создать приватную группу","one":"Чат один на один"},"typelabel":{"publicgroup":"Создание публичной группы","privategroup":"Создание приватной группы","one":"Создание чата один на один"},"yes":"Да","cancel":"Отменить","teamMessages":{"1-title":"Добро пожаловать в приватный чат Bastyon!","1-list1":"Личный мессенджер, который НЕ связан с вашим номером телефона","1-list2":"Конечное шифрование каждого разговора 1 на 1 по умолчанию","1-list3":"Все изображения, отправленные или полученные через чат, хранятся в зашифрованном виде","1-list4":"История сообщений сохраняется только в течение 7 дней","2-title":"Огромное объявление! Приложение Pocketnet теперь называется Bastyon!","2-message1":"Домен будет перенесен на Bastyon.com. Недавно мы выпустили следующие крупные обновления:","2-list1":"Частный зашифрованный мессенджер, не связанный с вашим номером телефона","2-list2":"Возможность пожертвовать PKOIN блогерам","2-list3":"Видео и прямая трансляция","2-message2":"Пригласите своих друзей сейчас и станьте частью большого будущего децентрализованного интернета!","2-button":"Пригласите друзей"},"sendingerror":"Возникла ошибка при отправке сообщения","details":"Подробнее","settings_pin":"Закрепить окно чата","checked":"Да","unchecked":"Нет","settings_read":"Отправлять отчёты о прочтении","messagewasburn":"Данное сообщение осталось только лишь в памяти вашего устройства","messagewillburn":"Сообщение скоро будет удалено","micaccessbrowser":"Доступ к микрофону запрещен настройками браузера, пожалуйста проверьте настройки.","micaccesscommonproblem":"Извините, по какой-то причине запись голосовых сообщений невозможна на устройстве.","micaccesscordova":"Доступ к микрофону запрещен настройками устройства, пожалуйста разрешите доступ к микрофону в настройках устройства.","micdevicenotfound":"Устройство для записи звука не найдено"}')},7747:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".deletedMessage[data-v-72e46191]{font-size:.8em;text-align:center;opacity:.6}.event[data-v-72e46191]{opacity:0;transition:.3s}.event.readyToRender[data-v-72e46191]{opacity:1}.event .loading[data-v-72e46191]{width:100%;height:100%;text-align:center}.event .deletedMessage[data-v-72e46191],.event .loading[data-v-72e46191]{position:relative;left:0;top:0;padding:.5em}",""]),e.exports=t},7769:function(e,t,n){"use strict";var r=n("a593");e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},"77ae":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".default .preloader span[data-v-3e6353d6]:nth-child(2){-webkit-animation:circle2-data-v-3e6353d6 1.5s infinite;animation:circle2-data-v-3e6353d6 1.5s infinite;transition-timing-function:ease-in-out;transform:translateX(1px);transform:scale(1.3);transform:translateY(1px)}.default .preloader span[data-v-3e6353d6]:first-child{-webkit-animation:circle1-data-v-3e6353d6 1.5s infinite;animation:circle1-data-v-3e6353d6 1.5s infinite;transition-timing-function:ease-in-out;transform:translateX(1px) translateY(1px) scale(.7)}.default .preloader span[data-v-3e6353d6]:nth-child(3){-webkit-animation:circle3-data-v-3e6353d6 1.5s infinite;animation:circle3-data-v-3e6353d6 1.5s infinite;transition-timing-function:ease-in-out;transform:translateX(1px);transform:scale(.7);transform:translateY(1px)}.spinner-eff.spinner-eff-3 .circle[data-v-3e6353d6]{border-radius:100px;position:absolute;left:0;right:0;margin:auto;transform:scale(1);transform-origin:center center}.spinner-eff.spinner-eff-3 .circle-1[data-v-3e6353d6]{width:100%;height:100%;background-color:#000;top:0;-webkit-animation:pulse-data-v-3e6353d6 1.6s linear 0s infinite;animation:pulse-data-v-3e6353d6 1.6s linear 0s infinite}.spinner-eff.spinner-eff-3 .circle-2[data-v-3e6353d6]{width:66.6%;height:66.6%;background-color:rgba(4,31,104,.4);top:16.5%;-webkit-animation:pulse-2-data-v-3e6353d6 1.6s linear 0s infinite;animation:pulse-2-data-v-3e6353d6 1.6s linear 0s infinite}.spinner-eff.spinner-eff-3 .circle-3[data-v-3e6353d6]{width:33.3%;height:33.3%;background-color:rgba(0,70,128,.6);top:33.3%}@-webkit-keyframes circle1-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@keyframes circle1-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@-webkit-keyframes circle2-data-v-3e6353d6{0%{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}50%{transform:translateY(17px) translateX(0) scale(2);background-color:#041f68}to{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}}@keyframes circle2-data-v-3e6353d6{0%{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}50%{transform:translateY(17px) translateX(0) scale(2);background-color:#041f68}to{transform:translateY(10px) translateX(0) scale(1.3);background-color:transparent}}@-webkit-keyframes circle3-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(-23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@keyframes circle3-data-v-3e6353d6{0%{transform:translateY(5px) translateX(0) scale(1.3)}50%{transform:translateY(0) translateX(-23px) scale(2);background-color:#041f68}to{transform:translateY(5px) translateX(0) scale(1.3)}}@-webkit-keyframes pulse-data-v-3e6353d6{0%{transform:scale(0)}50%{transform:scale(1.3);opacity:0}to{transform:scale(1.3);opacity:0}}@keyframes pulse-data-v-3e6353d6{0%{transform:scale(0)}50%{transform:scale(1.3);opacity:0}to{transform:scale(1.3);opacity:0}}@-webkit-keyframes pulse-2-data-v-3e6353d6{0%{transform:scale(0)}to{transform:scale(1.3);opacity:0}}@keyframes pulse-2-data-v-3e6353d6{0%{transform:scale(0)}to{transform:scale(1.3);opacity:0}}",""]),e.exports=t},"780f":function(e,t,n){"use strict";e.exports=i;var r=n("27bf");function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n("3fb5")(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"788e":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SERVICE_TYPES=void 0;const r=Object.freeze({IS:"SERVICE_TYPE_IS",IM:"SERVICE_TYPE_IM"});t.SERVICE_TYPES=r},"78ad":function(e,t,n){"use strict";n.r(t);var r=n("5faa");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"78db":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input,select,textarea{background-color:transparent;border-style:none;color:inherit;outline:none}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}",""]),e.exports=t},"790c":function(e,t,n){var r=n("6eca");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("5b848ab6",r,e)}},"79bb":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".namebuttoncreate[data-v-f0734632],.selectedtype[data-v-f0734632],.type[data-v-f0734632]{padding:1em;display:flex;align-items:center;border-bottom:1px solid rgb(var(--neutral-grad-0));white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer}.namebuttoncreate .icon i[data-v-f0734632],.selectedtype .icon i[data-v-f0734632],.type .icon i[data-v-f0734632]{width:30px;opacity:.7;font-size:.8em}.namebuttoncreate span[data-v-f0734632],.selectedtype span[data-v-f0734632],.type span[data-v-f0734632]{font-size:.9em}.namebuttoncreate button[data-v-f0734632],.selectedtype button[data-v-f0734632],.type button[data-v-f0734632]{white-space:nowrap;min-width:0!important}.namebuttoncreate input[data-v-f0734632],.selectedtype input[data-v-f0734632],.type input[data-v-f0734632]{width:auto}.namebuttoncreate .completewrapper[data-v-f0734632],.selectedtype .completewrapper[data-v-f0734632],.type .completewrapper[data-v-f0734632]{flex-grow:1;text-align:right}.namebuttoncreate[data-v-f0734632]{padding-top:0;padding-bottom:0}.namebuttoncreate>div[data-v-f0734632]{flex-grow:1}.namebuttoncreate input[data-v-f0734632]{width:100%;padding-top:1em;padding-bottom:1em}.selectedtype[data-v-f0734632]{background:rgb(var(--background-total-theme));position:sticky;top:-1px;z-index:12}.selectedtype .icon[data-v-f0734632]{cursor:pointer;transition:.3s}.selectedtype .icon[data-v-f0734632]:hover{opacity:.5}.selectedtype .label[data-v-f0734632]{font-weight:700;font-size:.8em}.oneonone[data-v-f0734632] .namebuttoncreate{display:none}.oneonone[data-v-f0734632] .searchWrapperEA{background:rgb(var(--background-total-theme));position:sticky;top:-1px;z-index:12;padding-bottom:.5em}",""]),e.exports=t},"79f0":function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixScheduler=s;var i=r(n("3987")),o=n("63c7");const a=!1;function s(e,t){this.retryAlgorithm=e||s.RETRY_BACKOFF_RATELIMIT,this.queueAlgorithm=t||s.QUEUE_MESSAGES,this._queues={},this._activeQueues=[],this._procFn=null}function c(e){e._procFn&&i.forEach(i.filter(i.keys(e._queues),(function(t){return-1===e._activeQueues.indexOf(t)&&e._queues[t].length>0})),(function(t){e._activeQueues.push(t),f("Spinning up queue: '%s'",t),l(e,t)}))}function l(e,t){const n=u(e,t);if(!n){const n=e._activeQueues.indexOf(t);return n>=0&&e._activeQueues.splice(n,1),void f("Stopping queue '%s' as it is now empty",t)}f("Queue '%s' has %s pending events",t,e._queues[t].length),Promise.resolve().then(()=>e._procFn(n.event)).then((function(r){d(e,t),f("Queue '%s' sent event %s",t,n.event.getId()),n.defer.resolve(r),l(e,t)}),(function(r){n.attempts+=1;const i=e.retryAlgorithm(n.event,n.attempts,r);f("retry(%s) err=%s event_id=%s waitTime=%s",n.attempts,r,n.event.getId(),i),-1===i?(f("Queue '%s' giving up on event %s",t,n.event.getId()),d(e,t),n.defer.reject(r),l(e,t)):setTimeout((function(){l(e,t)}),i)}))}function u(e,t){const n=e._queues[t];return i.isArray(n)?n[0]:null}function d(e,t){const n=e._queues[t];return i.isArray(n)?n.shift():null}function f(){a&&o.logger.log(...arguments)}s.prototype.getQueueForEvent=function(e){const t=this.queueAlgorithm(e);return t&&this._queues[t]?i.map(this._queues[t],(function(e){return e.event})):null},s.prototype.removeEventFromQueue=function(e){const t=this.queueAlgorithm(e);if(!t||!this._queues[t])return!1;let n=!1;return i.removeElement(this._queues[t],(function(t){if(t.event.getId()===e.getId())return n=!0,!0})),n},s.prototype.setProcessFunction=function(e){this._procFn=e,c(this)},s.prototype.queueEvent=function(e){const t=this.queueAlgorithm(e);if(!t)return null;this._queues[t]||(this._queues[t]=[]);const n=i.defer();return this._queues[t].push({event:e,defer:n,attempts:0}),f("Queue algorithm dumped event %s into queue '%s'",e.getId(),t),c(this),n.promise},s.RETRY_BACKOFF_RATELIMIT=function(e,t,n){if(400===n.httpStatus||403===n.httpStatus||401===n.httpStatus)return-1;if("rejected"===n.cors)return-1;if("M_TOO_LARGE"===n.name)return-1;if("M_LIMIT_EXCEEDED"===n.name){const e=n.data.retry_after_ms;if(e>0)return e}return t>4?-1:1e3*Math.pow(2,t)},s.QUEUE_MESSAGES=function(e){return"m.room.message"===e.getType()||e.hasAssocation()?"message":null}},"7a1f":function(e,t,n){"use strict";(function(e){var r=n("4a1e");function i(e){e.component("vue-page-transition",r["a"])}const o={version:1,install:i};t["a"]=o;let a=null;"undefined"!==typeof window?a=window.Vue:"undefined"!==typeof e&&(a=e.Vue),a&&a.use(o)}).call(this,n("c8ba"))},"7a77":function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},"7aac":function(e,t,n){"use strict";var r=n("c532");e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7acf":function(e,t,n){"use strict";n.r(t);var r=n("d3b8");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"7b0b":function(e,t,n){var r=n("1d80"),i=Object;e.exports=function(e){return i(r(e))}},"7c16":function(e,t,n){e.exports=n("d6dd")},"7cd7":function(e,t,n){"use strict";n.r(t);var r=n("8713");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"7d2a":function(e,t){var n=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!==typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!==typeof t)throw new TypeError("Key length not a number");if(t<0||t>n||t!==t)throw new TypeError("Bad key length")}},"7d72":function(e,t,n){"use strict";var r=n("62c8").Buffer,i=r.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){if(!e)return"utf8";var t;while(1)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!==typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=p,this.end=m,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=v,this.end=g,t=3;break;default:return this.write=y,void(this.end=b)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function c(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function l(e,t,n){var r=t.length-1;if(r=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0))}function u(e,t,n){if(128!==(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){var n=l(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function m(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function v(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function y(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return ndiv[data-v-a8a70f9c]{transition:.3s;opacity:0;color:rgb(var(--text-on-bg-ac-color));vertical-align:middle;text-align:center}#maincontent .expandp[data-v-a8a70f9c]:before{--size:0;content:"";position:absolute;left:var(--x);top:50%;width:var(--size);height:var(--size);background:radial-gradient(circle closest-side,rgba(0,24,48,.34902),transparent);transform:translate(-50%,-50%);transition:.3s}#maincontent .expandp:hover .etable>div[data-v-a8a70f9c]{opacity:1}#maincontent .expandp[data-v-a8a70f9c]:hover:before{--size:400px}#maincontent.bout .expandp[data-v-a8a70f9c]{display:none}#maincontent[data-v-a8a70f9c] .resize-observer{height:1px;overflow:hidden}#maincontent .headerSpacer[data-v-a8a70f9c]{position:static;left:0;right:0;top:0;bottom:0;padding-bottom:0;margin:0 auto;max-width:640px}#maincontent .headerSpacerWrapper[data-v-a8a70f9c]{position:absolute;left:0;right:0;top:calc(65px + var(--app-margin-top));bottom:90px;overflow-y:auto;overflow-x:hidden}#maincontent .headerSpacerWrapperOvf[data-v-a8a70f9c]{position:absolute;left:0;right:0;top:0;bottom:0;overflow-y:scroll;overflow-x:hidden;overscroll-behavior:contain}#maincontent.minimized .headerSpacerWrapper[data-v-a8a70f9c]{top:55px}#maincontent.minimized.fix .headerSpacerWrapper[data-v-a8a70f9c]{overflow-y:inherit;overflow-x:inherit;top:0;bottom:103px;will-change:transform;transition:transform .3s}#maincontent.minimized.fix:not(.active):not(.unauthorized) .headerSpacerWrapperOvf[data-v-a8a70f9c]{-webkit-mask-image:linear-gradient(0deg,transparent 3%,#000 10%);mask-image:linear-gradient(0deg,transparent 3%,#000 10%)}#maincontent.minimized.fix[data-v-a8a70f9c]:not(.active):not(.unauthorized) .maskedtop{-webkit-mask-image:linear-gradient(180deg,transparent 3%,#000 10%);mask-image:linear-gradient(180deg,transparent 3%,#000 10%)}#maincontent.minimized.fix .headerSpacerWrapperOvf[data-v-a8a70f9c]{position:relative;width:344px;height:100%;overflow:visible;will-change:transform;transition:transform .3s}#maincontent.minimized.fix .headerSpacer[data-v-a8a70f9c]{position:absolute;height:100%;left:0;width:344px;padding:0;overflow-x:hidden;will-change:transform;overscroll-behavior:contain}#maincontent.minimized.fix.active .expandp[data-v-a8a70f9c]{display:none}#maincontent.minimized.fix.active .headerSpacerWrapper[data-v-a8a70f9c]{transform:translateZ(0);z-index:130}#maincontent.minimized.fix.active .headerSpacerWrapperOvf[data-v-a8a70f9c]{transform:translate3d(-300px,4px,0)}#maincontent.minimized.fix.active .headerSpacerWrapperOvf .headerSpacer[data-v-a8a70f9c]{border-radius:8px;border-top-left-radius:0;border-top-right-radius:0;background:rgb(var(--background-total-theme));border:1px solid rgba(var(--neutral-grad-2),.2);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7);right:0}.modalcommoncontent[data-v-a8a70f9c] .previewContact{padding-left:.75em}',""]),e.exports=t},"7e78":function(e,t,n){var r=n("3fb5"),i=n("b672"),o=n("8707").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function l(e){return e<<1|e>>>31}function u(e){return e<<5|e>>>27}function d(e){return e<<30|e>>>2}function f(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=l(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var p=~~(h/20),m=u(n)+f(p,r,i,o)+s+t[h]+a[p]|0;s=o,o=i,i=d(r),r=n,n=m}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},"7f9a":function(e,t,n){var r=n("da84"),i=n("1626"),o=n("8925"),a=r.WeakMap;e.exports=i(a)&&/native code/.test(o(a))},"7ffb":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".eventMember[data-v-54a240c2]{display:flex;align-items:center;padding-left:.25em}.eventMember .iconWrapper[data-v-54a240c2]{width:33px;height:33px;margin-right:.5em}.eventMember .labelwrapper[data-v-54a240c2]{line-height:.9em;padding-bottom:7px;max-width:80%}.eventMember .labelwrapper span[data-v-54a240c2]{vertical-align:middle}",""]),e.exports=t},8056:function(e,t,n){var r=n("7747");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("21496148",r,e)}},"810b":function(e,t,n){var r=n("d270");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2d214bb3",r,e)}},8157:function(e,t,n){var r=n("7e59");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("6b42ebab",r,e)}},8183:function(e,t,n){var r=n("738c");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2aed7758",r,e)}},"81bf":function(e,t,n){"use strict";n.r(t);var r=n("a14c");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"820f":function(e,t,n){"use strict";var r=n("a593");e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},"825a":function(e,t,n){var r=n("861d"),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw o(i(e)+" is not an object")}},"826f":function(e,t,n){"use strict";n.r(t);var r=n("0b70");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"827e":function(e,t,n){"use strict";var r=n("480d");function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e,t=new i((function(t){e=t}));return{token:t,cancel:e}},e.exports=i},"83ab":function(e,t,n){var r=n("d039");e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"83b9":function(e,t,n){"use strict";var r=n("d925"),i=n("e683");e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},"848b":function(e,t,n){"use strict";var r=n("4a0c"),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},a=r.version.split(".");function s(e,t){for(var n=t?t.split("."):a,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]0){var o=r[i],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}}i.transitional=function(e,t,n){var i=t&&s(t);function a(e,t){return"[Axios v"+r.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(a(r," has been removed in "+t));return i&&!o[r]&&(o[r]=!0,console.warn(a(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={isOlderVersion:s,assertOptions:c,validators:i}},"85fe":function(e,t,n){"use strict";(function(e){function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},a=function(a){for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u1){var r=e.find((function(e){return e.isIntersecting}));r&&(t=r)}if(n.callback){var i=t.isIntersecting&&t.intersectionRatio>=n.threshold;if(i===n.oldResult)return;n.oldResult=i,n.callback(i,t)}}),this.options.intersection),t.context.$nextTick((function(){n.observer&&n.observer.observe(n.el)}))}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&this.options.intersection.threshold||0}}]),e}();function m(e,t,n){var r=t.value;if(r)if("undefined"===typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new p(e,r,n);e._vue_visibilityState=i}}function v(e,t,n){var r=t.value,i=t.oldValue;if(!h(r,i)){var o=e._vue_visibilityState;r?o?o.createObserver(r,n):m(e,{value:r},n):g(e)}}function g(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var y={bind:m,update:v,unbind:g};function b(e){e.directive("observe-visibility",y)}var _={version:"0.4.6",install:b},w=null;"undefined"!==typeof window?w=window.Vue:"undefined"!==typeof e&&(w=e.Vue),w&&w.use(_)}).call(this,n("c8ba"))},"861d":function(e,t,n){var r=n("1626");e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},8707:function(e,t,n){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var r=n("b639"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},8713:function(e,t,n){var r=n("1507");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("80c5bd92",r,e)}},"87d6":function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.User=a;var i=r(n("3987")),o=n("faa1");function a(e){this.userId=e,this.presence="offline",this.presenceStatusMsg=null,this._unstable_statusMessage="",this.displayName=e,this.rawDisplayName=e,this.avatarUrl=null,this.lastActiveAgo=0,this.lastPresenceTs=0,this.currentlyActive=!1,this.events={presence:null,profile:null},this._updateModifiedTime()}i.inherits(a,o.EventEmitter),a.prototype.setPresenceEvent=function(e){if("m.presence"!==e.getType())return;const t=null===this.events.presence;this.events.presence=e;const n=[];(e.getContent().presence!==this.presence||t)&&n.push("User.presence"),e.getContent().avatar_url&&e.getContent().avatar_url!==this.avatarUrl&&n.push("User.avatarUrl"),e.getContent().displayname&&e.getContent().displayname!==this.displayName&&n.push("User.displayName"),void 0!==e.getContent().currently_active&&e.getContent().currently_active!==this.currentlyActive&&n.push("User.currentlyActive"),this.presence=e.getContent().presence,n.push("User.lastPresenceTs"),e.getContent().status_msg&&(this.presenceStatusMsg=e.getContent().status_msg),e.getContent().displayname&&(this.displayName=e.getContent().displayname),e.getContent().avatar_url&&(this.avatarUrl=e.getContent().avatar_url),this.lastActiveAgo=e.getContent().last_active_ago,this.lastPresenceTs=Date.now(),this.currentlyActive=e.getContent().currently_active,this._updateModifiedTime();for(let r=0;r([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var f=0;f=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){l.headers[e]=i.merge(a)})),t.exports=l}).call(this,r("4362"))},"8ba6":function(e,t,n){var r=n("3d2e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("6d85e643",r,e)}},"8be6":function(e,t,n){var r=n("8707").Buffer;e.exports=function(e,t,n){if(r.isBuffer(e))return e;if("string"===typeof e)return r.from(e,t);if(ArrayBuffer.isView(e))return r.from(e.buffer);throw new TypeError(n+" must be a string, a Buffer, a typed array or a DataView")}},"8cd8":function(e,t,n){"use strict";n.r(t);var r=n("2eac");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"8d7d":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".previewWrapper[data-v-951b8314]{display:flex;align-items:center;width:100%}.previewWrapper .settingsWrapper[data-v-951b8314]{width:50px;text-align:center;opacity:.2}.previewWrapper .iconWrapper[data-v-951b8314]{width:44px}.previewWrapper .infoWrapper[data-v-951b8314]{padding-left:.5em;flex-grow:1}.emptyEvent span[data-v-951b8314]{color:rgb(var(--color-good));font-size:.8em}.contacts-preview[data-v-951b8314]{width:100%}.summaryLine[data-v-951b8314]{display:flex}.summaryLine .caption[data-v-951b8314]{flex-grow:1}.summaryLine .caption[data-v-951b8314] span{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700}",""]),e.exports=t},"8db5":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'/*! HTML5 Boilerplate v7.3.0 | MIT License | https://html5boilerplate.com/ */:root{--app-margin-top-default:0px;--app-margin-top:max(env(safe-area-inset-top),var(--app-margin-top-default));--safe-area-inset-top:0px;--safe-area-inset-right:0px;--safe-area-inset-bottom:0px;--safe-area-inset-left:0px}@supports (padding-top:constant(safe-area-inset-top)){:root{--safe-area-inset-top:constant(safe-area-inset-top,0);--safe-area-inset-right:constant(safe-area-inset-right,0);--safe-area-inset-bottom:constant(safe-area-inset-bottom,0);--safe-area-inset-left:constant(safe-area-inset-left,0)}}@supports (padding-top:env(safe-area-inset-top)){:root{--safe-area-inset-top:env(safe-area-inset-top,0);--safe-area-inset-right:env(safe-area-inset-right,0);--safe-area-inset-bottom:env(safe-area-inset-bottom,0);--safe-area-inset-left:env(safe-area-inset-left,0)}}:root{--background-hidden-layer:255,255,255;--background-total-theme:255,255,255;--background-secondary-theme:250,250,250;--background-main:240,242,245;--background-main-contrast:10,12,23;--color-medium-theme:199,200,217;--neutral-grad-0:235,235,240;--neutral-grad-1:227,228,235;--neutral-grad-2:142,144,166;--neutral-grad-3:85,87,112;--neutral-grad-4:64,65,82;--text-color:10,12,23;--text-on-main-bg-color:85,87,112;--text-on-bg-ac-color:255,255,255;--color-bg-ac-bright:0,163,247;--color-bg-ac:0,164,255;--color-bg-ac-1:0,142,191;--color-bg-ac-2:250,110,132;--color-bg-selection:179,212,252;--color-txt-ac:0,164,255;--color-txt-ac-1:0,142,191;--color-txt-ac-2:250,110,132;--color-txt-gray:70,71,98;--color-txt-gray-dark:53,53,63;--color-bg-orange:255,59,0;--color-txt-orange:255,72,0;--color-star-yellow:255,174,0;--color-shadow-base:2,18,24;--color-shadow-var:32,35,42;--text-on-bg-shadow-color:255,255,255;--color-bad:244,26,77;--color-nrml:0,0,0;--color-good:7,108,52;--color-yellow:255,238,0}:root,:root[theme=black]{--voice-message-fillStyle:81,129,184}:root[theme=black]{--background-hidden-layer:10,12,23;--background-total-theme:18,22,33;--background-secondary-theme:24,36,52;--background-main:14,28,43;--background-main-contrast:240,242,245;--color-medium-theme:99,100,117;--neutral-grad-0:16,16,17;--neutral-grad-1:34,34,37;--neutral-grad-2:59,59,71;--neutral-grad-3:77,78,92;--neutral-grad-4:85,87,112;--text-color:178,171,172;--text-on-main-bg-color:85,87,112;--text-on-bg-ac-color:255,255,255;--color-bg-ac-bright:0,90,200;--color-bg-ac:0,80,190;--color-bg-ac-1:0,142,191;--color-bg-ac-2:250,110,132;--color-bg-selection:179,212,252;--color-txt-ac:0,164,255;--color-txt-ac-1:0,142,191;--color-txt-ac-2:250,110,132;--color-txt-gray:103,105,128;--color-txt-gray-dark:113,113,134;--color-bg-orange:255,72,0;--text-txt-orange:255,72,0;--color-shadow-base:12,14,33;--color-shadow-var:18,18,26;--text-on-bg-shadow-color:214,219,230;--color-bad:244,26,77;--color-nrml:0,0,0;--color-good:7,108,52;--color-yellow:255,238,0}html{font-size:1em;line-height:1.4;position:relative;overflow-y:hidden;overflow-x:hidden;background:rgb(var(--background-total-theme))}body,html{min-height:100%}body{height:100%}*{box-sizing:border-box}a{color:inherit}::-moz-selection{background:#b3d4fc;text-shadow:none}::selection{background:#b3d4fc;text-shadow:none}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}audio,canvas,iframe,img,svg,video{vertical-align:middle}fieldset{border:0;margin:0;padding:0}textarea{resize:vertical}.browserupgrade{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.hidden{display:none!important}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.sr-only.focusable:active,.sr-only.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;white-space:inherit;width:auto}.invisible{visibility:hidden}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}@media print{*,:after,:before{background:transparent!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}}',""]),e.exports=t},"8df4":function(e,t,n){"use strict";var r=n("7a77");function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e,t=new i((function(t){e=t}));return{token:t,cancel:e}},e.exports=i},"8e08":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}}t.IntegrityError=r;class i extends Error{constructor(e){super(e),Object.setPrototypeOf(this,i.prototype)}}t.NotImplementedError=i},"8e26":function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0});const o=r("69fc"),a=r("bbd4");class s{constructor(e,t,n){this._cipher=e,this._subkey1=t,this._subkey2=n,this._bufferPos=0,this._finished=!1,this._buffer=new o.default}static importKey(e,t){return i(this,void 0,void 0,(function*(){const n=yield e.importBlockCipherKey(t),r=new o.default;yield n.encryptBlock(r),r.dbl();const i=r.clone();return i.dbl(),new s(n,r,i)}))}reset(){return this._buffer.clear(),this._bufferPos=0,this._finished=!1,this}clear(){this.reset(),this._subkey1.clear(),this._subkey2.clear()}update(e){return i(this,void 0,void 0,(function*(){const t=o.default.SIZE-this._bufferPos;let n=0,r=e.length;if(r>t){for(let n=0;no.default.SIZE){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:"";if("function"!=typeof e)throw"imageLoaded directive error: objet "+e+" should be a function "+t}function l(e,t){var n=t.value,r=t.arg,i=t.modifiers;if(!r)return c(n),void e.on("always",(function(e){return setTimeout((function(){return n(e)}))}));var o=!!i&&!!(0,f.default)(i).length,a=o?i:n,s=o?function(e){return n}:function(e){return n[e]},l=function(){var t=s(u);c(t,o?"":"property "+u+" of "+n),e[r](u,(function(e,n){return setTimeout((function(){return t(e,n)}))}))};for(var u in a)l()}function u(e,t){var n=(0,h.default)(e),r=n.images.map((function(e){return{img:e.img,src:e.img.src}})),i=e.__imagesLoaded__.context;s(i,r)||(l(n,t),(0,d.default)(e.__imagesLoaded__,{context:r,imageLoaded:n}))}Object.defineProperty(t,"__esModule",{value:!0});var d=a(n),f=a(r),h=a(i),p=a(o);t.default={bind:function(e){e.__imagesLoaded__={context:[]}},inserted:function(e,t){u(e,t)},componentUpdated:function(e,t){p.default.nextTick((function(){u(e,t)}))},unbind:function(e,t){e.__imagesLoaded__=null}},e.exports=t.default}))},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){e.exports=!n(2)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(4),i=n(1),o=n(21),a=n(25),s="prototype",c=function(e,t,n){var l,u,d,f=e&c.F,h=e&c.G,p=e&c.S,m=e&c.P,v=e&c.B,g=e&c.W,y=h?i:i[t]||(i[t]={}),b=y[s],_=h?r:p?r[t]:(r[t]||{})[s];for(l in h&&(n=t),n)u=!f&&_&&void 0!==_[l],u&&l in y||(d=u?_[l]:n[l],y[l]=h&&"function"!=typeof _[l]?n[l]:v&&u?o(d,r):g&&_[l]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[s]=e[s],t}(d):m&&"function"==typeof d?o(Function.call,d):d,m&&((y.virtual||(y.virtual={}))[l]=d,e&c.R&&b&&!b[l]&&a(b,l,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(20);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(30),i=n(23);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(8),i=n(6);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(6);e.exports=function(e){return Object(r(e))}},function(e,t,n){e.exports={default:n(15),__esModule:!0}},function(e,t,n){e.exports={default:n(16),__esModule:!0}},function(e,t,n){n(40),e.exports=n(1).Object.assign},function(e,t,n){n(41),e.exports=n(1).Object.keys},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(5);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(11),i=n(37),o=n(36);e.exports=function(e){return function(t,n,a){var s,c=r(t),l=i(c.length),u=o(a,l);if(e&&n!=n){for(;l>u;)if(s=c[u++],s!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(17);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(5),i=n(4).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(28),i=n(33);e.exports=n(3)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(3)&&!n(2)((function(){return 7!=Object.defineProperty(n(22)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){"use strict";var r=n(9),i=n(29),o=n(31),a=n(12),s=n(8),c=Object.assign;e.exports=!c||n(2)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r}))?function(e,t){for(var n=a(e),c=arguments.length,l=1,u=i.f,d=o.f;c>l;)for(var f,h=s(arguments[l++]),p=u?r(h).concat(u(h)):r(h),m=p.length,v=0;m>v;)d.call(h,f=p[v++])&&(n[f]=h[f]);return n}:c},function(e,t,n){var r=n(18),i=n(26),o=n(38),a=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(24),i=n(11),o=n(19)(!1),a=n(34)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),c=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~o(l,n)||l.push(n));return l}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(7),i=n(1),o=n(2);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(35)("keys"),i=n(39);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(4),i="__core-js_shared__",o=r[i]||(r[i]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){var r=n(10),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(10),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(5);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(7);r(r.S+r.F,"Object",{assign:n(27)})},function(e,t,n){var r=n(12),i=n(9);n(32)("keys",(function(){return function(e){return i(r(e))}}))},function(e,t,n){var r,i;!function(o,a){r=a,i="function"==typeof r?r.call(t,n,t,e):r,void 0===i||(e.exports=i)}("undefined"!=typeof window&&window,(function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{},r=n[e]=n[e]||{};return r[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=0,i=n[r];t=t||[];for(var o=this._onceEvents&&this._onceEvents[e];i;){var a=o&&o[i];a&&(this.off(e,i),delete o[i]),i.apply(this,t),r+=a?0:1,i=n[r]}return this}},e}))},function(e,t,n){var r,i; /*! @@ -25,23 +25,23 @@ var r=n("b639"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e * MIT License */!function(o,a){"use strict";r=[n(42)],i=function(e){return a(o,e)}.apply(t,r),void 0===i||(e.exports=i)}(window,(function(e,t){"use strict";function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){var t=[];if(Array.isArray(e))t=e;else if("number"==typeof e.length)for(var n=0;n=0?r:n+r;return s<0||s>=n?void 0:t[s]}))},"90e3":function(e,t,n){var r=n("e330"),i=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},9112:function(e,t,n){var r=n("83ab"),i=n("9bf2"),o=n("5c6c");e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},9152:function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<>1,u=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=f,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,c,l=8*o-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),t+=a+d>=1?f/c:f*Math.pow(2,1-d),t*c>=2&&(a++,c/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,l-=8);e[n+h-p]|=128*m}},"91dd":function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!==typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var c=1e3;o&&"number"===typeof o.maxKeys&&(c=o.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var u=0;u=0?(d=m.substr(0,v),f=m.substr(v+1)):(d=m,f=""),h=decodeURIComponent(d),p=decodeURIComponent(f),r(a,h)?i(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},9205:function(e,t,n){"use strict";n.r(t);var r=n("5e55");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"92a6":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"contacts-preview"},[n("div",{staticClass:"previewWrapper",style:e.isUser},[n("div",{staticClass:"iconWrapper"},[n("userpic",{attrs:{userinfo:e.contact,mode:"Contacts"}})],1),n("div",{staticClass:"infoWrapper"},[n("div",{staticClass:"summaryLine"},[n("div",{staticClass:"caption"},[n("span",[e._v(e._s(e.contact.name))])])])])])])},i=[],o=n("2f62"),a={name:"contactsPreview",props:{contact:{},mode:{default:"",type:String},user:null},components:{},data:function(){return{loading:!1,isUser:"",asd:{}}},computed:Object(o["c"])({auth:e=>e.auth}),methods:{},mounted(){}},s=a,c=n("2877");function l(e){var t=n("4001");t.__inject__&&t.__inject__(e)}var u=Object(c["a"])(s,r,i,!1,l,"951b8314",null,!0);t["a"]=u.exports},"93e6":function(e,t,n){"use strict";var r=n("8707").Buffer,i=n("e372").Transform,o=n("3fb5");function a(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}function s(e){i.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}o(s,i),s.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(i){r=i}n(r)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(n){t=n}e(t)},s.prototype.update=function(e,t){if(a(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));var n=this._block,i=0;while(this._blockOffset+e.length-i>=this._blockSize){for(var o=this._blockOffset;o0;++s)this._length[s]+=c,c=this._length[s]/4294967296|0,c>0&&(this._length[s]-=4294967296*c);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=s},"94bc":function(e,t,n){var r=n("fbbb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("341a8e06",r,e)}},"94ca":function(e,t,n){var r=n("d039"),i=n("1626"),o=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n==u||n!=l&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},9523:function(e,t){function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},"956b":function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0});const o=r("b8d8"),a=r("ffd9"),s=r("bbd4"),c=r("8e08"),l=r("69fc"),u=r("8e26"),d=r("9bed"),f=r("9060");n.MAX_ASSOCIATED_DATA=126;class h{static importKey(e,t,n=new f.WebCryptoProvider){return i(this,void 0,void 0,(function*(){if(32!==e.length&&64!==e.length)throw new Error("AES-SIV: key must be 32 or 64-bytes (got "+e.length);const r=e.subarray(0,e.length/2|0),i=e.subarray(e.length/2|0);let o;switch(t){case"AES-SIV":o=yield u.CMAC.importKey(n,r);break;case"AES-CMAC-SIV":o=yield u.CMAC.importKey(n,r);break;case"AES-PMAC-SIV":o=yield d.PMAC.importKey(n,r);break;default:throw new c.NotImplementedError("Miscreant: algorithm not supported: "+t)}const a=yield n.importCTRKey(i);return new h(o,a)}))}constructor(e,t){this._mac=e,this._ctr=t,this._tmp1=new l.default,this._tmp2=new l.default}seal(e,t){return i(this,void 0,void 0,(function*(){if(t.length>n.MAX_ASSOCIATED_DATA)throw new Error("AES-SIV: too many associated data items");const r=l.default.SIZE+e.length,i=new Uint8Array(r),o=yield this._s2v(t,e);return i.set(o),p(o),i.set(yield this._ctr.encryptCtr(o,e),o.length),i}))}open(e,t){return i(this,void 0,void 0,(function*(){if(t.length>n.MAX_ASSOCIATED_DATA)throw new Error("AES-SIV: too many associated data items");if(e.length=l.default.SIZE){const e=t.length-l.default.SIZE;this._tmp1.data.set(t.subarray(e)),yield this._mac.update(t.subarray(0,e))}else this._tmp1.data.set(t),this._tmp1.data[t.length]=128,this._tmp2.dbl();return s.xor(this._tmp1.data,this._tmp2.data),yield this._mac.update(this._tmp1.data),this._mac.finish()}))}}function p(e){e[e.length-8]&=127,e[e.length-4]&=127}n.SIV=h},9589:function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.SearchResult=a;var i=r(n("3987")),o=n("bb76");function a(e,t){this.rank=e,this.context=t}a.fromJson=function(e,t){const n=e.context||{},r=n.events_before||[],s=n.events_after||[],c=new o.EventContext(t(e.result));return c.setPaginateToken(n.start,!0),c.addEvents(i.map(r,t),!0),c.addEvents(i.map(s,t),!1),c.setPaginateToken(n.end,!1),new a(e.rank,c)}},"966d":function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!==typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:o=new Array(s-1),a=0;while(a{const t=e.getPushActions(),n=this._pushProcessor.actionsForEvent(e);e.setPushActions(n);const r=this.getRoom(e.getRoomId());if(!r)return;const i=r.getUnreadNotificationCount("highlight"),o=!(!t||!t.tweaks)&&!!t.tweaks.highlight,a=!(!n||!n.tweaks)&&!!n.tweaks.highlight;if((o!==a||i>0)&&!r.hasUserReadEvent(this.getUserId(),e.getId())){let e=i;a&&!o&&e++,!a&&o&&e--,r.setUnreadNotificationCount("highlight",e);const t=r.getUnreadNotificationCount("total");t{if(t&&this.isRoomEncrypted(t.roomId)){const n=e.getContent(),r=Object.keys(n).filter(e=>Object.keys(n[e]["m.read"]).includes(this.getUserId())).length>0;if(!r)return;const i=20,o=t.getLiveTimeline().getEvents();let a=0;for(let e=o.length-1;e>=0;e--){if(e===o.length-i)return;const n=o[e];if(t.hasUserReadEvent(this.getUserId(),n.getId()))break;const r=this.getPushActionsForEvent(n);a+=r.tweaks&&r.tweaks.highlight?1:0}t.setUnreadNotificationCount("highlight",a)}})}function D(e,t,n,r,i,o){return L.apply(this,arguments)}function L(){return L=i((function*(e,t,n,r,i,o){if(!e._crypto)throw new Error("End-to-End encryption disabled");yield e._crypto.setDeviceVerification(t,n,r,i,o)})),L.apply(this,arguments)}function N(e,t){for(const n of t)e.prototype[n]=function(){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto[n](...arguments)}}function $(e,t,n,r){return Promise.resolve().then((function(){const r=U(e,n,t);return r?(F(t,n,f.EventStatus.ENCRYPTING),r.then(()=>{F(t,n,f.EventStatus.SENDING)})):null})).then((function(){let r;return e.scheduler&&(r=e.scheduler.queueEvent(n),r&&e.scheduler.getQueueForEvent(n).length>1&&F(t,n,f.EventStatus.QUEUED)),r||(r=z(e,n),t&&(r=r.then(e=>(t.updatePendingEvent(n,f.EventStatus.SENT,e.event_id),e)))),r})).then((function(e){return r&&r(null,e),e}),(function(e){k.logger.error("Error sending event",e.stack||e);try{n.error=e,F(t,n,f.EventStatus.NOT_SENT),e.event=n,r&&r(e)}catch(i){k.logger.error("Exception in error handler!",i.stack||e)}throw e}))}function U(e,t,n){if(t.isEncrypted())return null;if(!e.isRoomEncrypted(t.getRoomId()))return null;if(!e._crypto&&e.usingExternalCrypto)return null;if("m.reaction"===t.getType())return null;if(!e._crypto)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return e._crypto.encryptEvent(t,n)}function B(e,t,n){if("m.reaction"===n)return n;const r=e.isRoomEncrypted(t);return r?"m.room.encrypted":n}function F(e,t,n){e?e.updatePendingEvent(t,n):t.setStatus(n)}function z(e,t){let n=t.getTxnId();n||(n=e.makeTxnId(),t.setTxnId(n));const r={$roomId:t.getRoomId(),$eventType:t.getWireType(),$stateKey:t.getStateKey(),$txnId:n};let i;if(t.isState()){let e="/rooms/$roomId/state/$eventType";t.getStateKey()&&t.getStateKey().length>0&&(e="/rooms/$roomId/state/$eventType/$stateKey"),i=y.encodeUri(e,r)}else if(t.isRedaction()){const e="/rooms/$roomId/redact/$redactsEventId/$txnId";i=y.encodeUri(e,Object.assign({$redactsEventId:t.event.redacts},r))}else i=y.encodeUri("/rooms/$roomId/send/$eventType/$txnId",r);return e._http.authedRequest(void 0,"PUT",i,void 0,t.getWireContent()).then(e=>(k.logger.log(`Event sent to ${t.getRoomId()} with event id ${e.event_id}`),e))}function q(e,t,n,r,i,o){y.isFunction(i)&&(o=i,i=void 0);const a=y.encodeUri("/rooms/$roomId/state/m.room.member/$userId",{$roomId:t,$userId:n});return e._http.authedRequest(o,"PUT",a,void 0,{membership:r,reason:i})}function W(e,t,n,r,i,o){y.isFunction(i)&&(o=i,i=void 0);const a=y.encodeUri("/rooms/$room_id/$membership",{$room_id:t,$membership:r});return e._http.authedRequest(o,"POST",a,void 0,{user_id:n,reason:i})}function K(e,t,n){e&&e(n),t(n)}function V(e,t,n){e&&e(null,n),t(n)}function G(e,t){const n=Boolean(t&&t.preventReEmit);function r(t){const r=new f.MatrixEvent(t);return r.isEncrypted()&&(n||e.reEmitter.reEmit(r,["Event.decrypted"]),r.attemptDecryption(e._crypto)),n||e.reEmitter.reEmit(r,["Event.replaced"]),r}return r}y.inherits(j,c.EventEmitter),y.extend(j.prototype,l.MatrixBaseApis.prototype),j.prototype.rehydrateDevice=i((function*(){if(this._crypto)throw new Error("Cannot rehydrate device after crypto is initialized");if(!this._cryptoCallbacks.getDehydrationKey)return;const n=yield this.getDehydratedDevice();if(!n)return;if(!n.device_data||!n.device_id)return void k.logger.info("no dehydrated device found");const r=new t.Olm.Account;try{const e=n.device_data;if(e.algorithm!==_dehydration.DEHYDRATION_ALGORITHM)return void k.logger.warn("Wrong algorithm for dehydrated device");k.logger.log("unpickling dehydrated device");const t=yield this._cryptoCallbacks.getDehydrationKey(e,t=>{r.unpickle(new Uint8Array(t),e.account)});r.unpickle(t,e.account),k.logger.log("unpickled device");const i=yield this._http.authedRequest(void 0,"POST","/dehydrated_device/claim",void 0,{device_id:n.device_id},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"});if(!0===i.success){this.deviceId=n.device_id,k.logger.info("using dehydrated device");const e=this.pickleKey||"DEFAULT_KEY";return this._exportedOlmDeviceToImport={pickledAccount:r.pickle(e),sessions:[],pickleKey:e},r.free(),this.deviceId}return r.free(),void k.logger.info("not using dehydrated device")}catch(e){r.free(),k.logger.warn("could not unpickle",e)}})),j.prototype.getDehydratedDevice=i((function*(){try{return yield this._http.authedRequest(void 0,"GET","/dehydrated_device",void 0,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})}catch(e){return void k.logger.info("could not get dehydrated device",e.toString())}})),j.prototype.setDehydrationKey=function(){var e=i((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(this._crypto)return yield this._crypto._dehydrationManager.setKeyAndQueueDehydration(e,t,n);k.logger.warn("not dehydrating device if crypto is not enabled")}));return function(t){return e.apply(this,arguments)}}(),j.prototype.createDehydratedDevice=function(){var e=i((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(this._crypto)return yield this._crypto._dehydrationManager.setKey(e,t,n),yield this._crypto._dehydrationManager.dehydrateDevice();k.logger.warn("not dehydrating device if crypto is not enabled")}));return function(t){return e.apply(this,arguments)}}(),j.prototype.exportDevice=i((function*(){if(this._crypto)return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:yield this._crypto._olmDevice.export()};k.logger.warn("not exporting device if crypto is not enabled")})),j.prototype.clearStores=function(){if(this._clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];return e.push(this.store.deleteAllData()),this._cryptoStore&&e.push(this._cryptoStore.deleteAllData()),Promise.all(e)},j.prototype.getUserId=function(){return this.credentials&&this.credentials.userId?this.credentials.userId:null},j.prototype.getDomain=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null},j.prototype.getUserIdLocalpart=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null},j.prototype.getDeviceId=function(){return this.deviceId},j.prototype.supportsVoip=function(){return this._supportsVoip},j.prototype.setForceTURN=function(e){this._forceTURN=e},j.prototype.setSupportsCallTransfer=function(e){this._supportsCallTransfer=e},j.prototype.getSyncState=function(){return this._syncApi?this._syncApi.getSyncState():null},j.prototype.getSyncStateData=function(){return this._syncApi?this._syncApi.getSyncStateData():null},j.prototype.isInitialSyncComplete=function(){const e=this.getSyncState();return!!e&&("PREPARED"===e||"SYNCING"===e)},j.prototype.isGuest=function(){return this._isGuest},j.prototype.getScheduler=function(){return this.scheduler},j.prototype.setGuest=function(e){this._isGuest=e},j.prototype.retryImmediately=function(){return this._syncApi.retryImmediately()},j.prototype.getNotifTimelineSet=function(){return this._notifTimelineSet},j.prototype.setNotifTimelineSet=function(e){this._notifTimelineSet=e},j.prototype.getCapabilities=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(new Date).getTime();return this._cachedCapabilities&&!e&&t(k.logger.error(e),null)).then(e=>{e||(e={});const n=e["capabilities"]||{},r=Object.keys(n).length?O:6e4+5e3*Math.random();return this._cachedCapabilities={capabilities:n,expiration:t+r},k.logger.log("Caching capabilities: ",n),n})},j.prototype.initCrypto=i((function*(){if(!(0,_crypto.isCryptoAvailable)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this._crypto)return void k.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");if(!this._sessionStore)throw new Error("Cannot enable encryption: no sessionStore provided");if(!this._cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");k.logger.log("Crypto: Starting up crypto store..."),yield this._cryptoStore.startup(),k.logger.log("Crypto: initialising roomlist..."),yield this._roomList.init();const e=this.getUserId();if(null===e)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(null===this.deviceId)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new _crypto.Crypto(this,this._sessionStore,e,this.deviceId,this.store,this._cryptoStore,this._roomList,this._verificationMethods);this.reEmitter.reEmit(t,["crypto.keyBackupFailed","crypto.keyBackupSessionsRemaining","crypto.roomKeyRequest","crypto.roomKeyRequestCancellation","crypto.warning","crypto.devicesUpdated","crypto.willUpdateDevices","deviceVerificationChanged","userTrustStatusChanged","crossSigning.keysChanged"]),k.logger.log("Crypto: initialising crypto object..."),yield t.init({exportedOlmDevice:this._exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this._exportedOlmDeviceToImport,this.olmVersion=_crypto.Crypto.getOlmVersion(),t.registerEventHandlers(this),this._crypto=t})),j.prototype.isCryptoEnabled=function(){return null!==this._crypto},j.prototype.getDeviceEd25519Key=function(){return this._crypto?this._crypto.getDeviceEd25519Key():null},j.prototype.getDeviceCurve25519Key=function(){return this._crypto?this._crypto.getDeviceCurve25519Key():null},j.prototype.uploadKeys=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.uploadDeviceKeys()},j.prototype.downloadKeys=function(e,t){return null===this._crypto?Promise.reject(new Error("End-to-end encryption disabled")):this._crypto.downloadKeys(e,t)},j.prototype.getStoredDevicesForUser=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevicesForUser(e)||[]},j.prototype.getStoredDevice=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevice(e,t)||null},j.prototype.setDeviceVerified=function(e,t,n){void 0===n&&(n=!0);const r=D(this,e,t,n,null);return e==this.credentials.userId&&this._crypto.checkKeyBackup(),r},j.prototype.setDeviceBlocked=function(e,t,n){return void 0===n&&(n=!0),D(this,e,t,null,n)},j.prototype.setDeviceKnown=function(e,t,n){return void 0===n&&(n=!0),D(this,e,t,null,null,n)},j.prototype.requestVerificationDM=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerificationDM(e,t)},j.prototype.findVerificationRequestDMInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.findVerificationRequestDMInProgress(e)},j.prototype.getVerificationRequestsToDeviceInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getVerificationRequestsToDeviceInProgress(e)},j.prototype.requestVerification=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerification(e,t)},j.prototype.beginKeyVerification=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.beginKeyVerification(e,t,n)},j.prototype.setGlobalBlacklistUnverifiedDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalBlacklistUnverifiedDevices(e)},j.prototype.getGlobalBlacklistUnverifiedDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalBlacklistUnverifiedDevices()},j.prototype.setGlobalErrorOnUnknownDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalErrorOnUnknownDevices(e)},j.prototype.getGlobalErrorOnUnknownDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalErrorOnUnknownDevices()},N(j,["getCrossSigningId","getStoredCrossSigningForUser","checkUserTrust","checkDeviceTrust","checkOwnCrossSigningTrust","checkCrossSigningPrivateKey","legacyDeviceVerification","prepareToEncrypt","isCrossSigningReady","bootstrapCrossSigning","getCryptoTrustCrossSignedDevices","setCryptoTrustCrossSignedDevices","countSessionsNeedingBackup"]),N(j,["getEventEncryptionInfo","createRecoveryKeyFromPassphrase","isSecretStorageReady","bootstrapSecretStorage","addSecretStorageKey","hasSecretStorageKey","storeSecret","getSecret","isSecretStored","requestSecret","getDefaultSecretStorageKeyId","setDefaultSecretStorageKeyId","checkSecretStorageKey","checkSecretStoragePrivateKey"]),j.prototype.getEventSenderDeviceInfo=function(){var e=i((function*(e){return this._crypto?this._crypto.getEventSenderDeviceInfo(e):null}));return function(t){return e.apply(this,arguments)}}(),j.prototype.isEventSenderVerified=function(){var e=i((function*(e){const t=yield this.getEventSenderDeviceInfo(e);return!!t&&t.isVerified()}));return function(t){return e.apply(this,arguments)}}(),j.prototype.cancelAndResendEventRoomKeyRequest=function(e){return e.cancelAndResendKeyRequest(this._crypto,this.getUserId())},j.prototype.setRoomEncryption=function(e,t){if(!this._crypto)throw new Error("End-to-End encryption disabled");return this._crypto.setRoomEncryption(e,t)},j.prototype.isRoomEncrypted=function(e){const t=this.getRoom(e);if(!t)return!1;const n=t.currentState.getStateEvents("m.room.encryption","");return!!n},j.prototype.forceDiscardSession=function(e){if(!this._crypto)throw new Error("End-to-End encryption disabled");this._crypto.forceDiscardSession(e)},j.prototype.exportRoomKeys=function(){return this._crypto?this._crypto.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))},j.prototype.importRoomKeys=function(e,t){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.importRoomKeys(e,t)},j.prototype.checkKeyBackup=function(){return this._crypto.checkKeyBackup()},j.prototype.getKeyBackupVersion=function(){return this._http.authedRequest(void 0,"GET","/room_keys/version",void 0,void 0,{prefix:b.PREFIX_UNSTABLE}).then(e=>{if(e.algorithm!==olmlib.MEGOLM_BACKUP_ALGORITHM){const t="Unknown backup algorithm: "+e.algorithm;return Promise.reject(t)}if("object"===typeof e.auth_data&&e.auth_data.public_key)return e;{const e="Invalid backup data returned";return Promise.reject(e)}}).catch(e=>{if("M_NOT_FOUND"===e.errcode)return null;throw e})},j.prototype.isKeyBackupTrusted=function(e){return this._crypto.isKeyBackupTrusted(e)},j.prototype.getKeyBackupEnabled=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto._checkedForBackup?Boolean(this._crypto.backupKey):null},j.prototype.enableKeyBackup=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=e,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=new t.Olm.PkEncryption,this._crypto.backupKey.set_recipient_key(e.auth_data.public_key),this.emit("crypto.keyBackupStatus",!0),this._crypto.scheduleKeyBackupSend()},j.prototype.disableKeyBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=null,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=null,this.emit("crypto.keyBackupStatus",!1)},j.prototype.prepareKeyBackupVersion=function(){var e=i((function*(e){let{secureSecretStorage:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===this._crypto)throw new Error("End-to-end encryption disabled");const{keyInfo:n,encodedPrivateKey:r,privateKey:i}=yield this.createRecoveryKeyFromPassphrase(e);t&&(yield this.storeSecret("m.megolm_backup.v1",(0,olmlib.encodeBase64)(i)),k.logger.info("Key backup private key stored in secret storage"));const o={public_key:n.pubkey};return n.passphrase&&(o.private_key_salt=n.passphrase.salt,o.private_key_iterations=n.passphrase.iterations),{algorithm:olmlib.MEGOLM_BACKUP_ALGORITHM,auth_data:o,recovery_key:r}}));return function(t){return e.apply(this,arguments)}}(),j.prototype.isKeyBackupKeyStored=i((function*(){return this.isSecretStored("m.megolm_backup.v1",!1)})),j.prototype.createKeyBackupVersion=function(){var e=i((function*(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const t={algorithm:e.algorithm,auth_data:e.auth_data};yield this._crypto._signObject(t.auth_data),this._cryptoCallbacks.getCrossSigningKey&&this._crypto._crossSigningInfo.getId()&&(yield this._crypto._crossSigningInfo.signObject(t.auth_data,"master"));const n=yield this._http.authedRequest(void 0,"POST","/room_keys/version",void 0,t,{prefix:b.PREFIX_UNSTABLE});return yield this.checkKeyBackup(),this.getKeyBackupEnabled()||k.logger.error("Key backup not usable even though we just created it"),n}));return function(t){return e.apply(this,arguments)}}(),j.prototype.deleteKeyBackupVersion=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo&&this._crypto.backupInfo.version===e&&this.disableKeyBackup();const t=y.encodeUri("/room_keys/version/$version",{$version:e});return this._http.authedRequest(void 0,"DELETE",t,void 0,void 0,{prefix:b.PREFIX_UNSTABLE})},j.prototype._makeKeyBackupPath=function(e,t,n){let r;r=void 0!==t?y.encodeUri("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):void 0!==e?y.encodeUri("/room_keys/keys/$roomId",{$roomId:e}):"/room_keys/keys";const i=void 0===n?void 0:{version:n};return{path:r,queryData:i}},j.prototype.sendKeyBackup=function(e,t,n,r){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const i=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"PUT",i.path,i.queryData,r,{prefix:b.PREFIX_UNSTABLE})},j.prototype.scheduleAllGroupSessionsForBackup=i((function*(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");yield this._crypto.scheduleAllGroupSessionsForBackup()})),j.prototype.flagAllGroupSessionsForBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.flagAllGroupSessionsForBackup()},j.prototype.isValidRecoveryKey=function(t){try{return(0,_recoverykey.decodeRecoveryKey)(t),!0}catch(e){return!1}},j.prototype.keyBackupKeyFromPassword=function(e,t){return(0,_key_passphrase.keyFromAuthData)(t.auth_data,e)},j.prototype.keyBackupKeyFromRecoveryKey=function(e){return(0,_recoverykey.decodeRecoveryKey)(e)},j.RESTORE_BACKUP_ERROR_BAD_KEY="RESTORE_BACKUP_ERROR_BAD_KEY",j.prototype.restoreKeyBackupWithPassword=function(){var e=i((function*(e,t,n,r,i){const o=yield(0,_key_passphrase.keyFromAuthData)(r.auth_data,e);return this._restoreKeyBackup(o,t,n,r,i)}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),j.prototype.restoreKeyBackupWithSecretStorage=function(){var e=i((function*(e,t,n,r){const i=yield this.getSecret("m.megolm_backup.v1"),o=(0,_crypto.fixBackupKey)(i);if(o){const[e]=yield this._crypto.getSecretStorageKey();yield this.storeSecret("m.megolm_backup.v1",o,[e])}const a=(0,olmlib.decodeBase64)(o||i);return this._restoreKeyBackup(a,t,n,e,r)}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype.restoreKeyBackupWithRecoveryKey=function(e,t,n,r,i){const o=(0,_recoverykey.decodeRecoveryKey)(e);return this._restoreKeyBackup(o,t,n,r,i)},j.prototype.restoreKeyBackupWithCache=function(){var e=i((function*(e,t,n,r){const i=yield this._crypto.getSessionBackupPrivateKey();if(!i)throw new Error("Couldn't get key");return this._restoreKeyBackup(i,e,t,n,r)}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype._restoreKeyBackup=function(n,r,i,o){let{cacheCompleteCallback:a,progressCallback:s}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(null===this._crypto)throw new Error("End-to-end encryption disabled");let c=0,l=[];const u=this._makeKeyBackupPath(r,i,o.version),d=new t.Olm.PkDecryption;let f;try{f=d.init_with_private_key(n)}catch(e){throw d.free(),e}return f!==o.auth_data.public_key?Promise.reject({errcode:j.RESTORE_BACKUP_ERROR_BAD_KEY}):(this._crypto.storeSessionBackupPrivateKey(n).catch(e=>{k.logger.warn("Error caching session backup key:",e)}).then(a),s&&s({stage:"fetch"}),this._http.authedRequest(void 0,"GET",u.path,u.queryData,void 0,{prefix:b.PREFIX_UNSTABLE}).then(t=>{if(t.rooms)for(const[e,n]of Object.entries(t.rooms)){if(!n.sessions)continue;c+=Object.keys(n.sessions).length;const t=A(n.sessions,d,e);for(const n of t)n.room_id=e,l.push(n)}else if(t.sessions)c=Object.keys(t.sessions).length,l=A(t.sessions,d,r,l);else{c=1;try{const e=P(t,d);e.room_id=r,e.session_id=i,l.push(e)}catch(e){k.logger.log("Failed to decrypt megolm session from backup",e)}}return this.importRoomKeys(l,{progressCallback:s,untrusted:!0,source:"backup"})}).then(()=>this._crypto.setTrustedBackupPubKey(f)).then(()=>({total:c,imported:l.length})).finally(()=>{d.free()}))},j.prototype.deleteKeysFromBackup=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const r=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"DELETE",r.path,r.queryData,void 0,{prefix:b.PREFIX_UNSTABLE})},j.prototype.sendSharedHistoryKeys=function(){var e=i((function*(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const n=this._roomList.getRoomEncryption(e);if(!n)return void k.logger.error("Unknown room. Not sharing decryption keys");const r=yield this._crypto.downloadKeys(t),i={};for(const[a,s]of Object.entries(r))i[a]=Object.values(s);const o=this._crypto._getRoomDecryptor(e,n.algorithm);o.sendSharedHistoryInboundSessions?yield o.sendSharedHistoryInboundSessions(i):k.logger.warning("Algorithm does not support sharing previous keys",n.algorithm)}));return function(t,n){return e.apply(this,arguments)}}(),j.prototype.getGroup=function(e){return this.store.getGroup(e)},j.prototype.getGroups=function(){return this.store.getGroups()},j.prototype.getMediaConfig=function(e){return this._http.authedRequest(e,"GET","/config",void 0,void 0,{prefix:b.PREFIX_MEDIA_R0})},j.prototype.getRoom=function(e){return this.store.getRoom(e)},j.prototype.getRooms=function(){return this.store.getRooms()},j.prototype.getVisibleRooms=function(){const e=this.store.getRooms(),t=new Set;for(const n of e){const e=n.currentState.getStateEvents("m.room.create","");if(e){const n=e.getContent()["predecessor"];n&&n["room_id"]&&t.add(n["room_id"])}}return e.filter(e=>{const n=e.currentState.getStateEvents("m.room.tombstone","");return!n||!t.has(e.roomId)})},j.prototype.getUser=function(e){return this.store.getUser(e)},j.prototype.getUsers=function(){return this.store.getUsers()},j.prototype.setAccountData=function(e,t,n){const r=y.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e}),i=(0,b.retryNetworkOperation)(5,()=>this._http.authedRequest(void 0,"PUT",r,void 0,t));return n&&i.then(e=>n(null,e),n),i},j.prototype.getAccountData=function(e){return this.store.getAccountData(e)},j.prototype.getAccountDataFromServer=function(){var t=i((function*(t){if(this.isInitialSyncComplete()){const e=this.store.getAccountData(t);return e?e.getContent():null}const n=y.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:t});try{const e=yield this._http.authedRequest(void 0,"GET",n,void 0);return e}catch(e){if(e.data&&"M_NOT_FOUND"===e.data.errcode)return null;throw e}}));return function(e){return t.apply(this,arguments)}}(),j.prototype.getIgnoredUsers=function(){const e=this.getAccountData("m.ignored_user_list");return e&&e.getContent()&&e.getContent()["ignored_users"]?Object.keys(e.getContent()["ignored_users"]):[]},j.prototype.setIgnoredUsers=function(e,t){const n={ignored_users:{}};return e.map(e=>n.ignored_users[e]={}),this.setAccountData("m.ignored_user_list",n,t)},j.prototype.isUserIgnored=function(e){return-1!==this.getIgnoredUsers().indexOf(e)},j.prototype.joinRoom=function(e,t,n){if(y.isFunction(t))throw new Error("Expected 'opts' object, got function.");t=t||{},void 0===t.syncRoom&&(t.syncRoom=!0);const r=this.getRoom(e);if(r&&r.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(r);let i=Promise.resolve();t.inviteSignUrl&&(i=this._http.requestOtherUrl(void 0,"POST",t.inviteSignUrl,{mxid:this.credentials.userId}));const o={};t.viaServers&&(o["server_name"]=t.viaServers);const a={qsStringifyOptions:{arrayFormat:"repeat"}},s=this,c=new Promise((r,c)=>{i.then((function(t){const n={};t&&(n.third_party_signed=t);const r=y.encodeUri("/join/$roomid",{$roomid:e});return s._http.authedRequest(void 0,"POST",r,o,n,a)})).then((function(e){const n=e.room_id,r=new d.SyncApi(s,s._clientOpts),i=r.createRoom(n);return t.syncRoom,Promise.resolve(i)})).then((function(e){V(n,r,e)}),(function(e){K(n,c,e)}))});return c},j.prototype.resendEvent=function(e,t){return F(t,e,f.EventStatus.SENDING),$(this,t,e)},j.prototype.cancelPendingEvent=function(e){if([f.EventStatus.QUEUED,f.EventStatus.NOT_SENT].indexOf(e.status)<0)throw new Error("cannot cancel an event with status "+e.status);this.scheduler&&this.scheduler.removeEventFromQueue(e);const t=this.getRoom(e.getRoomId());F(t,e,f.EventStatus.CANCELLED)},j.prototype.setRoomName=function(e,t,n){return this.sendStateEvent(e,"m.room.name",{name:t},void 0,n)},j.prototype.setRoomAvatarUrl=function(e,t,n){return this.sendStateEvent(e,"m.room.avatar",{avatarUrl:t},void 0,n)},j.prototype.setRoomTopic=function(e,t,n){return this.sendStateEvent(e,"m.room.topic",{topic:t},void 0,n)},j.prototype.getRoomTags=function(e,t){const n=y.encodeUri("/user/$userId/rooms/$roomId/tags/",{$userId:this.credentials.userId,$roomId:e});return this._http.authedRequest(t,"GET",n,void 0)},j.prototype.setRoomTag=function(e,t,n,r){const i=y.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(r,"PUT",i,void 0,n)},j.prototype.deleteRoomTag=function(e,t,n){const r=y.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(n,"DELETE",r,void 0,void 0)},j.prototype.setRoomAccountData=function(e,t,n,r){const i=y.encodeUri("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this._http.authedRequest(r,"PUT",i,void 0,n)},j.prototype.setPowerLevel=function(e,t,n,r,i){let o={users:{}};r&&"m.room.power_levels"===r.getType()&&(o=y.deepCopy(r.getContent())),o.users[t]=n;const a=y.encodeUri("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this._http.authedRequest(i,"PUT",a,void 0,o)},j.prototype.sendEvent=function(e,t,n,r,i){return this._sendCompleteEvent(e,{type:t,content:n},r,i)},j.prototype._sendCompleteEvent=function(e,t,n,r){y.isFunction(n)&&(r=n,n=void 0),n||(n=this.makeTxnId());const i=new f.MatrixEvent(Object.assign(t,{event_id:"~"+e+":"+n,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:(new Date).getTime()})),o=this.getRoom(e),a=i.getAssociatedId();if(a&&a.startsWith("~")){const e=o.getPendingEvents().find(e=>e.getId()===a);e.once("Event.localEventIdReplaced",()=>{i.updateAssociatedId(e.getId())})}const s=i.getType();return k.logger.log(`sendEvent of type ${s} in ${e} with txnId ${n}`),i.setTxnId(n),i.setStatus(f.EventStatus.SENDING),o&&o.addPendingEvent(i,n),i.status===f.EventStatus.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):$(this,o,i,r)},j.prototype.redactEvent=function(e,t,n,r){const i="object"===typeof r?r:{},o=i.reason,a="function"===typeof r?r:void 0;return this._sendCompleteEvent(e,{type:"m.room.redaction",content:{reason:o},redacts:t},n,a)},j.prototype.sendMessage=function(e,t,n,r){return y.isFunction(n)&&(r=n,n=void 0),this.sendEvent(e,"m.room.message",t,n,r)},j.prototype.sendTextMessage=function(e,t,n,r){const i=w.makeTextMessage(t);return this.sendMessage(e,i,n,r)},j.prototype.sendNotice=function(e,t,n,r){const i=w.makeNotice(t);return this.sendMessage(e,i,n,r)},j.prototype.sendEmoteMessage=function(e,t,n,r){const i=w.makeEmoteMessage(t);return this.sendMessage(e,i,n,r)},j.prototype.sendImageMessage=function(e,t,n,r,i){y.isFunction(r)&&(i=r,r=void 0),r||(r="Image");const o={msgtype:"m.image",url:t,info:n,body:r};return this.sendMessage(e,o,i)},j.prototype.sendAudioMessage=function(e,t,n,r,i){y.isFunction(r)&&(i=r,r=void 0),r||(r="Audio");const o={msgtype:"m.audio",url:t,info:n,body:r};return this.sendMessage(e,o,i)},j.prototype.sendStickerMessage=function(e,t,n,r,i){y.isFunction(r)&&(i=r,r=void 0),r||(r="Sticker");const o={url:t,info:n,body:r};return this.sendEvent(e,"m.sticker",o,i,void 0)},j.prototype.sendHtmlMessage=function(e,t,n,r){const i=w.makeHtmlMessage(t,n);return this.sendMessage(e,i,r)},j.prototype.sendHtmlNotice=function(e,t,n,r){const i=w.makeHtmlNotice(t,n);return this.sendMessage(e,i,r)},j.prototype.sendHtmlEmote=function(e,t,n,r){const i=w.makeHtmlEmote(t,n);return this.sendMessage(e,i,r)},j.prototype.sendReceipt=function(e,t,n,r){if("function"===typeof n&&(r=n,n={}),this.isGuest())return Promise.resolve({});const i=y.encodeUri("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()}),o=this._http.authedRequest(r,"POST",i,void 0,n||{}),a=this.getRoom(e.getRoomId());return a&&a._addLocalEchoReceipt(this.credentials.userId,e,t),o},j.prototype.sendReadReceipt=function(){var e=i((function*(e,t,n){"function"===typeof t&&(n=t,t={}),t||(t={});const r=e.getId(),i=this.getRoom(e.getRoomId());if(i&&i.hasPendingEvent(r))throw new Error(`Cannot set read receipt to a pending event (${r})`);const o={"m.hidden":Boolean(t.hidden)};return this.sendReceipt(e,"m.read",o,n)}));return function(t,n,r){return e.apply(this,arguments)}}(),j.prototype.setRoomReadMarkers=function(){var e=i((function*(e,t,n,r){const i=this.getRoom(e);if(i&&i.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let o;if(n){if(o=n.getId(),i&&i.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);i&&i._addLocalEchoReceipt(this.credentials.userId,n,"m.read")}return this.setRoomReadMarkersHttpRequest(e,t,o,r)}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype.getUrlPreview=function(e,t,n){t=6e4*Math.floor(t/6e4);const r=t+"_"+e,i=this.urlPreviewCache[r];if(i)return n&&i.then(n).catch(n),i;const o=this._http.authedRequest(n,"GET","/preview_url",{url:e,ts:t},void 0,{prefix:b.PREFIX_MEDIA_R0});return this.urlPreviewCache[r]=o,o},j.prototype.sendTyping=function(e,t,n,r){if(this.isGuest())return Promise.resolve({});const i=y.encodeUri("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.credentials.userId}),o={typing:t};return t&&(o.timeout=n||2e4),this._http.authedRequest(r,"PUT",i,void 0,o)},j.prototype.getRoomUpgradeHistory=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getRoom(e);if(!n)return[];const r=[n];let i=n.currentState.getStateEvents("m.room.create","");while(i){k.logger.log("Looking at "+i.getId());const e=i.getContent()["predecessor"];if(!e||!e["room_id"])break;{k.logger.log("Looking at predecessor "+e["room_id"]);const n=this.getRoom(e["room_id"]);if(!n)break;if(t){const e=n.currentState.getStateEvents("m.room.tombstone","");if(!e||e.getContent()["replacement_room"]!==n.roomId)break}r.splice(0,0,n),i=n.currentState.getStateEvents("m.room.create","")}}let o=n.currentState.getStateEvents("m.room.tombstone","");while(o){const e=this.getRoom(o.getContent()["replacement_room"]);if(!e)break;if(e.roomId===n.roomId)break;if(t){if(i=e.currentState.getStateEvents("m.room.create",""),!i||!i.getContent()["predecessor"])break;const t=i.getContent()["predecessor"];if(t["room_id"]!==n.roomId)break}r.push(e);const a=new Set(r.map(e=>e.roomId));if(a.size1&&void 0!==arguments[1])||arguments[1];const n=this.getRoomUpgradeHistory(e);let r=n;if(!t){r=[];for(const t of n)if(r.push(t),t.roomId===e)break}const i={},o=[],a=e=>this.leave(e).then(()=>{i[e]=null}).catch(t=>(i[e]=t,null));for(const s of r)o.push(a(s.roomId));return Promise.all(o).then(()=>i)},j.prototype.ban=function(e,t,n,r){return W(this,e,t,"ban",n,r)},j.prototype.forget=function(e,t,n){void 0===t&&(t=!0);const r=W(this,e,void 0,"forget",void 0,n);if(!t)return r;const i=this;return r.then((function(t){return i.store.removeRoom(e),i.emit("deleteRoom",e),t}))},j.prototype.unban=function(e,t,n){const r=y.encodeUri("/rooms/$roomId/unban",{$roomId:e}),i={user_id:t};return this._http.authedRequest(n,"POST",r,void 0,i)},j.prototype.kick=function(e,t,n,r){return q(this,e,t,"leave",n,r)},j.prototype.getPushActionsForEvent=function(e){return e.getPushActions()||e.setPushActions(this._pushProcessor.actionsForEvent(e)),e.getPushActions()},j.prototype.setProfileInfo=function(e,t,n){const r=y.encodeUri("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this._http.authedRequest(n,"PUT",r,void 0,t)},j.prototype.setDisplayName=function(){var e=i((function*(e,t){const n=yield this.setProfileInfo("displayname",{displayname:e},t),r=this.getUser(this.getUserId());return r&&(r.displayName=e,r.emit("User.displayName",r.events.presence,r)),n}));return function(t,n){return e.apply(this,arguments)}}(),j.prototype.setAvatarUrl=function(){var e=i((function*(e,t){const n=yield this.setProfileInfo("avatar_url",{avatar_url:e},t),r=this.getUser(this.getUserId());return r&&(r.avatarUrl=e,r.emit("User.avatarUrl",r.events.presence,r)),n}));return function(t,n){return e.apply(this,arguments)}}(),j.prototype.mxcUrlToHttp=function(e,t,n,r,i){return(0,_.getHttpUriForMxc)(this.baseUrl,e,t,n,r,i)},j.prototype._unstable_setStatusMessage=function(e){const t="im.vector.user_status";return Promise.all(this.getRooms().map(n=>{const r="join"===n.getMyMembership(),i=2===n.getInvitedAndJoinedMemberCount();if(!r||!i)return Promise.resolve();const o=n.currentState.mayClientSendStateEvent(t,this);return o?this.sendStateEvent(n.roomId,t,{status:e},this.getUserId()):Promise.resolve()}))},j.prototype.setPresence=function(e,t){const n=y.encodeUri("/presence/$userId/status",{$userId:this.credentials.userId});"string"===typeof e&&(e={presence:e});const r=["offline","online","unavailable"];if(-1==r.indexOf(e.presence))throw new Error("Bad presence value: "+e.presence);return this._http.authedRequest(t,"PUT",n,void 0,e)},j.prototype.getPresence=function(e,t){const n=y.encodeUri("/presence/$userId/status",{$userId:e});return this._http.authedRequest(t,"GET",n,void 0,void 0)},j.prototype.scrollback=function(e,t,n){y.isFunction(t)&&(n=t,t=void 0),t=t||30;let r=0,i=this._ongoingScrollbacks[e.roomId]||{};if(i.promise)return i.promise;if(i.errorTs){const e=Date.now()-i.errorTs;r=Math.max(I-e,0)}if(null===e.oldState.paginationToken)return Promise.resolve(e);const o=this.store.scrollback(e,t).length;if(o===t)return Promise.resolve(e);t-=o;const a=this,s=new Promise((i,o)=>{(0,y.sleep)(r).then((function(){return a._createMessagesRequest(e.roomId,e.oldState.paginationToken,t,"b")})).then((function(t){const r=y.map(t.chunk,G(a));if(t.state){const n=y.map(t.state,G(a));e.currentState.setUnknownStateEvents(n)}e.addEventsToTimeline(r,!0,e.getLiveTimeline()),e.oldState.paginationToken=t.end,0===t.chunk.length&&(e.oldState.paginationToken=null),a.store.storeEvents(e,r,t.end,!0),a._ongoingScrollbacks[e.roomId]=null,V(n,i,e)}),(function(t){a._ongoingScrollbacks[e.roomId]={errorTs:Date.now()},K(n,o,t)}))});return i={promise:s,errorTs:null},this._ongoingScrollbacks[e.roomId]=i,s},j.prototype.getEventTimeline=function(e,t){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(e.getTimelineForEvent(t))return Promise.resolve(e.getTimelineForEvent(t));const n=y.encodeUri("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let r=void 0;this._clientOpts.lazyLoadMembers&&(r={filter:JSON.stringify(u.Filter.LAZY_LOADING_MESSAGES_FILTER)});const i=this,o=i._http.authedRequest(void 0,"GET",n,r).then((function(n){if(!n.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);n.events_after.reverse();const r=n.events_after.concat([n.event]).concat(n.events_before),o=y.map(r,i.getEventMapper());let a=e.getTimelineForEvent(o[0].getId());if(a){const e=y.map(n.state,i.getEventMapper());a.getState(h.EventTimeline.BACKWARDS).setUnknownStateEvents(e)}else a=e.addTimeline(),a.initialiseState(y.map(n.state,i.getEventMapper())),a.getState(h.EventTimeline.FORWARDS).paginationToken=n.end;e.addEventsToTimeline(o,!0,a,n.start);const s=e.getTimelineForEvent(t)||a;return s}));return o},j.prototype._createMessagesRequest=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;const o=y.encodeUri("/rooms/$roomId/messages",{$roomId:e});void 0===n&&(n=30);const a={from:t,limit:n,dir:r};let s=null;return this._clientOpts.lazyLoadMembers&&(s=Object.assign({},u.Filter.LAZY_LOADING_MESSAGES_FILTER)),i&&(s=s||{},Object.assign(s,i.getRoomTimelineFilterComponent())),s&&(a.filter=JSON.stringify(s)),this._http.authedRequest(void 0,"GET",o,a)},j.prototype.paginateEventTimeline=function(e,t){const n=e.getTimelineSet()===this._notifTimelineSet;t=t||{};const r=t.backwards||!1;if(n&&!r)throw new Error("paginateNotifTimeline can only paginate backwards");const i=r?h.EventTimeline.BACKWARDS:h.EventTimeline.FORWARDS,o=e.getPaginationToken(i);if(!o)return Promise.resolve(!1);const a=e._paginationRequests[i];if(a)return a;let s,c,l;const u=this;if(n)s="/notifications",c={limit:"limit"in t?t.limit:30,only:"highlight"},o&&"end"!==o&&(c.from=o),l=this._http.authedRequest(void 0,"GET",s,c,void 0).then((function(t){const n=t.next_token,o=[];for(let e=0;e{i.then((function(){r.getPushRules().then((function(t){r.pushRules=t,e()}),(function(e){t(e)}))}),(function(e){r.getPushRules().then((function(n){r.pushRules=n,t(e)}),(function(n){t(e)}))}))})},j.prototype.searchMessageText=function(e,t){const n={search_term:e.query};return"keys"in e&&(n.keys=e.keys),this.search({body:{search_categories:{room_events:n}}},t)},j.prototype.searchRoomEvents=function(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:"recent",event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},n={_query:t,results:[],highlights:[]};return this.search({body:t}).then(this._processRoomEventsSearch.bind(this,n))},j.prototype.backPaginateRoomEventsSearch=function(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;const t={body:e._query,next_batch:e.next_batch},n=this.search(t).then(this._processRoomEventsSearch.bind(this,e)).finally((function(){e.pendingRequest=null}));return e.pendingRequest=n,n},j.prototype._processRoomEventsSearch=function(e,t){const n=t.search_categories.room_events;e.count=n.count,e.next_batch=n.next_batch;const r={};n.highlights.forEach((function(e){r[e]=1})),e.highlights.forEach((function(e){r[e]=1})),e.highlights=Object.keys(r);for(let i=0;iM)k.logger.debug("TURN creds are valid for another "+n+" ms: not fetching new ones."),e=!0;else{k.logger.debug("Fetching new TURN credentials");try{const t=yield this.turnServer();if(t.uris){k.logger.log("Got TURN URIs: "+t.uris+" refresh in "+t.ttl+" secs");const n={urls:t.uris,username:t.username,credential:t.password};this._turnServers=[n],this._turnServersExpiry=Date.now()+1e3*t.ttl,e=!0}}catch(r){k.logger.error("Failed to get TURN URIs",r),403===r.httpStatus&&(k.logger.info("TURN access unavailable for this account: stopping credentials checks"),null!==this._checkTurnServersIntervalID&&t.clearInterval(this._checkTurnServersIntervalID),this._checkTurnServersIntervalID=null)}}return e})),j.prototype.setFallbackICEServerAllowed=function(e){this._fallbackICEServerAllowed=e},j.prototype.isFallbackICEServerAllowed=function(){return this._fallbackICEServerAllowed},j.prototype.isSynapseAdministrator=function(){const e=y.encodeUri("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this._http.authedRequest(void 0,"GET",e,void 0,void 0,{prefix:""}).then(e=>e["admin"])},j.prototype.whoisSynapseUser=function(e){const t=y.encodeUri("/_synapse/admin/v1/whois/$userId",{$userId:e});return this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:""})},j.prototype.deactivateSynapseUser=function(e){const t=y.encodeUri("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this._http.authedRequest(void 0,"POST",t,void 0,void 0,{prefix:""})},j.prototype.startClient=function(){var e=i((function*(e){if(this.clientRunning)return;this.clientRunning=!0,"number"===typeof e&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new C.User(t)),this._crypto&&(this._crypto.uploadDeviceKeys(),this._crypto.start()),this._supportsVoip&&(this._checkTurnServersIntervalID=setInterval(()=>{this._checkTurnServers()},M),this._checkTurnServers()),this._syncApi&&(k.logger.error("Still have sync object whilst not running: stopping old one"),this._syncApi.stop()),e=Object.assign({},e),e.crypto=this._crypto,e.canResetEntireTimeline=e=>!!this._canResetTimelineCallback&&this._canResetTimelineCallback(e),this._clientOpts=e,this._syncApi=new d.SyncApi(this,e),this._syncApi.sync(),void 0!==e.clientWellKnownPollPeriod&&(this._clientWellKnownIntervalID=setInterval(()=>{this._fetchClientWellKnown()},1e3*e.clientWellKnownPollPeriod),this._fetchClientWellKnown())}));return function(t){return e.apply(this,arguments)}}(),j.prototype._fetchClientWellKnown=i((function*(){this._clientWellKnownPromise=T.AutoDiscovery.getRawClientConfig(this.getDomain()),this._clientWellKnown=yield this._clientWellKnownPromise,this.emit("WellKnown.client",this._clientWellKnown)})),j.prototype.getClientWellKnown=function(){return this._clientWellKnown},j.prototype.waitForClientWellKnown=function(){return this._clientWellKnownPromise},j.prototype._storeClientOptions=function(){const e=["boolean","string","number"],t=Object.entries(this._clientOpts).filter(t=>{let[n,r]=t;return e.includes(typeof r)}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});return this.store.storeClientOptions(t)},j.prototype._unstable_getSharedRooms=function(){var e=i((function*(e){if(!(yield this.doesServerSupportUnstableFeature("uk.half-shot.msc2666")))throw Error("Server does not support shared_rooms API");const t=y.encodeUri("/uk.half-shot.msc2666/user/shared_rooms/$userId",{$userId:e}),n=yield this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:b.PREFIX_UNSTABLE});return n.joined}));return function(t){return e.apply(this,arguments)}}(),j.prototype.stopClient=function(){k.logger.log("stopping MatrixClient"),this.clientRunning=!1,this._syncApi&&(this._syncApi.stop(),this._syncApi=null),this._crypto&&this._crypto.stop(),this._peekSync&&this._peekSync.stopPeeking(),this._callEventHandler&&(this._callEventHandler.stop(),this._callEventHandler=null),t.clearInterval(this._checkTurnServersIntervalID),void 0!==this._clientWellKnownIntervalID&&t.clearInterval(this._clientWellKnownIntervalID)},j.prototype.getVersions=function(){return this._serverVersionsPromise||(this._serverVersionsPromise=this._http.request(void 0,"GET","/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(e=>{throw this._serverVersionsPromise=null,e})),this._serverVersionsPromise},j.prototype.isVersionSupported=function(){var e=i((function*(e){const{versions:t}=yield this.getVersions();return t&&t.includes(e)}));return function(t){return e.apply(this,arguments)}}(),j.prototype.doesServerSupportLazyLoading=i((function*(){const e=yield this.getVersions();if(!e)return!1;const t=e["versions"],n=e["unstable_features"];return t&&t.includes("r0.5.0")||n&&n["m.lazy_load_members"]})),j.prototype.doesServerRequireIdServerParam=i((function*(){const e=yield this.getVersions();if(!e)return!0;const t=e["versions"];if(t&&t.includes("r0.6.0"))return!1;const n=e["unstable_features"];return!n||(void 0===n["m.require_identity_server"]||n["m.require_identity_server"])})),j.prototype.doesServerAcceptIdentityAccessToken=i((function*(){const e=yield this.getVersions();if(!e)return!1;const t=e["versions"],n=e["unstable_features"];return t&&t.includes("r0.6.0")||n&&n["m.id_access_token"]})),j.prototype.doesServerSupportSeparateAddAndBind=i((function*(){const e=yield this.getVersions();if(!e)return!1;const t=e["versions"],n=e["unstable_features"];return t&&t.includes("r0.6.0")||n&&n["m.separate_add_and_bind"]})),j.prototype.doesServerSupportUnstableFeature=function(){var e=i((function*(e){const t=yield this.getVersions();if(!t)return!1;const n=t["unstable_features"];return n&&!!n[e]}));return function(t){return e.apply(this,arguments)}}(),j.prototype.doesServerForceEncryptionForPreset=function(){var e=i((function*(e){const t=yield this.getVersions();if(!t)return!1;const n=t["unstable_features"];return n&&!!n["io.element.e2ee_forced."+e]}));return function(t){return e.apply(this,arguments)}}(),j.prototype.hasLazyLoadMembersEnabled=function(){return!!this._clientOpts.lazyLoadMembers},j.prototype.setCanResetTimelineCallback=function(e){this._canResetTimelineCallback=e},j.prototype.getCanResetTimelineCallback=function(){return this._canResetTimelineCallback},j.prototype.relations=function(){var e=i((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=B(this,e,r),a=yield this.fetchRelations(e,t,n,o,i),s=this.getEventMapper();let c;a.original_event&&(c=s(a.original_event));let l=a.chunk.map(s);if("m.room.encrypted"===o){const e=c?l.concat(c):l;yield Promise.all(e.map(e=>new Promise(t=>e.once("Event.decrypted",t)))),l=l.filter(e=>e.getType()===r)}return c&&"m.replace"===n&&(l=l.filter(e=>e.getSender()===c.getSender())),{originalEvent:c,events:l,nextBatch:a.next_batch}}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype.getEventMapper=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return G(this,e)},j.prototype.getCrossSigningCacheCallbacks=function(){return this._crypto&&this._crypto._crossSigningInfo.getCacheCallbacks()},j.prototype.generateClientSecret=function(){return(0,S.randomString)(32)}}).call(this,r("c8ba"))},9818:function(e,t,n){var r=n("77ae");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("1d616953",r,e)}},"98e6":function(e,t,n){"use strict";var r=n("3fb5"),i=n("f576"),o=n("b5ca"),a=n("69f2"),s=n("6430");function c(e){s.call(this,"digest"),this._hash=e}r(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return e=e.toLowerCase(),"md5"===e?new i:"rmd160"===e||"ripemd160"===e?new o:new c(a(e))}},"994e":function(e,t,n){"use strict";n.r(t);var r=n("f5af");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"9a41":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page chats",class:{pocketnet:e.pocketnet,mobile:e.mobile,minimized:e.minimized,active:e.active,newChat:e.newChat}},[n("topheader",{staticClass:"topheader",attrs:{share:e.share},on:{newchat:e.newchat}}),n("maincontent",{ref:"maincontent",attrs:{rbackexp:!0},scopedSlots:e._u([{key:"content",fn:function(){return[n("list",{attrs:{share:e.share},on:{scrolltop:e.scrolltop}}),e.newChat&&!e.hiddenInParent?n("modal",{on:{close:e.closeNewChat},scopedSlots:e._u([{key:"header",fn:function(){return[e._v(e._s(e.$t("caption.newChat")))]},proxy:!0},{key:"body",fn:function(){return[n("chatcreate",{on:{completed:e.chatcreated}})]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,1284178828)}):e._e()]},proxy:!0}])})],1)},i=[],o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"chats-list",class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active,empty:e.empty}},[e.unauthorized?n("div",{staticClass:"dmdv"}):n("div",[!e.minimized||e.active?n("div",{staticClass:"work searchWrapperEA"},[n("search",{attrs:{minimize:e.minimized},on:{search:e.search}})],1):e._e(),!e.searchText&&this.chats.length<=2&&1==e.chatsready?n("teamroom",{on:{click:e.openTeamRoom}}):e._e(),!0!==e.chatsready?n("div",{staticClass:"listChatLoading"},[n("dummypreviews")],1):n("div",{staticClass:"Swipes"},[n("transition",{attrs:{name:"fade"}},[e.showchatslist?n("div",{staticClass:"desktopList"},[e.filteredchats.length||!e.searchText?n("div",{staticClass:"chatswrapper"},[n("RecycleScroller",{staticClass:"scroller",attrs:{"page-mode":"",items:e.filteredchats,"item-size":e.pocketnet?60:70,"key-field":"roomId",buffer:e.pocketnet?400:700},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.item,i=t.active;return[r?n("div",{ref:"content",staticClass:"card-content",on:{click:function(t){return e.itemClick(r)}}},[i?n("preview",{attrs:{chat:r}}):e._e()],1):e._e()]}}],null,!1,127139565)})],1):n("div",{staticClass:"work"},[n("div",{staticClass:"chatsearchingempty"},[n("span",[e._v(e._s(e.$t("caption.chatsearchingempty")))])])])]):e._e()])],1)],1)])},a=[],s=n("2f62"),c=n("a54c"),l=n("087d"),u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active,mobile:e.mobile},attrs:{id:"teamroom"}},[n("div",{staticClass:"teamChatWrapper",on:{click:e.click}},[n("div",{staticClass:"iconWrapper"},[e._m(0),e.teamNotifications>0?n("div",{staticClass:"unseen"},[e._v(" "+e._s(e.teamNotifications))]):e._e()]),n("div",{staticClass:"infoWrapper"},[e._m(1),n("div",{staticClass:"previewMessage"},[e.pocketteammessages&&e.pocketteammessages.length>0?n("span",[e._v(" "+e._s(e.pocketteammessages[e.pocketteammessages.length-1].previewText)+" ")]):e._e()])])])])},d=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"logo"},[n("img",{attrs:{src:"https://pocketnet.app/img/logo20.svg"}})])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"infoName"},[n("span",[e._v("Bastyon")])])}],f={name:"teamroom",props:{},data:function(){return{}},created:()=>{},watch:{},computed:Object(s["c"])({...Object(s["c"])(["minimized","active","pocketnet","pocketteammessages","readedteammessages"]),mobile:function(){return this.$store.state.mobile},teamNotifications:function(){var e=this;return _.filter(this.pocketteammessages,(function(t){return!e.readedteammessages[t.id]})).length}}),methods:{click:function(){this.$emit("click")}}},h=f,p=n("2877");function m(e){var t=n("f9d6");t.__inject__&&t.__inject__(e)}var v=Object(p["a"])(h,u,d,!1,m,"9b340a7a",null,!0),g=v.exports,y=n("3139"),b={name:"list",data:function(){return{loading:!1,enabled:!0,page:0,revealed:{},lastEventDescription:"",blocked:!1,searchText:""}},components:{preview:l["a"],dummypreviews:c["a"],teamroom:g},props:{user_data:{type:String,default:()=>{}}},created:()=>{},watch:{topchatid:function(){this.hmode&&this.$emit("scrolltop")},active:function(){this.searchText=""}},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},computed:Object(s["c"])({window:function(){return window},auth:e=>e.auth,teamNotifications:function(){var e=this;return _.filter(this.pocketteammessages,(function(t){return!e.readedteammessages[t.id]})).length},...Object(s["c"])(["minimized","active","pocketnet","chatsready","prechats","chats","unauthorized","share","pocketteammessages","readedteammessages","deletedrooms","hideOptimization","wasunhidden"]),showchatslist:function(){return!this.hideOptimization},rooms:function(){return this.core.mtrx.client.getRooms()},empty:function(){return this.core.mtrx.ready&&0===this.chats.length},topchatid:function(){if(this.chats&&this.chats.length)return this.chats[this.chats.length-1].roomId},chats:function(e){var t=this,n=[];return _.each(e.chats,e=>{if(!this.deletedrooms[e.roomId]){this.core.mtrx.kit.tetatetchat(this.m_chat);var r=this.core.mtrx.chatUsersInfo(e.roomId,"anotherChatUsers");1===r.length&&r[0]&&t.core.mtrx.client.isUserIgnored(y["a"].getMatrixIdFull(r[0].id,t.core.domain))||n.push(e)}}),_.sortBy(n,(function(e){return e.lastModified})).reverse()},filteredchats:function(){var e=this.chats;if(this.searchText){var t=_.filter(_.map(e,e=>{var t=this.core.mtrx.chatUsersInfo(e.roomId,"anotherChatUsers"),n=this.core.mtrx.client.getRoom(e.roomId),r=_.reduce(t,(function(e,t){return e+t.name.toLowerCase()}),""),i="";n&&"public"===n.getJoinRule()&&n.currentState.getStateEvents("m.room.name").length>0&&(i=n.currentState.getStateEvents("m.room.name")[0].getContent().name),i||(i=n.name,"#"==i[0]&&(i=""));var o=(i+r).toLowerCase(),a=0;return o.indexOf(this.searchText)>-1&&(a=this.searchText.length/o.length),{chat:n.summary,point:a}}),(function(e){return e.point}));t=_.sortBy(t,(function(e){return e.point})).reverse(),e=_.map(t,e=>e.chat)}return e},withoutBlockedChats:function(){var e=this;this.share&&_.map(e.chats,(function(e){}))},activeuser:function(){return this.core.user.userinfo},hmode(){return this.pocketnet&&this.minimized&&!this.active}}),methods:{search(e){this.searchText=e.toLowerCase()},invitepnt(){this.core.invitepnt()},generatekeys:function(){},moment(){return moment()},dd(e){},revealFirstRight(){this.$refs.list.revealRight(0)},revealFirstLeft(){this.$refs.list.revealLeft(0)},remove(e){this.$set(this.mockSwipeList,this.page,this.mockSwipeList[this.page].filter(t=>t!==e))},setLastEvent(e,t){let{item:n,index:r}=t;this.lastEventDescription={name:e,index:r,id:n.id}},itemClick(e){if(this.hmode)this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"main"}),this.$store.commit("setiteraction",!0);else if(this.share){var t=this.share;this.$store.commit("SHARE",null),this.$store.commit("icon",{icon:"loading",message:"",manual:!0}),this.core.mtrx.shareInChat(e.roomId,t).then(n=>{this.$store.commit("icon",{icon:"success",message:""}),this.$router.push(t.route||"chat?id="+e.roomId).catch(e=>{})}).catch(e=>{console.error(e),this.$store.commit("icon",{icon:"error",message:""}),t.route&&this.$router.push(t.route).catch(e=>{})})}else this.$router.push("chat?id="+e.roomId).catch(e=>{})},fbClick(e){},sbClick(e){},openTeamRoom:function(){this.hmode?(this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"main"}),this.$store.commit("setiteraction",!0)):(setTimeout(()=>{this.$store.commit("SET_READEDTEAMMESSAGES",this.pocketteammessages),this.$store.commit("ALL_NOTIFICATIONS_COUNT",this.core.mtrx.client.getRooms())},500),this.$router.push("/teamroom").catch(e=>{}))},onKeyDown(e){16===e.keyCode&&(this.enabled=!1)},onKeyUp(e){16===e.keyCode&&(this.enabled=!0)},removeRoom(e){this.$dialog.confirm("Do you really want to leave room?",{okText:this.$i18n.t("yes"),cancelText:this.$i18n.t("cancel")}).then(t=>{this.core.mtrx.client.leave(e).then(t=>{this.core.mtrx.client.forget(e,!0).then(e=>e).then(t=>{this.$store.commit("DELETE_ROOM",e),this.$router.push({path:"/chats"}).catch(e=>{})})})})},tetatetchat(e){if(!e)return!0;var t=this.core.mtrx.client.getRoom(e.roomId);return!t||this.core.mtrx.kit.tetatetchat(this.core.mtrx.client.getRoom(e.roomId))}},mounted(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.hmode||this.$store.commit("SET_LAST_ROOM",null)}},w=b;function x(e){var t=n("191a");t.__inject__&&t.__inject__(e);var r=n("b551");r.__inject__&&r.__inject__(e)}var k=Object(p["a"])(w,o,a,!1,x,"57da332f",null,!0),S=k.exports,E=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"chatsTopheader"}},[n("topheader",{scopedSlots:e._u([{key:"left",fn:function(){return[e.share?n("div",{staticClass:"iconbutton",on:{click:e.cancelShare}},[n("i",{staticClass:"fas fa-times"})]):e._e(),e.minimized&&!e.active||!e.pocketnet||e.share?e._e():n("div",{staticClass:"iconbutton",on:{click:e.minimizeall}},[n("i",{staticClass:"fas fa-times"})]),e.pocketnet||e.share?e._e():n("div",{staticClass:"iconbutton",on:{click:e.gotoapp}},[n("i",{staticClass:"fas fa-angle-left"})])]},proxy:!0},{key:"leftadd",fn:function(){},proxy:!0},{key:"info",fn:function(){return[e.share?e._e():n("span",[e._v(e._s(e.$t("caption.chats")))]),e.share?n("span",[e._v(e._s(e.$t("caption.shareWith")))]):e._e()]},proxy:!0},{key:"rightadd",fn:function(){return[!e.share&&e.pocketnet?n("router-link",{attrs:{to:"settings"}},[n("div",{staticClass:"iconbuttonsmall"},[n("i",{staticClass:"fas fa-cog"})])]):e._e()]},proxy:!0},{key:"right",fn:function(){return[e.share||e.minimized&&!e.active?n("div",[e.window.cordova?n("div",{staticClass:"iconbutton",on:{click:e.cordovashare}},[n("i",{staticClass:"fas fa-share-alt"})]):e._e()]):n("div",{staticClass:"iconbutton",on:{click:e.newchat}},[n("i",{staticClass:"fas fa-plus"})])]},proxy:!0}])})],1)},C=[],T=n("71da"),I={name:"chatsTopheader",props:{},components:{contacts:T["a"]},data:function(){return{loading:!1,newchatopened:!1,createGroup:!1,contacts:!1}},created(){this.$store.commit("SET_CURRENT_ROOM","all")},destroyed(){this.$store.commit("SET_CURRENT_ROOM",!1)},watch:{},computed:Object(s["c"])({auth:e=>e.auth,minimized:e=>e.minimized,pocketnet:e=>e.pocketnet,active:e=>e.active,...Object(s["c"])(["share","closebybg"]),window:function(){return window}}),methods:{changeCloseByBg:function(){this.$store.commit("closebybg",!this.closebybg)},gotoapp:function(){this.core.backtoapp&&this.core.backtoapp()},cordovashare:function(){var e=this.share,t={};e.messages&&(t.message=e.messages.join(". ")),(e.images||e.files)&&(t.files=[].concat(e.images,e.files),t.files=_.filter(t.files,(function(e){return e}))),window.plugins&&window.plugins.socialsharing&&window.plugins.socialsharing.shareWithOptions(t),this.cancelShare()},cancelShare:function(){this.share&&this.share.route&&this.$router.push(this.share.route).catch(e=>{}),this.$store.commit("SHARE",null)},newchatmenu:function(){this.newchatopened=!this.newchatopened},minimizeall:function(){this.$store.commit("minimize",!0)},newchat:function(){this.$emit("newchat")}}},R=I;function O(e){var t=n("4cbb");t.__inject__&&t.__inject__(e)}var M=Object(p["a"])(R,E,C,!1,O,"06594ccd",null,!0),A=M.exports,P=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"chatcreate"}},[n("div",{staticClass:"selecttype"},[n("div",{staticClass:"work"},[e.type?e._e():n("div",{staticClass:"types"},e._l(e.types,(function(t){return n("div",{key:t.id,staticClass:"type",on:{click:function(n){return e.selecttype(t.id)}}},[n("div",{staticClass:"icon"},[n("i",{class:t.icon})]),n("div",[n("span",[e._v(e._s(e.$t("type."+t.id)))])])])})),0),e.type?n("div",{staticClass:"selectedtype"},[n("div",{staticClass:"icon",on:{click:e.unselecttype}},[n("i",{staticClass:"fas fa-arrow-left"})]),n("div",{staticClass:"label"},[e._v(" "+e._s(e.$t("typelabel."+e.type.id))+" ")]),n("div",{staticClass:"completewrapper"},[n("button",{staticClass:"button small rounded",class:{orange:e.cancomplete,ghost:!e.cancomplete},on:{click:function(t){return e.complete()}}},[e._v(" "+e._s(e.$t("caption.create"))+" "),n("i",{class:e.type.icon}),e._v(" "),e.selectedLength?n("span",[e._v(e._s(e.selectedLength))]):e._e()])])]):e._e()]),n("div",{staticClass:"creationbody"},[e.type?n("div",{staticClass:"groupsettigns"},[n("div",{staticClass:"namebuttoncreate"},[n("div",{staticClass:"groupNameInput"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:e.groupName,expression:"groupName"}],attrs:{type:"text",placeholder:"privategroup"===e.type.id?this.$i18n.t("caption.addGroupNamePlaceHolder"):this.$i18n.t("caption.addPublicChatName")},domProps:{value:e.groupName},on:{input:function(t){t.target.composing||(e.groupName=t.target.value)}}})])])])]):e._e(),e.type?e._e():n("div",{staticClass:"contactswrapper oneonone"},[n("contacts",{attrs:{mode:"Select"},on:{select:e.selectoneuser}})],1),e.type?n("div",{staticClass:"contactswrapper"},[n("contacts",{attrs:{mode:"Selectmany"},on:{selectedUsers:e.selectedUsers}})],1):e._e()])])])},j=[],D={name:"chatcreate",props:{},components:{contacts:T["a"]},data:function(){return{loading:!1,types:{privategroup:{id:"privategroup",icon:"fas fa-user-friends",value:"private"},publicgroup:{id:"publicgroup",icon:"fas fa-users",value:"public"}},type:null,groupName:"",selected:{}}},created:()=>{},watch:{},computed:Object(s["c"])({auth:e=>e.auth,cancomplete:function(){return!!this.type&&("privategroup"==this.type.id?this.selectedLength>1:"publicgroup"==this.type.id?!!this.groupName:void 0)},selectedLength:function(){return _.toArray(this.selected).length}}),methods:{unselecttype:function(){this.type=null,this.selected={}},selecttype:function(e){this.type=this.types[e],this.selected={}},selectedUsers:function(e){this.selected=e},selectoneuser:function(e){var t=this.core.mtrx.kit.tetatetid(e,this.core.user.userinfo);this.$router.push("chat?id="+t+"&u="+e.id).catch(e=>{})},complete(){this.createGroupAction(this.selected).then(e=>{this.$emit("completed",e),this.$store.commit("icon",{icon:"success",message:""})}).catch(e=>{var t="An unexpected error occurred";"cantcomplete"==e&&(t="Please enter a group name and add chat members"),this.$store.commit("icon",{icon:"error",message:t})})},createGroupAction(e){if(!this.cancomplete)return Promise.reject("cantcomplete");if(!this.type)return Promise.reject("type");if(_.isEmpty(e))return Promise.reject("users");const t=this.core.mtrx.kit.groupIdLight(e);return this.$store.state.globalpreloader=!0,this.core.mtrx.client.createRoom({visibility:this.type.value,invite:t.idForInviting,name:"@"+(this.groupName?this.groupName:"New Room"),initial_state:[{type:"m.room.guest_access",state_key:"",content:{guest_access:"can_join"}}]}).then(e=>(this.$store.state.globalpreloader=!1,e)).catch(e=>(this.$store.state.globalpreloader=!1,Promise.reject(e)))}}},L=D;function N(e){var t=n("e8d4");t.__inject__&&t.__inject__(e)}var $=Object(p["a"])(L,P,j,!1,N,"f0734632",null,!0),U=$.exports,B={name:"pagechats",components:{list:S,topheader:A,contacts:T["a"],chatcreate:U},props:{share:Object},data:function(){return{newChat:!1}},computed:Object(s["c"])({pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active,mobile:e=>e.mobile,hiddenInParent:e=>e.hiddenInParent}),methods:{newchat:function(){this.newChat=!0},closeNewChat:function(){this.newChat=!1},chatcreated:function(e){this.$router.push({path:"chat",query:{id:e.room_id}}).catch(e=>{})},scrolltop:function(){this.$refs["maincontent"].scroll(0)}},mounted(){}},F=B;function z(e){var t=n("b051");t.__inject__&&t.__inject__(e)}var q=Object(p["a"])(F,r,i,!1,z,"62a1ab6a",null,!0);t["default"]=q.exports},"9a55":function(e,t,n){var r=n("79bb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2f2118a6",r,e)}},"9b54":function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n("f60b").Buffer,o=n(3);function a(e,t,n){e.copy(t,n)}e.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";var t=this.head,n=""+t.data;while(t=t.next)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;var t=i.allocUnsafe(e>>>0),n=this.head,r=0;while(n)a(n.data,t,r),r+=n.data.length,n=n.next;return t},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},"9bed":function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0});const o=r("69fc"),a=r("b8d8"),s=r("3dc0"),c=r("bbd4"),l=31;class u{constructor(e,t,n){this._finished=!1,this._cipher=e,this._L=t,this._LInv=n,this._buffer=new o.default,this._bufferPos=0,this._counter=0,this._offset=new o.default,this._tag=new o.default}static importKey(e,t){return i(this,void 0,void 0,(function*(){const n=yield e.importBlockCipherKey(t),r=new o.default;yield n.encryptBlock(r);const i=new Array(l);for(let e=0;e0;e--){const t=a.select(1&s.data[e-1],128,0);s.data[e]=s.data[e]>>>1|t}return s.data[0]>>>=1,s.data[0]^=a.select(c,128,0),s.data[o.default.SIZE-1]^=a.select(c,o.default.R>>>1,0),new u(n,i,s)}))}reset(){return this._buffer.clear(),this._bufferPos=0,this._counter=0,this._offset.clear(),this._tag.clear(),this._finished=!1,this}clear(){this.reset(),this._cipher.clear()}update(e){return i(this,void 0,void 0,(function*(){if(this._finished)throw new Error("pmac: already finished");const t=o.default.SIZE-this._bufferPos;let n=0,r=e.length;r>t&&(this._buffer.data.set(e.slice(0,t),this._bufferPos),n+=t,r-=t,yield this._processBuffer());while(r>o.default.SIZE)this._buffer.data.set(e.slice(n,n+o.default.SIZE)),n+=o.default.SIZE,r-=o.default.SIZE,yield this._processBuffer();return r>0&&(this._buffer.data.set(e.slice(n,n+r),this._bufferPos),this._bufferPos+=r),this}))}finish(){return i(this,void 0,void 0,(function*(){if(this._finished)throw new Error("pmac: already finished");return this._bufferPos===o.default.SIZE?(c.xor(this._tag.data,this._buffer.data),c.xor(this._tag.data,this._LInv.data)):(c.xor(this._tag.data,this._buffer.data.slice(0,this._bufferPos)),this._tag.data[this._bufferPos]^=128),yield this._cipher.encryptBlock(this._tag),this._finished=!0,this._tag.clone().data}))}_processBuffer(){return i(this,void 0,void 0,(function*(){c.xor(this._offset.data,this._L[s.ctz(this._counter+1)].data),c.xor(this._buffer.data,this._offset.data),this._counter++,yield this._cipher.encryptBlock(this._buffer),c.xor(this._tag.data,this._buffer.data),this._bufferPos=0}))}}n.PMAC=u},"9bf2":function(e,t,n){var r=n("83ab"),i=n("0cfb"),o=n("aed9"),a=n("825a"),s=n("a04b"),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",f="configurable",h="writable";t.f=r?o?function(e,t,n){if(a(e),t=s(t),a(n),"function"===typeof e&&"prototype"===t&&"value"in n&&h in n&&!n[h]){var r=u(e,t);r&&r[h]&&(e[t]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),i)try{return l(e,t,n)}catch(r){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"9c0e":function(e,t,n){"use strict";(function(t){var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n("903c"),a=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[u]=null,e[a]=null,e[s]=null,t(h(n,!1)))}}function m(e){t.nextTick(p,e)}function v(e,t){return function(n,r){e.then((function(){t[l]?n(h(void 0,!0)):t[d](n,r)}),r)}}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((r={get stream(){return this[f]},next:function(){var e=this,n=this[c];if(null!==n)return Promise.reject(n);if(this[l])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(n,r){t.nextTick((function(){e[c]?r(e[c]):n(h(void 0,!0))}))}));var r,i=this[u];if(i)r=new Promise(v(i,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(h(o,!1));r=new Promise(this[d])}return this[u]=r,r}},i(r,Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),g),b=function(e){var t,n=Object.create(y,(t={},i(t,f,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[u]=null,n[a]=null,n[s]=null,e(h(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[u]=null,n[a]=null,n[s]=null,t(e)),void(n[c]=e)}var r=n[a];null!==r&&(n[u]=null,n[a]=null,n[s]=null,r(h(void 0,!0))),n[l]=!0})),e.on("readable",m.bind(null,n)),n};e.exports=b}).call(this,n("4362"))},"9c21":function(t,n,r){"use strict";(function(t){var i=r("1da1"),o=(r("907a"),r("d9e2"),r("3139")),a=r("6129"),s=r("3db6");const c=r("399f");var l=r("a099"),u="PR7srzZt4EfcNb3s27grgmiG8aB9vYNV82",d=null,f=function(){var n=Object(i["a"])((function*(n,r,a){let{ls:f,lse:p}=a;var m=this;this.configurable=!1;var v={},g=12,y={},b=new h;r.pcrypto=m,m.clear=function(){({}),y={},[],v={}};var w="pcrypto5_"+r.roomId+"_",x="e_pcrypto5_";m.preparedUsers=function(e){return _.filter(T(e),(function(e){return e.keys&&e.keys.length>=g}))},m.cantchat=function(){var e=m.preparedUsers();return!!(n.core.mtrx.kit.tetatetchat(r)&&e.length&&e.length<2)},m.canBeEncrypt=function(e){var t=_.toArray(y),i=n.core.mtrx.kit.chatIsPublic(r);return!!(!i&&n.user&&n.user.private&&12==n.user.private.length&&v[n.user.userinfo.id]&&n.core.mtrx.kit.tetatetchat(r)&&t.length>1&&t.length<50&&m.preparedUsers(e).length/t.length>.6)},m.userschanded=function(){return m.cantchat()?(m.clear(),m.prepare()):Promise.resolve()};var k=function(){var e=_.map(v,(function(e){return e.id}));return n.core.user.usersInfo(e).then(e=>(y={},_.each(e,(function(e){y[e.id]=e})),Promise.resolve()))},S=function(){var e=n.core.mtrx.kit.tetatetchat(r),t=_.filter(_.map(r.currentState.getStateEvents("m.room.member"),(function(t){var n=t.event,r=n.content.membership;return"join"==r||"leave"==r&&!e||e&&"invite"==r?{time:n.origin_server_ts||1,membership:r,id:"invite"==r?o["a"].getmatrixid(n.state_key):o["a"].getmatrixid(n.sender)}:null})),(function(e){return e}));return t=_.sortBy(t,(function(e){return e.time})),t},E=function(e){for(var t=0,n=S(),r=n.length-1;r>=0;r--)n[r].timee))return!0}else if(t.start&&!t.end)return!0}));if(n)return!0}))};m.getusersinfobytime=T,m.prepare=function(){return C(),k().then(e=>m)};var R={aeskeys:{inp:function(e){var t={};return _.each(e,(function(e,n){t[n]=o["a"]._arrayBufferToBase64(e)})),t},out:function(e){var t={};return _.each(e,(function(e,n){t[n]=new Uint8Array(o["a"]._base64ToArrayBuffer(e))})),t}}},O={aeskeysls:function(e,t){e||(e=0),t||(t=n.currentblock.height),n.core.mtrx.kit.tetatetchat(r)||(t=10);var o=E(e)+"-"+t;return f.get(`${w+n.user.userinfo.id}-${o}`).then(e=>{const t=R.aeskeys.out(e);return{keys:t,k:o}}).catch(function(){var r=Object(i["a"])((function*(r){const i=O.aeskeys(e,t);if(m.preparedUsers(e).length>1){const e=`${w+n.user.userinfo.id}-${o}`;yield f.set(e,R.aeskeys.inp(i)).catch(()=>{})}return{keys:i,k:o}}));return function(e){return r.apply(this,arguments)}}())},aeskeys:function(e,t){return e||(e=0),t||(t=n.currentblock.height),M.aeskeys(e,t)}},M={cuhash:function(e,t,r){return l.pbkdf2Sync(o["a"].sha224(_.map(e,(function(e){return e.keys[t]})).join("")+(r||n.currentblock.height)).toString("hex"),u,1,32,"sha256")},userspublics:function(e,r){var i=m.preparedUsers(e),o={};return _.each(i,(function(a){if(!(a.id==n.user.userinfo.id&&i.length>1)){var s=_.map(a.keys,(function(e){return t.from(e,"hex")}));o[a.id]=M.points(e,r,s)}})),o},current:function(e,r){var i=_.map(n.user.private,(function(e){return e.private})),o=t.allocUnsafe(32),a=M.scalars(e,r,i).toBuffer();return a.copy(o,32-a.length),o},scalars:function(e,t,n){for(var r=m.preparedUsers(e),i=null,o=0;o{console.error("Error clearing item on LS.CLEAR")}),new Error(u)}));return function(e,n,r,i){return t.apply(this,arguments)}}(),m.encrypt=function(){var e=Object(i["a"])((function*(e,t){let{keys:n}=yield O.aeskeysls();if(n[e])return yield D(t,n[e]);throw new Error("emptykey")}));return function(t,n){return e.apply(this,arguments)}}(),m.decryptEvent=function(){var t=Object(i["a"])((function*(t){if(t.content.hash)return m.decryptEventGroup(t);if(!n.user.userinfo)throw new Error("userinfo");if(t.decrypting)return t.decrypting;var r=`${x+n.user.userinfo.id}-${t.event_id}`,a=p.get(r).then(t=>{var n=null;try{n=JSON.parse(t)}catch(e){}return n?Promise.resolve(n):Promise.reject()}).catch(function(){var e=Object(i["a"])((function*(e){const i=o["a"].getmatrixid(t.sender),a=n.user.userinfo.id;let s,c;const l=JSON.parse(o["a"].Base64.decode(t.content.body)),u=t.origin_server_ts||1,d=t.content.block;if(i==a?_.find(l,(function(e,t){if(t!=a)return s=t,c=t,!0})):(c=a,s=i),!l[c])throw new Error("emptyforme");return m.decrypt(s,l[c],u,d).then(e=>{var t={body:e,msgtype:"m.text"};return p.set(r,JSON.stringify(t)),t})}));return function(t){return e.apply(this,arguments)}}()).finally(()=>{delete t.decrypting});return t.decrypting=a,a}));return function(e){return t.apply(this,arguments)}}(),m.encryptFile=function(){var e=Object(i["a"])((function*(e,t){var n=yield b.randomkey(),r=yield m.encryptKey(n),i={file:null,secrets:r};return b.encryptFile(e,n,t).then(e=>(i.file=e,Promise.resolve(i))).catch(e=>(console.error(e),Promise.reject(e)))}));return function(t,n){return e.apply(this,arguments)}}(),m.decryptFile=function(){var e=Object(i["a"])((function*(e,t,n){return b.decryptFile(e,t,n).then(e=>Promise.resolve(e))}));return function(t,n,r){return e.apply(this,arguments)}}(),m.encryptKey=function(){var e=Object(i["a"])((function*(e){var t=m.preparedUsers(),i=n.currentblock.height;n.core.mtrx.kit.tetatetchat(r)||(i=10);for(var a={block:i,keys:{}},s=0;se.id),e=>e&&e!=n.user.userinfo.id).join("")+"_v4");return t};m.sendCommonKey=function(){return m.createMyCommonKey().then(e=>n.core.mtrx.client.sendStateEvent(r.roomId,"m.room.encryption",e.export,"pcrypto."+n.user.userinfo.id+"."+e.export.hash)).then(e=>m.getCommonKey()).catch(e=>(console.error(e),Promise.reject(e)))};var P=function(e,t){var i=t||A();e||(e=n.user.userinfo.id);var o="pcrypto."+e+"."+i,a=r.currentState.getStateEvents("m.room.encryption"),s=_.find(a,e=>e.event.state_key==o);if(s)return s};m.getCommonKey=function(e,t){return o["a"].pretry(()=>{var n=P(e,t);return n},50,5e3).then(()=>{var n=P(e,t);return n||Promise.reject("m.room.encryption event not found"),Promise.resolve(n.event)})},m.getOrCreateCommonKey=function(){var e=null,t=P(),n=null;return n=t?Promise.resolve(t.event):m.sendCommonKey(),n.then(t=>(e=t,m.decryptKey(t))).then(t=>({key:t,hash:e.content.hash,block:e.content.block}))},m.createMyCommonKey=function(){var e=A(),t={private:{},export:{}};return b.randomkey().then(e=>(t.private.secret=e,b.key(e))).then(n=>(t.private.key=n,t.private.hash=e,t.export.hash=e,m.encryptKey(t.private.secret))).then(e=>(t.export.keys=e.keys,t.export.block=e.block,t))},m.decryptEventGroup=function(e){if(!n.user.userinfo)throw new Error("userinfo");if(e.decrypting)return e.decrypting;var r=e.content.hash,i=o["a"].getmatrixid(e.sender),a=(e.content.block,m.getCommonKey(i,r).then(e=>m.decryptKey(e)).then(n=>b.decrypt(t.from(e.content.body,"hex"),n).then(e=>{var t=new TextDecoder,n={body:t.decode(new Uint8Array(e)),msgtype:"m.text"};return Promise.resolve(n)})).finally(()=>{delete e.decrypting}));return e.decrypting=a,a},m.encryptEventGroup=function(){var e=Object(i["a"])((function*(e){var n={msgtype:"m.encrypted",body:{}};return m.getOrCreateCommonKey().then(r=>{n.block=r.block,n.hash=r.hash;let i=new TextEncoder;return b.encrypt(i.encode(e),r.key).then(e=>(n.body=t.from(e).toString("hex"),Promise.resolve(n)))})}));return function(t){return e.apply(this,arguments)}}();var j=function(){var e=Object(i["a"])((function*(e,t){let{encrypted:n,nonce:r}=t;var i=yield s["SIV"].importKey(e,"AES-SIV"),a=new Uint8Array(o["a"]._base64ToArrayBuffer(n)),c=new Uint8Array(o["a"]._base64ToArrayBuffer(r)),l=yield i.open(a,c),u=yield(new TextDecoder).decode(l);return u}));return function(t,n){return e.apply(this,arguments)}}(),D=function(){var e=Object(i["a"])((function*(e,t){let n=yield s["SIV"].importKey(t,"AES-SIV"),r=new Uint8Array((new TextEncoder).encode(e)),i=new Uint8Array(32);window.crypto.getRandomValues(i);let a=yield n.seal(r,i),c={encrypted:o["a"]._arrayBufferToBase64(a.buffer),nonce:o["a"]._arrayBufferToBase64(i.buffer)};return c}));return function(t,n){return e.apply(this,arguments)}}();return m}));return function(e,t,r){return n.apply(this,arguments)}}(),h=function(){var e=this,t=[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],n=function(e){let t=new FileReader;return window.cordova&&(t=t._realReader),t.readAsArrayBuffer(e),new Promise((e,n)=>{t.onloadend=function(n){e(t.result)},t.onerror=function(){n(t.error)}})},r=function(e,t){return new(window.wFile||window.File)([e],"encrypted",{type:"encrypted/"+t.type,name:t.name})},i=function(e,t){return new(window.wFile||window.File)([e],"decrypted",{type:(t.type||"").replace("encrypted/",""),name:"Unnamed"})};return e.randomkey=function(){return new Promise(e=>{var t=new Uint32Array(24),n=window.crypto.getRandomValues(t).toString("hex");e(n)})},e.key=function(e){let t=new TextEncoder;function n(){return window.crypto.subtle.importKey("raw",t.encode(e),"PBKDF2",!1,["deriveBits","deriveKey"])}return n().then(e=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t.encode("matrix.pocketnet"),iterations:1e4,hash:"SHA-256"},e,{name:"AES-CBC",length:256},!0,["encrypt","decrypt"]))},e.encryptFile=function(t,i,o){return n(t).then(t=>e.encrypt(t,i,o)).then(e=>Promise.resolve(r(e,t)))},e.decryptFile=function(t,r,o){return n(t).then(t=>e.decrypt(t,r,o)).then(e=>Promise.resolve(i(e,t)))},e.encrypt=function(n,r,i){return n&&r?(i||(i={}),i.charsetEnc=i.charsetEnc||"utf8",i.charsetDec=i.charsetDec||"hex",e.key(r).then(e=>crypto.subtle.encrypt({name:"AES-CBC",iv:new Uint8Array(t)},e,n)).then((function(e){return e}))):Promise.reject("data")},e.decrypt=function(n,r,i){return n&&r?(i||(i={}),i.charsetEnc=i.charsetEnc||"utf8",i.charsetDec=i.charsetDec||"hex",e.key(r).then(e=>crypto.subtle?crypto.subtle.decrypt({name:"AES-CBC",iv:new Uint8Array(t)},e,n):Promise.reject("crypto.subtle")).then((function(e){return e})).catch(e=>(console.error(e),Promise.reject(e)))):Promise.reject("data")},e},p=function(e,t){d=new c("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);var n,r,o=this;return o.core=e,o.clearStorage=function(){o.core.mtrx.clearstorage("pcrypto")},o.currentblock={height:1},o.blocks={},o.user=null,o.rooms={},o.init=function(e){o.user=e},o.destroy=function(){_.each(o.rooms,(function(e){e.clear()})),o.rooms={}},o.addroom=function(t){return pretry(()=>e.user.private&&12==e.user.private.length).then(function(){var e=Object(i["a"])((function*(e){if(o.rooms[t.roomId])return o.rooms[t.roomId].prepare();var i=yield new f(o,t,{ls:n,lse:r});return o.rooms[t.roomId]=i,i.prepare()}));return function(t){return e.apply(this,arguments)}}())},o.set={block:function(e){e&&e.height>o.currentblock.height&&(o.currentblock=e),e.height&&(o.blocks[e.height]=e)}},o.helpers={checkuser:function(){if(e.user&&e.user.private&&12==e.user.private.length&&e.user.userinfo&&e.user.userinfo.keys&&e.user.userinfo.keys.length){var t=e.user.userinfo.keys.join(","),n=_.map(e.user.private,(function(e){return e.public})).join(",");return t==n}return!1}},o.prepare=function(){return Promise.all([Object(a["a"])("messages",1),Object(a["a"])("events",1)]).then(e=>(n=e[0],r=e[1],Promise.resolve()))},o};n["a"]=p}).call(this,r("b639").Buffer)},"9dd7":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".actions[data-v-16157ecb]{padding-top:9em}.connect[data-v-16157ecb]{padding-top:2em}.connect[data-v-16157ecb] .previewWrapper{display:block;max-width:70%;margin:0 auto;padding:2em 0}.connect[data-v-16157ecb] .iconWrapper{margin:0 auto}.connect[data-v-16157ecb] .infoWrapper{padding:0}.connect .connectCaption[data-v-16157ecb]{max-width:70%;margin:0 auto}.connect .connectCaption span[data-v-16157ecb]{font-size:.8em}#userUnauthorized[data-v-16157ecb]{height:100%}#userUnauthorized.bin[data-v-16157ecb]{transition:.3s}#userUnauthorized.bin.minimized .wrapper[data-v-16157ecb]{top:60px;bottom:100px}#userUnauthorized.bin.minimized[data-v-16157ecb]:not(.active){width:44px}#userUnauthorized.bin.minimized:not(.active) .actions[data-v-16157ecb]{display:none}#userUnauthorized.bin.active .wrapper[data-v-16157ecb]{width:344px;transform:translateX(-300px)}.table[data-v-16157ecb]{height:100%}.table .cell[data-v-16157ecb]{vertical-align:middle}",""]),e.exports=t},"9e54":function(e,t,n){"use strict";var r=n("c973").default;n("d9e2");var i=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.LocalIndexedDBStoreBackend=y;var o=n("2d78"),a=i(n("3987")),s=i(n("6146")),c=n("63c7");const l=3;function u(e){e.createObjectStore("users",{keyPath:["userId"]}),e.createObjectStore("accountData",{keyPath:["type"]}),e.createObjectStore("sync",{keyPath:["clobber"]})}function d(e){const t=e.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]});t.createIndex("room","room_id")}function f(e){e.createObjectStore("client_options",{keyPath:["clobber"]})}function h(e,t,n){const r=e.openCursor(t);return new Promise((e,t)=>{const i=[];r.onerror=e=>{t(new Error("Query failed: "+e.target.errorCode))},r.onsuccess=t=>{const r=t.target.result;r?(i.push(n(r)),r.continue()):e(i)}})}function p(e){return new Promise((t,n)=>{e.oncomplete=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function m(e){return new Promise((t,n)=>{e.onsuccess=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function v(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e),e.onerror=e=>n(e)})}function g(e){return m(e).then(e=>e.target.result)}function y(e,t){this.indexedDB=e,this._dbName="matrix-js-sdk:"+(t||"default"),this.db=null,this._disconnected=!0,this._syncAccumulator=new o.SyncAccumulator,this._isNewlyCreated=!1}y.exists=function(e,t){return t="matrix-js-sdk:"+(t||"default"),s.exists(e,t)},y.prototype={connect:function(){if(!this._disconnected)return c.logger.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this._disconnected=!1,c.logger.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this._dbName,l);return e.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;c.logger.log("LocalIndexedDBStoreBackend.connect: upgrading from "+n),n<1&&(this._isNewlyCreated=!0,u(t)),n<2&&d(t),n<3&&f(t)},e.onblocked=()=>{c.logger.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},c.logger.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),m(e).then(e=>(c.logger.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.target.result,this.db.onversionchange=()=>{this.db.close()},this._init()))},isNewlyCreated:function(){return Promise.resolve(this._isNewlyCreated)},_init:function(){return Promise.all([this._loadAccountData(),this._loadSyncData()]).then(e=>{let[t,n]=e;c.logger.log("LocalIndexedDBStoreBackend: loaded initial data"),this._syncAccumulator.accumulate({next_batch:n.nextBatch,rooms:n.roomsData,groups:n.groupsData,account_data:{events:t}},!0)})},getOutOfBandMembers:function(e){return new Promise((t,n)=>{const r=this.db.transaction(["oob_membership_events"],"readonly"),i=r.objectStore("oob_membership_events"),o=i.index("room"),a=IDBKeyRange.only(e),s=o.openCursor(a),c=[];let l=!1;s.onsuccess=e=>{const n=e.target.result;if(!n)return c.length||l?t(c):t(null);const r=n.value;r.oob_written?l=!0:c.push(r),n.continue()},s.onerror=e=>{n(e)}}).then(t=>(c.logger.log("LL: got "+(t&&t.length)+` membershipEvents from storage for room ${e} ...`),t))},setOutOfBandMembers:function(){var e=r((function*(e,t){c.logger.log("LL: backend about to store "+t.length+" members for "+e);const n=this.db.transaction(["oob_membership_events"],"readwrite"),r=n.objectStore("oob_membership_events");t.forEach(e=>{r.put(e)});const i={room_id:e,oob_written:!0,state_key:0};r.put(i),yield p(n),c.logger.log(`LL: backend done storing for ${e}!`)}));return function(t,n){return e.apply(this,arguments)}}(),clearOutOfBandMembers:function(){var e=r((function*(e){const t=this.db.transaction(["oob_membership_events"],"readonly"),n=t.objectStore("oob_membership_events"),r=n.index("room"),i=IDBKeyRange.only(e),o=g(r.openKeyCursor(i,"next")).then(e=>e&&e.primaryKey[1]),a=g(r.openKeyCursor(i,"prev")).then(e=>e&&e.primaryKey[1]),[s,l]=yield Promise.all([o,a]),u=this.db.transaction(["oob_membership_events"],"readwrite"),d=u.objectStore("oob_membership_events"),f=IDBKeyRange.bound([e,s],[e,l]);c.logger.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,s],[e,l]),yield v(d.delete(f))}));return function(t){return e.apply(this,arguments)}}(),clearDatabase:function(){return new Promise((e,t)=>{c.logger.log("Removing indexeddb instance: "+this._dbName);const n=this.indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{c.logger.log("can't yet delete indexeddb "+this._dbName+" because it is open elsewhere")},n.onerror=t=>{c.logger.warn("unable to delete js-sdk store indexeddb: "+t.target.error),e()},n.onsuccess=()=>{c.logger.log("Removed indexeddb instance: "+this._dbName),e()}})},getSavedSync:function(e){void 0===e&&(e=!0);const t=this._syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(a.deepCopy(t)):Promise.resolve(t):Promise.resolve(null)},getNextBatchToken:function(){return Promise.resolve(this._syncAccumulator.getNextBatchToken())},setSyncData:function(e){return Promise.resolve().then(()=>{this._syncAccumulator.accumulate(e)})},syncToDatabase:function(e){const t=this._syncAccumulator.getJSON(!0);return Promise.all([this._persistUserPresenceEvents(e),this._persistAccountData(t.accountData),this._persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])},_persistSyncData:function(e,t,n){return c.logger.log("Persisting sync data up to",e),a.promiseTry(()=>{const r=this.db.transaction(["sync"],"readwrite"),i=r.objectStore("sync");return i.put({clobber:"-",nextBatch:e,roomsData:t,groupsData:n}),p(r)})},_persistAccountData:function(e){return a.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readwrite"),n=t.objectStore("accountData");for(let r=0;r{const t=this.db.transaction(["users"],"readwrite"),n=t.objectStore("users");for(const r of e)n.put({userId:r[0],event:r[1]});return p(t)})},getUserPresenceEvents:function(){return a.promiseTry(()=>{const e=this.db.transaction(["users"],"readonly"),t=e.objectStore("users");return h(t,void 0,e=>[e.value.userId,e.value.event])})},_loadAccountData:function(){return c.logger.log("LocalIndexedDBStoreBackend: loading account data..."),a.promiseTry(()=>{const e=this.db.transaction(["accountData"],"readonly"),t=e.objectStore("accountData");return h(t,void 0,e=>e.value).then(e=>(c.logger.log("LocalIndexedDBStoreBackend: loaded account data"),e))})},_loadSyncData:function(){return c.logger.log("LocalIndexedDBStoreBackend: loading sync data..."),a.promiseTry(()=>{const e=this.db.transaction(["sync"],"readonly"),t=e.objectStore("sync");return h(t,void 0,e=>e.value).then(e=>(c.logger.log("LocalIndexedDBStoreBackend: loaded sync data"),e.length>1&&c.logger.warn("loadSyncData: More than 1 sync row found."),e.length>0?e[0]:{}))})},getClientOptions:function(){return Promise.resolve().then(()=>{const e=this.db.transaction(["client_options"],"readonly"),t=e.objectStore("client_options");return h(t,void 0,e=>{if(e.value&&e.value&&e.value.options)return e.value.options}).then(e=>e[0])})},storeClientOptions:function(){var e=r((function*(e){const t=this.db.transaction(["client_options"],"readwrite"),n=t.objectStore("client_options");n.put({clobber:"-",options:e}),yield p(t)}));return function(t){return e.apply(this,arguments)}}()}},"9e6a":function(e,t,n){"use strict";var r=n("d233"),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",d=function(e,t){var n,d={},f=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,h=t.parameterLimit===1/0?void 0:t.parameterLimit,p=f.split(t.delimiter,h),m=-1,v=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(y=o(y)?[y]:y),i.call(d,g)?d[g]=r.combine(d[g],y):d[g]=y}return d},f=function(e,t,n,r){for(var i=r?t:c(t,n),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&n.parseArrays)a=[].concat(i);else{a=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[],a[u]=i):"__proto__"!==l&&(a[l]=i):a={0:i}}i=a}return i},h=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&a.exec(o),l=c?o.slice(0,c.index):o,u=[];if(l){if(!n.plainObjects&&i.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}var d=0;while(n.depth>0&&null!==(c=s.exec(o))&&d=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,n("c8ba"),n("4362"))},a026:function(t,n,r){"use strict";r.r(n),function(t){ +t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<>1,u=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=f,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=l}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,c,l=8*o-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),t+=a+d>=1?f/c:f*Math.pow(2,1-d),t*c>=2&&(a++,c/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,l-=8);e[n+h-p]|=128*m}},"91dd":function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!==typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var c=1e3;o&&"number"===typeof o.maxKeys&&(c=o.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var u=0;u=0?(d=m.substr(0,v),f=m.substr(v+1)):(d=m,f=""),h=decodeURIComponent(d),p=decodeURIComponent(f),r(a,h)?i(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},9205:function(e,t,n){"use strict";n.r(t);var r=n("5e55");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"92a6":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"contacts-preview"},[n("div",{staticClass:"previewWrapper",style:e.isUser},[n("div",{staticClass:"iconWrapper"},[n("userpic",{attrs:{userinfo:e.contact,mode:"Contacts"}})],1),n("div",{staticClass:"infoWrapper"},[n("div",{staticClass:"summaryLine"},[n("div",{staticClass:"caption"},[n("span",[e._v(e._s(e.contact.name))])])])])])])},i=[],o=n("2f62"),a={name:"contactsPreview",props:{contact:{},mode:{default:"",type:String},user:null},components:{},data:function(){return{loading:!1,isUser:"",asd:{}}},computed:Object(o["c"])({auth:e=>e.auth}),methods:{},mounted(){}},s=a,c=n("2877");function l(e){var t=n("4001");t.__inject__&&t.__inject__(e)}var u=Object(c["a"])(s,r,i,!1,l,"951b8314",null,!0);t["a"]=u.exports},"93e6":function(e,t,n){"use strict";var r=n("8707").Buffer,i=n("e372").Transform,o=n("3fb5");function a(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}function s(e){i.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}o(s,i),s.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(i){r=i}n(r)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(n){t=n}e(t)},s.prototype.update=function(e,t){if(a(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));var n=this._block,i=0;while(this._blockOffset+e.length-i>=this._blockSize){for(var o=this._blockOffset;o0;++s)this._length[s]+=c,c=this._length[s]/4294967296|0,c>0&&(this._length[s]-=4294967296*c);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=s},"94bc":function(e,t,n){var r=n("fbbb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("341a8e06",r,e)}},"94ca":function(e,t,n){var r=n("d039"),i=n("1626"),o=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n==u||n!=l&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},9523:function(e,t){function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},"956b":function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0});const o=r("b8d8"),a=r("ffd9"),s=r("bbd4"),c=r("8e08"),l=r("69fc"),u=r("8e26"),d=r("9bed"),f=r("9060");n.MAX_ASSOCIATED_DATA=126;class h{static importKey(e,t,n=new f.WebCryptoProvider){return i(this,void 0,void 0,(function*(){if(32!==e.length&&64!==e.length)throw new Error("AES-SIV: key must be 32 or 64-bytes (got "+e.length);const r=e.subarray(0,e.length/2|0),i=e.subarray(e.length/2|0);let o;switch(t){case"AES-SIV":o=yield u.CMAC.importKey(n,r);break;case"AES-CMAC-SIV":o=yield u.CMAC.importKey(n,r);break;case"AES-PMAC-SIV":o=yield d.PMAC.importKey(n,r);break;default:throw new c.NotImplementedError("Miscreant: algorithm not supported: "+t)}const a=yield n.importCTRKey(i);return new h(o,a)}))}constructor(e,t){this._mac=e,this._ctr=t,this._tmp1=new l.default,this._tmp2=new l.default}seal(e,t){return i(this,void 0,void 0,(function*(){if(t.length>n.MAX_ASSOCIATED_DATA)throw new Error("AES-SIV: too many associated data items");const r=l.default.SIZE+e.length,i=new Uint8Array(r),o=yield this._s2v(t,e);return i.set(o),p(o),i.set(yield this._ctr.encryptCtr(o,e),o.length),i}))}open(e,t){return i(this,void 0,void 0,(function*(){if(t.length>n.MAX_ASSOCIATED_DATA)throw new Error("AES-SIV: too many associated data items");if(e.length=l.default.SIZE){const e=t.length-l.default.SIZE;this._tmp1.data.set(t.subarray(e)),yield this._mac.update(t.subarray(0,e))}else this._tmp1.data.set(t),this._tmp1.data[t.length]=128,this._tmp2.dbl();return s.xor(this._tmp1.data,this._tmp2.data),yield this._mac.update(this._tmp1.data),this._mac.finish()}))}}function p(e){e[e.length-8]&=127,e[e.length-4]&=127}n.SIV=h},9589:function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.SearchResult=a;var i=r(n("3987")),o=n("bb76");function a(e,t){this.rank=e,this.context=t}a.fromJson=function(e,t){const n=e.context||{},r=n.events_before||[],s=n.events_after||[],c=new o.EventContext(t(e.result));return c.setPaginateToken(n.start,!0),c.addEvents(i.map(r,t),!0),c.addEvents(i.map(s,t),!1),c.setPaginateToken(n.end,!1),new a(e.rank,c)}},"966d":function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!==typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:o=new Array(s-1),a=0;while(a{const t=e.getPushActions(),n=this._pushProcessor.actionsForEvent(e);e.setPushActions(n);const r=this.getRoom(e.getRoomId());if(!r)return;const i=r.getUnreadNotificationCount("highlight"),o=!(!t||!t.tweaks)&&!!t.tweaks.highlight,a=!(!n||!n.tweaks)&&!!n.tweaks.highlight;if((o!==a||i>0)&&!r.hasUserReadEvent(this.getUserId(),e.getId())){let e=i;a&&!o&&e++,!a&&o&&e--,r.setUnreadNotificationCount("highlight",e);const t=r.getUnreadNotificationCount("total");t{if(t&&this.isRoomEncrypted(t.roomId)){const n=e.getContent(),r=Object.keys(n).filter(e=>Object.keys(n[e]["m.read"]).includes(this.getUserId())).length>0;if(!r)return;const i=20,o=t.getLiveTimeline().getEvents();let a=0;for(let e=o.length-1;e>=0;e--){if(e===o.length-i)return;const n=o[e];if(t.hasUserReadEvent(this.getUserId(),n.getId()))break;const r=this.getPushActionsForEvent(n);a+=r.tweaks&&r.tweaks.highlight?1:0}t.setUnreadNotificationCount("highlight",a)}})}function D(e,t,n,r,i,o){return L.apply(this,arguments)}function L(){return L=i((function*(e,t,n,r,i,o){if(!e._crypto)throw new Error("End-to-End encryption disabled");yield e._crypto.setDeviceVerification(t,n,r,i,o)})),L.apply(this,arguments)}function N(e,t){for(const n of t)e.prototype[n]=function(){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto[n](...arguments)}}function $(e,t,n,r){return Promise.resolve().then((function(){const r=U(e,n,t);return r?(F(t,n,f.EventStatus.ENCRYPTING),r.then(()=>{F(t,n,f.EventStatus.SENDING)})):null})).then((function(){let r;return e.scheduler&&(r=e.scheduler.queueEvent(n),r&&e.scheduler.getQueueForEvent(n).length>1&&F(t,n,f.EventStatus.QUEUED)),r||(r=z(e,n),t&&(r=r.then(e=>(t.updatePendingEvent(n,f.EventStatus.SENT,e.event_id),e)))),r})).then((function(e){return r&&r(null,e),e}),(function(e){S.logger.error("Error sending event",e.stack||e);try{n.error=e,F(t,n,f.EventStatus.NOT_SENT),e.event=n,r&&r(e)}catch(i){S.logger.error("Exception in error handler!",i.stack||e)}throw e}))}function U(e,t,n){if(t.isEncrypted())return null;if(!e.isRoomEncrypted(t.getRoomId()))return null;if(!e._crypto&&e.usingExternalCrypto)return null;if("m.reaction"===t.getType())return null;if(!e._crypto)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return e._crypto.encryptEvent(t,n)}function B(e,t,n){if("m.reaction"===n)return n;const r=e.isRoomEncrypted(t);return r?"m.room.encrypted":n}function F(e,t,n){e?e.updatePendingEvent(t,n):t.setStatus(n)}function z(e,t){let n=t.getTxnId();n||(n=e.makeTxnId(),t.setTxnId(n));const r={$roomId:t.getRoomId(),$eventType:t.getWireType(),$stateKey:t.getStateKey(),$txnId:n};let i;if(t.isState()){let e="/rooms/$roomId/state/$eventType";t.getStateKey()&&t.getStateKey().length>0&&(e="/rooms/$roomId/state/$eventType/$stateKey"),i=y.encodeUri(e,r)}else if(t.isRedaction()){const e="/rooms/$roomId/redact/$redactsEventId/$txnId";i=y.encodeUri(e,Object.assign({$redactsEventId:t.event.redacts},r))}else i=y.encodeUri("/rooms/$roomId/send/$eventType/$txnId",r);return e._http.authedRequest(void 0,"PUT",i,void 0,t.getWireContent()).then(e=>(S.logger.log(`Event sent to ${t.getRoomId()} with event id ${e.event_id}`),e))}function q(e,t,n,r,i,o){y.isFunction(i)&&(o=i,i=void 0);const a=y.encodeUri("/rooms/$roomId/state/m.room.member/$userId",{$roomId:t,$userId:n});return e._http.authedRequest(o,"PUT",a,void 0,{membership:r,reason:i})}function W(e,t,n,r,i,o){y.isFunction(i)&&(o=i,i=void 0);const a=y.encodeUri("/rooms/$room_id/$membership",{$room_id:t,$membership:r});return e._http.authedRequest(o,"POST",a,void 0,{user_id:n,reason:i})}function K(e,t,n){e&&e(n),t(n)}function V(e,t,n){e&&e(null,n),t(n)}function G(e,t){const n=Boolean(t&&t.preventReEmit);function r(t){const r=new f.MatrixEvent(t);return r.isEncrypted()&&(n||e.reEmitter.reEmit(r,["Event.decrypted"]),r.attemptDecryption(e._crypto)),n||e.reEmitter.reEmit(r,["Event.replaced"]),r}return r}y.inherits(j,c.EventEmitter),y.extend(j.prototype,l.MatrixBaseApis.prototype),j.prototype.rehydrateDevice=i((function*(){if(this._crypto)throw new Error("Cannot rehydrate device after crypto is initialized");if(!this._cryptoCallbacks.getDehydrationKey)return;const n=yield this.getDehydratedDevice();if(!n)return;if(!n.device_data||!n.device_id)return void S.logger.info("no dehydrated device found");const r=new t.Olm.Account;try{const e=n.device_data;if(e.algorithm!==_dehydration.DEHYDRATION_ALGORITHM)return void S.logger.warn("Wrong algorithm for dehydrated device");S.logger.log("unpickling dehydrated device");const t=yield this._cryptoCallbacks.getDehydrationKey(e,t=>{r.unpickle(new Uint8Array(t),e.account)});r.unpickle(t,e.account),S.logger.log("unpickled device");const i=yield this._http.authedRequest(void 0,"POST","/dehydrated_device/claim",void 0,{device_id:n.device_id},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"});if(!0===i.success){this.deviceId=n.device_id,S.logger.info("using dehydrated device");const e=this.pickleKey||"DEFAULT_KEY";return this._exportedOlmDeviceToImport={pickledAccount:r.pickle(e),sessions:[],pickleKey:e},r.free(),this.deviceId}return r.free(),void S.logger.info("not using dehydrated device")}catch(e){r.free(),S.logger.warn("could not unpickle",e)}})),j.prototype.getDehydratedDevice=i((function*(){try{return yield this._http.authedRequest(void 0,"GET","/dehydrated_device",void 0,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})}catch(e){return void S.logger.info("could not get dehydrated device",e.toString())}})),j.prototype.setDehydrationKey=function(){var e=i((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(this._crypto)return yield this._crypto._dehydrationManager.setKeyAndQueueDehydration(e,t,n);S.logger.warn("not dehydrating device if crypto is not enabled")}));return function(t){return e.apply(this,arguments)}}(),j.prototype.createDehydratedDevice=function(){var e=i((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(this._crypto)return yield this._crypto._dehydrationManager.setKey(e,t,n),yield this._crypto._dehydrationManager.dehydrateDevice();S.logger.warn("not dehydrating device if crypto is not enabled")}));return function(t){return e.apply(this,arguments)}}(),j.prototype.exportDevice=i((function*(){if(this._crypto)return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:yield this._crypto._olmDevice.export()};S.logger.warn("not exporting device if crypto is not enabled")})),j.prototype.clearStores=function(){if(this._clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];return e.push(this.store.deleteAllData()),this._cryptoStore&&e.push(this._cryptoStore.deleteAllData()),Promise.all(e)},j.prototype.getUserId=function(){return this.credentials&&this.credentials.userId?this.credentials.userId:null},j.prototype.getDomain=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null},j.prototype.getUserIdLocalpart=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null},j.prototype.getDeviceId=function(){return this.deviceId},j.prototype.supportsVoip=function(){return this._supportsVoip},j.prototype.setForceTURN=function(e){this._forceTURN=e},j.prototype.setSupportsCallTransfer=function(e){this._supportsCallTransfer=e},j.prototype.getSyncState=function(){return this._syncApi?this._syncApi.getSyncState():null},j.prototype.getSyncStateData=function(){return this._syncApi?this._syncApi.getSyncStateData():null},j.prototype.isInitialSyncComplete=function(){const e=this.getSyncState();return!!e&&("PREPARED"===e||"SYNCING"===e)},j.prototype.isGuest=function(){return this._isGuest},j.prototype.getScheduler=function(){return this.scheduler},j.prototype.setGuest=function(e){this._isGuest=e},j.prototype.retryImmediately=function(){return this._syncApi.retryImmediately()},j.prototype.getNotifTimelineSet=function(){return this._notifTimelineSet},j.prototype.setNotifTimelineSet=function(e){this._notifTimelineSet=e},j.prototype.getCapabilities=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(new Date).getTime();return this._cachedCapabilities&&!e&&t(S.logger.error(e),null)).then(e=>{e||(e={});const n=e["capabilities"]||{},r=Object.keys(n).length?O:6e4+5e3*Math.random();return this._cachedCapabilities={capabilities:n,expiration:t+r},S.logger.log("Caching capabilities: ",n),n})},j.prototype.initCrypto=i((function*(){if(!(0,_crypto.isCryptoAvailable)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this._crypto)return void S.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");if(!this._sessionStore)throw new Error("Cannot enable encryption: no sessionStore provided");if(!this._cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");S.logger.log("Crypto: Starting up crypto store..."),yield this._cryptoStore.startup(),S.logger.log("Crypto: initialising roomlist..."),yield this._roomList.init();const e=this.getUserId();if(null===e)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(null===this.deviceId)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new _crypto.Crypto(this,this._sessionStore,e,this.deviceId,this.store,this._cryptoStore,this._roomList,this._verificationMethods);this.reEmitter.reEmit(t,["crypto.keyBackupFailed","crypto.keyBackupSessionsRemaining","crypto.roomKeyRequest","crypto.roomKeyRequestCancellation","crypto.warning","crypto.devicesUpdated","crypto.willUpdateDevices","deviceVerificationChanged","userTrustStatusChanged","crossSigning.keysChanged"]),S.logger.log("Crypto: initialising crypto object..."),yield t.init({exportedOlmDevice:this._exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this._exportedOlmDeviceToImport,this.olmVersion=_crypto.Crypto.getOlmVersion(),t.registerEventHandlers(this),this._crypto=t})),j.prototype.isCryptoEnabled=function(){return null!==this._crypto},j.prototype.getDeviceEd25519Key=function(){return this._crypto?this._crypto.getDeviceEd25519Key():null},j.prototype.getDeviceCurve25519Key=function(){return this._crypto?this._crypto.getDeviceCurve25519Key():null},j.prototype.uploadKeys=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.uploadDeviceKeys()},j.prototype.downloadKeys=function(e,t){return null===this._crypto?Promise.reject(new Error("End-to-end encryption disabled")):this._crypto.downloadKeys(e,t)},j.prototype.getStoredDevicesForUser=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevicesForUser(e)||[]},j.prototype.getStoredDevice=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevice(e,t)||null},j.prototype.setDeviceVerified=function(e,t,n){void 0===n&&(n=!0);const r=D(this,e,t,n,null);return e==this.credentials.userId&&this._crypto.checkKeyBackup(),r},j.prototype.setDeviceBlocked=function(e,t,n){return void 0===n&&(n=!0),D(this,e,t,null,n)},j.prototype.setDeviceKnown=function(e,t,n){return void 0===n&&(n=!0),D(this,e,t,null,null,n)},j.prototype.requestVerificationDM=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerificationDM(e,t)},j.prototype.findVerificationRequestDMInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.findVerificationRequestDMInProgress(e)},j.prototype.getVerificationRequestsToDeviceInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getVerificationRequestsToDeviceInProgress(e)},j.prototype.requestVerification=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerification(e,t)},j.prototype.beginKeyVerification=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.beginKeyVerification(e,t,n)},j.prototype.setGlobalBlacklistUnverifiedDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalBlacklistUnverifiedDevices(e)},j.prototype.getGlobalBlacklistUnverifiedDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalBlacklistUnverifiedDevices()},j.prototype.setGlobalErrorOnUnknownDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalErrorOnUnknownDevices(e)},j.prototype.getGlobalErrorOnUnknownDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalErrorOnUnknownDevices()},N(j,["getCrossSigningId","getStoredCrossSigningForUser","checkUserTrust","checkDeviceTrust","checkOwnCrossSigningTrust","checkCrossSigningPrivateKey","legacyDeviceVerification","prepareToEncrypt","isCrossSigningReady","bootstrapCrossSigning","getCryptoTrustCrossSignedDevices","setCryptoTrustCrossSignedDevices","countSessionsNeedingBackup"]),N(j,["getEventEncryptionInfo","createRecoveryKeyFromPassphrase","isSecretStorageReady","bootstrapSecretStorage","addSecretStorageKey","hasSecretStorageKey","storeSecret","getSecret","isSecretStored","requestSecret","getDefaultSecretStorageKeyId","setDefaultSecretStorageKeyId","checkSecretStorageKey","checkSecretStoragePrivateKey"]),j.prototype.getEventSenderDeviceInfo=function(){var e=i((function*(e){return this._crypto?this._crypto.getEventSenderDeviceInfo(e):null}));return function(t){return e.apply(this,arguments)}}(),j.prototype.isEventSenderVerified=function(){var e=i((function*(e){const t=yield this.getEventSenderDeviceInfo(e);return!!t&&t.isVerified()}));return function(t){return e.apply(this,arguments)}}(),j.prototype.cancelAndResendEventRoomKeyRequest=function(e){return e.cancelAndResendKeyRequest(this._crypto,this.getUserId())},j.prototype.setRoomEncryption=function(e,t){if(!this._crypto)throw new Error("End-to-End encryption disabled");return this._crypto.setRoomEncryption(e,t)},j.prototype.isRoomEncrypted=function(e){const t=this.getRoom(e);if(!t)return!1;const n=t.currentState.getStateEvents("m.room.encryption","");return!!n},j.prototype.forceDiscardSession=function(e){if(!this._crypto)throw new Error("End-to-End encryption disabled");this._crypto.forceDiscardSession(e)},j.prototype.exportRoomKeys=function(){return this._crypto?this._crypto.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))},j.prototype.importRoomKeys=function(e,t){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.importRoomKeys(e,t)},j.prototype.checkKeyBackup=function(){return this._crypto.checkKeyBackup()},j.prototype.getKeyBackupVersion=function(){return this._http.authedRequest(void 0,"GET","/room_keys/version",void 0,void 0,{prefix:b.PREFIX_UNSTABLE}).then(e=>{if(e.algorithm!==olmlib.MEGOLM_BACKUP_ALGORITHM){const t="Unknown backup algorithm: "+e.algorithm;return Promise.reject(t)}if("object"===typeof e.auth_data&&e.auth_data.public_key)return e;{const e="Invalid backup data returned";return Promise.reject(e)}}).catch(e=>{if("M_NOT_FOUND"===e.errcode)return null;throw e})},j.prototype.isKeyBackupTrusted=function(e){return this._crypto.isKeyBackupTrusted(e)},j.prototype.getKeyBackupEnabled=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto._checkedForBackup?Boolean(this._crypto.backupKey):null},j.prototype.enableKeyBackup=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=e,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=new t.Olm.PkEncryption,this._crypto.backupKey.set_recipient_key(e.auth_data.public_key),this.emit("crypto.keyBackupStatus",!0),this._crypto.scheduleKeyBackupSend()},j.prototype.disableKeyBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=null,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=null,this.emit("crypto.keyBackupStatus",!1)},j.prototype.prepareKeyBackupVersion=function(){var e=i((function*(e){let{secureSecretStorage:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===this._crypto)throw new Error("End-to-end encryption disabled");const{keyInfo:n,encodedPrivateKey:r,privateKey:i}=yield this.createRecoveryKeyFromPassphrase(e);t&&(yield this.storeSecret("m.megolm_backup.v1",(0,olmlib.encodeBase64)(i)),S.logger.info("Key backup private key stored in secret storage"));const o={public_key:n.pubkey};return n.passphrase&&(o.private_key_salt=n.passphrase.salt,o.private_key_iterations=n.passphrase.iterations),{algorithm:olmlib.MEGOLM_BACKUP_ALGORITHM,auth_data:o,recovery_key:r}}));return function(t){return e.apply(this,arguments)}}(),j.prototype.isKeyBackupKeyStored=i((function*(){return this.isSecretStored("m.megolm_backup.v1",!1)})),j.prototype.createKeyBackupVersion=function(){var e=i((function*(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const t={algorithm:e.algorithm,auth_data:e.auth_data};yield this._crypto._signObject(t.auth_data),this._cryptoCallbacks.getCrossSigningKey&&this._crypto._crossSigningInfo.getId()&&(yield this._crypto._crossSigningInfo.signObject(t.auth_data,"master"));const n=yield this._http.authedRequest(void 0,"POST","/room_keys/version",void 0,t,{prefix:b.PREFIX_UNSTABLE});return yield this.checkKeyBackup(),this.getKeyBackupEnabled()||S.logger.error("Key backup not usable even though we just created it"),n}));return function(t){return e.apply(this,arguments)}}(),j.prototype.deleteKeyBackupVersion=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo&&this._crypto.backupInfo.version===e&&this.disableKeyBackup();const t=y.encodeUri("/room_keys/version/$version",{$version:e});return this._http.authedRequest(void 0,"DELETE",t,void 0,void 0,{prefix:b.PREFIX_UNSTABLE})},j.prototype._makeKeyBackupPath=function(e,t,n){let r;r=void 0!==t?y.encodeUri("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):void 0!==e?y.encodeUri("/room_keys/keys/$roomId",{$roomId:e}):"/room_keys/keys";const i=void 0===n?void 0:{version:n};return{path:r,queryData:i}},j.prototype.sendKeyBackup=function(e,t,n,r){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const i=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"PUT",i.path,i.queryData,r,{prefix:b.PREFIX_UNSTABLE})},j.prototype.scheduleAllGroupSessionsForBackup=i((function*(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");yield this._crypto.scheduleAllGroupSessionsForBackup()})),j.prototype.flagAllGroupSessionsForBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.flagAllGroupSessionsForBackup()},j.prototype.isValidRecoveryKey=function(t){try{return(0,_recoverykey.decodeRecoveryKey)(t),!0}catch(e){return!1}},j.prototype.keyBackupKeyFromPassword=function(e,t){return(0,_key_passphrase.keyFromAuthData)(t.auth_data,e)},j.prototype.keyBackupKeyFromRecoveryKey=function(e){return(0,_recoverykey.decodeRecoveryKey)(e)},j.RESTORE_BACKUP_ERROR_BAD_KEY="RESTORE_BACKUP_ERROR_BAD_KEY",j.prototype.restoreKeyBackupWithPassword=function(){var e=i((function*(e,t,n,r,i){const o=yield(0,_key_passphrase.keyFromAuthData)(r.auth_data,e);return this._restoreKeyBackup(o,t,n,r,i)}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),j.prototype.restoreKeyBackupWithSecretStorage=function(){var e=i((function*(e,t,n,r){const i=yield this.getSecret("m.megolm_backup.v1"),o=(0,_crypto.fixBackupKey)(i);if(o){const[e]=yield this._crypto.getSecretStorageKey();yield this.storeSecret("m.megolm_backup.v1",o,[e])}const a=(0,olmlib.decodeBase64)(o||i);return this._restoreKeyBackup(a,t,n,e,r)}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype.restoreKeyBackupWithRecoveryKey=function(e,t,n,r,i){const o=(0,_recoverykey.decodeRecoveryKey)(e);return this._restoreKeyBackup(o,t,n,r,i)},j.prototype.restoreKeyBackupWithCache=function(){var e=i((function*(e,t,n,r){const i=yield this._crypto.getSessionBackupPrivateKey();if(!i)throw new Error("Couldn't get key");return this._restoreKeyBackup(i,e,t,n,r)}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype._restoreKeyBackup=function(n,r,i,o){let{cacheCompleteCallback:a,progressCallback:s}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(null===this._crypto)throw new Error("End-to-end encryption disabled");let c=0,l=[];const u=this._makeKeyBackupPath(r,i,o.version),d=new t.Olm.PkDecryption;let f;try{f=d.init_with_private_key(n)}catch(e){throw d.free(),e}return f!==o.auth_data.public_key?Promise.reject({errcode:j.RESTORE_BACKUP_ERROR_BAD_KEY}):(this._crypto.storeSessionBackupPrivateKey(n).catch(e=>{S.logger.warn("Error caching session backup key:",e)}).then(a),s&&s({stage:"fetch"}),this._http.authedRequest(void 0,"GET",u.path,u.queryData,void 0,{prefix:b.PREFIX_UNSTABLE}).then(t=>{if(t.rooms)for(const[e,n]of Object.entries(t.rooms)){if(!n.sessions)continue;c+=Object.keys(n.sessions).length;const t=P(n.sessions,d,e);for(const n of t)n.room_id=e,l.push(n)}else if(t.sessions)c=Object.keys(t.sessions).length,l=P(t.sessions,d,r,l);else{c=1;try{const e=A(t,d);e.room_id=r,e.session_id=i,l.push(e)}catch(e){S.logger.log("Failed to decrypt megolm session from backup",e)}}return this.importRoomKeys(l,{progressCallback:s,untrusted:!0,source:"backup"})}).then(()=>this._crypto.setTrustedBackupPubKey(f)).then(()=>({total:c,imported:l.length})).finally(()=>{d.free()}))},j.prototype.deleteKeysFromBackup=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const r=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"DELETE",r.path,r.queryData,void 0,{prefix:b.PREFIX_UNSTABLE})},j.prototype.sendSharedHistoryKeys=function(){var e=i((function*(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const n=this._roomList.getRoomEncryption(e);if(!n)return void S.logger.error("Unknown room. Not sharing decryption keys");const r=yield this._crypto.downloadKeys(t),i={};for(const[a,s]of Object.entries(r))i[a]=Object.values(s);const o=this._crypto._getRoomDecryptor(e,n.algorithm);o.sendSharedHistoryInboundSessions?yield o.sendSharedHistoryInboundSessions(i):S.logger.warning("Algorithm does not support sharing previous keys",n.algorithm)}));return function(t,n){return e.apply(this,arguments)}}(),j.prototype.getGroup=function(e){return this.store.getGroup(e)},j.prototype.getGroups=function(){return this.store.getGroups()},j.prototype.getMediaConfig=function(e){return this._http.authedRequest(e,"GET","/config",void 0,void 0,{prefix:b.PREFIX_MEDIA_R0})},j.prototype.getRoom=function(e){return this.store.getRoom(e)},j.prototype.getRooms=function(){return this.store.getRooms()},j.prototype.getVisibleRooms=function(){const e=this.store.getRooms(),t=new Set;for(const n of e){const e=n.currentState.getStateEvents("m.room.create","");if(e){const n=e.getContent()["predecessor"];n&&n["room_id"]&&t.add(n["room_id"])}}return e.filter(e=>{const n=e.currentState.getStateEvents("m.room.tombstone","");return!n||!t.has(e.roomId)})},j.prototype.getUser=function(e){return this.store.getUser(e)},j.prototype.getUsers=function(){return this.store.getUsers()},j.prototype.setAccountData=function(e,t,n){const r=y.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e}),i=(0,b.retryNetworkOperation)(5,()=>this._http.authedRequest(void 0,"PUT",r,void 0,t));return n&&i.then(e=>n(null,e),n),i},j.prototype.getAccountData=function(e){return this.store.getAccountData(e)},j.prototype.getAccountDataFromServer=function(){var t=i((function*(t){if(this.isInitialSyncComplete()){const e=this.store.getAccountData(t);return e?e.getContent():null}const n=y.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:t});try{const e=yield this._http.authedRequest(void 0,"GET",n,void 0);return e}catch(e){if(e.data&&"M_NOT_FOUND"===e.data.errcode)return null;throw e}}));return function(e){return t.apply(this,arguments)}}(),j.prototype.getIgnoredUsers=function(){const e=this.getAccountData("m.ignored_user_list");return e&&e.getContent()&&e.getContent()["ignored_users"]?Object.keys(e.getContent()["ignored_users"]):[]},j.prototype.setIgnoredUsers=function(e,t){const n={ignored_users:{}};return e.map(e=>n.ignored_users[e]={}),this.setAccountData("m.ignored_user_list",n,t)},j.prototype.isUserIgnored=function(e){return-1!==this.getIgnoredUsers().indexOf(e)},j.prototype.joinRoom=function(e,t,n){if(y.isFunction(t))throw new Error("Expected 'opts' object, got function.");t=t||{},void 0===t.syncRoom&&(t.syncRoom=!0);const r=this.getRoom(e);if(r&&r.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(r);let i=Promise.resolve();t.inviteSignUrl&&(i=this._http.requestOtherUrl(void 0,"POST",t.inviteSignUrl,{mxid:this.credentials.userId}));const o={};t.viaServers&&(o["server_name"]=t.viaServers);const a={qsStringifyOptions:{arrayFormat:"repeat"}},s=this,c=new Promise((r,c)=>{i.then((function(t){const n={};t&&(n.third_party_signed=t);const r=y.encodeUri("/join/$roomid",{$roomid:e});return s._http.authedRequest(void 0,"POST",r,o,n,a)})).then((function(e){const n=e.room_id,r=new d.SyncApi(s,s._clientOpts),i=r.createRoom(n);return t.syncRoom,Promise.resolve(i)})).then((function(e){V(n,r,e)}),(function(e){K(n,c,e)}))});return c},j.prototype.resendEvent=function(e,t){return F(t,e,f.EventStatus.SENDING),$(this,t,e)},j.prototype.cancelPendingEvent=function(e){if([f.EventStatus.QUEUED,f.EventStatus.NOT_SENT].indexOf(e.status)<0)throw new Error("cannot cancel an event with status "+e.status);this.scheduler&&this.scheduler.removeEventFromQueue(e);const t=this.getRoom(e.getRoomId());F(t,e,f.EventStatus.CANCELLED)},j.prototype.setRoomName=function(e,t,n){return this.sendStateEvent(e,"m.room.name",{name:t},void 0,n)},j.prototype.setRoomAvatarUrl=function(e,t,n){return this.sendStateEvent(e,"m.room.avatar",{avatarUrl:t},void 0,n)},j.prototype.setRoomTopic=function(e,t,n){return this.sendStateEvent(e,"m.room.topic",{topic:t},void 0,n)},j.prototype.getRoomTags=function(e,t){const n=y.encodeUri("/user/$userId/rooms/$roomId/tags/",{$userId:this.credentials.userId,$roomId:e});return this._http.authedRequest(t,"GET",n,void 0)},j.prototype.setRoomTag=function(e,t,n,r){const i=y.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(r,"PUT",i,void 0,n)},j.prototype.deleteRoomTag=function(e,t,n){const r=y.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(n,"DELETE",r,void 0,void 0)},j.prototype.setRoomAccountData=function(e,t,n,r){const i=y.encodeUri("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this._http.authedRequest(r,"PUT",i,void 0,n)},j.prototype.setPowerLevel=function(e,t,n,r,i){let o={users:{}};r&&"m.room.power_levels"===r.getType()&&(o=y.deepCopy(r.getContent())),o.users[t]=n;const a=y.encodeUri("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this._http.authedRequest(i,"PUT",a,void 0,o)},j.prototype.sendEvent=function(e,t,n,r,i){return this._sendCompleteEvent(e,{type:t,content:n},r,i)},j.prototype._sendCompleteEvent=function(e,t,n,r){y.isFunction(n)&&(r=n,n=void 0),n||(n=this.makeTxnId());const i=new f.MatrixEvent(Object.assign(t,{event_id:"~"+e+":"+n,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:(new Date).getTime()})),o=this.getRoom(e),a=i.getAssociatedId();if(a&&a.startsWith("~")){const e=o.getPendingEvents().find(e=>e.getId()===a);e.once("Event.localEventIdReplaced",()=>{i.updateAssociatedId(e.getId())})}const s=i.getType();return S.logger.log(`sendEvent of type ${s} in ${e} with txnId ${n}`),i.setTxnId(n),i.setStatus(f.EventStatus.SENDING),o&&o.addPendingEvent(i,n),i.status===f.EventStatus.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):$(this,o,i,r)},j.prototype.redactEvent=function(e,t,n,r){const i="object"===typeof r?r:{},o=i.reason,a="function"===typeof r?r:void 0;return this._sendCompleteEvent(e,{type:"m.room.redaction",content:{reason:o},redacts:t},n,a)},j.prototype.sendMessage=function(e,t,n,r){return y.isFunction(n)&&(r=n,n=void 0),this.sendEvent(e,"m.room.message",t,n,r)},j.prototype.sendTextMessage=function(e,t,n,r){const i=w.makeTextMessage(t);return this.sendMessage(e,i,n,r)},j.prototype.sendNotice=function(e,t,n,r){const i=w.makeNotice(t);return this.sendMessage(e,i,n,r)},j.prototype.sendEmoteMessage=function(e,t,n,r){const i=w.makeEmoteMessage(t);return this.sendMessage(e,i,n,r)},j.prototype.sendImageMessage=function(e,t,n,r,i){y.isFunction(r)&&(i=r,r=void 0),r||(r="Image");const o={msgtype:"m.image",url:t,info:n,body:r};return this.sendMessage(e,o,i)},j.prototype.sendAudioMessage=function(e,t,n,r,i){y.isFunction(r)&&(i=r,r=void 0),r||(r="Audio");const o={msgtype:"m.audio",url:t,info:n,body:r};return this.sendMessage(e,o,i)},j.prototype.sendStickerMessage=function(e,t,n,r,i){y.isFunction(r)&&(i=r,r=void 0),r||(r="Sticker");const o={url:t,info:n,body:r};return this.sendEvent(e,"m.sticker",o,i,void 0)},j.prototype.sendHtmlMessage=function(e,t,n,r){const i=w.makeHtmlMessage(t,n);return this.sendMessage(e,i,r)},j.prototype.sendHtmlNotice=function(e,t,n,r){const i=w.makeHtmlNotice(t,n);return this.sendMessage(e,i,r)},j.prototype.sendHtmlEmote=function(e,t,n,r){const i=w.makeHtmlEmote(t,n);return this.sendMessage(e,i,r)},j.prototype.sendReceipt=function(e,t,n,r){if("function"===typeof n&&(r=n,n={}),this.isGuest())return Promise.resolve({});const i=y.encodeUri("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()}),o=this._http.authedRequest(r,"POST",i,void 0,n||{}),a=this.getRoom(e.getRoomId());return a&&a._addLocalEchoReceipt(this.credentials.userId,e,t),o},j.prototype.sendReadReceipt=function(){var e=i((function*(e,t,n){"function"===typeof t&&(n=t,t={}),t||(t={});const r=e.getId(),i=this.getRoom(e.getRoomId());if(i&&i.hasPendingEvent(r))throw new Error(`Cannot set read receipt to a pending event (${r})`);const o={"m.hidden":Boolean(t.hidden)};return this.sendReceipt(e,"m.read",o,n)}));return function(t,n,r){return e.apply(this,arguments)}}(),j.prototype.setRoomReadMarkers=function(){var e=i((function*(e,t,n,r){const i=this.getRoom(e);if(i&&i.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let o;if(n){if(o=n.getId(),i&&i.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);i&&i._addLocalEchoReceipt(this.credentials.userId,n,"m.read")}return this.setRoomReadMarkersHttpRequest(e,t,o,r)}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype.getUrlPreview=function(e,t,n){t=6e4*Math.floor(t/6e4);const r=t+"_"+e,i=this.urlPreviewCache[r];if(i)return n&&i.then(n).catch(n),i;const o=this._http.authedRequest(n,"GET","/preview_url",{url:e,ts:t},void 0,{prefix:b.PREFIX_MEDIA_R0});return this.urlPreviewCache[r]=o,o},j.prototype.sendTyping=function(e,t,n,r){if(this.isGuest())return Promise.resolve({});const i=y.encodeUri("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.credentials.userId}),o={typing:t};return t&&(o.timeout=n||2e4),this._http.authedRequest(r,"PUT",i,void 0,o)},j.prototype.getRoomUpgradeHistory=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getRoom(e);if(!n)return[];const r=[n];let i=n.currentState.getStateEvents("m.room.create","");while(i){S.logger.log("Looking at "+i.getId());const e=i.getContent()["predecessor"];if(!e||!e["room_id"])break;{S.logger.log("Looking at predecessor "+e["room_id"]);const n=this.getRoom(e["room_id"]);if(!n)break;if(t){const e=n.currentState.getStateEvents("m.room.tombstone","");if(!e||e.getContent()["replacement_room"]!==n.roomId)break}r.splice(0,0,n),i=n.currentState.getStateEvents("m.room.create","")}}let o=n.currentState.getStateEvents("m.room.tombstone","");while(o){const e=this.getRoom(o.getContent()["replacement_room"]);if(!e)break;if(e.roomId===n.roomId)break;if(t){if(i=e.currentState.getStateEvents("m.room.create",""),!i||!i.getContent()["predecessor"])break;const t=i.getContent()["predecessor"];if(t["room_id"]!==n.roomId)break}r.push(e);const a=new Set(r.map(e=>e.roomId));if(a.size1&&void 0!==arguments[1])||arguments[1];const n=this.getRoomUpgradeHistory(e);let r=n;if(!t){r=[];for(const t of n)if(r.push(t),t.roomId===e)break}const i={},o=[],a=e=>this.leave(e).then(()=>{i[e]=null}).catch(t=>(i[e]=t,null));for(const s of r)o.push(a(s.roomId));return Promise.all(o).then(()=>i)},j.prototype.ban=function(e,t,n,r){return W(this,e,t,"ban",n,r)},j.prototype.forget=function(e,t,n){void 0===t&&(t=!0);const r=W(this,e,void 0,"forget",void 0,n);if(!t)return r;const i=this;return r.then((function(t){return i.store.removeRoom(e),i.emit("deleteRoom",e),t}))},j.prototype.unban=function(e,t,n){const r=y.encodeUri("/rooms/$roomId/unban",{$roomId:e}),i={user_id:t};return this._http.authedRequest(n,"POST",r,void 0,i)},j.prototype.kick=function(e,t,n,r){return q(this,e,t,"leave",n,r)},j.prototype.getPushActionsForEvent=function(e){return e.getPushActions()||e.setPushActions(this._pushProcessor.actionsForEvent(e)),e.getPushActions()},j.prototype.setProfileInfo=function(e,t,n){const r=y.encodeUri("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this._http.authedRequest(n,"PUT",r,void 0,t)},j.prototype.setDisplayName=function(){var e=i((function*(e,t){const n=yield this.setProfileInfo("displayname",{displayname:e},t),r=this.getUser(this.getUserId());return r&&(r.displayName=e,r.emit("User.displayName",r.events.presence,r)),n}));return function(t,n){return e.apply(this,arguments)}}(),j.prototype.setAvatarUrl=function(){var e=i((function*(e,t){const n=yield this.setProfileInfo("avatar_url",{avatar_url:e},t),r=this.getUser(this.getUserId());return r&&(r.avatarUrl=e,r.emit("User.avatarUrl",r.events.presence,r)),n}));return function(t,n){return e.apply(this,arguments)}}(),j.prototype.mxcUrlToHttp=function(e,t,n,r,i){return(0,_.getHttpUriForMxc)(this.baseUrl,e,t,n,r,i)},j.prototype._unstable_setStatusMessage=function(e){const t="im.vector.user_status";return Promise.all(this.getRooms().map(n=>{const r="join"===n.getMyMembership(),i=2===n.getInvitedAndJoinedMemberCount();if(!r||!i)return Promise.resolve();const o=n.currentState.mayClientSendStateEvent(t,this);return o?this.sendStateEvent(n.roomId,t,{status:e},this.getUserId()):Promise.resolve()}))},j.prototype.setPresence=function(e,t){const n=y.encodeUri("/presence/$userId/status",{$userId:this.credentials.userId});"string"===typeof e&&(e={presence:e});const r=["offline","online","unavailable"];if(-1==r.indexOf(e.presence))throw new Error("Bad presence value: "+e.presence);return this._http.authedRequest(t,"PUT",n,void 0,e)},j.prototype.getPresence=function(e,t){const n=y.encodeUri("/presence/$userId/status",{$userId:e});return this._http.authedRequest(t,"GET",n,void 0,void 0)},j.prototype.scrollback=function(e,t,n){y.isFunction(t)&&(n=t,t=void 0),t=t||30;let r=0,i=this._ongoingScrollbacks[e.roomId]||{};if(i.promise)return i.promise;if(i.errorTs){const e=Date.now()-i.errorTs;r=Math.max(I-e,0)}if(null===e.oldState.paginationToken)return Promise.resolve(e);const o=this.store.scrollback(e,t).length;if(o===t)return Promise.resolve(e);t-=o;const a=this,s=new Promise((i,o)=>{(0,y.sleep)(r).then((function(){return a._createMessagesRequest(e.roomId,e.oldState.paginationToken,t,"b")})).then((function(t){const r=y.map(t.chunk,G(a));if(t.state){const n=y.map(t.state,G(a));e.currentState.setUnknownStateEvents(n)}e.addEventsToTimeline(r,!0,e.getLiveTimeline()),e.oldState.paginationToken=t.end,0===t.chunk.length&&(e.oldState.paginationToken=null),a.store.storeEvents(e,r,t.end,!0),a._ongoingScrollbacks[e.roomId]=null,V(n,i,e)}),(function(t){a._ongoingScrollbacks[e.roomId]={errorTs:Date.now()},K(n,o,t)}))});return i={promise:s,errorTs:null},this._ongoingScrollbacks[e.roomId]=i,s},j.prototype.getEventTimeline=function(e,t){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(e.getTimelineForEvent(t))return Promise.resolve(e.getTimelineForEvent(t));const n=y.encodeUri("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let r=void 0;this._clientOpts.lazyLoadMembers&&(r={filter:JSON.stringify(u.Filter.LAZY_LOADING_MESSAGES_FILTER)});const i=this,o=i._http.authedRequest(void 0,"GET",n,r).then((function(n){if(!n.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);n.events_after.reverse();const r=n.events_after.concat([n.event]).concat(n.events_before),o=y.map(r,i.getEventMapper());let a=e.getTimelineForEvent(o[0].getId());if(a){const e=y.map(n.state,i.getEventMapper());a.getState(h.EventTimeline.BACKWARDS).setUnknownStateEvents(e)}else a=e.addTimeline(),a.initialiseState(y.map(n.state,i.getEventMapper())),a.getState(h.EventTimeline.FORWARDS).paginationToken=n.end;e.addEventsToTimeline(o,!0,a,n.start);const s=e.getTimelineForEvent(t)||a;return s}));return o},j.prototype._createMessagesRequest=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;const o=y.encodeUri("/rooms/$roomId/messages",{$roomId:e});void 0===n&&(n=30);const a={from:t,limit:n,dir:r};let s=null;return this._clientOpts.lazyLoadMembers&&(s=Object.assign({},u.Filter.LAZY_LOADING_MESSAGES_FILTER)),i&&(s=s||{},Object.assign(s,i.getRoomTimelineFilterComponent())),s&&(a.filter=JSON.stringify(s)),this._http.authedRequest(void 0,"GET",o,a)},j.prototype.paginateEventTimeline=function(e,t){const n=e.getTimelineSet()===this._notifTimelineSet;t=t||{};const r=t.backwards||!1;if(n&&!r)throw new Error("paginateNotifTimeline can only paginate backwards");const i=r?h.EventTimeline.BACKWARDS:h.EventTimeline.FORWARDS,o=e.getPaginationToken(i);if(!o)return Promise.resolve(!1);const a=e._paginationRequests[i];if(a)return a;let s,c,l;const u=this;if(n)s="/notifications",c={limit:"limit"in t?t.limit:30,only:"highlight"},o&&"end"!==o&&(c.from=o),l=this._http.authedRequest(void 0,"GET",s,c,void 0).then((function(t){const n=t.next_token,o=[];for(let e=0;e{i.then((function(){r.getPushRules().then((function(t){r.pushRules=t,e()}),(function(e){t(e)}))}),(function(e){r.getPushRules().then((function(n){r.pushRules=n,t(e)}),(function(n){t(e)}))}))})},j.prototype.searchMessageText=function(e,t){const n={search_term:e.query};return"keys"in e&&(n.keys=e.keys),this.search({body:{search_categories:{room_events:n}}},t)},j.prototype.searchRoomEvents=function(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:"recent",event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},n={_query:t,results:[],highlights:[]};return this.search({body:t}).then(this._processRoomEventsSearch.bind(this,n))},j.prototype.backPaginateRoomEventsSearch=function(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;const t={body:e._query,next_batch:e.next_batch},n=this.search(t).then(this._processRoomEventsSearch.bind(this,e)).finally((function(){e.pendingRequest=null}));return e.pendingRequest=n,n},j.prototype._processRoomEventsSearch=function(e,t){const n=t.search_categories.room_events;e.count=n.count,e.next_batch=n.next_batch;const r={};n.highlights.forEach((function(e){r[e]=1})),e.highlights.forEach((function(e){r[e]=1})),e.highlights=Object.keys(r);for(let i=0;iM)S.logger.debug("TURN creds are valid for another "+n+" ms: not fetching new ones."),e=!0;else{S.logger.debug("Fetching new TURN credentials");try{const t=yield this.turnServer();if(t.uris){S.logger.log("Got TURN URIs: "+t.uris+" refresh in "+t.ttl+" secs");const n={urls:t.uris,username:t.username,credential:t.password};this._turnServers=[n],this._turnServersExpiry=Date.now()+1e3*t.ttl,e=!0}}catch(r){S.logger.error("Failed to get TURN URIs",r),403===r.httpStatus&&(S.logger.info("TURN access unavailable for this account: stopping credentials checks"),null!==this._checkTurnServersIntervalID&&t.clearInterval(this._checkTurnServersIntervalID),this._checkTurnServersIntervalID=null)}}return e})),j.prototype.setFallbackICEServerAllowed=function(e){this._fallbackICEServerAllowed=e},j.prototype.isFallbackICEServerAllowed=function(){return this._fallbackICEServerAllowed},j.prototype.isSynapseAdministrator=function(){const e=y.encodeUri("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this._http.authedRequest(void 0,"GET",e,void 0,void 0,{prefix:""}).then(e=>e["admin"])},j.prototype.whoisSynapseUser=function(e){const t=y.encodeUri("/_synapse/admin/v1/whois/$userId",{$userId:e});return this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:""})},j.prototype.deactivateSynapseUser=function(e){const t=y.encodeUri("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this._http.authedRequest(void 0,"POST",t,void 0,void 0,{prefix:""})},j.prototype.startClient=function(){var e=i((function*(e){if(this.clientRunning)return;this.clientRunning=!0,"number"===typeof e&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new C.User(t)),this._crypto&&(this._crypto.uploadDeviceKeys(),this._crypto.start()),this._supportsVoip&&(this._checkTurnServersIntervalID=setInterval(()=>{this._checkTurnServers()},M),this._checkTurnServers()),this._syncApi&&(S.logger.error("Still have sync object whilst not running: stopping old one"),this._syncApi.stop()),e=Object.assign({},e),e.crypto=this._crypto,e.canResetEntireTimeline=e=>!!this._canResetTimelineCallback&&this._canResetTimelineCallback(e),this._clientOpts=e,this._syncApi=new d.SyncApi(this,e),this._syncApi.sync(),void 0!==e.clientWellKnownPollPeriod&&(this._clientWellKnownIntervalID=setInterval(()=>{this._fetchClientWellKnown()},1e3*e.clientWellKnownPollPeriod),this._fetchClientWellKnown())}));return function(t){return e.apply(this,arguments)}}(),j.prototype._fetchClientWellKnown=i((function*(){this._clientWellKnownPromise=T.AutoDiscovery.getRawClientConfig(this.getDomain()),this._clientWellKnown=yield this._clientWellKnownPromise,this.emit("WellKnown.client",this._clientWellKnown)})),j.prototype.getClientWellKnown=function(){return this._clientWellKnown},j.prototype.waitForClientWellKnown=function(){return this._clientWellKnownPromise},j.prototype._storeClientOptions=function(){const e=["boolean","string","number"],t=Object.entries(this._clientOpts).filter(t=>{let[n,r]=t;return e.includes(typeof r)}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});return this.store.storeClientOptions(t)},j.prototype._unstable_getSharedRooms=function(){var e=i((function*(e){if(!(yield this.doesServerSupportUnstableFeature("uk.half-shot.msc2666")))throw Error("Server does not support shared_rooms API");const t=y.encodeUri("/uk.half-shot.msc2666/user/shared_rooms/$userId",{$userId:e}),n=yield this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:b.PREFIX_UNSTABLE});return n.joined}));return function(t){return e.apply(this,arguments)}}(),j.prototype.stopClient=function(){S.logger.log("stopping MatrixClient"),this.clientRunning=!1,this._syncApi&&(this._syncApi.stop(),this._syncApi=null),this._crypto&&this._crypto.stop(),this._peekSync&&this._peekSync.stopPeeking(),this._callEventHandler&&(this._callEventHandler.stop(),this._callEventHandler=null),t.clearInterval(this._checkTurnServersIntervalID),void 0!==this._clientWellKnownIntervalID&&t.clearInterval(this._clientWellKnownIntervalID)},j.prototype.getVersions=function(){return this._serverVersionsPromise||(this._serverVersionsPromise=this._http.request(void 0,"GET","/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(e=>{throw this._serverVersionsPromise=null,e})),this._serverVersionsPromise},j.prototype.isVersionSupported=function(){var e=i((function*(e){const{versions:t}=yield this.getVersions();return t&&t.includes(e)}));return function(t){return e.apply(this,arguments)}}(),j.prototype.doesServerSupportLazyLoading=i((function*(){const e=yield this.getVersions();if(!e)return!1;const t=e["versions"],n=e["unstable_features"];return t&&t.includes("r0.5.0")||n&&n["m.lazy_load_members"]})),j.prototype.doesServerRequireIdServerParam=i((function*(){const e=yield this.getVersions();if(!e)return!0;const t=e["versions"];if(t&&t.includes("r0.6.0"))return!1;const n=e["unstable_features"];return!n||(void 0===n["m.require_identity_server"]||n["m.require_identity_server"])})),j.prototype.doesServerAcceptIdentityAccessToken=i((function*(){const e=yield this.getVersions();if(!e)return!1;const t=e["versions"],n=e["unstable_features"];return t&&t.includes("r0.6.0")||n&&n["m.id_access_token"]})),j.prototype.doesServerSupportSeparateAddAndBind=i((function*(){const e=yield this.getVersions();if(!e)return!1;const t=e["versions"],n=e["unstable_features"];return t&&t.includes("r0.6.0")||n&&n["m.separate_add_and_bind"]})),j.prototype.doesServerSupportUnstableFeature=function(){var e=i((function*(e){const t=yield this.getVersions();if(!t)return!1;const n=t["unstable_features"];return n&&!!n[e]}));return function(t){return e.apply(this,arguments)}}(),j.prototype.doesServerForceEncryptionForPreset=function(){var e=i((function*(e){const t=yield this.getVersions();if(!t)return!1;const n=t["unstable_features"];return n&&!!n["io.element.e2ee_forced."+e]}));return function(t){return e.apply(this,arguments)}}(),j.prototype.hasLazyLoadMembersEnabled=function(){return!!this._clientOpts.lazyLoadMembers},j.prototype.setCanResetTimelineCallback=function(e){this._canResetTimelineCallback=e},j.prototype.getCanResetTimelineCallback=function(){return this._canResetTimelineCallback},j.prototype.relations=function(){var e=i((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=B(this,e,r),a=yield this.fetchRelations(e,t,n,o,i),s=this.getEventMapper();let c;a.original_event&&(c=s(a.original_event));let l=a.chunk.map(s);if("m.room.encrypted"===o){const e=c?l.concat(c):l;yield Promise.all(e.map(e=>new Promise(t=>e.once("Event.decrypted",t)))),l=l.filter(e=>e.getType()===r)}return c&&"m.replace"===n&&(l=l.filter(e=>e.getSender()===c.getSender())),{originalEvent:c,events:l,nextBatch:a.next_batch}}));return function(t,n,r,i){return e.apply(this,arguments)}}(),j.prototype.getEventMapper=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return G(this,e)},j.prototype.getCrossSigningCacheCallbacks=function(){return this._crypto&&this._crypto._crossSigningInfo.getCacheCallbacks()},j.prototype.generateClientSecret=function(){return(0,k.randomString)(32)}}).call(this,r("c8ba"))},9818:function(e,t,n){var r=n("77ae");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("1d616953",r,e)}},"98e6":function(e,t,n){"use strict";var r=n("3fb5"),i=n("f576"),o=n("b5ca"),a=n("69f2"),s=n("6430");function c(e){s.call(this,"digest"),this._hash=e}r(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return e=e.toLowerCase(),"md5"===e?new i:"rmd160"===e||"ripemd160"===e?new o:new c(a(e))}},"994e":function(e,t,n){"use strict";n.r(t);var r=n("f5af");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},"9a41":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page chats",class:{pocketnet:e.pocketnet,mobile:e.mobile,minimized:e.minimized,active:e.active,newChat:e.newChat}},[n("topheader",{staticClass:"topheader",attrs:{share:e.share},on:{newchat:e.newchat}}),n("maincontent",{ref:"maincontent",attrs:{rbackexp:!0},scopedSlots:e._u([{key:"content",fn:function(){return[n("list",{attrs:{share:e.share},on:{scrolltop:e.scrolltop}}),e.newChat&&!e.hiddenInParent?n("modal",{on:{close:e.closeNewChat},scopedSlots:e._u([{key:"header",fn:function(){return[e._v(e._s(e.$t("caption.newChat")))]},proxy:!0},{key:"body",fn:function(){return[n("chatcreate",{on:{completed:e.chatcreated}})]},proxy:!0},{key:"footer",fn:function(){},proxy:!0}],null,!1,1284178828)}):e._e()]},proxy:!0}])})],1)},i=[],o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"chats-list",class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active,empty:e.empty}},[e.unauthorized?n("div",{staticClass:"dmdv"}):n("div",[!e.minimized||e.active?n("div",{staticClass:"work searchWrapperEA"},[n("search",{attrs:{minimize:e.minimized},on:{search:e.search}})],1):e._e(),!e.searchText&&this.chats.length<=2&&1==e.chatsready?n("teamroom",{on:{click:e.openTeamRoom}}):e._e(),!0!==e.chatsready?n("div",{staticClass:"listChatLoading"},[n("dummypreviews")],1):n("div",{staticClass:"Swipes"},[n("transition",{attrs:{name:"fade"}},[e.showchatslist?n("div",{staticClass:"desktopList"},[e.filteredchats.length||!e.searchText?n("div",{staticClass:"chatswrapper"},[n("RecycleScroller",{staticClass:"scroller",attrs:{"page-mode":"",items:e.filteredchats,"item-size":e.pocketnet?60:70,"key-field":"roomId",buffer:e.pocketnet?400:700},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.item,i=t.active;return[r?n("div",{ref:"content",staticClass:"card-content",on:{click:function(t){return e.itemClick(r)}}},[i?n("preview",{attrs:{chat:r}}):e._e()],1):e._e()]}}],null,!1,127139565)})],1):n("div",{staticClass:"work"},[n("div",{staticClass:"chatsearchingempty"},[n("span",[e._v(e._s(e.$t("caption.chatsearchingempty")))])])])]):e._e()])],1)],1)])},a=[],s=n("2f62"),c=n("a54c"),l=n("087d"),u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{bin:e.pocketnet,bout:!e.pocketnet,minimized:e.minimized,fix:e.pocketnet,active:e.active,mobile:e.mobile},attrs:{id:"teamroom"}},[n("div",{staticClass:"teamChatWrapper",on:{click:e.click}},[n("div",{staticClass:"iconWrapper"},[e._m(0),e.teamNotifications>0?n("div",{staticClass:"unseen"},[e._v(" "+e._s(e.teamNotifications))]):e._e()]),n("div",{staticClass:"infoWrapper"},[e._m(1),n("div",{staticClass:"previewMessage"},[e.pocketteammessages&&e.pocketteammessages.length>0?n("span",[e._v(" "+e._s(e.pocketteammessages[e.pocketteammessages.length-1].previewText)+" ")]):e._e()])])])])},d=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"logo"},[n("img",{attrs:{src:"https://pocketnet.app/img/logo20.svg"}})])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"infoName"},[n("span",[e._v("Bastyon")])])}],f={name:"teamroom",props:{},data:function(){return{}},created:()=>{},watch:{},computed:Object(s["c"])({...Object(s["c"])(["minimized","active","pocketnet","pocketteammessages","readedteammessages"]),mobile:function(){return this.$store.state.mobile},teamNotifications:function(){var e=this;return _.filter(this.pocketteammessages,(function(t){return!e.readedteammessages[t.id]})).length}}),methods:{click:function(){this.$emit("click")}}},h=f,p=n("2877");function m(e){var t=n("f9d6");t.__inject__&&t.__inject__(e)}var v=Object(p["a"])(h,u,d,!1,m,"9b340a7a",null,!0),g=v.exports,y=n("3139"),b={name:"list",data:function(){return{loading:!1,enabled:!0,page:0,revealed:{},lastEventDescription:"",blocked:!1,searchText:""}},components:{preview:l["a"],dummypreviews:c["a"],teamroom:g},props:{user_data:{type:String,default:()=>{}}},created:()=>{},watch:{topchatid:function(){this.hmode&&this.$emit("scrolltop")},active:function(){this.searchText=""}},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},computed:Object(s["c"])({window:function(){return window},auth:e=>e.auth,teamNotifications:function(){var e=this;return _.filter(this.pocketteammessages,(function(t){return!e.readedteammessages[t.id]})).length},...Object(s["c"])(["minimized","active","pocketnet","chatsready","prechats","chats","unauthorized","share","pocketteammessages","readedteammessages","deletedrooms","hideOptimization","wasunhidden"]),showchatslist:function(){return!this.hideOptimization},rooms:function(){return this.core.mtrx.client.getRooms()},empty:function(){return this.core.mtrx.ready&&0===this.chats.length},topchatid:function(){if(this.chats&&this.chats.length)return this.chats[this.chats.length-1].roomId},chats:function(e){var t=this,n=[];return _.each(e.chats,e=>{if(!this.deletedrooms[e.roomId]){this.core.mtrx.kit.tetatetchat(this.m_chat);var r=this.core.mtrx.chatUsersInfo(e.roomId,"anotherChatUsers");1===r.length&&r[0]&&t.core.mtrx.client.isUserIgnored(y["a"].getMatrixIdFull(r[0].id,t.core.domain))||n.push(e)}}),_.sortBy(n,(function(e){return e.lastModified})).reverse()},filteredchats:function(){var e=this.chats;if(this.searchText){var t=_.filter(_.map(e,e=>{var t=this.core.mtrx.chatUsersInfo(e.roomId,"anotherChatUsers"),n=this.core.mtrx.client.getRoom(e.roomId),r=_.reduce(t,(function(e,t){return e+t.name.toLowerCase()}),""),i="";n&&"public"===n.getJoinRule()&&n.currentState.getStateEvents("m.room.name").length>0&&(i=n.currentState.getStateEvents("m.room.name")[0].getContent().name),i||(i=n.name,"#"==i[0]&&(i=""));var o=(i+r).toLowerCase(),a=0;return o.indexOf(this.searchText)>-1&&(a=this.searchText.length/o.length),{chat:n.summary,point:a}}),(function(e){return e.point}));t=_.sortBy(t,(function(e){return e.point})).reverse(),e=_.map(t,e=>e.chat)}return e},withoutBlockedChats:function(){var e=this;this.share&&_.map(e.chats,(function(e){}))},activeuser:function(){return this.core.user.userinfo},hmode(){return this.pocketnet&&this.minimized&&!this.active}}),methods:{search(e){this.searchText=e.toLowerCase()},invitepnt(){this.core.invitepnt()},generatekeys:function(){},moment(){return moment()},dd(e){},revealFirstRight(){this.$refs.list.revealRight(0)},revealFirstLeft(){this.$refs.list.revealLeft(0)},remove(e){this.$set(this.mockSwipeList,this.page,this.mockSwipeList[this.page].filter(t=>t!==e))},setLastEvent(e,t){let{item:n,index:r}=t;this.lastEventDescription={name:e,index:r,id:n.id}},itemClick(e){if(this.hmode)this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"main"}),this.$store.commit("setiteraction",!0);else if(this.share){var t=this.share;this.$store.commit("SHARE",null),this.$store.commit("icon",{icon:"loading",message:"",manual:!0}),this.core.mtrx.shareInChat(e.roomId,t).then(n=>{this.$store.commit("icon",{icon:"success",message:""}),this.$router.push(t.route||"chat?id="+e.roomId).catch(e=>{})}).catch(e=>{console.error(e),this.$store.commit("icon",{icon:"error",message:""}),t.route&&this.$router.push(t.route).catch(e=>{})})}else this.$router.push("chat?id="+e.roomId).catch(e=>{})},fbClick(e){},sbClick(e){},openTeamRoom:function(){this.hmode?(this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"main"}),this.$store.commit("setiteraction",!0)):(setTimeout(()=>{this.$store.commit("SET_READEDTEAMMESSAGES",this.pocketteammessages),this.$store.commit("ALL_NOTIFICATIONS_COUNT",this.core.mtrx.client.getRooms())},500),this.$router.push("/teamroom").catch(e=>{}))},onKeyDown(e){16===e.keyCode&&(this.enabled=!1)},onKeyUp(e){16===e.keyCode&&(this.enabled=!0)},removeRoom(e){this.$dialog.confirm("Do you really want to leave room?",{okText:this.$i18n.t("yes"),cancelText:this.$i18n.t("cancel")}).then(t=>{this.core.mtrx.client.leave(e).then(t=>{this.core.mtrx.client.forget(e,!0).then(e=>e).then(t=>{this.$store.commit("DELETE_ROOM",e),this.$router.push({path:"/chats"}).catch(e=>{})})})})},tetatetchat(e){if(!e)return!0;var t=this.core.mtrx.client.getRoom(e.roomId);return!t||this.core.mtrx.kit.tetatetchat(this.core.mtrx.client.getRoom(e.roomId))}},mounted(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.hmode||this.$store.commit("SET_LAST_ROOM",null)}},w=b;function x(e){var t=n("191a");t.__inject__&&t.__inject__(e);var r=n("b551");r.__inject__&&r.__inject__(e)}var S=Object(p["a"])(w,o,a,!1,x,"57da332f",null,!0),k=S.exports,E=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"chatsTopheader"}},[n("topheader",{scopedSlots:e._u([{key:"left",fn:function(){return[e.share?n("div",{staticClass:"iconbutton",on:{click:e.cancelShare}},[n("i",{staticClass:"fas fa-times"})]):e._e(),e.minimized&&!e.active||!e.pocketnet||e.share?e._e():n("div",{staticClass:"iconbutton",on:{click:e.minimizeall}},[n("i",{staticClass:"fas fa-times"})]),e.pocketnet||e.share?e._e():n("div",{staticClass:"iconbutton",on:{click:e.gotoapp}},[n("i",{staticClass:"fas fa-angle-left"})])]},proxy:!0},{key:"leftadd",fn:function(){},proxy:!0},{key:"info",fn:function(){return[e.share?e._e():n("span",[e._v(e._s(e.$t("caption.chats")))]),e.share?n("span",[e._v(e._s(e.$t("caption.shareWith")))]):e._e()]},proxy:!0},{key:"rightadd",fn:function(){return[!e.share&&e.pocketnet?n("router-link",{attrs:{to:"settings"}},[n("div",{staticClass:"iconbuttonsmall"},[n("i",{staticClass:"fas fa-cog"})])]):e._e()]},proxy:!0},{key:"right",fn:function(){return[e.share||e.minimized&&!e.active?n("div",[e.window.cordova?n("div",{staticClass:"iconbutton",on:{click:e.cordovashare}},[n("i",{staticClass:"fas fa-share-alt"})]):e._e()]):n("div",{staticClass:"iconbutton",on:{click:e.newchat}},[n("i",{staticClass:"fas fa-plus"})])]},proxy:!0}])})],1)},C=[],T=n("71da"),I={name:"chatsTopheader",props:{},components:{contacts:T["a"]},data:function(){return{loading:!1,newchatopened:!1,createGroup:!1,contacts:!1}},created(){this.$store.commit("SET_CURRENT_ROOM","all")},destroyed(){this.$store.commit("SET_CURRENT_ROOM",!1)},watch:{},computed:Object(s["c"])({auth:e=>e.auth,minimized:e=>e.minimized,pocketnet:e=>e.pocketnet,active:e=>e.active,...Object(s["c"])(["share","closebybg"]),window:function(){return window}}),methods:{changeCloseByBg:function(){this.$store.commit("closebybg",!this.closebybg)},gotoapp:function(){this.core.backtoapp&&this.core.backtoapp()},cordovashare:function(){var e=this.share,t={};e.messages&&(t.message=e.messages.join(". ")),(e.images||e.files)&&(t.files=[].concat(e.images,e.files),t.files=_.filter(t.files,(function(e){return e}))),window.plugins&&window.plugins.socialsharing&&window.plugins.socialsharing.shareWithOptions(t),this.cancelShare()},cancelShare:function(){this.share&&this.share.route&&this.$router.push(this.share.route).catch(e=>{}),this.$store.commit("SHARE",null)},newchatmenu:function(){this.newchatopened=!this.newchatopened},minimizeall:function(){this.$store.commit("minimize",!0)},newchat:function(){this.$emit("newchat")}}},R=I;function O(e){var t=n("4cbb");t.__inject__&&t.__inject__(e)}var M=Object(p["a"])(R,E,C,!1,O,"06594ccd",null,!0),P=M.exports,A=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"chatcreate"}},[n("div",{staticClass:"selecttype"},[n("div",{staticClass:"work"},[e.type?e._e():n("div",{staticClass:"types"},e._l(e.types,(function(t){return n("div",{key:t.id,staticClass:"type",on:{click:function(n){return e.selecttype(t.id)}}},[n("div",{staticClass:"icon"},[n("i",{class:t.icon})]),n("div",[n("span",[e._v(e._s(e.$t("type."+t.id)))])])])})),0),e.type?n("div",{staticClass:"selectedtype"},[n("div",{staticClass:"icon",on:{click:e.unselecttype}},[n("i",{staticClass:"fas fa-arrow-left"})]),n("div",{staticClass:"label"},[e._v(" "+e._s(e.$t("typelabel."+e.type.id))+" ")]),n("div",{staticClass:"completewrapper"},[n("button",{staticClass:"button small rounded",class:{orange:e.cancomplete,ghost:!e.cancomplete},on:{click:function(t){return e.complete()}}},[e._v(" "+e._s(e.$t("caption.create"))+" "),n("i",{class:e.type.icon}),e._v(" "),e.selectedLength?n("span",[e._v(e._s(e.selectedLength))]):e._e()])])]):e._e()]),n("div",{staticClass:"creationbody"},[e.type?n("div",{staticClass:"groupsettigns"},[n("div",{staticClass:"namebuttoncreate"},[n("div",{staticClass:"groupNameInput"},[n("label",[n("input",{directives:[{name:"model",rawName:"v-model",value:e.groupName,expression:"groupName"}],attrs:{type:"text",placeholder:"privategroup"===e.type.id?this.$i18n.t("caption.addGroupNamePlaceHolder"):this.$i18n.t("caption.addPublicChatName")},domProps:{value:e.groupName},on:{input:function(t){t.target.composing||(e.groupName=t.target.value)}}})])])])]):e._e(),e.type?e._e():n("div",{staticClass:"contactswrapper oneonone"},[n("contacts",{attrs:{mode:"Select"},on:{select:e.selectoneuser}})],1),e.type?n("div",{staticClass:"contactswrapper"},[n("contacts",{attrs:{mode:"Selectmany"},on:{selectedUsers:e.selectedUsers}})],1):e._e()])])])},j=[],D={name:"chatcreate",props:{},components:{contacts:T["a"]},data:function(){return{loading:!1,types:{privategroup:{id:"privategroup",icon:"fas fa-user-friends",value:"private"},publicgroup:{id:"publicgroup",icon:"fas fa-users",value:"public"}},type:null,groupName:"",selected:{}}},created:()=>{},watch:{},computed:Object(s["c"])({auth:e=>e.auth,cancomplete:function(){return!!this.type&&("privategroup"==this.type.id?this.selectedLength>1:"publicgroup"==this.type.id?!!this.groupName:void 0)},selectedLength:function(){return _.toArray(this.selected).length}}),methods:{unselecttype:function(){this.type=null,this.selected={}},selecttype:function(e){this.type=this.types[e],this.selected={}},selectedUsers:function(e){this.selected=e},selectoneuser:function(e){var t=this.core.mtrx.kit.tetatetid(e,this.core.user.userinfo);this.$router.push("chat?id="+t+"&u="+e.id).catch(e=>{})},complete(){this.createGroupAction(this.selected).then(e=>{this.$emit("completed",e),this.$store.commit("icon",{icon:"success",message:""})}).catch(e=>{var t="An unexpected error occurred";"cantcomplete"==e&&(t="Please enter a group name and add chat members"),this.$store.commit("icon",{icon:"error",message:t})})},createGroupAction(e){if(!this.cancomplete)return Promise.reject("cantcomplete");if(!this.type)return Promise.reject("type");if(_.isEmpty(e))return Promise.reject("users");const t=this.core.mtrx.kit.groupIdLight(e);return this.$store.state.globalpreloader=!0,this.core.mtrx.client.createRoom({visibility:this.type.value,invite:t.idForInviting,name:"@"+(this.groupName?this.groupName:"New Room"),initial_state:[{type:"m.room.guest_access",state_key:"",content:{guest_access:"can_join"}}]}).then(e=>(this.$store.state.globalpreloader=!1,e)).catch(e=>(this.$store.state.globalpreloader=!1,Promise.reject(e)))}}},L=D;function N(e){var t=n("e8d4");t.__inject__&&t.__inject__(e)}var $=Object(p["a"])(L,A,j,!1,N,"f0734632",null,!0),U=$.exports,B={name:"pagechats",components:{list:k,topheader:P,contacts:T["a"],chatcreate:U},props:{share:Object},data:function(){return{newChat:!1}},computed:Object(s["c"])({pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active,mobile:e=>e.mobile,hiddenInParent:e=>e.hiddenInParent}),methods:{newchat:function(){this.newChat=!0},closeNewChat:function(){this.newChat=!1},chatcreated:function(e){this.$router.push({path:"chat",query:{id:e.room_id}}).catch(e=>{})},scrolltop:function(){this.$refs["maincontent"].scroll(0)}},mounted(){}},F=B;function z(e){var t=n("b051");t.__inject__&&t.__inject__(e)}var q=Object(p["a"])(F,r,i,!1,z,"62a1ab6a",null,!0);t["default"]=q.exports},"9a55":function(e,t,n){var r=n("79bb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2f2118a6",r,e)}},"9b54":function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n("f60b").Buffer,o=n(3);function a(e,t,n){e.copy(t,n)}e.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";var t=this.head,n=""+t.data;while(t=t.next)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;var t=i.allocUnsafe(e>>>0),n=this.head,r=0;while(n)a(n.data,t,r),r+=n.data.length,n=n.next;return t},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},"9bed":function(t,n,r){"use strict";var i=this&&this.__awaiter||function(t,n,r,i){return new(r||(r=Promise))((function(o,a){function s(t){try{l(i.next(t))}catch(e){a(e)}}function c(t){try{l(i["throw"](t))}catch(e){a(e)}}function l(e){e.done?o(e.value):new r((function(t){t(e.value)})).then(s,c)}l((i=i.apply(t,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0});const o=r("69fc"),a=r("b8d8"),s=r("3dc0"),c=r("bbd4"),l=31;class u{constructor(e,t,n){this._finished=!1,this._cipher=e,this._L=t,this._LInv=n,this._buffer=new o.default,this._bufferPos=0,this._counter=0,this._offset=new o.default,this._tag=new o.default}static importKey(e,t){return i(this,void 0,void 0,(function*(){const n=yield e.importBlockCipherKey(t),r=new o.default;yield n.encryptBlock(r);const i=new Array(l);for(let e=0;e0;e--){const t=a.select(1&s.data[e-1],128,0);s.data[e]=s.data[e]>>>1|t}return s.data[0]>>>=1,s.data[0]^=a.select(c,128,0),s.data[o.default.SIZE-1]^=a.select(c,o.default.R>>>1,0),new u(n,i,s)}))}reset(){return this._buffer.clear(),this._bufferPos=0,this._counter=0,this._offset.clear(),this._tag.clear(),this._finished=!1,this}clear(){this.reset(),this._cipher.clear()}update(e){return i(this,void 0,void 0,(function*(){if(this._finished)throw new Error("pmac: already finished");const t=o.default.SIZE-this._bufferPos;let n=0,r=e.length;r>t&&(this._buffer.data.set(e.slice(0,t),this._bufferPos),n+=t,r-=t,yield this._processBuffer());while(r>o.default.SIZE)this._buffer.data.set(e.slice(n,n+o.default.SIZE)),n+=o.default.SIZE,r-=o.default.SIZE,yield this._processBuffer();return r>0&&(this._buffer.data.set(e.slice(n,n+r),this._bufferPos),this._bufferPos+=r),this}))}finish(){return i(this,void 0,void 0,(function*(){if(this._finished)throw new Error("pmac: already finished");return this._bufferPos===o.default.SIZE?(c.xor(this._tag.data,this._buffer.data),c.xor(this._tag.data,this._LInv.data)):(c.xor(this._tag.data,this._buffer.data.slice(0,this._bufferPos)),this._tag.data[this._bufferPos]^=128),yield this._cipher.encryptBlock(this._tag),this._finished=!0,this._tag.clone().data}))}_processBuffer(){return i(this,void 0,void 0,(function*(){c.xor(this._offset.data,this._L[s.ctz(this._counter+1)].data),c.xor(this._buffer.data,this._offset.data),this._counter++,yield this._cipher.encryptBlock(this._buffer),c.xor(this._tag.data,this._buffer.data),this._bufferPos=0}))}}n.PMAC=u},"9bf2":function(e,t,n){var r=n("83ab"),i=n("0cfb"),o=n("aed9"),a=n("825a"),s=n("a04b"),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",f="configurable",h="writable";t.f=r?o?function(e,t,n){if(a(e),t=s(t),a(n),"function"===typeof e&&"prototype"===t&&"value"in n&&h in n&&!n[h]){var r=u(e,t);r&&r[h]&&(e[t]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),i)try{return l(e,t,n)}catch(r){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"9c0e":function(e,t,n){"use strict";(function(t){var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n("903c"),a=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var n=e[f].read();null!==n&&(e[u]=null,e[a]=null,e[s]=null,t(h(n,!1)))}}function m(e){t.nextTick(p,e)}function v(e,t){return function(n,r){e.then((function(){t[l]?n(h(void 0,!0)):t[d](n,r)}),r)}}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((r={get stream(){return this[f]},next:function(){var e=this,n=this[c];if(null!==n)return Promise.reject(n);if(this[l])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(n,r){t.nextTick((function(){e[c]?r(e[c]):n(h(void 0,!0))}))}));var r,i=this[u];if(i)r=new Promise(v(i,this));else{var o=this[f].read();if(null!==o)return Promise.resolve(h(o,!1));r=new Promise(this[d])}return this[u]=r,r}},i(r,Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),g),b=function(e){var t,n=Object.create(y,(t={},i(t,f,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[u]=null,n[a]=null,n[s]=null,e(h(r,!1))):(n[a]=e,n[s]=t)},writable:!0}),t));return n[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[u]=null,n[a]=null,n[s]=null,t(e)),void(n[c]=e)}var r=n[a];null!==r&&(n[u]=null,n[a]=null,n[s]=null,r(h(void 0,!0))),n[l]=!0})),e.on("readable",m.bind(null,n)),n};e.exports=b}).call(this,n("4362"))},"9c21":function(t,n,r){"use strict";(function(t){var i=r("1da1"),o=(r("907a"),r("d9e2"),r("3139")),a=r("6129"),s=r("3db6");const c=r("399f");var l=r("a099"),u="PR7srzZt4EfcNb3s27grgmiG8aB9vYNV82",d=null,f=function(){var n=Object(i["a"])((function*(n,r,a){let{ls:f,lse:p}=a;var m=this;this.configurable=!1;var v={},g=12,y={},b=new h;r.pcrypto=m,m.clear=function(){({}),y={},[],v={}};var w="pcrypto5_"+r.roomId+"_",x="e_pcrypto5_";m.preparedUsers=function(e){return _.filter(T(e),(function(e){return e.keys&&e.keys.length>=g}))},m.cantchat=function(){var e=m.preparedUsers();return!!(n.core.mtrx.kit.tetatetchat(r)&&e.length&&e.length<2)},m.canBeEncrypt=function(e){var t=_.toArray(y),i=n.core.mtrx.kit.chatIsPublic(r);return!!(!i&&n.user&&n.user.private&&12==n.user.private.length&&v[n.user.userinfo.id]&&n.core.mtrx.kit.tetatetchat(r)&&t.length>1&&t.length<50&&m.preparedUsers(e).length/t.length>.6)},m.userschanded=function(){return m.cantchat()?(m.clear(),m.prepare()):Promise.resolve()};var S=function(){var e=_.map(v,(function(e){return e.id}));return n.core.user.usersInfo(e).then(e=>(y={},_.each(e,(function(e){y[e.id]=e})),Promise.resolve()))},k=function(){var e=n.core.mtrx.kit.tetatetchat(r),t=_.filter(_.map(r.currentState.getStateEvents("m.room.member"),(function(t){var n=t.event,r=n.content.membership;return"join"==r||"leave"==r&&!e||e&&"invite"==r?{time:n.origin_server_ts||1,membership:r,id:"invite"==r?o["a"].getmatrixid(n.state_key):o["a"].getmatrixid(n.sender)}:null})),(function(e){return e}));return t=_.sortBy(t,(function(e){return e.time})),t},E=function(e){for(var t=0,n=k(),r=n.length-1;r>=0;r--)n[r].timee))return!0}else if(t.start&&!t.end)return!0}));if(n)return!0}))};m.getusersinfobytime=T,m.prepare=function(){return C(),S().then(e=>m)};var R={aeskeys:{inp:function(e){var t={};return _.each(e,(function(e,n){t[n]=o["a"]._arrayBufferToBase64(e)})),t},out:function(e){var t={};return _.each(e,(function(e,n){t[n]=new Uint8Array(o["a"]._base64ToArrayBuffer(e))})),t}}},O={aeskeysls:function(e,t){e||(e=0),t||(t=n.currentblock.height),n.core.mtrx.kit.tetatetchat(r)||(t=10);var o=E(e)+"-"+t;return f.get(`${w+n.user.userinfo.id}-${o}`).then(e=>{const t=R.aeskeys.out(e);return{keys:t,k:o}}).catch(function(){var r=Object(i["a"])((function*(r){const i=O.aeskeys(e,t);if(m.preparedUsers(e).length>1){const e=`${w+n.user.userinfo.id}-${o}`;yield f.set(e,R.aeskeys.inp(i)).catch(()=>{})}return{keys:i,k:o}}));return function(e){return r.apply(this,arguments)}}())},aeskeys:function(e,t){return e||(e=0),t||(t=n.currentblock.height),M.aeskeys(e,t)}},M={cuhash:function(e,t,r){return l.pbkdf2Sync(o["a"].sha224(_.map(e,(function(e){return e.keys[t]})).join("")+(r||n.currentblock.height)).toString("hex"),u,1,32,"sha256")},userspublics:function(e,r){var i=m.preparedUsers(e),o={};return _.each(i,(function(a){if(!(a.id==n.user.userinfo.id&&i.length>1)){var s=_.map(a.keys,(function(e){return t.from(e,"hex")}));o[a.id]=M.points(e,r,s)}})),o},current:function(e,r){var i=_.map(n.user.private,(function(e){return e.private})),o=t.allocUnsafe(32),a=M.scalars(e,r,i).toBuffer();return a.copy(o,32-a.length),o},scalars:function(e,t,n){for(var r=m.preparedUsers(e),i=null,o=0;o{console.error("Error clearing item on LS.CLEAR")}),new Error(u)}));return function(e,n,r,i){return t.apply(this,arguments)}}(),m.encrypt=function(){var e=Object(i["a"])((function*(e,t){let{keys:n}=yield O.aeskeysls();if(n[e])return yield D(t,n[e]);throw new Error("emptykey")}));return function(t,n){return e.apply(this,arguments)}}(),m.decryptEvent=function(){var t=Object(i["a"])((function*(t){if(t.content.hash)return m.decryptEventGroup(t);if(!n.user.userinfo)throw new Error("userinfo");if(t.decrypting)return t.decrypting;var r=`${x+n.user.userinfo.id}-${t.event_id}`,a=p.get(r).then(t=>{var n=null;try{n=JSON.parse(t)}catch(e){}return n?Promise.resolve(n):Promise.reject()}).catch(function(){var e=Object(i["a"])((function*(e){const i=o["a"].getmatrixid(t.sender),a=n.user.userinfo.id;let s,c;const l=JSON.parse(o["a"].Base64.decode(t.content.body)),u=t.origin_server_ts||1,d=t.content.block;if(i==a?_.find(l,(function(e,t){if(t!=a)return s=t,c=t,!0})):(c=a,s=i),!l[c])throw new Error("emptyforme");return m.decrypt(s,l[c],u,d).then(e=>{var t={body:e,msgtype:"m.text"};return p.set(r,JSON.stringify(t)),t})}));return function(t){return e.apply(this,arguments)}}()).finally(()=>{delete t.decrypting});return t.decrypting=a,a}));return function(e){return t.apply(this,arguments)}}(),m.encryptFile=function(){var e=Object(i["a"])((function*(e,t){var n=yield b.randomkey(),r=yield m.encryptKey(n),i={file:null,secrets:r};return b.encryptFile(e,n,t).then(e=>(i.file=e,Promise.resolve(i))).catch(e=>(console.error(e),Promise.reject(e)))}));return function(t,n){return e.apply(this,arguments)}}(),m.decryptFile=function(){var e=Object(i["a"])((function*(e,t,n){return b.decryptFile(e,t,n).then(e=>Promise.resolve(e))}));return function(t,n,r){return e.apply(this,arguments)}}(),m.encryptKey=function(){var e=Object(i["a"])((function*(e){var t=m.preparedUsers(),i=n.currentblock.height;n.core.mtrx.kit.tetatetchat(r)||(i=10);for(var a={block:i,keys:{}},s=0;se.id),e=>e&&e!=n.user.userinfo.id).join("")+"_v4");return t};m.sendCommonKey=function(){return m.createMyCommonKey().then(e=>n.core.mtrx.client.sendStateEvent(r.roomId,"m.room.encryption",e.export,"pcrypto."+n.user.userinfo.id+"."+e.export.hash)).then(e=>m.getCommonKey()).catch(e=>(console.error(e),Promise.reject(e)))};var A=function(e,t){var i=t||P();e||(e=n.user.userinfo.id);var o="pcrypto."+e+"."+i,a=r.currentState.getStateEvents("m.room.encryption"),s=_.find(a,e=>e.event.state_key==o);if(s)return s};m.getCommonKey=function(e,t){return o["a"].pretry(()=>{var n=A(e,t);return n},50,5e3).then(()=>{var n=A(e,t);return n||Promise.reject("m.room.encryption event not found"),Promise.resolve(n.event)})},m.getOrCreateCommonKey=function(){var e=null,t=A(),n=null;return n=t?Promise.resolve(t.event):m.sendCommonKey(),n.then(t=>(e=t,m.decryptKey(t))).then(t=>({key:t,hash:e.content.hash,block:e.content.block}))},m.createMyCommonKey=function(){var e=P(),t={private:{},export:{}};return b.randomkey().then(e=>(t.private.secret=e,b.key(e))).then(n=>(t.private.key=n,t.private.hash=e,t.export.hash=e,m.encryptKey(t.private.secret))).then(e=>(t.export.keys=e.keys,t.export.block=e.block,t))},m.decryptEventGroup=function(e){if(!n.user.userinfo)throw new Error("userinfo");if(e.decrypting)return e.decrypting;var r=e.content.hash,i=o["a"].getmatrixid(e.sender),a=(e.content.block,m.getCommonKey(i,r).then(e=>m.decryptKey(e)).then(n=>b.decrypt(t.from(e.content.body,"hex"),n).then(e=>{var t=new TextDecoder,n={body:t.decode(new Uint8Array(e)),msgtype:"m.text"};return Promise.resolve(n)})).finally(()=>{delete e.decrypting}));return e.decrypting=a,a},m.encryptEventGroup=function(){var e=Object(i["a"])((function*(e){var n={msgtype:"m.encrypted",body:{}};return m.getOrCreateCommonKey().then(r=>{n.block=r.block,n.hash=r.hash;let i=new TextEncoder;return b.encrypt(i.encode(e),r.key).then(e=>(n.body=t.from(e).toString("hex"),Promise.resolve(n)))})}));return function(t){return e.apply(this,arguments)}}();var j=function(){var e=Object(i["a"])((function*(e,t){let{encrypted:n,nonce:r}=t;var i=yield s["SIV"].importKey(e,"AES-SIV"),a=new Uint8Array(o["a"]._base64ToArrayBuffer(n)),c=new Uint8Array(o["a"]._base64ToArrayBuffer(r)),l=yield i.open(a,c),u=yield(new TextDecoder).decode(l);return u}));return function(t,n){return e.apply(this,arguments)}}(),D=function(){var e=Object(i["a"])((function*(e,t){let n=yield s["SIV"].importKey(t,"AES-SIV"),r=new Uint8Array((new TextEncoder).encode(e)),i=new Uint8Array(32);window.crypto.getRandomValues(i);let a=yield n.seal(r,i),c={encrypted:o["a"]._arrayBufferToBase64(a.buffer),nonce:o["a"]._arrayBufferToBase64(i.buffer)};return c}));return function(t,n){return e.apply(this,arguments)}}();return m}));return function(e,t,r){return n.apply(this,arguments)}}(),h=function(){var e=this,t=[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],n=function(e){let t=new FileReader;return window.cordova&&(t=t._realReader),t.readAsArrayBuffer(e),new Promise((e,n)=>{t.onloadend=function(n){e(t.result)},t.onerror=function(){n(t.error)}})},r=function(e,t){return new(window.wFile||window.File)([e],"encrypted",{type:"encrypted/"+t.type,name:t.name})},i=function(e,t){return new(window.wFile||window.File)([e],"decrypted",{type:(t.type||"").replace("encrypted/",""),name:"Unnamed"})};return e.randomkey=function(){return new Promise(e=>{var t=new Uint32Array(24),n=window.crypto.getRandomValues(t).toString("hex");e(n)})},e.key=function(e){let t=new TextEncoder;function n(){return window.crypto.subtle.importKey("raw",t.encode(e),"PBKDF2",!1,["deriveBits","deriveKey"])}return n().then(e=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t.encode("matrix.pocketnet"),iterations:1e4,hash:"SHA-256"},e,{name:"AES-CBC",length:256},!0,["encrypt","decrypt"]))},e.encryptFile=function(t,i,o){return n(t).then(t=>e.encrypt(t,i,o)).then(e=>Promise.resolve(r(e,t)))},e.decryptFile=function(t,r,o){return n(t).then(t=>e.decrypt(t,r,o)).then(e=>Promise.resolve(i(e,t)))},e.encrypt=function(n,r,i){return n&&r?(i||(i={}),i.charsetEnc=i.charsetEnc||"utf8",i.charsetDec=i.charsetDec||"hex",e.key(r).then(e=>crypto.subtle.encrypt({name:"AES-CBC",iv:new Uint8Array(t)},e,n)).then((function(e){return e}))):Promise.reject("data")},e.decrypt=function(n,r,i){return n&&r?(i||(i={}),i.charsetEnc=i.charsetEnc||"utf8",i.charsetDec=i.charsetDec||"hex",e.key(r).then(e=>crypto.subtle?crypto.subtle.decrypt({name:"AES-CBC",iv:new Uint8Array(t)},e,n):Promise.reject("crypto.subtle")).then((function(e){return e})).catch(e=>(console.error(e),Promise.reject(e)))):Promise.reject("data")},e},p=function(e,t){d=new c("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);var n,r,o=this;return o.core=e,o.clearStorage=function(){o.core.mtrx.clearstorage("pcrypto")},o.currentblock={height:1},o.blocks={},o.user=null,o.rooms={},o.init=function(e){o.user=e},o.destroy=function(){_.each(o.rooms,(function(e){e.clear()})),o.rooms={}},o.addroom=function(t){return pretry(()=>e.user.private&&12==e.user.private.length).then(function(){var e=Object(i["a"])((function*(e){if(o.rooms[t.roomId])return o.rooms[t.roomId].prepare();var i=yield new f(o,t,{ls:n,lse:r});return o.rooms[t.roomId]=i,i.prepare()}));return function(t){return e.apply(this,arguments)}}())},o.set={block:function(e){e&&e.height>o.currentblock.height&&(o.currentblock=e),e.height&&(o.blocks[e.height]=e)}},o.helpers={checkuser:function(){if(e.user&&e.user.private&&12==e.user.private.length&&e.user.userinfo&&e.user.userinfo.keys&&e.user.userinfo.keys.length){var t=e.user.userinfo.keys.join(","),n=_.map(e.user.private,(function(e){return e.public})).join(",");return t==n}return!1}},o.prepare=function(){return Promise.all([Object(a["a"])("messages",1),Object(a["a"])("events",1)]).then(e=>(n=e[0],r=e[1],Promise.resolve()))},o};n["a"]=p}).call(this,r("b639").Buffer)},"9dd7":function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".actions[data-v-16157ecb]{padding-top:9em}.connect[data-v-16157ecb]{padding-top:2em}.connect[data-v-16157ecb] .previewWrapper{display:block;max-width:70%;margin:0 auto;padding:2em 0}.connect[data-v-16157ecb] .iconWrapper{margin:0 auto}.connect[data-v-16157ecb] .infoWrapper{padding:0}.connect .connectCaption[data-v-16157ecb]{max-width:70%;margin:0 auto}.connect .connectCaption span[data-v-16157ecb]{font-size:.8em}#userUnauthorized[data-v-16157ecb]{height:100%}#userUnauthorized.bin[data-v-16157ecb]{transition:.3s}#userUnauthorized.bin.minimized .wrapper[data-v-16157ecb]{top:60px;bottom:100px}#userUnauthorized.bin.minimized[data-v-16157ecb]:not(.active){width:44px}#userUnauthorized.bin.minimized:not(.active) .actions[data-v-16157ecb]{display:none}#userUnauthorized.bin.active .wrapper[data-v-16157ecb]{width:344px;transform:translateX(-300px)}.table[data-v-16157ecb]{height:100%}.table .cell[data-v-16157ecb]{vertical-align:middle}",""]),e.exports=t},"9e54":function(e,t,n){"use strict";var r=n("c973").default;n("d9e2");var i=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.LocalIndexedDBStoreBackend=y;var o=n("2d78"),a=i(n("3987")),s=i(n("6146")),c=n("63c7");const l=3;function u(e){e.createObjectStore("users",{keyPath:["userId"]}),e.createObjectStore("accountData",{keyPath:["type"]}),e.createObjectStore("sync",{keyPath:["clobber"]})}function d(e){const t=e.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]});t.createIndex("room","room_id")}function f(e){e.createObjectStore("client_options",{keyPath:["clobber"]})}function h(e,t,n){const r=e.openCursor(t);return new Promise((e,t)=>{const i=[];r.onerror=e=>{t(new Error("Query failed: "+e.target.errorCode))},r.onsuccess=t=>{const r=t.target.result;r?(i.push(n(r)),r.continue()):e(i)}})}function p(e){return new Promise((t,n)=>{e.oncomplete=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function m(e){return new Promise((t,n)=>{e.onsuccess=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function v(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e),e.onerror=e=>n(e)})}function g(e){return m(e).then(e=>e.target.result)}function y(e,t){this.indexedDB=e,this._dbName="matrix-js-sdk:"+(t||"default"),this.db=null,this._disconnected=!0,this._syncAccumulator=new o.SyncAccumulator,this._isNewlyCreated=!1}y.exists=function(e,t){return t="matrix-js-sdk:"+(t||"default"),s.exists(e,t)},y.prototype={connect:function(){if(!this._disconnected)return c.logger.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this._disconnected=!1,c.logger.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this._dbName,l);return e.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;c.logger.log("LocalIndexedDBStoreBackend.connect: upgrading from "+n),n<1&&(this._isNewlyCreated=!0,u(t)),n<2&&d(t),n<3&&f(t)},e.onblocked=()=>{c.logger.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},c.logger.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),m(e).then(e=>(c.logger.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.target.result,this.db.onversionchange=()=>{this.db.close()},this._init()))},isNewlyCreated:function(){return Promise.resolve(this._isNewlyCreated)},_init:function(){return Promise.all([this._loadAccountData(),this._loadSyncData()]).then(e=>{let[t,n]=e;c.logger.log("LocalIndexedDBStoreBackend: loaded initial data"),this._syncAccumulator.accumulate({next_batch:n.nextBatch,rooms:n.roomsData,groups:n.groupsData,account_data:{events:t}},!0)})},getOutOfBandMembers:function(e){return new Promise((t,n)=>{const r=this.db.transaction(["oob_membership_events"],"readonly"),i=r.objectStore("oob_membership_events"),o=i.index("room"),a=IDBKeyRange.only(e),s=o.openCursor(a),c=[];let l=!1;s.onsuccess=e=>{const n=e.target.result;if(!n)return c.length||l?t(c):t(null);const r=n.value;r.oob_written?l=!0:c.push(r),n.continue()},s.onerror=e=>{n(e)}}).then(t=>(c.logger.log("LL: got "+(t&&t.length)+` membershipEvents from storage for room ${e} ...`),t))},setOutOfBandMembers:function(){var e=r((function*(e,t){c.logger.log("LL: backend about to store "+t.length+" members for "+e);const n=this.db.transaction(["oob_membership_events"],"readwrite"),r=n.objectStore("oob_membership_events");t.forEach(e=>{r.put(e)});const i={room_id:e,oob_written:!0,state_key:0};r.put(i),yield p(n),c.logger.log(`LL: backend done storing for ${e}!`)}));return function(t,n){return e.apply(this,arguments)}}(),clearOutOfBandMembers:function(){var e=r((function*(e){const t=this.db.transaction(["oob_membership_events"],"readonly"),n=t.objectStore("oob_membership_events"),r=n.index("room"),i=IDBKeyRange.only(e),o=g(r.openKeyCursor(i,"next")).then(e=>e&&e.primaryKey[1]),a=g(r.openKeyCursor(i,"prev")).then(e=>e&&e.primaryKey[1]),[s,l]=yield Promise.all([o,a]),u=this.db.transaction(["oob_membership_events"],"readwrite"),d=u.objectStore("oob_membership_events"),f=IDBKeyRange.bound([e,s],[e,l]);c.logger.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,s],[e,l]),yield v(d.delete(f))}));return function(t){return e.apply(this,arguments)}}(),clearDatabase:function(){return new Promise((e,t)=>{c.logger.log("Removing indexeddb instance: "+this._dbName);const n=this.indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{c.logger.log("can't yet delete indexeddb "+this._dbName+" because it is open elsewhere")},n.onerror=t=>{c.logger.warn("unable to delete js-sdk store indexeddb: "+t.target.error),e()},n.onsuccess=()=>{c.logger.log("Removed indexeddb instance: "+this._dbName),e()}})},getSavedSync:function(e){void 0===e&&(e=!0);const t=this._syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(a.deepCopy(t)):Promise.resolve(t):Promise.resolve(null)},getNextBatchToken:function(){return Promise.resolve(this._syncAccumulator.getNextBatchToken())},setSyncData:function(e){return Promise.resolve().then(()=>{this._syncAccumulator.accumulate(e)})},syncToDatabase:function(e){const t=this._syncAccumulator.getJSON(!0);return Promise.all([this._persistUserPresenceEvents(e),this._persistAccountData(t.accountData),this._persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])},_persistSyncData:function(e,t,n){return c.logger.log("Persisting sync data up to",e),a.promiseTry(()=>{const r=this.db.transaction(["sync"],"readwrite"),i=r.objectStore("sync");return i.put({clobber:"-",nextBatch:e,roomsData:t,groupsData:n}),p(r)})},_persistAccountData:function(e){return a.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readwrite"),n=t.objectStore("accountData");for(let r=0;r{const t=this.db.transaction(["users"],"readwrite"),n=t.objectStore("users");for(const r of e)n.put({userId:r[0],event:r[1]});return p(t)})},getUserPresenceEvents:function(){return a.promiseTry(()=>{const e=this.db.transaction(["users"],"readonly"),t=e.objectStore("users");return h(t,void 0,e=>[e.value.userId,e.value.event])})},_loadAccountData:function(){return c.logger.log("LocalIndexedDBStoreBackend: loading account data..."),a.promiseTry(()=>{const e=this.db.transaction(["accountData"],"readonly"),t=e.objectStore("accountData");return h(t,void 0,e=>e.value).then(e=>(c.logger.log("LocalIndexedDBStoreBackend: loaded account data"),e))})},_loadSyncData:function(){return c.logger.log("LocalIndexedDBStoreBackend: loading sync data..."),a.promiseTry(()=>{const e=this.db.transaction(["sync"],"readonly"),t=e.objectStore("sync");return h(t,void 0,e=>e.value).then(e=>(c.logger.log("LocalIndexedDBStoreBackend: loaded sync data"),e.length>1&&c.logger.warn("loadSyncData: More than 1 sync row found."),e.length>0?e[0]:{}))})},getClientOptions:function(){return Promise.resolve().then(()=>{const e=this.db.transaction(["client_options"],"readonly"),t=e.objectStore("client_options");return h(t,void 0,e=>{if(e.value&&e.value&&e.value.options)return e.value.options}).then(e=>e[0])})},storeClientOptions:function(){var e=r((function*(e){const t=this.db.transaction(["client_options"],"readwrite"),n=t.objectStore("client_options");n.put({clobber:"-",options:e}),yield p(t)}));return function(t){return e.apply(this,arguments)}}()}},"9e6a":function(e,t,n){"use strict";var r=n("d233"),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},l="utf8=%26%2310003%3B",u="utf8=%E2%9C%93",d=function(e,t){var n,d={},f=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,h=t.parameterLimit===1/0?void 0:t.parameterLimit,p=f.split(t.delimiter,h),m=-1,v=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(y=o(y)?[y]:y),i.call(d,g)?d[g]=r.combine(d[g],y):d[g]=y}return d},f=function(e,t,n,r){for(var i=r?t:c(t,n),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&n.parseArrays)a=[].concat(i);else{a=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(a=[],a[u]=i):"__proto__"!==l&&(a[l]=i):a={0:i}}i=a}return i},h=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&a.exec(o),l=c?o.slice(0,c.index):o,u=[];if(l){if(!n.plainObjects&&i.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}var d=0;while(n.depth>0&&null!==(c=s.exec(o))&&d=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,n("c8ba"),n("4362"))},a026:function(t,n,r){"use strict";r.r(n),function(t){ /*! * Vue.js v2.6.14 * (c) 2014-2021 Evan You * Released under the MIT License. */ -var r=Object.freeze({});function i(e){return void 0===e||null===e}function o(e){return void 0!==e&&null!==e}function a(e){return!0===e}function s(e){return!1===e}function c(e){return"string"===typeof e||"number"===typeof e||"symbol"===typeof e||"boolean"===typeof e}function l(e){return null!==e&&"object"===typeof e}var u=Object.prototype.toString;function d(e){return"[object Object]"===u.call(e)}function f(e){return"[object RegExp]"===u.call(e)}function h(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function p(e){return o(e)&&"function"===typeof e.then&&"function"===typeof e.catch}function m(e){return null==e?"":Array.isArray(e)||d(e)&&e.toString===u?JSON.stringify(e,null,2):String(e)}function v(e){var t=parseFloat(e);return isNaN(t)?e:t}function g(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var w=Object.prototype.hasOwnProperty;function x(e,t){return w.call(e,t)}function k(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}var S=/-(\w)/g,E=k((function(e){return e.replace(S,(function(e,t){return t?t.toUpperCase():""}))})),C=k((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),T=/\B([A-Z])/g,I=k((function(e){return e.replace(T,"-$1").toLowerCase()}));function R(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function O(e,t){return e.bind(t)}var M=Function.prototype.bind?O:R;function A(e,t){t=t||0;var n=e.length-t,r=new Array(n);while(n--)r[n]=e[n+t];return r}function P(e,t){for(var n in t)e[n]=t[n];return e}function j(e){for(var t={},n=0;n0,oe=ne&&ne.indexOf("edge/")>0,ae=(ne&&ne.indexOf("android"),ne&&/iphone|ipad|ipod|ios/.test(ne)||"ios"===te),se=(ne&&/chrome\/\d+/.test(ne),ne&&/phantomjs/.test(ne),ne&&ne.match(/firefox\/(\d+)/)),ce={}.watch,le=!1;if(Q)try{var ue={};Object.defineProperty(ue,"passive",{get:function(){le=!0}}),window.addEventListener("test-passive",null,ue)}catch(e){}var de=function(){return void 0===X&&(X=!Q&&!ee&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),X},fe=Q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"===typeof e&&/native code/.test(e.toString())}var pe,me="undefined"!==typeof Symbol&&he(Symbol)&&"undefined"!==typeof Reflect&&he(Reflect.ownKeys);pe="undefined"!==typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ve=D,ge=0,ye=function(){this.id=ge++,this.subs=[]};ye.prototype.addSub=function(e){this.subs.push(e)},ye.prototype.removeSub=function(e){_(this.subs,e)},ye.prototype.depend=function(){ye.target&&ye.target.addDep(this)},ye.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t-1)if(o&&!x(i,"default"))a=!1;else if(""===a||a===I(e)){var c=it(String,i.type);(c<0||s0&&(r=Mt(r,(t||"")+"_"+n),Ot(r[0])&&Ot(l)&&(u[s]=Ee(l.text+r[0].text),r.shift()),u.push.apply(u,r)):c(r)?Ot(l)?u[s]=Ee(l.text+r):""!==r&&u.push(Ee(r)):Ot(r)&&Ot(l)?u[s]=Ee(l.text+r.text):(a(e._isVList)&&o(r.tag)&&i(r.key)&&o(t)&&(r.key="__vlist"+t+"_"+n+"__"),u.push(r)));return u}function At(e){var t=e.$options.provide;t&&(e._provided="function"===typeof t?t.call(e):t)}function Pt(e){var t=jt(e.$options.inject,e);t&&(Ae(!1),Object.keys(t).forEach((function(n){Ne(e,n,t[n])})),Ae(!0))}function jt(e,t){if(e){for(var n=Object.create(null),r=me?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=e?!!e.$stable:!o,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&n&&n!==r&&s===n.$key&&!o&&!n.$hasNormal)return n;for(var c in i={},e)e[c]&&"$"!==c[0]&&(i[c]=Ut(t,c,e[c]))}else i={};for(var l in t)l in i||(i[l]=Bt(t,l));return e&&Object.isExtensible(e)&&(e._normalized=i),H(i,"$stable",a),H(i,"$key",s),H(i,"$hasNormal",o),i}function Ut(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});e=e&&"object"===typeof e&&!Array.isArray(e)?[e]:Rt(e);var t=e&&e[0];return e&&(!t||1===e.length&&t.isComment&&!Nt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Bt(e,t){return function(){return e[t]}}function Ft(e,t){var n,r,i,a,s;if(Array.isArray(e)||"string"===typeof e)for(n=new Array(e.length),r=0,i=e.length;r1?A(n):n;for(var r=A(arguments,1),i='event handler for "'+e+'"',o=0,a=n.length;odocument.createEvent("Event").timeStamp&&(Zn=function(){return Qn.now()})}function er(){var e,t;for(Xn=Zn(),Hn=!0,Wn.sort((function(e,t){return e.id-t.id})),Yn=0;YnYn&&Wn[n].id>e.id)n--;Wn.splice(n+1,0,e)}else Wn.push(e);Gn||(Gn=!0,yt(er))}}var or=0,ar=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++or,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new pe,this.newDepIds=new pe,this.expression="","function"===typeof t?this.getter=t:(this.getter=J(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};ar.prototype.get=function(){var t;_e(this);var n=this.vm;try{t=this.getter.call(n,n)}catch(e){if(!this.user)throw e;ot(e,n,'getter for watcher "'+this.expression+'"')}finally{this.deep&&_t(t),we(),this.cleanupDeps()}return t},ar.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},ar.prototype.cleanupDeps=function(){var e=this.deps.length;while(e--){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ar.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ir(this)},ar.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||l(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';at(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},ar.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ar.prototype.depend=function(){var e=this.deps.length;while(e--)this.deps[e].depend()},ar.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);var e=this.deps.length;while(e--)this.deps[e].removeSub(this);this.active=!1}};var sr={enumerable:!0,configurable:!0,get:D,set:D};function cr(e,t,n){sr.get=function(){return this[t][n]},sr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,sr)}function lr(e){e._watchers=[];var t=e.$options;t.props&&ur(e,t.props),t.methods&&yr(e,t.methods),t.data?dr(e):Le(e._data={},!0),t.computed&&pr(e,t.computed),t.watch&&t.watch!==ce&&br(e,t.watch)}function ur(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;o||Ae(!1);var a=function(o){i.push(o);var a=Qe(o,t,n,e);Ne(r,o,a),o in e||cr(e,"_props",o)};for(var s in t)a(s);Ae(!0)}function dr(e){var t=e.$options.data;t=e._data="function"===typeof t?fr(t,e):t||{},d(t)||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);while(i--){var o=n[i];0,r&&x(r,o)||G(o)||cr(e,"_data",o)}Le(t,!0)}function fr(t,n){_e();try{return t.call(n,n)}catch(e){return ot(e,n,"data()"),{}}finally{we()}}var hr={lazy:!0};function pr(e,t){var n=e._computedWatchers=Object.create(null),r=de();for(var i in t){var o=t[i],a="function"===typeof o?o:o.get;0,r||(n[i]=new ar(e,a||D,D,hr)),i in e||mr(e,i,o)}}function mr(e,t,n){var r=!de();"function"===typeof n?(sr.get=r?vr(t):gr(n),sr.set=D):(sr.get=n.get?r&&!1!==n.cache?vr(t):gr(n.get):D,sr.set=n.set||D),Object.defineProperty(e,t,sr)}function vr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ye.target&&t.depend(),t.value}}function gr(e){return function(){return e.call(this,this)}}function yr(e,t){e.$options.props;for(var n in t)e[n]="function"!==typeof t[n]?D:M(t[n],e)}function br(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1)return this;var n=A(arguments,1);return n.unshift(this),"function"===typeof e.install?e.install.apply(e,n):"function"===typeof e&&e.apply(null,n),t.push(e),this}}function Rr(e){e.mixin=function(e){return this.options=Xe(this.options,e),this}}function Or(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;var a=function(e){this._init(e)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=t++,a.options=Xe(n.options,e),a["super"]=n,a.options.props&&Mr(a),a.options.computed&&Ar(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,q.forEach((function(e){a[e]=n[e]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=P({},a.options),i[r]=a,a}}function Mr(e){var t=e.options.props;for(var n in t)cr(e.prototype,"_props",n)}function Ar(e){var t=e.options.computed;for(var n in t)mr(e.prototype,n,t[n])}function Pr(e){q.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&d(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"===typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}function jr(e){return e&&(e.Ctor.options.name||e.tag)}function Dr(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"===typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Lr(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!t(s)&&Nr(n,o,r,i)}}}function Nr(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,_(n,t)}kr(Tr),wr(Tr),Pn(Tr),Nn(Tr),kn(Tr);var $r=[String,RegExp,Array],Ur={name:"keep-alive",abstract:!0,props:{include:$r,exclude:$r,max:[String,Number]},methods:{cacheVNode:function(){var e=this,t=e.cache,n=e.keys,r=e.vnodeToCache,i=e.keyToCache;if(r){var o=r.tag,a=r.componentInstance,s=r.componentOptions;t[i]={name:jr(s),tag:o,componentInstance:a},n.push(i),this.max&&n.length>parseInt(this.max)&&Nr(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Nr(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){Lr(e,(function(e){return Dr(t,e)}))})),this.$watch("exclude",(function(t){Lr(e,(function(e){return!Dr(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Tn(e),n=t&&t.componentOptions;if(n){var r=jr(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Dr(o,r))||a&&r&&Dr(a,r))return t;var s=this,c=s.cache,l=s.keys,u=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;c[u]?(t.componentInstance=c[u].componentInstance,_(l,u),l.push(u)):(this.vnodeToCache=t,this.keyToCache=u),t.data.keepAlive=!0}return t||e&&e[0]}},Br={KeepAlive:Ur};function Fr(e){var t={get:function(){return K}};Object.defineProperty(e,"config",t),e.util={warn:ve,extend:P,mergeOptions:Xe,defineReactive:Ne},e.set=$e,e.delete=Ue,e.nextTick=yt,e.observable=function(e){return Le(e),e},e.options=Object.create(null),q.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,P(e.options.components,Br),Ir(e),Rr(e),Or(e),Pr(e)}Fr(Tr),Object.defineProperty(Tr.prototype,"$isServer",{get:de}),Object.defineProperty(Tr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Tr,"FunctionalRenderContext",{value:nn}),Tr.version="2.6.14";var zr=g("style,class"),qr=g("input,textarea,option,select,progress"),Wr=function(e,t,n){return"value"===n&&qr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Kr=g("contenteditable,draggable,spellcheck"),Vr=g("events,caret,typing,plaintext-only"),Gr=function(e,t){return Zr(t)||"false"===t?"false":"contenteditable"===e&&Vr(t)?t:"true"},Hr=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Yr="http://www.w3.org/1999/xlink",Jr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Xr=function(e){return Jr(e)?e.slice(6,e.length):""},Zr=function(e){return null==e||!1===e};function Qr(e){var t=e.data,n=e,r=e;while(o(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(t=ei(r.data,t));while(o(n=n.parent))n&&n.data&&(t=ei(t,n.data));return ti(t.staticClass,t.class)}function ei(e,t){return{staticClass:ni(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function ti(e,t){return o(e)||o(t)?ni(e,ri(t)):""}function ni(e,t){return e?t?e+" "+t:e:t||""}function ri(e){return Array.isArray(e)?ii(e):l(e)?oi(e):"string"===typeof e?e:""}function ii(e){for(var t,n="",r=0,i=e.length;r-1?fi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:fi[e]=/HTMLUnknownElement/.test(t.toString())}var pi=g("text,number,password,search,email,tel,url");function mi(e){if("string"===typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function vi(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function gi(e,t){return document.createElementNS(ai[e],t)}function yi(e){return document.createTextNode(e)}function bi(e){return document.createComment(e)}function _i(e,t,n){e.insertBefore(t,n)}function wi(e,t){e.removeChild(t)}function xi(e,t){e.appendChild(t)}function ki(e){return e.parentNode}function Si(e){return e.nextSibling}function Ei(e){return e.tagName}function Ci(e,t){e.textContent=t}function Ti(e,t){e.setAttribute(t,"")}var Ii=Object.freeze({createElement:vi,createElementNS:gi,createTextNode:yi,createComment:bi,insertBefore:_i,removeChild:wi,appendChild:xi,parentNode:ki,nextSibling:Si,tagName:Ei,setTextContent:Ci,setStyleScope:Ti}),Ri={create:function(e,t){Oi(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Oi(e,!0),Oi(t))},destroy:function(e){Oi(e,!0)}};function Oi(e,t){var n=e.data.ref;if(o(n)){var r=e.context,i=e.componentInstance||e.elm,a=r.$refs;t?Array.isArray(a[n])?_(a[n],i):a[n]===i&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(i)<0&&a[n].push(i):a[n]=[i]:a[n]=i}}var Mi=new xe("",{},[]),Ai=["create","activate","update","remove","destroy"];function Pi(e,t){return e.key===t.key&&e.asyncFactory===t.asyncFactory&&(e.tag===t.tag&&e.isComment===t.isComment&&o(e.data)===o(t.data)&&ji(e,t)||a(e.isAsyncPlaceholder)&&i(t.asyncFactory.error))}function ji(e,t){if("input"!==e.tag)return!0;var n,r=o(n=e.data)&&o(n=n.attrs)&&n.type,i=o(n=t.data)&&o(n=n.attrs)&&n.type;return r===i||pi(r)&&pi(i)}function Di(e,t,n){var r,i,a={};for(r=t;r<=n;++r)i=e[r].key,o(i)&&(a[i]=r);return a}function Li(e){var t,n,r={},s=e.modules,l=e.nodeOps;for(t=0;tm?(d=i(n[y+1])?null:n[y+1].elm,k(e,d,n,p,y,r)):p>y&&E(t,f,m)}function I(e,t,n,r){for(var i=n;i-1?Gi(e,t,n):Hr(t)?Zr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Kr(t)?e.setAttribute(t,Gr(t,n)):Jr(t)?Zr(n)?e.removeAttributeNS(Yr,Xr(t)):e.setAttributeNS(Yr,t,n):Gi(e,t,n)}function Gi(e,t,n){if(Zr(n))e.removeAttribute(t);else{if(re&&!ie&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Hi={create:Ki,update:Ki};function Yi(e,t){var n=t.elm,r=t.data,a=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var s=Qr(t),c=n._transitionClasses;o(c)&&(s=ni(s,ri(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Ji,Xi,Zi,Qi,eo,to,no={create:Yi,update:Yi},ro=/[\w).+\-_$\]]/;function io(e){var t,n,r,i,o,a=!1,s=!1,c=!1,l=!1,u=0,d=0,f=0,h=0;for(r=0;r=0;p--)if(m=e.charAt(p)," "!==m)break;m&&ro.test(m)||(l=!0)}}else void 0===i?(h=r+1,i=e.slice(0,r).trim()):v();function v(){(o||(o=[])).push(e.slice(h,r).trim()),h=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==h&&v(),o)for(r=0;r-1?{exp:e.slice(0,Qi),key:'"'+e.slice(Qi+1)+'"'}:{exp:e,key:null};Xi=e,Qi=eo=to=0;while(!So())Zi=ko(),Eo(Zi)?To(Zi):91===Zi&&Co(Zi);return{exp:e.slice(0,eo),key:e.slice(eo+1,to)}}function ko(){return Xi.charCodeAt(++Qi)}function So(){return Qi>=Ji}function Eo(e){return 34===e||39===e}function Co(e){var t=1;eo=Qi;while(!So())if(e=ko(),Eo(e))To(e);else if(91===e&&t++,93===e&&t--,0===t){to=Qi;break}}function To(e){var t=e;while(!So())if(e=ko(),e===t)break}var Io,Ro="__r",Oo="__c";function Mo(e,t,n){n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return _o(e,r,i),!1;if("select"===o)jo(e,r,i);else if("input"===o&&"checkbox"===a)Ao(e,r,i);else if("input"===o&&"radio"===a)Po(e,r,i);else if("input"===o||"textarea"===o)Do(e,r,i);else{if(!K.isReservedTag(o))return _o(e,r,i),!1}return!0}function Ao(e,t,n){var r=n&&n.number,i=vo(e,"value")||"null",o=vo(e,"true-value")||"true",a=vo(e,"false-value")||"false";co(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),po(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+wo(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+wo(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+wo(t,"$$c")+"}",null,!0)}function Po(e,t,n){var r=n&&n.number,i=vo(e,"value")||"null";i=r?"_n("+i+")":i,co(e,"checked","_q("+t+","+i+")"),po(e,"change",wo(t,i),null,!0)}function jo(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="$event.target.multiple ? $$selectedVal : $$selectedVal[0]",a="var $$selectedVal = "+i+";";a=a+" "+wo(t,o),po(e,"change",a,null,!0)}function Do(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?Ro:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var d=wo(t,u);c&&(d="if($event.target.composing)return;"+d),co(e,"value","("+t+")"),po(e,l,d,null,!0),(s||a)&&po(e,"blur","$forceUpdate()")}function Lo(e){if(o(e[Ro])){var t=re?"change":"input";e[t]=[].concat(e[Ro],e[t]||[]),delete e[Ro]}o(e[Oo])&&(e.change=[].concat(e[Oo],e.change||[]),delete e[Oo])}function No(e,t,n){var r=Io;return function i(){var o=t.apply(null,arguments);null!==o&&Bo(e,i,n,r)}}var $o=ut&&!(se&&Number(se[1])<=53);function Uo(e,t,n,r){if($o){var i=Xn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Io.addEventListener(e,t,le?{capture:n,passive:r}:n)}function Bo(e,t,n,r){(r||Io).removeEventListener(e,t._wrapper||t,n)}function Fo(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Io=t.elm,Lo(n),St(n,r,Uo,Bo,No,t.context),Io=void 0}}var zo,qo={create:Fo,update:Fo};function Wo(t,n){if(!i(t.data.domProps)||!i(n.data.domProps)){var r,a,s=n.elm,c=t.data.domProps||{},l=n.data.domProps||{};for(r in o(l.__ob__)&&(l=n.data.domProps=P({},l)),c)r in l||(s[r]="");for(r in l){if(a=l[r],"textContent"===r||"innerHTML"===r){if(n.children&&(n.children.length=0),a===c[r])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===r&&"PROGRESS"!==s.tagName){s._value=a;var u=i(a)?"":String(a);Ko(s,u)&&(s.value=u)}else if("innerHTML"===r&&ci(s.tagName)&&i(s.innerHTML)){zo=zo||document.createElement("div"),zo.innerHTML=""+a+"";var d=zo.firstChild;while(s.firstChild)s.removeChild(s.firstChild);while(d.firstChild)s.appendChild(d.firstChild)}else if(a!==c[r])try{s[r]=a}catch(e){}}}}function Ko(e,t){return!e.composing&&("OPTION"===e.tagName||Vo(e,t)||Go(e,t))}function Vo(t,n){var r=!0;try{r=document.activeElement!==t}catch(e){}return r&&t.value!==n}function Go(e,t){var n=e.value,r=e._vModifiers;if(o(r)){if(r.number)return v(n)!==v(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}var Ho={create:Wo,update:Wo},Yo=k((function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach((function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}));function Jo(e){var t=Xo(e.style);return e.staticStyle?P(e.staticStyle,t):t}function Xo(e){return Array.isArray(e)?j(e):"string"===typeof e?Yo(e):e}function Zo(e,t){var n,r={};if(t){var i=e;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(n=Jo(i.data))&&P(r,n)}(n=Jo(e.data))&&P(r,n);var o=e;while(o=o.parent)o.data&&(n=Jo(o.data))&&P(r,n);return r}var Qo,ea=/^--/,ta=/\s*!important$/,na=function(e,t,n){if(ea.test(t))e.style.setProperty(t,n);else if(ta.test(n))e.style.setProperty(I(t),n.replace(ta,""),"important");else{var r=ia(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(sa).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function la(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(sa).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?e.setAttribute("class",n):e.removeAttribute("class")}}function ua(e){if(e){if("object"===typeof e){var t={};return!1!==e.css&&P(t,da(e.name||"v")),P(t,e),t}return"string"===typeof e?da(e):void 0}}var da=k((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),fa=Q&&!ie,ha="transition",pa="animation",ma="transition",va="transitionend",ga="animation",ya="animationend";fa&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ma="WebkitTransition",va="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ga="WebkitAnimation",ya="webkitAnimationEnd"));var ba=Q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function _a(e){ba((function(){ba(e)}))}function wa(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ca(e,t))}function xa(e,t){e._transitionClasses&&_(e._transitionClasses,t),la(e,t)}function ka(e,t,n){var r=Ea(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ha?va:ya,c=0,l=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++c>=a&&l()};setTimeout((function(){c0&&(n=ha,u=a,d=o.length):t===pa?l>0&&(n=pa,u=l,d=c.length):(u=Math.max(a,l),n=u>0?a>l?ha:pa:null,d=n?n===ha?o.length:c.length:0);var f=n===ha&&Sa.test(r[ma+"Property"]);return{type:n,timeout:u,propCount:d,hasTransform:f}}function Ca(e,t){while(e.length1}function Aa(e,t){!0!==t.data.show&&Ia(t)}var Pa=Q?{create:Aa,activate:Aa,remove:function(e,t){!0!==e.data.show?Ra(e,t):t()}}:{},ja=[Hi,no,qo,Ho,aa,Pa],Da=ja.concat(Wi),La=Li({nodeOps:Ii,modules:Da});ie&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&Wa(e,"input")}));var Na={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Et(n,"postpatch",(function(){Na.componentUpdated(e,t,n)})):$a(e,t,n.context),e._vOptions=[].map.call(e.options,Fa)):("textarea"===n.tag||pi(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",za),e.addEventListener("compositionend",qa),e.addEventListener("change",qa),ie&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){$a(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Fa);if(i.some((function(e,t){return!U(e,r[t])}))){var o=e.multiple?t.value.some((function(e){return Ba(e,i)})):t.value!==t.oldValue&&Ba(t.value,i);o&&Wa(e,"change")}}}};function $a(e,t,n){Ua(e,t,n),(re||oe)&&setTimeout((function(){Ua(e,t,n)}),0)}function Ua(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(U(Fa(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Ba(e,t){return t.every((function(t){return!U(t,e)}))}function Fa(e){return"_value"in e?e._value:e.value}function za(e){e.target.composing=!0}function qa(e){e.target.composing&&(e.target.composing=!1,Wa(e.target,"input"))}function Wa(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ka(e){return!e.componentInstance||e.data&&e.data.transition?e:Ka(e.componentInstance._vnode)}var Va={bind:function(e,t,n){var r=t.value;n=Ka(n);var i=n.data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Ia(n,(function(){e.style.display=o}))):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value,i=t.oldValue;if(!r!==!i){n=Ka(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?Ia(n,(function(){e.style.display=e.__vOriginalDisplay})):Ra(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none"}},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},Ga={model:Na,show:Va},Ha={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ya(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ya(Tn(t.children)):e}function Ja(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[E(o)]=i[o];return t}function Xa(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Za(e){while(e=e.parent)if(e.data.transition)return!0}function Qa(e,t){return t.key===e.key&&t.tag===e.tag}var es=function(e){return e.tag||Nt(e)},ts=function(e){return"show"===e.name},ns={name:"transition",props:Ha,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(es),n.length)){0;var r=this.mode;0;var i=n[0];if(Za(this.$vnode))return i;var o=Ya(i);if(!o)return i;if(this._leaving)return Xa(e,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:c(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var s=(o.data||(o.data={})).transition=Ja(this),l=this._vnode,u=Ya(l);if(o.data.directives&&o.data.directives.some(ts)&&(o.data.show=!0),u&&u.data&&!Qa(o,u)&&!Nt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=P({},s);if("out-in"===r)return this._leaving=!0,Et(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Xa(e,i);if("in-out"===r){if(Nt(o))return l;var f,h=function(){f()};Et(s,"afterEnter",h),Et(s,"enterCancelled",h),Et(d,"delayLeave",(function(e){f=e}))}}return i}}},rs=P({tag:String,moveClass:String},Ha);delete rs.mode;var is={props:rs,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Dn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ja(this),s=0;sc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var l=io(r[1].trim());a.push("_s("+l+")"),s.push({"@binding":l}),c=i+r[0].length}return c\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Es=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Cs="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+V.source+"]*",Ts="((?:"+Cs+"\\:)?"+Cs+")",Is=new RegExp("^<"+Ts),Rs=/^\s*(\/?)>/,Os=new RegExp("^<\\/"+Ts+"[^>]*>"),Ms=/^]+>/i,As=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Ns=/&(?:lt|gt|quot|amp|#39);/g,$s=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Us=g("pre,textarea",!0),Bs=function(e,t){return e&&Us(e)&&"\n"===t[0]};function Fs(e,t){var n=t?$s:Ns;return e.replace(n,(function(e){return Ls[e]}))}function zs(e,t){var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||L,s=t.canBeLeftOpenTag||L,c=0;while(e){if(n=e,r&&js(r)){var l=0,u=r.toLowerCase(),d=Ds[u]||(Ds[u]=new RegExp("([\\s\\S]*?)(]*>)","i")),f=e.replace(d,(function(e,n,r){return l=r.length,js(u)||"noscript"===u||(n=n.replace(//g,"$1").replace(//g,"$1")),Bs(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));c+=e.length-f.length,e=f,C(u,c-l,c)}else{var h=e.indexOf("<");if(0===h){if(As.test(e)){var p=e.indexOf("--\x3e");if(p>=0){t.shouldKeepComment&&t.comment(e.substring(4,p),c,c+p+3),k(p+3);continue}}if(Ps.test(e)){var m=e.indexOf("]>");if(m>=0){k(m+2);continue}}var v=e.match(Ms);if(v){k(v[0].length);continue}var g=e.match(Os);if(g){var y=c;k(g[0].length),C(g[1],y,c);continue}var b=S();if(b){E(b),Bs(b.tagName,e)&&k(1);continue}}var _=void 0,w=void 0,x=void 0;if(h>=0){w=e.slice(h);while(!Os.test(w)&&!Is.test(w)&&!As.test(w)&&!Ps.test(w)){if(x=w.indexOf("<",1),x<0)break;h+=x,w=e.slice(h)}_=e.substring(0,h)}h<0&&(_=e),_&&k(_.length),t.chars&&_&&t.chars(_,c-_.length,c)}if(e===n){t.chars&&t.chars(e);break}}function k(t){c+=t,e=e.substring(t)}function S(){var t=e.match(Is);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};k(t[0].length);while(!(n=e.match(Rs))&&(r=e.match(Es)||e.match(Ss)))r.start=c,k(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],k(n[0].length),i.end=c,i}}function E(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&ks(n)&&C(r),s(n)&&r===n&&C(n));for(var l=a(n)||!!c,u=e.attrs.length,d=new Array(u),f=0;f=0;a--)if(i[a].lowerCasedTag===s)break}else a=0;if(a>=0){for(var l=i.length-1;l>=a;l--)t.end&&t.end(i[l].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}C()}var qs,Ws,Ks,Vs,Gs,Hs,Ys,Js,Xs=/^@|^v-on:/,Zs=/^v-|^@|^:|^#/,Qs=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ec=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,tc=/^\(|\)$/g,nc=/^\[.*\]$/,rc=/:(.*)$/,ic=/^:|^\.|^v-bind:/,oc=/\.[^.\]]+(?=[^\]]*$)/g,ac=/^v-slot(:|$)|^#/,sc=/[\r\n]/,cc=/[ \f\t\r\n]+/g,lc=k(_s.decode),uc="_empty_";function dc(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:Ac(t),rawAttrsMap:{},parent:n,children:[]}}function fc(e,t){qs=t.warn||ao,Hs=t.isPreTag||L,Ys=t.mustUseProp||L,Js=t.getTagNamespace||L;var n=t.isReservedTag||L;(function(e){return!(!(e.component||e.attrsMap[":is"]||e.attrsMap["v-bind:is"])&&(e.attrsMap.is?n(e.attrsMap.is):n(e.tag)))}),Ks=so(t.modules,"transformNode"),Vs=so(t.modules,"preTransformNode"),Gs=so(t.modules,"postTransformNode"),Ws=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,l=!1;function u(e){if(d(e),c||e.processed||(e=mc(e,t)),o.length||e===r||r.if&&(e.elseif||e.else)&&kc(r,{exp:e.elseif,block:e}),i&&!e.forbidden)if(e.elseif||e.else)wc(e,i);else{if(e.slotScope){var n=e.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=e}i.children.push(e),e.parent=i}e.children=e.children.filter((function(e){return!e.slotScope})),d(e),e.pre&&(c=!1),Hs(e.tag)&&(l=!1);for(var a=0;a|^function(?:\s+[\w$]+)?\s*\(/,nl=/\([^)]*?\);*$/,rl=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,il={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ol={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},al=function(e){return"if("+e+")return null;"},sl={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:al("$event.target !== $event.currentTarget"),ctrl:al("!$event.ctrlKey"),shift:al("!$event.shiftKey"),alt:al("!$event.altKey"),meta:al("!$event.metaKey"),left:al("'button' in $event && $event.button !== 0"),middle:al("'button' in $event && $event.button !== 1"),right:al("'button' in $event && $event.button !== 2")};function cl(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=ll(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function ll(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return ll(e)})).join(",")+"]";var t=rl.test(e.value),n=tl.test(e.value),r=rl.test(e.value.replace(nl,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(sl[s])o+=sl[s],il[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=al(["ctrl","shift","alt","meta"].filter((function(e){return!c[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else a.push(s);a.length&&(i+=ul(a)),o&&(i+=o);var l=t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value;return"function($event){"+i+l+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function ul(e){return"if(!$event.type.indexOf('key')&&"+e.map(dl).join("&&")+")return null;"}function dl(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=il[e],r=ol[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function fl(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function hl(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}var pl={on:fl,bind:hl,cloak:D},ml=function(e){this.options=e,this.warn=e.warn||ao,this.transforms=so(e.modules,"transformCode"),this.dataGenFns=so(e.modules,"genData"),this.directives=P(P({},pl),e.directives);var t=e.isReservedTag||L;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function vl(e,t){var n=new ml(t),r=e?"script"===e.tag?"null":gl(e,n):'_c("div")';return{render:"with(this){return "+r+"}",staticRenderFns:n.staticRenderFns}}function gl(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return yl(e,t);if(e.once&&!e.onceProcessed)return bl(e,t);if(e.for&&!e.forProcessed)return xl(e,t);if(e.if&&!e.ifProcessed)return _l(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return Ll(e,t);var n;if(e.component)n=Nl(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=kl(e,t));var i=e.inlineTemplate?null:Ol(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}function Il(e){return 1===e.type&&("slot"===e.tag||e.children.some(Il))}function Rl(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return _l(e,t,Rl,"null");if(e.for&&!e.forProcessed)return xl(e,t,Rl);var r=e.slotScope===uc?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Ol(e,t)||"undefined")+":undefined":Ol(e,t)||"undefined":gl(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Ol(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||gl)(a,t)+s}var c=n?Ml(o,t.maybeComponent):0,l=i||Pl;return"["+o.map((function(e){return l(e,t)})).join(",")+"]"+(c?","+c:"")}}function Ml(e,t){for(var n=0,r=0;r':'
',ql.innerHTML.indexOf(" ")>0}var Hl=!!Q&&Gl(!1),Yl=!!Q&&Gl(!0),Jl=k((function(e){var t=mi(e);return t&&t.innerHTML})),Xl=Tr.prototype.$mount;function Zl(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}Tr.prototype.$mount=function(e,t){if(e=e&&mi(e),e===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"===typeof r)"#"===r.charAt(0)&&(r=Jl(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Zl(e));if(r){0;var i=Vl(r,{outputSourceRange:!1,shouldDecodeNewlines:Hl,shouldDecodeNewlinesForHref:Yl,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Xl.call(this,e,t)},Tr.compile=Vl,n["default"]=Tr}.call(this,r("c8ba"))},a04b:function(e,t,n){var r=n("c04e"),i=n("d9b5");e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},a071:function(e,t,n){"use strict";n.r(t);var r=n("40af");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},a099:function(e,t,n){t.pbkdf2=n("206d"),t.pbkdf2Sync=n("e07b")},a0d3:function(e,t,n){"use strict";var r=n("0f7c");e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},a120:function(t,n,r){"use strict";var i=r("c973").default;r("d9e2");var o=r("dbce");Object.defineProperty(n,"__esModule",{value:!0}),n.MatrixEvent=n.EventStatus=void 0;var a=r("faa1"),s=o(r("3987")),c=r("63c7");const l={NOT_SENT:"not_sent",ENCRYPTING:"encrypting",SENDING:"sending",QUEUED:"queued",SENT:"sent",CANCELLED:"cancelled"};n.EventStatus=l;const u={};function d(e){return u[e]||(u[e]=e),u[e]}const f=function(e){["state_key","type","sender","room_id","membership"].forEach(t=>{e[t]&&(e[t]=d(e[t]))}),["membership","avatar_url","displayname"].forEach(t=>{e.content&&e.content[t]&&(e.content[t]=d(e.content[t]))}),["rel_type"].forEach(t=>{e.content&&e.content["m.relates_to"]&&e.content["m.relates_to"][t]&&(e.content["m.relates_to"][t]=d(e.content["m.relates_to"][t]))}),this.event=e||{},this.sender=null,this.target=null,this.status=null,this.error=null,this.forwardLooking=!0,this._pushActions=null,this._replacingEvent=null,this._localRedactionEvent=null,this._isCancelled=!1,this._clearEvent={},this._senderCurve25519Key=null,this._claimedEd25519Key=null,this._forwardingCurve25519KeyChain=[],this._untrusted=null,this._decryptionPromise=null,this._retryDecryption=!1,this.verificationRequest=null,this._txnId=e.txn_id||null,this._localTimestamp=Date.now()-this.getAge()};n.MatrixEvent=f,s.inherits(f,a.EventEmitter),s.extend(f.prototype,{getId:function(){return this.event.event_id},getSender:function(){return this.event.sender||this.event.user_id},getType:function(){return this._clearEvent.type||this.event.type},getWireType:function(){return this.event.type},getRoomId:function(){return this.event.room_id},getTs:function(){return this.event.origin_server_ts},getDate:function(){return this.event.origin_server_ts?new Date(this.event.origin_server_ts):null},getOriginalContent:function(){return this._localRedactionEvent?{}:this._clearEvent.content||this.event.content||{}},getContent:function(){return this._localRedactionEvent?{}:this._replacingEvent?this._replacingEvent.getContent()["m.new_content"]||{}:this.getOriginalContent()},getWireContent:function(){return this.event.content||{}},getPrevContent:function(){return this.getUnsigned().prev_content||this.event.prev_content||{}},getDirectionalContent:function(){return this.forwardLooking?this.getContent():this.getPrevContent()},getAge:function(){return this.getUnsigned().age||this.event.age},getLocalAge:function(){return Date.now()-this._localTimestamp},getStateKey:function(){return this.event.state_key},isState:function(){return void 0!==this.event.state_key},makeEncrypted:function(e,t,n,r){this._clearEvent={type:this.event.type,content:this.event.content},this.event.type=e,this.event.content=t,this._senderCurve25519Key=n,this._claimedEd25519Key=r},isBeingDecrypted:function(){return null!=this._decryptionPromise},isDecryptionFailure:function(){return this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"===this._clearEvent.content.msgtype},attemptDecryption:function(){var e=i((function*(e,t){if(!this.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");if(this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"!==this._clearEvent.content.msgtype)throw new Error("Attempt to decrypt event which has already been decrypted");return this._decryptionPromise?(c.logger.log(`Event ${this.getId()} already being decrypted; queueing a retry`),this._retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this._decryptionLoop(e,t),this._decryptionPromise)}));return function(t,n){return e.apply(this,arguments)}}(),cancelAndResendKeyRequest:function(e,t){const n=this.getWireContent();return e.requestRoomKey({algorithm:n.algorithm,room_id:this.getRoomId(),session_id:n.session_id,sender_key:n.sender_key},this.getKeyRequestRecipients(t),!0)},getKeyRequestRecipients:function(e){const t=this.getWireContent(),n=[{userId:e,deviceId:"*"}],r=this.getSender();return r!==e&&n.push({userId:r,deviceId:t.device_id}),n},_decryptionLoop:function(){var t=i((function*(t,n){yield Promise.resolve();while(1){let r,i;this._retryDecryption=!1;try{t?(r=yield t.decryptEvent(this),n&&c.logger.info(`Decrypted event on retry (id=${this.getId()})`)):r=this._badEncryptedMessage("Encryption not enabled")}catch(e){if("DecryptionError"!==e.name){const r=n?"re":"";return c.logger.error(`Error ${r}decrypting event (id=${this.getId()}): ${e.stack||e}`),this._decryptionPromise=null,void(this._retryDecryption=!1)}if(i=e,this._retryDecryption){c.logger.log(`Got error decrypting event (id=${this.getId()}: `+e+"), but retrying");continue}c.logger.warn(`Error decrypting event (id=${this.getId()}): ${e.detailedString}`),r=this._badEncryptedMessage(e.message)}return this._decryptionPromise=null,this._retryDecryption=!1,this._setClearData(r),this.setPushActions(null),void this.emit("Event.decrypted",this,i)}}));return function(e,n){return t.apply(this,arguments)}}(),_badEncryptedMessage:function(e){return{clearEvent:{type:"m.room.message",content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: "+e+" **"}}}},_setClearData:function(e){this._clearEvent=e.clearEvent,this._senderCurve25519Key=e.senderCurve25519Key||null,this._claimedEd25519Key=e.claimedEd25519Key||null,this._forwardingCurve25519KeyChain=e.forwardingCurve25519KeyChain||[],this._untrusted=e.untrusted||!1},getClearContent:function(){const e=this._clearEvent;return e&&e.content?e.content:null},isEncrypted:function(){return!this.isState()&&"m.room.encrypted"===this.event.type},getSenderKey:function(){return this._senderCurve25519Key},getKeysClaimed:function(){return{ed25519:this._claimedEd25519Key}},getClaimedEd25519Key:function(){return this._claimedEd25519Key},getForwardingCurve25519KeyChain:function(){return this._forwardingCurve25519KeyChain},isKeySourceUntrusted:function(){return this._untrusted},getUnsigned:function(){return this.event.unsigned||{}},unmarkLocallyRedacted:function(){const e=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=null),!!e},markLocallyRedacted:function(e){this._localRedactionEvent||(this.emit("Event.beforeRedaction",this,e),this._localRedactionEvent=e,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event)},makeRedacted:function(e){if(!e.event)throw new Error("invalid redaction_event in makeRedacted");let t;for(t in this._localRedactionEvent=null,this.emit("Event.beforeRedaction",this,e),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event,this.event)this.event.hasOwnProperty(t)&&(h[t]||delete this.event[t]);const n=p[this.getType()]||{},r=this.getContent();for(t in r)r.hasOwnProperty(t)&&(n[t]||delete r[t])},isRedacted:function(){return Boolean(this.getUnsigned().redacted_because)},isRedaction:function(){return"m.room.redaction"===this.getType()},getRedactionEvent:function(){return this.isRedacted()?this._clearEvent.unsigned?this._clearEvent.unsigned.redacted_because:this.event.unsigned.redacted_because?this.event.unsigned.redacted_because:{}:null},getPushActions:function(){return this._pushActions},setPushActions:function(e){this._pushActions=e},handleRemoteEcho:function(e){const t=this.getUnsigned(),n=this.getId();this.event=e,t.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=t.redacted_because),this.setStatus(null),this.getId()!==n&&this.emit("Event.localEventIdReplaced",this)},isSending(){return!!this.status},setStatus(e){this.status=e,this.emit("Event.status",this,e)},replaceLocalEventId(e){this.event.event_id=e,this.emit("Event.localEventIdReplaced",this)},isRelation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;const t=this.getWireContent(),n=t&&t["m.relates_to"];return n&&n.rel_type&&n.event_id&&(e&&n.rel_type===e||!e)},getRelation(){return this.isRelation()?this.getWireContent()["m.relates_to"]:null},makeReplaced(e){this.isRedacted()&&e||this._replacingEvent!==e&&(this._replacingEvent=e,this.emit("Event.replaced",this))},getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status},getServerAggregatedRelation(e){const t=this.getUnsigned()["m.relations"];if(t)return t[e]},replacingEventId(){const e=this.getServerAggregatedRelation("m.replace");return e?e.event_id:this._replacingEvent?this._replacingEvent.getId():void 0},replacingEvent(){return this._replacingEvent},replacingEventDate(){const e=this.getServerAggregatedRelation("m.replace");if(e){const t=e.origin_server_ts;if(Number.isFinite(t))return new Date(t)}else if(this._replacingEvent)return this._replacingEvent.getDate()},localRedactionEvent(){return this._localRedactionEvent},getAssociatedId(){const e=this.getRelation();return e?e.event_id:this.isRedaction()?this.event.redacts:void 0},hasAssocation(){return!!this.getAssociatedId()},updateAssociatedId(e){const t=this.getRelation();t?t.event_id=e:this.isRedaction()&&(this.event.redacts=e)},flagCancelled(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._isCancelled=e},isCancelled(){return this._isCancelled},toJSON(){const e={type:this.getType(),sender:this.getSender(),content:this.getContent(),event_id:this.getId(),origin_server_ts:this.getTs(),unsigned:this.getUnsigned(),room_id:this.getRoomId()};return this.isRedaction()&&(e.redacts=this.event.redacts),this.isEncrypted()?{decrypted:e,encrypted:this.event}:e},setVerificationRequest:function(e){this.verificationRequest=e},setTxnId(e){this._txnId=e},getTxnId(){return this._txnId}});const h=["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"].reduce((function(e,t){return e[t]=1,e}),{}),p={"m.room.member":{membership:1},"m.room.create":{creator:1},"m.room.join_rules":{join_rule:1},"m.room.power_levels":{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1},"m.room.aliases":{aliases:1}}},a14c:function(e,t,n){var r=n("12a8");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("57a2b51c",r,e)}},a255:function(e,t,n){var r=n("3fb5"),i=n("b672"),o=n("8707").Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}function l(e,t,n){return n^e&(t^n)}function u(e,t,n){return e&t|n&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}r(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=p(t[g-2])+t[g-7]+h(t[g-15])+t[g-16]|0;for(var y=0;y<64;++y){var b=v+f(s)+l(s,c,m)+a[y]+t[y]|0,_=d(n)+u(n,r,i)|0;v=m,m=c,c=s,s=o+b|0,o=i,i=r,r=n,n=b+_|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=c+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},a279:function(e,t,n){var r=n("b753");function i(){for(var e={},t=Object.keys(r),n=t.length,i=0;i({messagesPreview:!1}),props:{data:Object},components:{preview:a["a"]},computed:Object(o["c"])({auth:e=>e.auth,a:function(){return this.messagesPreview?[1]:[1,2,3,4,5,6]}}),methods:{}},c=s,l=n("2877");function u(e){var t=n("6e9e");t.__inject__&&t.__inject__(e)}var d=Object(l["a"])(c,r,i,!1,u,"7ed73c7c",null,!0);t["a"]=d.exports},a593:function(e,t,n){"use strict";var r=n("651d"),i=n("044b"),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function s(e){return"[object ArrayBuffer]"===o.call(e)}function c(e){return"undefined"!==typeof FormData&&e instanceof FormData}function l(e){var t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function u(e){return"string"===typeof e}function d(e){return"number"===typeof e}function f(e){return"undefined"===typeof e}function h(e){return null!==e&&"object"===typeof e}function p(e){return"[object Date]"===o.call(e)}function m(e){return"[object File]"===o.call(e)}function v(e){return"[object Blob]"===o.call(e)}function g(e){return"[object Function]"===o.call(e)}function y(e){return h(e)&&g(e.pipe)}function b(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function _(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function x(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n0)return this.m_chat.currentState.getStateEvents("m.room.name")[0].getContent().name;var e=_.filter(this.users,e=>e.userId!=this.core.user.userinfo.id),t=_.filter(_.map(e,e=>{if(this.$store.state.users[e.userId])return this.$store.state.users[e.userId].name}),(function(e){return e}));return t.length?0==this.m_chat.name.indexOf("@")?this.m_chat.name.replace("@",""):t.join(", "):this.core.mtrx.chatUsers(this.chat.roomId).length?"Empty chat: "+this.chat.roomId:"-"},isShowGroupIcon(){return"@"===this.m_chat.name.slice(0,1)}},mounted:function(){}},a=o,s=n("2877");function c(e){var t=n("64a6");t.__inject__&&t.__inject__(e)}var l=Object(s["a"])(a,r,i,!1,c,"72a9c575",null,!0);t["a"]=l.exports},aa4a:function(e,t,n){"use strict";var r=n("a593");function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},aa69:function(e,t,n){"use strict";e.exports=o;var r=n("dcd0"),i=Object.create(n("3a7c"));function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=n("3fb5"),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},ab36:function(e,t,n){var r=n("861d"),i=n("9112");e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},abac:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".previewWrapper[data-v-691bf714]{height:60px;position:absolute;top:0;width:100%;display:flex;align-items:center;justify-content:flex-start;padding:0;border-bottom:1px solid rgb(var(--background-main))}.previewWrapper .previewContact[data-v-691bf714],.previewWrapper .previewContactSelect[data-v-691bf714]{width:100%}.previewWrapper .previewBox[data-v-691bf714]{width:100%;display:flex;justify-content:space-between;align-items:center}.previewWrapper .previewBox .previewWrapper[data-v-691bf714]{flex-grow:1;width:100%}.previewWrapper .checkBox[data-v-691bf714]{text-align:center;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList[data-v-691bf714]{margin-bottom:8px}.contactList .title[data-v-691bf714]{padding:0 .5em}.contactList.minimized .title[data-v-691bf714]{display:none}.contactList.minimized .previewWrapper[data-v-691bf714]{padding:.5em 0;border-bottom:0;cursor:pointer}.contactList.minimized .previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList.minimized .previewWrapper[data-v-691bf714] .previewWrapper{padding:0}",""]),e.exports=t},abf7:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.matrin[data-v-9d2b1700]{margin:0 auto 0 0!important}.msgAction[data-v-9d2b1700]{position:absolute}.msgAction[data-v-9d2b1700]:before{content:"";display:block;width:100%;height:100%;position:fixed;z-index:10;opacity:.9;left:0;right:0;top:0;bottom:0}.msgAction .contentAction[data-v-9d2b1700],.msgAction[data-v-9d2b1700]:before{background-color:rgb(var(--background-main))}.msgAction .contentAction[data-v-9d2b1700]{width:180px;position:relative;z-index:300;border:.1em solid rgb(var(--neutral-grad-0));border-radius:.8em;margin:.6em 0 0 auto}.msgAction .contentAction ul[data-v-9d2b1700]{padding:0;list-style:none;margin:0;display:block;width:100%;height:100%}.msgAction .contentAction ul li[data-v-9d2b1700]{display:flex;justify-content:space-between;padding:.2em .8em;align-items:center;border-top:.1em solid rgb(var(--neutral-grad-1));font-size:1em}.msgAction .contentAction ul li[data-v-9d2b1700]:first-child{border:0}',""]),e.exports=t},ac2a:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.outer-div[data-v-e4f39dca]{line-height:inherit;border-radius:50%}.dropDownIcon[data-v-e4f39dca]{width:35px;height:35px;line-height:35px}.dropDownIcon i[data-v-e4f39dca]{line-height:35px!important}.menuwrapper[data-v-e4f39dca]{padding-left:1em;padding-right:1em;padding-bottom:1em;position:absolute;z-index:100;bottom:0;left:0;right:0}.menuwrapper[data-v-e4f39dca] .items{max-height:500px;overflow-y:auto;border-radius:3px;padding-left:.5em;padding-right:.5em;padding-bottom:.5em}.dropdown[data-v-e4f39dca]{z-index:10000;position:absolute;width:100%;right:0;height:auto;color:rgb(var(--text-color));transition:.3s;bottom:-100em;top:100em}.dropdown .backgr[data-v-e4f39dca]{background:rgba(var(--background-total-theme),.15);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);position:fixed;z-index:100;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}.dropdown.visible[data-v-e4f39dca]{bottom:0;top:0}.dropdown.visible .backgr[data-v-e4f39dca]{opacity:1}.dropdown[data-v-e4f39dca] .contentWrapper{margin-top:.25em;border-radius:10px;overflow:hidden}.dropdown .contentWrapper[data-v-e4f39dca],.dropdown[data-v-e4f39dca] .contentWrapper{border-top:1px solid rgba(var(--neutral-grad-1),.5);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .cancelWrapper .menu-item[data-v-e4f39dca]{margin-top:0;box-shadow:none;color:rgb(var(--neutral-grad-3));box-shadow:0 5px 5px -3px rgba(var(--color-shadow-base),.4)}.dropdown .menu-item[data-v-e4f39dca]{padding:.5em;background:rgb(var(--background-total-theme));color:rgb(var(--neutral-grad-3));line-height:44px;margin-top:.25em;display:flex;border-radius:10px;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .menu-item .title[data-v-e4f39dca]{flex-grow:2;padding-right:44px;text-align:center}.dropdown .menu-item .iconWrapper[data-v-e4f39dca]{width:44px;text-align:center}.dropdown .blocker[data-v-e4f39dca]{position:fixed;top:0;left:0;bottom:0;right:0;content:" "}.cancelWrapper[data-v-e4f39dca]{border-radius:3px;padding-left:.5em;padding-right:.5em;color:rgb(var(--neutral-grad-3))}.small[data-v-e4f39dca]{font-size:.85em}.outer-div.mobile .menuwrapper[data-v-e4f39dca]{position:fixed}.outer-div.minimized[data-v-e4f39dca]{position:static}.outer-div.minimized .backgr[data-v-e4f39dca]{border-radius:4px;height:1000px;bottom:0;top:auto;background:transparent;position:absolute}.outer-div.minimized .dropdown[data-v-e4f39dca]{z-index:10000;right:0}.outer-div.minimized .menuwrapper[data-v-e4f39dca]{border-radius:4px;padding-top:.5em}.outer-div.minimized .menuwrapper[data-v-e4f39dca] .menu-item{margin-top:.25em;border-radius:5px;background:rgba(var(--background-total-theme),.95)}',""]),e.exports=t},ad71:function(e,t,n){"use strict";(function(t,r){var i;e.exports=R,R.ReadableState=I;n("faa1").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=n("429b"),s=n("b639").Buffer,c=t.Uint8Array||function(){};function l(e){return s.from(e)}function u(e){return s.isBuffer(e)||e instanceof c}var d,f=n(0);d=f&&f.debuglog?f.debuglog("stream"):function(){};var h,p,m,v=n("c6ae"),g=n("4681"),y=n("0db6"),b=y.getHighWaterMark,_=n("c9b8").codes,w=_.ERR_INVALID_ARG_TYPE,x=_.ERR_STREAM_PUSH_AFTER_EOF,k=_.ERR_METHOD_NOT_IMPLEMENTED,S=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n("3fb5")(R,a);var E=g.errorOrDestroy,C=["error","close","destroy","pause","resume"];function T(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function I(e,t,r){i=i||n("b19a"),e=e||{},"boolean"!==typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",r),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n("7d72").StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function R(e){if(i=i||n("b19a"),!(this instanceof R))return new R(e);var t=this instanceof i;this._readableState=new I(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function O(e,t,n,r,i){d("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,L(e,a);else if(i||(o=A(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=l(t)),r)a.endEmitted?E(e,new S):M(e,a,t,!0);else if(a.ended)E(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):U(e,a)):M(e,a,t,!1)}else r||(a.reading=!1,U(e,a));return!a.ended&&(a.length=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=j(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function L(e,t){if(d("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?N(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,$(e)))}}function N(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick($,e))}function $(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,V(e)}function U(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(B,e,t))}function B(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function q(e){d("readable nexttick read 0"),e.read(0)}function W(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(K,e,t))}function K(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&null!==e.read());}function G(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function H(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(Y,t,e))}function Y(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function J(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?H(this):N(this),null;if(e=D(e,t),0===e&&t.ended)return 0===t.length&&H(this),null;var r,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?G(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&H(this)),null!==r&&this.emit("data",r),r},R.prototype._read=function(e){E(this,new k("_read()"))},R.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,s=a?l:y;function c(e,t){d("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function l(){d("onend"),e.end()}i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",c);var u=F(n);e.on("drain",u);var f=!1;function h(){d("cleanup"),e.removeListener("close",v),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",y),n.removeListener("data",p),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u()}function p(t){d("ondata");var r=e.write(t);d("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==J(i.pipes,e))&&!f&&(d("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function m(t){d("onerror",t),y(),e.removeListener("error",m),0===o(e,"error")&&E(e,t)}function v(){e.removeListener("finish",g),y()}function g(){d("onfinish"),e.removeListener("close",v),y()}function y(){d("unpipe"),n.unpipe(e)}return n.on("data",p),T(e,"error",m),e.once("close",v),e.once("finish",g),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,d("on readable",i.length,i.reading),i.length?N(this):i.reading||r.nextTick(q,this))),n},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(z,this),n},R.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(z,this),t},R.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,W(this,e)),e.paused=!1,this},R.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){if(d("wrapped data"),n.decoder&&(i=n.decoder.write(i)),(!n.objectMode||null!==i&&void 0!==i)&&(n.objectMode||i&&i.length)){var o=t.push(i);o||(r=!0,e.pause())}})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;oe.time-t.time),k(r.store,i,o)}))()}getEndToEndSessionProblem(e,t){var n=this;return i((function*(){const r=g(e),i=x(n.store,r)||[];if(!i.length)return null;const o=i[i.length-1];for(const e of i)if(e.time>t)return Object.assign({},e,{fixed:o.fixed});return o.fixed?null:o}))()}filterOutNotifiedErrorDevices(e){var t=this;return i((function*(){const n=x(t.store,u)||{},r=[];for(const t of e){const{userId:e,deviceInfo:i}=t;e in n?i.deviceId in n[e]||(r.push(t),n[e][i.deviceId]=!0):(r.push(t),n[e]={[i.deviceId]:!0})}return k(t.store,u,n),r}))()}getEndToEndInboundGroupSession(e,t,n,r){r(x(this.store,y(e,t)),x(this.store,b(e,t)))}getAllEndToEndInboundGroupSessions(e,t){for(let n=0;n{n.push({senderKey:t,sessionId:i,sessionData:e})}),e&&r.length>=e)break}return Promise.resolve(n)}countSessionsNeedingBackup(){const e=x(this.store,m)||{};return Promise.resolve(Object.keys(e).length)}unmarkSessionsNeedingBackup(e){const t=x(this.store,m)||{};for(const n of e)delete t[n.senderKey+"/"+n.sessionId];return k(this.store,m,t),Promise.resolve()}markSessionsNeedingBackup(e){const t=x(this.store,m)||{};for(const n of e)t[n.senderKey+"/"+n.sessionId]=!0;return k(this.store,m,t),Promise.resolve()}deleteAllData(){return this.store.removeItem(c),Promise.resolve()}getAccount(e,t){const n=x(this.store,c);t(n)}storeAccount(e,t){k(this.store,c,t)}getCrossSigningKeys(e,t){const n=x(this.store,l);t(n)}getSecretStorePrivateKey(e,t,n){const r=x(this.store,s+"ssss_cache."+n);t(r)}storeCrossSigningKeys(e,t){k(this.store,l,t)}storeSecretStorePrivateKey(e,t,n){k(this.store,s+"ssss_cache."+t,n)}doTxn(e,t,n){return Promise.resolve(n(null))}}function x(t,n){try{return JSON.parse(t.getItem(n))}catch(e){o.logger.log("Error: Failed to get key %s: %s",n,e.stack||e),o.logger.log(e.stack)}return null}function k(e,t,n){e.setItem(t,JSON.stringify(n))}n.LocalStorageCryptoStore=w},b313:function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g,o={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports={default:o.RFC3986,formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o.RFC1738,RFC3986:o.RFC3986}},b383:function(e,t,n){"use strict";t.decode=t.parse=n("91dd"),t.encode=t.stringify=n("e099")},b40f:function(e,t,n){"use strict"; +var r=Object.freeze({});function i(e){return void 0===e||null===e}function o(e){return void 0!==e&&null!==e}function a(e){return!0===e}function s(e){return!1===e}function c(e){return"string"===typeof e||"number"===typeof e||"symbol"===typeof e||"boolean"===typeof e}function l(e){return null!==e&&"object"===typeof e}var u=Object.prototype.toString;function d(e){return"[object Object]"===u.call(e)}function f(e){return"[object RegExp]"===u.call(e)}function h(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function p(e){return o(e)&&"function"===typeof e.then&&"function"===typeof e.catch}function m(e){return null==e?"":Array.isArray(e)||d(e)&&e.toString===u?JSON.stringify(e,null,2):String(e)}function v(e){var t=parseFloat(e);return isNaN(t)?e:t}function g(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var w=Object.prototype.hasOwnProperty;function x(e,t){return w.call(e,t)}function S(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}var k=/-(\w)/g,E=S((function(e){return e.replace(k,(function(e,t){return t?t.toUpperCase():""}))})),C=S((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),T=/\B([A-Z])/g,I=S((function(e){return e.replace(T,"-$1").toLowerCase()}));function R(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function O(e,t){return e.bind(t)}var M=Function.prototype.bind?O:R;function P(e,t){t=t||0;var n=e.length-t,r=new Array(n);while(n--)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function j(e){for(var t={},n=0;n0,oe=ne&&ne.indexOf("edge/")>0,ae=(ne&&ne.indexOf("android"),ne&&/iphone|ipad|ipod|ios/.test(ne)||"ios"===te),se=(ne&&/chrome\/\d+/.test(ne),ne&&/phantomjs/.test(ne),ne&&ne.match(/firefox\/(\d+)/)),ce={}.watch,le=!1;if(Q)try{var ue={};Object.defineProperty(ue,"passive",{get:function(){le=!0}}),window.addEventListener("test-passive",null,ue)}catch(e){}var de=function(){return void 0===X&&(X=!Q&&!ee&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),X},fe=Q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function he(e){return"function"===typeof e&&/native code/.test(e.toString())}var pe,me="undefined"!==typeof Symbol&&he(Symbol)&&"undefined"!==typeof Reflect&&he(Reflect.ownKeys);pe="undefined"!==typeof Set&&he(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ve=D,ge=0,ye=function(){this.id=ge++,this.subs=[]};ye.prototype.addSub=function(e){this.subs.push(e)},ye.prototype.removeSub=function(e){_(this.subs,e)},ye.prototype.depend=function(){ye.target&&ye.target.addDep(this)},ye.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t-1)if(o&&!x(i,"default"))a=!1;else if(""===a||a===I(e)){var c=it(String,i.type);(c<0||s0&&(r=Mt(r,(t||"")+"_"+n),Ot(r[0])&&Ot(l)&&(u[s]=Ee(l.text+r[0].text),r.shift()),u.push.apply(u,r)):c(r)?Ot(l)?u[s]=Ee(l.text+r):""!==r&&u.push(Ee(r)):Ot(r)&&Ot(l)?u[s]=Ee(l.text+r.text):(a(e._isVList)&&o(r.tag)&&i(r.key)&&o(t)&&(r.key="__vlist"+t+"_"+n+"__"),u.push(r)));return u}function Pt(e){var t=e.$options.provide;t&&(e._provided="function"===typeof t?t.call(e):t)}function At(e){var t=jt(e.$options.inject,e);t&&(Pe(!1),Object.keys(t).forEach((function(n){Ne(e,n,t[n])})),Pe(!0))}function jt(e,t){if(e){for(var n=Object.create(null),r=me?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=e?!!e.$stable:!o,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&n&&n!==r&&s===n.$key&&!o&&!n.$hasNormal)return n;for(var c in i={},e)e[c]&&"$"!==c[0]&&(i[c]=Ut(t,c,e[c]))}else i={};for(var l in t)l in i||(i[l]=Bt(t,l));return e&&Object.isExtensible(e)&&(e._normalized=i),H(i,"$stable",a),H(i,"$key",s),H(i,"$hasNormal",o),i}function Ut(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});e=e&&"object"===typeof e&&!Array.isArray(e)?[e]:Rt(e);var t=e&&e[0];return e&&(!t||1===e.length&&t.isComment&&!Nt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Bt(e,t){return function(){return e[t]}}function Ft(e,t){var n,r,i,a,s;if(Array.isArray(e)||"string"===typeof e)for(n=new Array(e.length),r=0,i=e.length;r1?P(n):n;for(var r=P(arguments,1),i='event handler for "'+e+'"',o=0,a=n.length;odocument.createEvent("Event").timeStamp&&(Zn=function(){return Qn.now()})}function er(){var e,t;for(Xn=Zn(),Hn=!0,Wn.sort((function(e,t){return e.id-t.id})),Yn=0;YnYn&&Wn[n].id>e.id)n--;Wn.splice(n+1,0,e)}else Wn.push(e);Gn||(Gn=!0,yt(er))}}var or=0,ar=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++or,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new pe,this.newDepIds=new pe,this.expression="","function"===typeof t?this.getter=t:(this.getter=J(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};ar.prototype.get=function(){var t;_e(this);var n=this.vm;try{t=this.getter.call(n,n)}catch(e){if(!this.user)throw e;ot(e,n,'getter for watcher "'+this.expression+'"')}finally{this.deep&&_t(t),we(),this.cleanupDeps()}return t},ar.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},ar.prototype.cleanupDeps=function(){var e=this.deps.length;while(e--){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ar.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ir(this)},ar.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||l(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';at(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},ar.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},ar.prototype.depend=function(){var e=this.deps.length;while(e--)this.deps[e].depend()},ar.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);var e=this.deps.length;while(e--)this.deps[e].removeSub(this);this.active=!1}};var sr={enumerable:!0,configurable:!0,get:D,set:D};function cr(e,t,n){sr.get=function(){return this[t][n]},sr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,sr)}function lr(e){e._watchers=[];var t=e.$options;t.props&&ur(e,t.props),t.methods&&yr(e,t.methods),t.data?dr(e):Le(e._data={},!0),t.computed&&pr(e,t.computed),t.watch&&t.watch!==ce&&br(e,t.watch)}function ur(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;o||Pe(!1);var a=function(o){i.push(o);var a=Qe(o,t,n,e);Ne(r,o,a),o in e||cr(e,"_props",o)};for(var s in t)a(s);Pe(!0)}function dr(e){var t=e.$options.data;t=e._data="function"===typeof t?fr(t,e):t||{},d(t)||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);while(i--){var o=n[i];0,r&&x(r,o)||G(o)||cr(e,"_data",o)}Le(t,!0)}function fr(t,n){_e();try{return t.call(n,n)}catch(e){return ot(e,n,"data()"),{}}finally{we()}}var hr={lazy:!0};function pr(e,t){var n=e._computedWatchers=Object.create(null),r=de();for(var i in t){var o=t[i],a="function"===typeof o?o:o.get;0,r||(n[i]=new ar(e,a||D,D,hr)),i in e||mr(e,i,o)}}function mr(e,t,n){var r=!de();"function"===typeof n?(sr.get=r?vr(t):gr(n),sr.set=D):(sr.get=n.get?r&&!1!==n.cache?vr(t):gr(n.get):D,sr.set=n.set||D),Object.defineProperty(e,t,sr)}function vr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ye.target&&t.depend(),t.value}}function gr(e){return function(){return e.call(this,this)}}function yr(e,t){e.$options.props;for(var n in t)e[n]="function"!==typeof t[n]?D:M(t[n],e)}function br(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1)return this;var n=P(arguments,1);return n.unshift(this),"function"===typeof e.install?e.install.apply(e,n):"function"===typeof e&&e.apply(null,n),t.push(e),this}}function Rr(e){e.mixin=function(e){return this.options=Xe(this.options,e),this}}function Or(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name;var a=function(e){this._init(e)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=t++,a.options=Xe(n.options,e),a["super"]=n,a.options.props&&Mr(a),a.options.computed&&Pr(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,q.forEach((function(e){a[e]=n[e]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=A({},a.options),i[r]=a,a}}function Mr(e){var t=e.options.props;for(var n in t)cr(e.prototype,"_props",n)}function Pr(e){var t=e.options.computed;for(var n in t)mr(e.prototype,n,t[n])}function Ar(e){q.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&d(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"===typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}function jr(e){return e&&(e.Ctor.options.name||e.tag)}function Dr(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"===typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Lr(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!t(s)&&Nr(n,o,r,i)}}}function Nr(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,_(n,t)}Sr(Tr),wr(Tr),An(Tr),Nn(Tr),Sn(Tr);var $r=[String,RegExp,Array],Ur={name:"keep-alive",abstract:!0,props:{include:$r,exclude:$r,max:[String,Number]},methods:{cacheVNode:function(){var e=this,t=e.cache,n=e.keys,r=e.vnodeToCache,i=e.keyToCache;if(r){var o=r.tag,a=r.componentInstance,s=r.componentOptions;t[i]={name:jr(s),tag:o,componentInstance:a},n.push(i),this.max&&n.length>parseInt(this.max)&&Nr(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Nr(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){Lr(e,(function(e){return Dr(t,e)}))})),this.$watch("exclude",(function(t){Lr(e,(function(e){return!Dr(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Tn(e),n=t&&t.componentOptions;if(n){var r=jr(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Dr(o,r))||a&&r&&Dr(a,r))return t;var s=this,c=s.cache,l=s.keys,u=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;c[u]?(t.componentInstance=c[u].componentInstance,_(l,u),l.push(u)):(this.vnodeToCache=t,this.keyToCache=u),t.data.keepAlive=!0}return t||e&&e[0]}},Br={KeepAlive:Ur};function Fr(e){var t={get:function(){return K}};Object.defineProperty(e,"config",t),e.util={warn:ve,extend:A,mergeOptions:Xe,defineReactive:Ne},e.set=$e,e.delete=Ue,e.nextTick=yt,e.observable=function(e){return Le(e),e},e.options=Object.create(null),q.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,A(e.options.components,Br),Ir(e),Rr(e),Or(e),Ar(e)}Fr(Tr),Object.defineProperty(Tr.prototype,"$isServer",{get:de}),Object.defineProperty(Tr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Tr,"FunctionalRenderContext",{value:nn}),Tr.version="2.6.14";var zr=g("style,class"),qr=g("input,textarea,option,select,progress"),Wr=function(e,t,n){return"value"===n&&qr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Kr=g("contenteditable,draggable,spellcheck"),Vr=g("events,caret,typing,plaintext-only"),Gr=function(e,t){return Zr(t)||"false"===t?"false":"contenteditable"===e&&Vr(t)?t:"true"},Hr=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Yr="http://www.w3.org/1999/xlink",Jr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Xr=function(e){return Jr(e)?e.slice(6,e.length):""},Zr=function(e){return null==e||!1===e};function Qr(e){var t=e.data,n=e,r=e;while(o(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(t=ei(r.data,t));while(o(n=n.parent))n&&n.data&&(t=ei(t,n.data));return ti(t.staticClass,t.class)}function ei(e,t){return{staticClass:ni(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function ti(e,t){return o(e)||o(t)?ni(e,ri(t)):""}function ni(e,t){return e?t?e+" "+t:e:t||""}function ri(e){return Array.isArray(e)?ii(e):l(e)?oi(e):"string"===typeof e?e:""}function ii(e){for(var t,n="",r=0,i=e.length;r-1?fi[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:fi[e]=/HTMLUnknownElement/.test(t.toString())}var pi=g("text,number,password,search,email,tel,url");function mi(e){if("string"===typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function vi(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function gi(e,t){return document.createElementNS(ai[e],t)}function yi(e){return document.createTextNode(e)}function bi(e){return document.createComment(e)}function _i(e,t,n){e.insertBefore(t,n)}function wi(e,t){e.removeChild(t)}function xi(e,t){e.appendChild(t)}function Si(e){return e.parentNode}function ki(e){return e.nextSibling}function Ei(e){return e.tagName}function Ci(e,t){e.textContent=t}function Ti(e,t){e.setAttribute(t,"")}var Ii=Object.freeze({createElement:vi,createElementNS:gi,createTextNode:yi,createComment:bi,insertBefore:_i,removeChild:wi,appendChild:xi,parentNode:Si,nextSibling:ki,tagName:Ei,setTextContent:Ci,setStyleScope:Ti}),Ri={create:function(e,t){Oi(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Oi(e,!0),Oi(t))},destroy:function(e){Oi(e,!0)}};function Oi(e,t){var n=e.data.ref;if(o(n)){var r=e.context,i=e.componentInstance||e.elm,a=r.$refs;t?Array.isArray(a[n])?_(a[n],i):a[n]===i&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(i)<0&&a[n].push(i):a[n]=[i]:a[n]=i}}var Mi=new xe("",{},[]),Pi=["create","activate","update","remove","destroy"];function Ai(e,t){return e.key===t.key&&e.asyncFactory===t.asyncFactory&&(e.tag===t.tag&&e.isComment===t.isComment&&o(e.data)===o(t.data)&&ji(e,t)||a(e.isAsyncPlaceholder)&&i(t.asyncFactory.error))}function ji(e,t){if("input"!==e.tag)return!0;var n,r=o(n=e.data)&&o(n=n.attrs)&&n.type,i=o(n=t.data)&&o(n=n.attrs)&&n.type;return r===i||pi(r)&&pi(i)}function Di(e,t,n){var r,i,a={};for(r=t;r<=n;++r)i=e[r].key,o(i)&&(a[i]=r);return a}function Li(e){var t,n,r={},s=e.modules,l=e.nodeOps;for(t=0;tm?(d=i(n[y+1])?null:n[y+1].elm,S(e,d,n,p,y,r)):p>y&&E(t,f,m)}function I(e,t,n,r){for(var i=n;i-1?Gi(e,t,n):Hr(t)?Zr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Kr(t)?e.setAttribute(t,Gr(t,n)):Jr(t)?Zr(n)?e.removeAttributeNS(Yr,Xr(t)):e.setAttributeNS(Yr,t,n):Gi(e,t,n)}function Gi(e,t,n){if(Zr(n))e.removeAttribute(t);else{if(re&&!ie&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Hi={create:Ki,update:Ki};function Yi(e,t){var n=t.elm,r=t.data,a=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var s=Qr(t),c=n._transitionClasses;o(c)&&(s=ni(s,ri(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Ji,Xi,Zi,Qi,eo,to,no={create:Yi,update:Yi},ro=/[\w).+\-_$\]]/;function io(e){var t,n,r,i,o,a=!1,s=!1,c=!1,l=!1,u=0,d=0,f=0,h=0;for(r=0;r=0;p--)if(m=e.charAt(p)," "!==m)break;m&&ro.test(m)||(l=!0)}}else void 0===i?(h=r+1,i=e.slice(0,r).trim()):v();function v(){(o||(o=[])).push(e.slice(h,r).trim()),h=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==h&&v(),o)for(r=0;r-1?{exp:e.slice(0,Qi),key:'"'+e.slice(Qi+1)+'"'}:{exp:e,key:null};Xi=e,Qi=eo=to=0;while(!ko())Zi=So(),Eo(Zi)?To(Zi):91===Zi&&Co(Zi);return{exp:e.slice(0,eo),key:e.slice(eo+1,to)}}function So(){return Xi.charCodeAt(++Qi)}function ko(){return Qi>=Ji}function Eo(e){return 34===e||39===e}function Co(e){var t=1;eo=Qi;while(!ko())if(e=So(),Eo(e))To(e);else if(91===e&&t++,93===e&&t--,0===t){to=Qi;break}}function To(e){var t=e;while(!ko())if(e=So(),e===t)break}var Io,Ro="__r",Oo="__c";function Mo(e,t,n){n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return _o(e,r,i),!1;if("select"===o)jo(e,r,i);else if("input"===o&&"checkbox"===a)Po(e,r,i);else if("input"===o&&"radio"===a)Ao(e,r,i);else if("input"===o||"textarea"===o)Do(e,r,i);else{if(!K.isReservedTag(o))return _o(e,r,i),!1}return!0}function Po(e,t,n){var r=n&&n.number,i=vo(e,"value")||"null",o=vo(e,"true-value")||"true",a=vo(e,"false-value")||"false";co(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),po(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+wo(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+wo(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+wo(t,"$$c")+"}",null,!0)}function Ao(e,t,n){var r=n&&n.number,i=vo(e,"value")||"null";i=r?"_n("+i+")":i,co(e,"checked","_q("+t+","+i+")"),po(e,"change",wo(t,i),null,!0)}function jo(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="$event.target.multiple ? $$selectedVal : $$selectedVal[0]",a="var $$selectedVal = "+i+";";a=a+" "+wo(t,o),po(e,"change",a,null,!0)}function Do(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?Ro:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var d=wo(t,u);c&&(d="if($event.target.composing)return;"+d),co(e,"value","("+t+")"),po(e,l,d,null,!0),(s||a)&&po(e,"blur","$forceUpdate()")}function Lo(e){if(o(e[Ro])){var t=re?"change":"input";e[t]=[].concat(e[Ro],e[t]||[]),delete e[Ro]}o(e[Oo])&&(e.change=[].concat(e[Oo],e.change||[]),delete e[Oo])}function No(e,t,n){var r=Io;return function i(){var o=t.apply(null,arguments);null!==o&&Bo(e,i,n,r)}}var $o=ut&&!(se&&Number(se[1])<=53);function Uo(e,t,n,r){if($o){var i=Xn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Io.addEventListener(e,t,le?{capture:n,passive:r}:n)}function Bo(e,t,n,r){(r||Io).removeEventListener(e,t._wrapper||t,n)}function Fo(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Io=t.elm,Lo(n),kt(n,r,Uo,Bo,No,t.context),Io=void 0}}var zo,qo={create:Fo,update:Fo};function Wo(t,n){if(!i(t.data.domProps)||!i(n.data.domProps)){var r,a,s=n.elm,c=t.data.domProps||{},l=n.data.domProps||{};for(r in o(l.__ob__)&&(l=n.data.domProps=A({},l)),c)r in l||(s[r]="");for(r in l){if(a=l[r],"textContent"===r||"innerHTML"===r){if(n.children&&(n.children.length=0),a===c[r])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===r&&"PROGRESS"!==s.tagName){s._value=a;var u=i(a)?"":String(a);Ko(s,u)&&(s.value=u)}else if("innerHTML"===r&&ci(s.tagName)&&i(s.innerHTML)){zo=zo||document.createElement("div"),zo.innerHTML=""+a+"";var d=zo.firstChild;while(s.firstChild)s.removeChild(s.firstChild);while(d.firstChild)s.appendChild(d.firstChild)}else if(a!==c[r])try{s[r]=a}catch(e){}}}}function Ko(e,t){return!e.composing&&("OPTION"===e.tagName||Vo(e,t)||Go(e,t))}function Vo(t,n){var r=!0;try{r=document.activeElement!==t}catch(e){}return r&&t.value!==n}function Go(e,t){var n=e.value,r=e._vModifiers;if(o(r)){if(r.number)return v(n)!==v(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}var Ho={create:Wo,update:Wo},Yo=S((function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach((function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}));function Jo(e){var t=Xo(e.style);return e.staticStyle?A(e.staticStyle,t):t}function Xo(e){return Array.isArray(e)?j(e):"string"===typeof e?Yo(e):e}function Zo(e,t){var n,r={};if(t){var i=e;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(n=Jo(i.data))&&A(r,n)}(n=Jo(e.data))&&A(r,n);var o=e;while(o=o.parent)o.data&&(n=Jo(o.data))&&A(r,n);return r}var Qo,ea=/^--/,ta=/\s*!important$/,na=function(e,t,n){if(ea.test(t))e.style.setProperty(t,n);else if(ta.test(n))e.style.setProperty(I(t),n.replace(ta,""),"important");else{var r=ia(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(sa).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function la(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(sa).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?e.setAttribute("class",n):e.removeAttribute("class")}}function ua(e){if(e){if("object"===typeof e){var t={};return!1!==e.css&&A(t,da(e.name||"v")),A(t,e),t}return"string"===typeof e?da(e):void 0}}var da=S((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),fa=Q&&!ie,ha="transition",pa="animation",ma="transition",va="transitionend",ga="animation",ya="animationend";fa&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ma="WebkitTransition",va="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ga="WebkitAnimation",ya="webkitAnimationEnd"));var ba=Q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function _a(e){ba((function(){ba(e)}))}function wa(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ca(e,t))}function xa(e,t){e._transitionClasses&&_(e._transitionClasses,t),la(e,t)}function Sa(e,t,n){var r=Ea(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ha?va:ya,c=0,l=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++c>=a&&l()};setTimeout((function(){c0&&(n=ha,u=a,d=o.length):t===pa?l>0&&(n=pa,u=l,d=c.length):(u=Math.max(a,l),n=u>0?a>l?ha:pa:null,d=n?n===ha?o.length:c.length:0);var f=n===ha&&ka.test(r[ma+"Property"]);return{type:n,timeout:u,propCount:d,hasTransform:f}}function Ca(e,t){while(e.length1}function Pa(e,t){!0!==t.data.show&&Ia(t)}var Aa=Q?{create:Pa,activate:Pa,remove:function(e,t){!0!==e.data.show?Ra(e,t):t()}}:{},ja=[Hi,no,qo,Ho,aa,Aa],Da=ja.concat(Wi),La=Li({nodeOps:Ii,modules:Da});ie&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&Wa(e,"input")}));var Na={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Et(n,"postpatch",(function(){Na.componentUpdated(e,t,n)})):$a(e,t,n.context),e._vOptions=[].map.call(e.options,Fa)):("textarea"===n.tag||pi(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",za),e.addEventListener("compositionend",qa),e.addEventListener("change",qa),ie&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){$a(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Fa);if(i.some((function(e,t){return!U(e,r[t])}))){var o=e.multiple?t.value.some((function(e){return Ba(e,i)})):t.value!==t.oldValue&&Ba(t.value,i);o&&Wa(e,"change")}}}};function $a(e,t,n){Ua(e,t,n),(re||oe)&&setTimeout((function(){Ua(e,t,n)}),0)}function Ua(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s-1,a.selected!==o&&(a.selected=o);else if(U(Fa(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Ba(e,t){return t.every((function(t){return!U(t,e)}))}function Fa(e){return"_value"in e?e._value:e.value}function za(e){e.target.composing=!0}function qa(e){e.target.composing&&(e.target.composing=!1,Wa(e.target,"input"))}function Wa(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ka(e){return!e.componentInstance||e.data&&e.data.transition?e:Ka(e.componentInstance._vnode)}var Va={bind:function(e,t,n){var r=t.value;n=Ka(n);var i=n.data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Ia(n,(function(){e.style.display=o}))):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value,i=t.oldValue;if(!r!==!i){n=Ka(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?Ia(n,(function(){e.style.display=e.__vOriginalDisplay})):Ra(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none"}},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},Ga={model:Na,show:Va},Ha={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ya(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Ya(Tn(t.children)):e}function Ja(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[E(o)]=i[o];return t}function Xa(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Za(e){while(e=e.parent)if(e.data.transition)return!0}function Qa(e,t){return t.key===e.key&&t.tag===e.tag}var es=function(e){return e.tag||Nt(e)},ts=function(e){return"show"===e.name},ns={name:"transition",props:Ha,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(es),n.length)){0;var r=this.mode;0;var i=n[0];if(Za(this.$vnode))return i;var o=Ya(i);if(!o)return i;if(this._leaving)return Xa(e,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:c(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var s=(o.data||(o.data={})).transition=Ja(this),l=this._vnode,u=Ya(l);if(o.data.directives&&o.data.directives.some(ts)&&(o.data.show=!0),u&&u.data&&!Qa(o,u)&&!Nt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=A({},s);if("out-in"===r)return this._leaving=!0,Et(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Xa(e,i);if("in-out"===r){if(Nt(o))return l;var f,h=function(){f()};Et(s,"afterEnter",h),Et(s,"enterCancelled",h),Et(d,"delayLeave",(function(e){f=e}))}}return i}}},rs=A({tag:String,moveClass:String},Ha);delete rs.mode;var is={props:rs,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Dn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ja(this),s=0;sc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var l=io(r[1].trim());a.push("_s("+l+")"),s.push({"@binding":l}),c=i+r[0].length}return c\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Es=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Cs="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+V.source+"]*",Ts="((?:"+Cs+"\\:)?"+Cs+")",Is=new RegExp("^<"+Ts),Rs=/^\s*(\/?)>/,Os=new RegExp("^<\\/"+Ts+"[^>]*>"),Ms=/^]+>/i,Ps=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Ns=/&(?:lt|gt|quot|amp|#39);/g,$s=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Us=g("pre,textarea",!0),Bs=function(e,t){return e&&Us(e)&&"\n"===t[0]};function Fs(e,t){var n=t?$s:Ns;return e.replace(n,(function(e){return Ls[e]}))}function zs(e,t){var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||L,s=t.canBeLeftOpenTag||L,c=0;while(e){if(n=e,r&&js(r)){var l=0,u=r.toLowerCase(),d=Ds[u]||(Ds[u]=new RegExp("([\\s\\S]*?)(]*>)","i")),f=e.replace(d,(function(e,n,r){return l=r.length,js(u)||"noscript"===u||(n=n.replace(//g,"$1").replace(//g,"$1")),Bs(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));c+=e.length-f.length,e=f,C(u,c-l,c)}else{var h=e.indexOf("<");if(0===h){if(Ps.test(e)){var p=e.indexOf("--\x3e");if(p>=0){t.shouldKeepComment&&t.comment(e.substring(4,p),c,c+p+3),S(p+3);continue}}if(As.test(e)){var m=e.indexOf("]>");if(m>=0){S(m+2);continue}}var v=e.match(Ms);if(v){S(v[0].length);continue}var g=e.match(Os);if(g){var y=c;S(g[0].length),C(g[1],y,c);continue}var b=k();if(b){E(b),Bs(b.tagName,e)&&S(1);continue}}var _=void 0,w=void 0,x=void 0;if(h>=0){w=e.slice(h);while(!Os.test(w)&&!Is.test(w)&&!Ps.test(w)&&!As.test(w)){if(x=w.indexOf("<",1),x<0)break;h+=x,w=e.slice(h)}_=e.substring(0,h)}h<0&&(_=e),_&&S(_.length),t.chars&&_&&t.chars(_,c-_.length,c)}if(e===n){t.chars&&t.chars(e);break}}function S(t){c+=t,e=e.substring(t)}function k(){var t=e.match(Is);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};S(t[0].length);while(!(n=e.match(Rs))&&(r=e.match(Es)||e.match(ks)))r.start=c,S(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],S(n[0].length),i.end=c,i}}function E(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&Ss(n)&&C(r),s(n)&&r===n&&C(n));for(var l=a(n)||!!c,u=e.attrs.length,d=new Array(u),f=0;f=0;a--)if(i[a].lowerCasedTag===s)break}else a=0;if(a>=0){for(var l=i.length-1;l>=a;l--)t.end&&t.end(i[l].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}C()}var qs,Ws,Ks,Vs,Gs,Hs,Ys,Js,Xs=/^@|^v-on:/,Zs=/^v-|^@|^:|^#/,Qs=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ec=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,tc=/^\(|\)$/g,nc=/^\[.*\]$/,rc=/:(.*)$/,ic=/^:|^\.|^v-bind:/,oc=/\.[^.\]]+(?=[^\]]*$)/g,ac=/^v-slot(:|$)|^#/,sc=/[\r\n]/,cc=/[ \f\t\r\n]+/g,lc=S(_s.decode),uc="_empty_";function dc(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:Pc(t),rawAttrsMap:{},parent:n,children:[]}}function fc(e,t){qs=t.warn||ao,Hs=t.isPreTag||L,Ys=t.mustUseProp||L,Js=t.getTagNamespace||L;var n=t.isReservedTag||L;(function(e){return!(!(e.component||e.attrsMap[":is"]||e.attrsMap["v-bind:is"])&&(e.attrsMap.is?n(e.attrsMap.is):n(e.tag)))}),Ks=so(t.modules,"transformNode"),Vs=so(t.modules,"preTransformNode"),Gs=so(t.modules,"postTransformNode"),Ws=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=t.whitespace,c=!1,l=!1;function u(e){if(d(e),c||e.processed||(e=mc(e,t)),o.length||e===r||r.if&&(e.elseif||e.else)&&Sc(r,{exp:e.elseif,block:e}),i&&!e.forbidden)if(e.elseif||e.else)wc(e,i);else{if(e.slotScope){var n=e.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=e}i.children.push(e),e.parent=i}e.children=e.children.filter((function(e){return!e.slotScope})),d(e),e.pre&&(c=!1),Hs(e.tag)&&(l=!1);for(var a=0;a|^function(?:\s+[\w$]+)?\s*\(/,nl=/\([^)]*?\);*$/,rl=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,il={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ol={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},al=function(e){return"if("+e+")return null;"},sl={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:al("$event.target !== $event.currentTarget"),ctrl:al("!$event.ctrlKey"),shift:al("!$event.shiftKey"),alt:al("!$event.altKey"),meta:al("!$event.metaKey"),left:al("'button' in $event && $event.button !== 0"),middle:al("'button' in $event && $event.button !== 1"),right:al("'button' in $event && $event.button !== 2")};function cl(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=ll(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function ll(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return ll(e)})).join(",")+"]";var t=rl.test(e.value),n=tl.test(e.value),r=rl.test(e.value.replace(nl,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(sl[s])o+=sl[s],il[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=al(["ctrl","shift","alt","meta"].filter((function(e){return!c[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else a.push(s);a.length&&(i+=ul(a)),o&&(i+=o);var l=t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value;return"function($event){"+i+l+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function ul(e){return"if(!$event.type.indexOf('key')&&"+e.map(dl).join("&&")+")return null;"}function dl(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=il[e],r=ol[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}function fl(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function hl(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}var pl={on:fl,bind:hl,cloak:D},ml=function(e){this.options=e,this.warn=e.warn||ao,this.transforms=so(e.modules,"transformCode"),this.dataGenFns=so(e.modules,"genData"),this.directives=A(A({},pl),e.directives);var t=e.isReservedTag||L;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function vl(e,t){var n=new ml(t),r=e?"script"===e.tag?"null":gl(e,n):'_c("div")';return{render:"with(this){return "+r+"}",staticRenderFns:n.staticRenderFns}}function gl(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return yl(e,t);if(e.once&&!e.onceProcessed)return bl(e,t);if(e.for&&!e.forProcessed)return xl(e,t);if(e.if&&!e.ifProcessed)return _l(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return Ll(e,t);var n;if(e.component)n=Nl(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Sl(e,t));var i=e.inlineTemplate?null:Ol(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}function Il(e){return 1===e.type&&("slot"===e.tag||e.children.some(Il))}function Rl(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return _l(e,t,Rl,"null");if(e.for&&!e.forProcessed)return xl(e,t,Rl);var r=e.slotScope===uc?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Ol(e,t)||"undefined")+":undefined":Ol(e,t)||"undefined":gl(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Ol(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||gl)(a,t)+s}var c=n?Ml(o,t.maybeComponent):0,l=i||Al;return"["+o.map((function(e){return l(e,t)})).join(",")+"]"+(c?","+c:"")}}function Ml(e,t){for(var n=0,r=0;r':'
',ql.innerHTML.indexOf(" ")>0}var Hl=!!Q&&Gl(!1),Yl=!!Q&&Gl(!0),Jl=S((function(e){var t=mi(e);return t&&t.innerHTML})),Xl=Tr.prototype.$mount;function Zl(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}Tr.prototype.$mount=function(e,t){if(e=e&&mi(e),e===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"===typeof r)"#"===r.charAt(0)&&(r=Jl(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Zl(e));if(r){0;var i=Vl(r,{outputSourceRange:!1,shouldDecodeNewlines:Hl,shouldDecodeNewlinesForHref:Yl,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Xl.call(this,e,t)},Tr.compile=Vl,n["default"]=Tr}.call(this,r("c8ba"))},a04b:function(e,t,n){var r=n("c04e"),i=n("d9b5");e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},a071:function(e,t,n){"use strict";n.r(t);var r=n("40af");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},a099:function(e,t,n){t.pbkdf2=n("206d"),t.pbkdf2Sync=n("e07b")},a0d3:function(e,t,n){"use strict";var r=n("0f7c");e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},a120:function(t,n,r){"use strict";var i=r("c973").default;r("d9e2");var o=r("dbce");Object.defineProperty(n,"__esModule",{value:!0}),n.MatrixEvent=n.EventStatus=void 0;var a=r("faa1"),s=o(r("3987")),c=r("63c7");const l={NOT_SENT:"not_sent",ENCRYPTING:"encrypting",SENDING:"sending",QUEUED:"queued",SENT:"sent",CANCELLED:"cancelled"};n.EventStatus=l;const u={};function d(e){return u[e]||(u[e]=e),u[e]}const f=function(e){["state_key","type","sender","room_id","membership"].forEach(t=>{e[t]&&(e[t]=d(e[t]))}),["membership","avatar_url","displayname"].forEach(t=>{e.content&&e.content[t]&&(e.content[t]=d(e.content[t]))}),["rel_type"].forEach(t=>{e.content&&e.content["m.relates_to"]&&e.content["m.relates_to"][t]&&(e.content["m.relates_to"][t]=d(e.content["m.relates_to"][t]))}),this.event=e||{},this.sender=null,this.target=null,this.status=null,this.error=null,this.forwardLooking=!0,this._pushActions=null,this._replacingEvent=null,this._localRedactionEvent=null,this._isCancelled=!1,this._clearEvent={},this._senderCurve25519Key=null,this._claimedEd25519Key=null,this._forwardingCurve25519KeyChain=[],this._untrusted=null,this._decryptionPromise=null,this._retryDecryption=!1,this.verificationRequest=null,this._txnId=e.txn_id||null,this._localTimestamp=Date.now()-this.getAge()};n.MatrixEvent=f,s.inherits(f,a.EventEmitter),s.extend(f.prototype,{getId:function(){return this.event.event_id},getSender:function(){return this.event.sender||this.event.user_id},getType:function(){return this._clearEvent.type||this.event.type},getWireType:function(){return this.event.type},getRoomId:function(){return this.event.room_id},getTs:function(){return this.event.origin_server_ts},getDate:function(){return this.event.origin_server_ts?new Date(this.event.origin_server_ts):null},getOriginalContent:function(){return this._localRedactionEvent?{}:this._clearEvent.content||this.event.content||{}},getContent:function(){return this._localRedactionEvent?{}:this._replacingEvent?this._replacingEvent.getContent()["m.new_content"]||{}:this.getOriginalContent()},getWireContent:function(){return this.event.content||{}},getPrevContent:function(){return this.getUnsigned().prev_content||this.event.prev_content||{}},getDirectionalContent:function(){return this.forwardLooking?this.getContent():this.getPrevContent()},getAge:function(){return this.getUnsigned().age||this.event.age},getLocalAge:function(){return Date.now()-this._localTimestamp},getStateKey:function(){return this.event.state_key},isState:function(){return void 0!==this.event.state_key},makeEncrypted:function(e,t,n,r){this._clearEvent={type:this.event.type,content:this.event.content},this.event.type=e,this.event.content=t,this._senderCurve25519Key=n,this._claimedEd25519Key=r},isBeingDecrypted:function(){return null!=this._decryptionPromise},isDecryptionFailure:function(){return this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"===this._clearEvent.content.msgtype},attemptDecryption:function(){var e=i((function*(e,t){if(!this.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");if(this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"!==this._clearEvent.content.msgtype)throw new Error("Attempt to decrypt event which has already been decrypted");return this._decryptionPromise?(c.logger.log(`Event ${this.getId()} already being decrypted; queueing a retry`),this._retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this._decryptionLoop(e,t),this._decryptionPromise)}));return function(t,n){return e.apply(this,arguments)}}(),cancelAndResendKeyRequest:function(e,t){const n=this.getWireContent();return e.requestRoomKey({algorithm:n.algorithm,room_id:this.getRoomId(),session_id:n.session_id,sender_key:n.sender_key},this.getKeyRequestRecipients(t),!0)},getKeyRequestRecipients:function(e){const t=this.getWireContent(),n=[{userId:e,deviceId:"*"}],r=this.getSender();return r!==e&&n.push({userId:r,deviceId:t.device_id}),n},_decryptionLoop:function(){var t=i((function*(t,n){yield Promise.resolve();while(1){let r,i;this._retryDecryption=!1;try{t?(r=yield t.decryptEvent(this),n&&c.logger.info(`Decrypted event on retry (id=${this.getId()})`)):r=this._badEncryptedMessage("Encryption not enabled")}catch(e){if("DecryptionError"!==e.name){const r=n?"re":"";return c.logger.error(`Error ${r}decrypting event (id=${this.getId()}): ${e.stack||e}`),this._decryptionPromise=null,void(this._retryDecryption=!1)}if(i=e,this._retryDecryption){c.logger.log(`Got error decrypting event (id=${this.getId()}: `+e+"), but retrying");continue}c.logger.warn(`Error decrypting event (id=${this.getId()}): ${e.detailedString}`),r=this._badEncryptedMessage(e.message)}return this._decryptionPromise=null,this._retryDecryption=!1,this._setClearData(r),this.setPushActions(null),void this.emit("Event.decrypted",this,i)}}));return function(e,n){return t.apply(this,arguments)}}(),_badEncryptedMessage:function(e){return{clearEvent:{type:"m.room.message",content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: "+e+" **"}}}},_setClearData:function(e){this._clearEvent=e.clearEvent,this._senderCurve25519Key=e.senderCurve25519Key||null,this._claimedEd25519Key=e.claimedEd25519Key||null,this._forwardingCurve25519KeyChain=e.forwardingCurve25519KeyChain||[],this._untrusted=e.untrusted||!1},getClearContent:function(){const e=this._clearEvent;return e&&e.content?e.content:null},isEncrypted:function(){return!this.isState()&&"m.room.encrypted"===this.event.type},getSenderKey:function(){return this._senderCurve25519Key},getKeysClaimed:function(){return{ed25519:this._claimedEd25519Key}},getClaimedEd25519Key:function(){return this._claimedEd25519Key},getForwardingCurve25519KeyChain:function(){return this._forwardingCurve25519KeyChain},isKeySourceUntrusted:function(){return this._untrusted},getUnsigned:function(){return this.event.unsigned||{}},unmarkLocallyRedacted:function(){const e=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=null),!!e},markLocallyRedacted:function(e){this._localRedactionEvent||(this.emit("Event.beforeRedaction",this,e),this._localRedactionEvent=e,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event)},makeRedacted:function(e){if(!e.event)throw new Error("invalid redaction_event in makeRedacted");let t;for(t in this._localRedactionEvent=null,this.emit("Event.beforeRedaction",this,e),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event,this.event)this.event.hasOwnProperty(t)&&(h[t]||delete this.event[t]);const n=p[this.getType()]||{},r=this.getContent();for(t in r)r.hasOwnProperty(t)&&(n[t]||delete r[t])},isRedacted:function(){return Boolean(this.getUnsigned().redacted_because)},isRedaction:function(){return"m.room.redaction"===this.getType()},getRedactionEvent:function(){return this.isRedacted()?this._clearEvent.unsigned?this._clearEvent.unsigned.redacted_because:this.event.unsigned.redacted_because?this.event.unsigned.redacted_because:{}:null},getPushActions:function(){return this._pushActions},setPushActions:function(e){this._pushActions=e},handleRemoteEcho:function(e){const t=this.getUnsigned(),n=this.getId();this.event=e,t.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=t.redacted_because),this.setStatus(null),this.getId()!==n&&this.emit("Event.localEventIdReplaced",this)},isSending(){return!!this.status},setStatus(e){this.status=e,this.emit("Event.status",this,e)},replaceLocalEventId(e){this.event.event_id=e,this.emit("Event.localEventIdReplaced",this)},isRelation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;const t=this.getWireContent(),n=t&&t["m.relates_to"];return n&&n.rel_type&&n.event_id&&(e&&n.rel_type===e||!e)},getRelation(){return this.isRelation()?this.getWireContent()["m.relates_to"]:null},makeReplaced(e){this.isRedacted()&&e||this._replacingEvent!==e&&(this._replacingEvent=e,this.emit("Event.replaced",this))},getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status},getServerAggregatedRelation(e){const t=this.getUnsigned()["m.relations"];if(t)return t[e]},replacingEventId(){const e=this.getServerAggregatedRelation("m.replace");return e?e.event_id:this._replacingEvent?this._replacingEvent.getId():void 0},replacingEvent(){return this._replacingEvent},replacingEventDate(){const e=this.getServerAggregatedRelation("m.replace");if(e){const t=e.origin_server_ts;if(Number.isFinite(t))return new Date(t)}else if(this._replacingEvent)return this._replacingEvent.getDate()},localRedactionEvent(){return this._localRedactionEvent},getAssociatedId(){const e=this.getRelation();return e?e.event_id:this.isRedaction()?this.event.redacts:void 0},hasAssocation(){return!!this.getAssociatedId()},updateAssociatedId(e){const t=this.getRelation();t?t.event_id=e:this.isRedaction()&&(this.event.redacts=e)},flagCancelled(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._isCancelled=e},isCancelled(){return this._isCancelled},toJSON(){const e={type:this.getType(),sender:this.getSender(),content:this.getContent(),event_id:this.getId(),origin_server_ts:this.getTs(),unsigned:this.getUnsigned(),room_id:this.getRoomId()};return this.isRedaction()&&(e.redacts=this.event.redacts),this.isEncrypted()?{decrypted:e,encrypted:this.event}:e},setVerificationRequest:function(e){this.verificationRequest=e},setTxnId(e){this._txnId=e},getTxnId(){return this._txnId}});const h=["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"].reduce((function(e,t){return e[t]=1,e}),{}),p={"m.room.member":{membership:1},"m.room.create":{creator:1},"m.room.join_rules":{join_rule:1},"m.room.power_levels":{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1},"m.room.aliases":{aliases:1}}},a14c:function(e,t,n){var r=n("12a8");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("57a2b51c",r,e)}},a255:function(e,t,n){var r=n("3fb5"),i=n("b672"),o=n("8707").Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}function l(e,t,n){return n^e&(t^n)}function u(e,t,n){return e&t|n&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}r(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0|this._f,m=0|this._g,v=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=p(t[g-2])+t[g-7]+h(t[g-15])+t[g-16]|0;for(var y=0;y<64;++y){var b=v+f(s)+l(s,c,m)+a[y]+t[y]|0,_=d(n)+u(n,r,i)|0;v=m,m=c,c=s,s=o+b|0,o=i,i=r,r=n,n=b+_|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=c+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},a279:function(e,t,n){var r=n("b753");function i(){for(var e={},t=Object.keys(r),n=t.length,i=0;i({messagesPreview:!1}),props:{data:Object},components:{preview:a["a"]},computed:Object(o["c"])({auth:e=>e.auth,a:function(){return this.messagesPreview?[1]:[1,2,3,4,5,6]}}),methods:{}},c=s,l=n("2877");function u(e){var t=n("6e9e");t.__inject__&&t.__inject__(e)}var d=Object(l["a"])(c,r,i,!1,u,"7ed73c7c",null,!0);t["a"]=d.exports},a593:function(e,t,n){"use strict";var r=n("651d"),i=n("044b"),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function s(e){return"[object ArrayBuffer]"===o.call(e)}function c(e){return"undefined"!==typeof FormData&&e instanceof FormData}function l(e){var t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function u(e){return"string"===typeof e}function d(e){return"number"===typeof e}function f(e){return"undefined"===typeof e}function h(e){return null!==e&&"object"===typeof e}function p(e){return"[object Date]"===o.call(e)}function m(e){return"[object File]"===o.call(e)}function v(e){return"[object Blob]"===o.call(e)}function g(e){return"[object Function]"===o.call(e)}function y(e){return h(e)&&g(e.pipe)}function b(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function _(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function x(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n0)return this.m_chat.currentState.getStateEvents("m.room.name")[0].getContent().name;var e=_.filter(this.users,e=>e.userId!=this.core.user.userinfo.id),t=_.filter(_.map(e,e=>{if(this.$store.state.users[e.userId])return this.$store.state.users[e.userId].name}),(function(e){return e}));return t.length?0==this.m_chat.name.indexOf("@")?this.m_chat.name.replace("@",""):t.join(", "):this.core.mtrx.chatUsers(this.chat.roomId).length?"Empty chat: "+this.chat.roomId:"-"},isShowGroupIcon(){return"@"===this.m_chat.name.slice(0,1)}},mounted:function(){}},a=o,s=n("2877");function c(e){var t=n("64a6");t.__inject__&&t.__inject__(e)}var l=Object(s["a"])(a,r,i,!1,c,"72a9c575",null,!0);t["a"]=l.exports},aa4a:function(e,t,n){"use strict";var r=n("a593");function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},aa69:function(e,t,n){"use strict";e.exports=o;var r=n("dcd0"),i=Object.create(n("3a7c"));function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=n("3fb5"),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},ab36:function(e,t,n){var r=n("861d"),i=n("9112");e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},abac:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".previewWrapper[data-v-691bf714]{height:60px;position:absolute;top:0;width:100%;display:flex;align-items:center;justify-content:flex-start;padding:0;border-bottom:1px solid rgb(var(--background-main))}.previewWrapper .previewContact[data-v-691bf714],.previewWrapper .previewContactSelect[data-v-691bf714]{width:100%}.previewWrapper .previewBox[data-v-691bf714]{width:100%;display:flex;justify-content:space-between;align-items:center}.previewWrapper .previewBox .previewWrapper[data-v-691bf714]{flex-grow:1;width:100%}.previewWrapper .checkBox[data-v-691bf714]{text-align:center;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList[data-v-691bf714]{margin-bottom:8px}.contactList .title[data-v-691bf714]{padding:0 .5em}.contactList.minimized .title[data-v-691bf714]{display:none}.contactList.minimized .previewWrapper[data-v-691bf714]{padding:.5em 0;border-bottom:0;cursor:pointer}.contactList.minimized .previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList.minimized .previewWrapper[data-v-691bf714] .previewWrapper{padding:0}",""]),e.exports=t},abf7:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.matrin[data-v-9d2b1700]{margin:0 auto 0 0!important}.msgAction[data-v-9d2b1700]{position:absolute}.msgAction[data-v-9d2b1700]:before{content:"";display:block;width:100%;height:100%;position:fixed;z-index:10;opacity:.9;left:0;right:0;top:0;bottom:0}.msgAction .contentAction[data-v-9d2b1700],.msgAction[data-v-9d2b1700]:before{background-color:rgb(var(--background-main))}.msgAction .contentAction[data-v-9d2b1700]{width:180px;position:relative;z-index:300;border:.1em solid rgb(var(--neutral-grad-0));border-radius:.8em;margin:.6em 0 0 auto}.msgAction .contentAction ul[data-v-9d2b1700]{padding:0;list-style:none;margin:0;display:block;width:100%;height:100%}.msgAction .contentAction ul li[data-v-9d2b1700]{display:flex;justify-content:space-between;padding:.2em .8em;align-items:center;border-top:.1em solid rgb(var(--neutral-grad-1));font-size:1em}.msgAction .contentAction ul li[data-v-9d2b1700]:first-child{border:0}',""]),e.exports=t},ac2a:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.outer-div[data-v-e4f39dca]{line-height:inherit;border-radius:50%}.dropDownIcon[data-v-e4f39dca]{width:35px;height:35px;line-height:35px}.dropDownIcon i[data-v-e4f39dca]{line-height:35px!important}.menuwrapper[data-v-e4f39dca]{padding-left:1em;padding-right:1em;padding-bottom:1em;position:absolute;z-index:100;bottom:0;left:0;right:0}.menuwrapper[data-v-e4f39dca] .items{max-height:500px;overflow-y:auto;border-radius:3px;padding-left:.5em;padding-right:.5em;padding-bottom:.5em}.dropdown[data-v-e4f39dca]{z-index:10000;position:absolute;width:100%;right:0;height:auto;color:rgb(var(--text-color));transition:.3s;bottom:-100em;top:100em}.dropdown .backgr[data-v-e4f39dca]{background:rgba(var(--background-total-theme),.15);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);position:fixed;z-index:100;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}.dropdown.visible[data-v-e4f39dca]{bottom:0;top:0}.dropdown.visible .backgr[data-v-e4f39dca]{opacity:1}.dropdown[data-v-e4f39dca] .contentWrapper{margin-top:.25em;border-radius:10px;overflow:hidden}.dropdown .contentWrapper[data-v-e4f39dca],.dropdown[data-v-e4f39dca] .contentWrapper{border-top:1px solid rgba(var(--neutral-grad-1),.5);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .cancelWrapper .menu-item[data-v-e4f39dca]{margin-top:0;box-shadow:none;color:rgb(var(--neutral-grad-3));box-shadow:0 5px 5px -3px rgba(var(--color-shadow-base),.4)}.dropdown .menu-item[data-v-e4f39dca]{padding:.5em;background:rgb(var(--background-total-theme));color:rgb(var(--neutral-grad-3));line-height:44px;margin-top:.25em;display:flex;border-radius:10px;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .menu-item .title[data-v-e4f39dca]{flex-grow:2;padding-right:44px;text-align:center}.dropdown .menu-item .iconWrapper[data-v-e4f39dca]{width:44px;text-align:center}.dropdown .blocker[data-v-e4f39dca]{position:fixed;top:0;left:0;bottom:0;right:0;content:" "}.cancelWrapper[data-v-e4f39dca]{border-radius:3px;padding-left:.5em;padding-right:.5em;color:rgb(var(--neutral-grad-3))}.small[data-v-e4f39dca]{font-size:.85em}.outer-div.mobile .menuwrapper[data-v-e4f39dca]{position:fixed}.outer-div.minimized[data-v-e4f39dca]{position:static}.outer-div.minimized .backgr[data-v-e4f39dca]{border-radius:4px;height:1000px;bottom:0;top:auto;background:transparent;position:absolute}.outer-div.minimized .dropdown[data-v-e4f39dca]{z-index:10000;right:0}.outer-div.minimized .menuwrapper[data-v-e4f39dca]{border-radius:4px;padding-top:.5em}.outer-div.minimized .menuwrapper[data-v-e4f39dca] .menu-item{margin-top:.25em;border-radius:5px;background:rgba(var(--background-total-theme),.95)}',""]),e.exports=t},ad71:function(e,t,n){"use strict";(function(t,r){var i;e.exports=R,R.ReadableState=I;n("faa1").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=n("429b"),s=n("b639").Buffer,c=t.Uint8Array||function(){};function l(e){return s.from(e)}function u(e){return s.isBuffer(e)||e instanceof c}var d,f=n(0);d=f&&f.debuglog?f.debuglog("stream"):function(){};var h,p,m,v=n("c6ae"),g=n("4681"),y=n("0db6"),b=y.getHighWaterMark,_=n("c9b8").codes,w=_.ERR_INVALID_ARG_TYPE,x=_.ERR_STREAM_PUSH_AFTER_EOF,S=_.ERR_METHOD_NOT_IMPLEMENTED,k=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n("3fb5")(R,a);var E=g.errorOrDestroy,C=["error","close","destroy","pause","resume"];function T(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function I(e,t,r){i=i||n("b19a"),e=e||{},"boolean"!==typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",r),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n("7d72").StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function R(e){if(i=i||n("b19a"),!(this instanceof R))return new R(e);var t=this instanceof i;this._readableState=new I(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function O(e,t,n,r,i){d("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,L(e,a);else if(i||(o=P(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=l(t)),r)a.endEmitted?E(e,new k):M(e,a,t,!0);else if(a.ended)E(e,new x);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):U(e,a)):M(e,a,t,!1)}else r||(a.reading=!1,U(e,a));return!a.ended&&(a.length=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=j(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function L(e,t){if(d("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?N(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,$(e)))}}function N(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick($,e))}function $(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,V(e)}function U(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(B,e,t))}function B(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function q(e){d("readable nexttick read 0"),e.read(0)}function W(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(K,e,t))}function K(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&null!==e.read());}function G(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function H(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(Y,t,e))}function Y(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function J(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?H(this):N(this),null;if(e=D(e,t),0===e&&t.ended)return 0===t.length&&H(this),null;var r,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?G(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&H(this)),null!==r&&this.emit("data",r),r},R.prototype._read=function(e){E(this,new S("_read()"))},R.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,s=a?l:y;function c(e,t){d("onunpipe"),e===n&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function l(){d("onend"),e.end()}i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",c);var u=F(n);e.on("drain",u);var f=!1;function h(){d("cleanup"),e.removeListener("close",v),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",y),n.removeListener("data",p),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u()}function p(t){d("ondata");var r=e.write(t);d("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==J(i.pipes,e))&&!f&&(d("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function m(t){d("onerror",t),y(),e.removeListener("error",m),0===o(e,"error")&&E(e,t)}function v(){e.removeListener("finish",g),y()}function g(){d("onfinish"),e.removeListener("close",v),y()}function y(){d("unpipe"),n.unpipe(e)}return n.on("data",p),T(e,"error",m),e.once("close",v),e.once("finish",g),e.emit("pipe",n),i.flowing||(d("pipe resume"),n.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,d("on readable",i.length,i.reading),i.length?N(this):i.reading||r.nextTick(q,this))),n},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(z,this),n},R.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(z,this),t},R.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,W(this,e)),e.paused=!1,this},R.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){if(d("wrapped data"),n.decoder&&(i=n.decoder.write(i)),(!n.objectMode||null!==i&&void 0!==i)&&(n.objectMode||i&&i.length)){var o=t.push(i);o||(r=!0,e.pause())}})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;oe.time-t.time),S(r.store,i,o)}))()}getEndToEndSessionProblem(e,t){var n=this;return i((function*(){const r=g(e),i=x(n.store,r)||[];if(!i.length)return null;const o=i[i.length-1];for(const e of i)if(e.time>t)return Object.assign({},e,{fixed:o.fixed});return o.fixed?null:o}))()}filterOutNotifiedErrorDevices(e){var t=this;return i((function*(){const n=x(t.store,u)||{},r=[];for(const t of e){const{userId:e,deviceInfo:i}=t;e in n?i.deviceId in n[e]||(r.push(t),n[e][i.deviceId]=!0):(r.push(t),n[e]={[i.deviceId]:!0})}return S(t.store,u,n),r}))()}getEndToEndInboundGroupSession(e,t,n,r){r(x(this.store,y(e,t)),x(this.store,b(e,t)))}getAllEndToEndInboundGroupSessions(e,t){for(let n=0;n{n.push({senderKey:t,sessionId:i,sessionData:e})}),e&&r.length>=e)break}return Promise.resolve(n)}countSessionsNeedingBackup(){const e=x(this.store,m)||{};return Promise.resolve(Object.keys(e).length)}unmarkSessionsNeedingBackup(e){const t=x(this.store,m)||{};for(const n of e)delete t[n.senderKey+"/"+n.sessionId];return S(this.store,m,t),Promise.resolve()}markSessionsNeedingBackup(e){const t=x(this.store,m)||{};for(const n of e)t[n.senderKey+"/"+n.sessionId]=!0;return S(this.store,m,t),Promise.resolve()}deleteAllData(){return this.store.removeItem(c),Promise.resolve()}getAccount(e,t){const n=x(this.store,c);t(n)}storeAccount(e,t){S(this.store,c,t)}getCrossSigningKeys(e,t){const n=x(this.store,l);t(n)}getSecretStorePrivateKey(e,t,n){const r=x(this.store,s+"ssss_cache."+n);t(r)}storeCrossSigningKeys(e,t){S(this.store,l,t)}storeSecretStorePrivateKey(e,t,n){S(this.store,s+"ssss_cache."+t,n)}doTxn(e,t,n){return Promise.resolve(n(null))}}function x(t,n){try{return JSON.parse(t.getItem(n))}catch(e){o.logger.log("Error: Failed to get key %s: %s",n,e.stack||e),o.logger.log(e.stack)}return null}function S(e,t,n){e.setItem(t,JSON.stringify(n))}n.LocalStorageCryptoStore=w},b313:function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g,o={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports={default:o.RFC3986,formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o.RFC1738,RFC3986:o.RFC3986}},b383:function(e,t,n){"use strict";t.decode=t.parse=n("91dd"),t.encode=t.stringify=n("e099")},b40f:function(e,t,n){"use strict"; /*! * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,i=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,a=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,c=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function l(e){if(!e||"object"!==typeof e)throw new TypeError("argument obj is required");var t=e.parameters,n=e.type;if(!n||!c.test(n))throw new TypeError("invalid type");var r=n;if(t&&"object"===typeof t)for(var i,a=Object.keys(t).sort(),s=0;s0&&!i.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(s,"\\$1")+'"'}function h(e){this.parameters=Object.create(null),this.type=e}t.format=l,t.parse=u},b42e:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}},b465:function(e,t,n){var r=n("6b38");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("1c8940c8",r,e)}},b466:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"#topheader[data-v-52afd868]{background:rgb(var(--background-total-theme));top:0;padding-top:var(--app-margin-top);left:0;right:0;position:absolute;z-index:4;color:rgb(var(--text-color));border-bottom:1px solid rgb(var(--neutral-grad-0))}#topheader .iconbutton[data-v-52afd868]{cursor:pointer}#topheader .headerLine[data-v-52afd868]{display:flex;align-items:center;padding:0;height:64px}#topheader .headerLine>div[data-v-52afd868]{text-align:center}#topheader .headerLine .iconsmall[data-v-52afd868]{width:22px;min-width:22px}#topheader .headerLine .icon[data-v-52afd868]{color:rgb(var(--color-txt-ac));width:44px;min-width:44px}#topheader .headerLine .rightaddIcons[data-v-52afd868]{margin-right:11px}#topheader .headerLine .leftaddIcon[data-v-52afd868]{margin-left:11px}#topheader .headerLine .infoPart[data-v-52afd868]{flex-grow:1;padding:0 1em;overflow:hidden}#topheader .headerLine .infoPart[data-v-52afd868] span,#topheader .headerLine .infoPart span[data-v-52afd868]{font-size:.9em;font-weight:500}#topheader .rightaddIcons[data-v-52afd868],#topheader .rightIcons[data-v-52afd868]{justify-content:space-between}#topheader.bin[data-v-52afd868]{position:relative}#topheader.minimized[data-v-52afd868]{right:auto;transition:.3s}#topheader.minimized .headerLine[data-v-52afd868]{height:54px}#topheader.minimized.fix[data-v-52afd868]{width:344px;position:absolute;background:transparent;overflow:hidden;will-change:transform;right:0}#topheader.minimized.fix .headerLine[data-v-52afd868]{padding:0}#topheader.minimized.fix .icon[data-v-52afd868]{width:44px;height:44px;line-height:44px;transition:transform .3s}#topheader.minimized.fix .icon .iconbutton[data-v-52afd868]{border-radius:50%;background:rgba(var(--neutral-grad-4),.1);color:rgb(var(--color-txt-ac));cursor:pointer}@media (pointer:fine){#topheader.minimized.fix .icon .iconbutton[data-v-52afd868]:hover{background:rgba(var(--neutral-grad-4),.05)}}#topheader.minimized.fix .infoPart[data-v-52afd868],#topheader.minimized.fix .leftIcon[data-v-52afd868]{display:none}#topheader.minimized.fix.active[data-v-52afd868]{transform:translate3d(-300px,-56px,0);border-radius:8px;border-bottom-left-radius:0;border-bottom-right-radius:0;background:rgb(var(--background-total-theme));border:1px solid rgba(var(--neutral-grad-4),.2);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}#topheader.minimized.fix.active .infoPart[data-v-52afd868],#topheader.minimized.fix.active .leftIcon[data-v-52afd868]{display:block}#topheader.minimized.fix[data-v-52afd868]:not(.active){border-bottom:0!important}",""]),e.exports=t},b480:function(e,t,n){var r=n("5609");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("8a42ff40",r,e)}},b4f6:function(e,t,n){"use strict";n.r(t);var r=n("8fc3");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},b503:function(e,t,n){"use strict";(function(e){n("d9e2");var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedDBCryptoStore=void 0;var i=n("63c7"),o=n("b2ca"),a=n("4df7"),s=r(n("3c2f")),c=n("0023"),l=r(n("6146"));class u{constructor(e,t){this._indexedDB=e,this._dbName=t,this._backendPromise=null,this._backend=null}static exists(e,t){return l.exists(e,t)}startup(){return this._backendPromise||(this._backendPromise=new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));i.logger.log("connecting to indexeddb "+this._dbName);const n=this._indexedDB.open(this._dbName,s.VERSION);n.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;s.upgradeDatabase(t,n)},n.onblocked=()=>{i.logger.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{i.logger.log("Error connecting to indexeddb",e),t(e.target.error)},n.onsuccess=t=>{const n=t.target.result;i.logger.log("connected to indexeddb "+this._dbName),e(new s.Backend(n))}}).then(e=>e.doTxn("readonly",[u.STORE_INBOUND_GROUP_SESSIONS,u.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],t=>{e.getEndToEndInboundGroupSession("","",t,()=>{})}).then(()=>e)).catch(t=>{if("VersionError"===t.name)throw i.logger.warn("Crypto DB is too new for us to use!",t),new c.InvalidCryptoStoreError(c.InvalidCryptoStoreError.TOO_NEW);i.logger.warn("unable to connect to indexeddb "+this._dbName+": falling back to localStorage store: "+t);try{return new o.LocalStorageCryptoStore(e.localStorage)}catch(t){return i.logger.warn("unable to open localStorage: falling back to in-memory store: "+t),new a.MemoryCryptoStore}}).then(e=>{this._backend=e})),this._backendPromise}deleteAllData(){return new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));i.logger.log("Removing indexeddb instance: "+this._dbName);const n=this._indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{i.logger.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{i.logger.log("Error deleting data from indexeddb",e),t(e.target.error)},n.onsuccess=()=>{i.logger.log("Removed indexeddb instance: "+this._dbName),e()}}).catch(e=>{i.logger.warn("unable to delete IndexedDBCryptoStore: "+e)})}getOrAddOutgoingRoomKeyRequest(e){return this._backend.getOrAddOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequest(e){return this._backend.getOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequestByState(e){return this._backend.getOutgoingRoomKeyRequestByState(e)}getAllOutgoingRoomKeyRequestsByState(e){return this._backend.getAllOutgoingRoomKeyRequestsByState(e)}getOutgoingRoomKeyRequestsByTarget(e,t,n){return this._backend.getOutgoingRoomKeyRequestsByTarget(e,t,n)}updateOutgoingRoomKeyRequest(e,t,n){return this._backend.updateOutgoingRoomKeyRequest(e,t,n)}deleteOutgoingRoomKeyRequest(e,t){return this._backend.deleteOutgoingRoomKeyRequest(e,t)}getAccount(e,t){this._backend.getAccount(e,t)}storeAccount(e,t){this._backend.storeAccount(e,t)}getCrossSigningKeys(e,t){this._backend.getCrossSigningKeys(e,t)}getSecretStorePrivateKey(e,t,n){this._backend.getSecretStorePrivateKey(e,t,n)}storeCrossSigningKeys(e,t){this._backend.storeCrossSigningKeys(e,t)}storeSecretStorePrivateKey(e,t,n){this._backend.storeSecretStorePrivateKey(e,t,n)}countEndToEndSessions(e,t){this._backend.countEndToEndSessions(e,t)}getEndToEndSession(e,t,n,r){this._backend.getEndToEndSession(e,t,n,r)}getEndToEndSessions(e,t,n){this._backend.getEndToEndSessions(e,t,n)}getAllEndToEndSessions(e,t){this._backend.getAllEndToEndSessions(e,t)}storeEndToEndSession(e,t,n,r){this._backend.storeEndToEndSession(e,t,n,r)}storeEndToEndSessionProblem(e,t,n){return this._backend.storeEndToEndSessionProblem(e,t,n)}getEndToEndSessionProblem(e,t){return this._backend.getEndToEndSessionProblem(e,t)}filterOutNotifiedErrorDevices(e){return this._backend.filterOutNotifiedErrorDevices(e)}getEndToEndInboundGroupSession(e,t,n,r){this._backend.getEndToEndInboundGroupSession(e,t,n,r)}getAllEndToEndInboundGroupSessions(e,t){this._backend.getAllEndToEndInboundGroupSessions(e,t)}addEndToEndInboundGroupSession(e,t,n,r){this._backend.addEndToEndInboundGroupSession(e,t,n,r)}storeEndToEndInboundGroupSession(e,t,n,r){this._backend.storeEndToEndInboundGroupSession(e,t,n,r)}storeEndToEndInboundGroupSessionWithheld(e,t,n,r){this._backend.storeEndToEndInboundGroupSessionWithheld(e,t,n,r)}storeEndToEndDeviceData(e,t){this._backend.storeEndToEndDeviceData(e,t)}getEndToEndDeviceData(e,t){this._backend.getEndToEndDeviceData(e,t)}storeEndToEndRoom(e,t,n){this._backend.storeEndToEndRoom(e,t,n)}getEndToEndRooms(e,t){this._backend.getEndToEndRooms(e,t)}getSessionsNeedingBackup(e){return this._backend.getSessionsNeedingBackup(e)}countSessionsNeedingBackup(e){return this._backend.countSessionsNeedingBackup(e)}unmarkSessionsNeedingBackup(e,t){return this._backend.unmarkSessionsNeedingBackup(e,t)}markSessionsNeedingBackup(e,t){return this._backend.markSessionsNeedingBackup(e,t)}addSharedHistoryInboundGroupSession(e,t,n,r){this._backend.addSharedHistoryInboundGroupSession(e,t,n,r)}getSharedHistoryInboundGroupSessions(e,t){return this._backend.getSharedHistoryInboundGroupSessions(e,t)}doTxn(e,t,n,r){return this._backend.doTxn(e,t,n,r)}}t.IndexedDBCryptoStore=u,u.STORE_ACCOUNT="account",u.STORE_SESSIONS="sessions",u.STORE_INBOUND_GROUP_SESSIONS="inbound_group_sessions",u.STORE_INBOUND_GROUP_SESSIONS_WITHHELD="inbound_group_sessions_withheld",u.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS="shared_history_inbound_group_sessions",u.STORE_DEVICE_DATA="device_data",u.STORE_ROOMS="rooms",u.STORE_BACKUP="sessions_needing_backup"}).call(this,n("c8ba"))},b50d:function(e,t,n){"use strict";var r=n("c532"),i=n("467f"),o=n("7aac"),a=n("30b5"),s=n("83b9"),c=n("c345"),l=n("3934"),u=n("2d83");e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers,h=e.responseType;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(m+":"+v)}var g=s(e.baseURL,e.url);function y(){if(p){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,o=h&&"text"!==h&&"json"!==h?p.response:p.responseText,a={data:o,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};i(t,n,a),p=null}}if(p.open(e.method.toUpperCase(),a(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(y)},p.onabort=function(){p&&(n(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||l(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(f[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&r.forEach(f,(function(e,t){"undefined"===typeof d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},b551:function(e,t,n){"use strict";n.r(t);var r=n("f6f7");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},b57f:function(e,t,n){"use strict";var r=n("a593");e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},b5ca:function(e,t,n){"use strict";var r=n("b639").Buffer,i=n("3fb5"),o=n("93e6"),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function m(e,t,n,r,i,o,a,s){return p(e+(t^n^r)+o+a|0,s)+i|0}function v(e,t,n,r,i,o,a,s){return p(e+(t&n|~t&r)+o+a|0,s)+i|0}function g(e,t,n,r,i,o,a,s){return p(e+((t|~n)^r)+o+a|0,s)+i|0}function y(e,t,n,r,i,o,a,s){return p(e+(t&r|n&~r)+o+a|0,s)+i|0}function b(e,t,n,r,i,o,a,s){return p(e+(t^(n|~r))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,x=0|this._c,k=0|this._d,S=0|this._e,E=0;E<80;E+=1){var C,T;E<16?(C=m(n,r,i,o,h,e[s[E]],d[0],l[E]),T=b(_,w,x,k,S,e[c[E]],f[0],u[E])):E<32?(C=v(n,r,i,o,h,e[s[E]],d[1],l[E]),T=y(_,w,x,k,S,e[c[E]],f[1],u[E])):E<48?(C=g(n,r,i,o,h,e[s[E]],d[2],l[E]),T=g(_,w,x,k,S,e[c[E]],f[2],u[E])):E<64?(C=y(n,r,i,o,h,e[s[E]],d[3],l[E]),T=v(_,w,x,k,S,e[c[E]],f[3],u[E])):(C=b(n,r,i,o,h,e[s[E]],d[4],l[E]),T=m(_,w,x,k,S,e[c[E]],f[4],u[E])),n=h,h=o,o=p(i,10),i=r,r=C,_=S,S=k,k=p(x,10),x=w,w=T}var I=this._b+i+k|0;this._b=this._c+o+S|0,this._c=this._d+h+_|0,this._d=this._e+n+w|0,this._e=this._a+r+x|0,this._a=I},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},b622:function(e,t,n){var r=n("da84"),i=n("5692"),o=n("1a2d"),a=n("90e3"),s=n("4930"),c=n("fdbf"),l=i("wks"),u=r.Symbol,d=u&&u["for"],f=c?u:u&&u.withoutSetter||a;e.exports=function(e){if(!o(l,e)||!s&&"string"!=typeof l[e]){var t="Symbol."+e;s&&o(u,e)?l[e]=u[e]:l[e]=c&&d?d(t):f(t)}return l[e]}},b639:function(t,n,r){"use strict";(function(t){ + */var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,i=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,a=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,c=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function l(e){if(!e||"object"!==typeof e)throw new TypeError("argument obj is required");var t=e.parameters,n=e.type;if(!n||!c.test(n))throw new TypeError("invalid type");var r=n;if(t&&"object"===typeof t)for(var i,a=Object.keys(t).sort(),s=0;s0&&!i.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(s,"\\$1")+'"'}function h(e){this.parameters=Object.create(null),this.type=e}t.format=l,t.parse=u},b42e:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?r:n)(t)}},b465:function(e,t,n){var r=n("6b38");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("1c8940c8",r,e)}},b466:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"#topheader[data-v-52afd868]{background:rgb(var(--background-total-theme));top:0;padding-top:var(--app-margin-top);left:0;right:0;position:absolute;z-index:4;color:rgb(var(--text-color));border-bottom:1px solid rgb(var(--neutral-grad-0))}#topheader .iconbutton[data-v-52afd868]{cursor:pointer}#topheader .headerLine[data-v-52afd868]{display:flex;align-items:center;padding:0;height:64px}#topheader .headerLine>div[data-v-52afd868]{text-align:center}#topheader .headerLine .iconsmall[data-v-52afd868]{width:22px;min-width:22px}#topheader .headerLine .icon[data-v-52afd868]{color:rgb(var(--color-txt-ac));width:44px;min-width:44px}#topheader .headerLine .rightaddIcons[data-v-52afd868]{margin-right:11px}#topheader .headerLine .leftaddIcon[data-v-52afd868]{margin-left:11px}#topheader .headerLine .infoPart[data-v-52afd868]{flex-grow:1;padding:0 1em;overflow:hidden}#topheader .headerLine .infoPart[data-v-52afd868] span,#topheader .headerLine .infoPart span[data-v-52afd868]{font-size:.9em;font-weight:500}#topheader .rightaddIcons[data-v-52afd868],#topheader .rightIcons[data-v-52afd868]{justify-content:space-between}#topheader.bin[data-v-52afd868]{position:relative}#topheader.minimized[data-v-52afd868]{right:auto;transition:.3s}#topheader.minimized .headerLine[data-v-52afd868]{height:54px}#topheader.minimized.fix[data-v-52afd868]{width:344px;position:absolute;background:transparent;overflow:hidden;will-change:transform;right:0}#topheader.minimized.fix .headerLine[data-v-52afd868]{padding:0}#topheader.minimized.fix .icon[data-v-52afd868]{width:44px;height:44px;line-height:44px;transition:transform .3s}#topheader.minimized.fix .icon .iconbutton[data-v-52afd868]{border-radius:50%;background:rgba(var(--neutral-grad-4),.1);color:rgb(var(--color-txt-ac));cursor:pointer}@media (pointer:fine){#topheader.minimized.fix .icon .iconbutton[data-v-52afd868]:hover{background:rgba(var(--neutral-grad-4),.05)}}#topheader.minimized.fix .infoPart[data-v-52afd868],#topheader.minimized.fix .leftIcon[data-v-52afd868]{display:none}#topheader.minimized.fix.active[data-v-52afd868]{transform:translate3d(-300px,-56px,0);border-radius:8px;border-bottom-left-radius:0;border-bottom-right-radius:0;background:rgb(var(--background-total-theme));border:1px solid rgba(var(--neutral-grad-4),.2);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}#topheader.minimized.fix.active .infoPart[data-v-52afd868],#topheader.minimized.fix.active .leftIcon[data-v-52afd868]{display:block}#topheader.minimized.fix[data-v-52afd868]:not(.active){border-bottom:0!important}",""]),e.exports=t},b480:function(e,t,n){var r=n("5609");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("8a42ff40",r,e)}},b4f6:function(e,t,n){"use strict";n.r(t);var r=n("8fc3");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},b503:function(e,t,n){"use strict";(function(e){n("d9e2");var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedDBCryptoStore=void 0;var i=n("63c7"),o=n("b2ca"),a=n("4df7"),s=r(n("3c2f")),c=n("0023"),l=r(n("6146"));class u{constructor(e,t){this._indexedDB=e,this._dbName=t,this._backendPromise=null,this._backend=null}static exists(e,t){return l.exists(e,t)}startup(){return this._backendPromise||(this._backendPromise=new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));i.logger.log("connecting to indexeddb "+this._dbName);const n=this._indexedDB.open(this._dbName,s.VERSION);n.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;s.upgradeDatabase(t,n)},n.onblocked=()=>{i.logger.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{i.logger.log("Error connecting to indexeddb",e),t(e.target.error)},n.onsuccess=t=>{const n=t.target.result;i.logger.log("connected to indexeddb "+this._dbName),e(new s.Backend(n))}}).then(e=>e.doTxn("readonly",[u.STORE_INBOUND_GROUP_SESSIONS,u.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],t=>{e.getEndToEndInboundGroupSession("","",t,()=>{})}).then(()=>e)).catch(t=>{if("VersionError"===t.name)throw i.logger.warn("Crypto DB is too new for us to use!",t),new c.InvalidCryptoStoreError(c.InvalidCryptoStoreError.TOO_NEW);i.logger.warn("unable to connect to indexeddb "+this._dbName+": falling back to localStorage store: "+t);try{return new o.LocalStorageCryptoStore(e.localStorage)}catch(t){return i.logger.warn("unable to open localStorage: falling back to in-memory store: "+t),new a.MemoryCryptoStore}}).then(e=>{this._backend=e})),this._backendPromise}deleteAllData(){return new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));i.logger.log("Removing indexeddb instance: "+this._dbName);const n=this._indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{i.logger.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{i.logger.log("Error deleting data from indexeddb",e),t(e.target.error)},n.onsuccess=()=>{i.logger.log("Removed indexeddb instance: "+this._dbName),e()}}).catch(e=>{i.logger.warn("unable to delete IndexedDBCryptoStore: "+e)})}getOrAddOutgoingRoomKeyRequest(e){return this._backend.getOrAddOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequest(e){return this._backend.getOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequestByState(e){return this._backend.getOutgoingRoomKeyRequestByState(e)}getAllOutgoingRoomKeyRequestsByState(e){return this._backend.getAllOutgoingRoomKeyRequestsByState(e)}getOutgoingRoomKeyRequestsByTarget(e,t,n){return this._backend.getOutgoingRoomKeyRequestsByTarget(e,t,n)}updateOutgoingRoomKeyRequest(e,t,n){return this._backend.updateOutgoingRoomKeyRequest(e,t,n)}deleteOutgoingRoomKeyRequest(e,t){return this._backend.deleteOutgoingRoomKeyRequest(e,t)}getAccount(e,t){this._backend.getAccount(e,t)}storeAccount(e,t){this._backend.storeAccount(e,t)}getCrossSigningKeys(e,t){this._backend.getCrossSigningKeys(e,t)}getSecretStorePrivateKey(e,t,n){this._backend.getSecretStorePrivateKey(e,t,n)}storeCrossSigningKeys(e,t){this._backend.storeCrossSigningKeys(e,t)}storeSecretStorePrivateKey(e,t,n){this._backend.storeSecretStorePrivateKey(e,t,n)}countEndToEndSessions(e,t){this._backend.countEndToEndSessions(e,t)}getEndToEndSession(e,t,n,r){this._backend.getEndToEndSession(e,t,n,r)}getEndToEndSessions(e,t,n){this._backend.getEndToEndSessions(e,t,n)}getAllEndToEndSessions(e,t){this._backend.getAllEndToEndSessions(e,t)}storeEndToEndSession(e,t,n,r){this._backend.storeEndToEndSession(e,t,n,r)}storeEndToEndSessionProblem(e,t,n){return this._backend.storeEndToEndSessionProblem(e,t,n)}getEndToEndSessionProblem(e,t){return this._backend.getEndToEndSessionProblem(e,t)}filterOutNotifiedErrorDevices(e){return this._backend.filterOutNotifiedErrorDevices(e)}getEndToEndInboundGroupSession(e,t,n,r){this._backend.getEndToEndInboundGroupSession(e,t,n,r)}getAllEndToEndInboundGroupSessions(e,t){this._backend.getAllEndToEndInboundGroupSessions(e,t)}addEndToEndInboundGroupSession(e,t,n,r){this._backend.addEndToEndInboundGroupSession(e,t,n,r)}storeEndToEndInboundGroupSession(e,t,n,r){this._backend.storeEndToEndInboundGroupSession(e,t,n,r)}storeEndToEndInboundGroupSessionWithheld(e,t,n,r){this._backend.storeEndToEndInboundGroupSessionWithheld(e,t,n,r)}storeEndToEndDeviceData(e,t){this._backend.storeEndToEndDeviceData(e,t)}getEndToEndDeviceData(e,t){this._backend.getEndToEndDeviceData(e,t)}storeEndToEndRoom(e,t,n){this._backend.storeEndToEndRoom(e,t,n)}getEndToEndRooms(e,t){this._backend.getEndToEndRooms(e,t)}getSessionsNeedingBackup(e){return this._backend.getSessionsNeedingBackup(e)}countSessionsNeedingBackup(e){return this._backend.countSessionsNeedingBackup(e)}unmarkSessionsNeedingBackup(e,t){return this._backend.unmarkSessionsNeedingBackup(e,t)}markSessionsNeedingBackup(e,t){return this._backend.markSessionsNeedingBackup(e,t)}addSharedHistoryInboundGroupSession(e,t,n,r){this._backend.addSharedHistoryInboundGroupSession(e,t,n,r)}getSharedHistoryInboundGroupSessions(e,t){return this._backend.getSharedHistoryInboundGroupSessions(e,t)}doTxn(e,t,n,r){return this._backend.doTxn(e,t,n,r)}}t.IndexedDBCryptoStore=u,u.STORE_ACCOUNT="account",u.STORE_SESSIONS="sessions",u.STORE_INBOUND_GROUP_SESSIONS="inbound_group_sessions",u.STORE_INBOUND_GROUP_SESSIONS_WITHHELD="inbound_group_sessions_withheld",u.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS="shared_history_inbound_group_sessions",u.STORE_DEVICE_DATA="device_data",u.STORE_ROOMS="rooms",u.STORE_BACKUP="sessions_needing_backup"}).call(this,n("c8ba"))},b50d:function(e,t,n){"use strict";var r=n("c532"),i=n("467f"),o=n("7aac"),a=n("30b5"),s=n("83b9"),c=n("c345"),l=n("3934"),u=n("2d83");e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers,h=e.responseType;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(m+":"+v)}var g=s(e.baseURL,e.url);function y(){if(p){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,o=h&&"text"!==h&&"json"!==h?p.response:p.responseText,a={data:o,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};i(t,n,a),p=null}}if(p.open(e.method.toUpperCase(),a(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(y)},p.onabort=function(){p&&(n(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||l(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(f[e.xsrfHeaderName]=b)}"setRequestHeader"in p&&r.forEach(f,(function(e,t){"undefined"===typeof d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),h&&"json"!==h&&(p.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},b551:function(e,t,n){"use strict";n.r(t);var r=n("f6f7");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},b57f:function(e,t,n){"use strict";var r=n("a593");e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},b5ca:function(e,t,n){"use strict";var r=n("b639").Buffer,i=n("3fb5"),o=n("93e6"),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function m(e,t,n,r,i,o,a,s){return p(e+(t^n^r)+o+a|0,s)+i|0}function v(e,t,n,r,i,o,a,s){return p(e+(t&n|~t&r)+o+a|0,s)+i|0}function g(e,t,n,r,i,o,a,s){return p(e+((t|~n)^r)+o+a|0,s)+i|0}function y(e,t,n,r,i,o,a,s){return p(e+(t&r|n&~r)+o+a|0,s)+i|0}function b(e,t,n,r,i,o,a,s){return p(e+(t^(n|~r))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,x=0|this._c,S=0|this._d,k=0|this._e,E=0;E<80;E+=1){var C,T;E<16?(C=m(n,r,i,o,h,e[s[E]],d[0],l[E]),T=b(_,w,x,S,k,e[c[E]],f[0],u[E])):E<32?(C=v(n,r,i,o,h,e[s[E]],d[1],l[E]),T=y(_,w,x,S,k,e[c[E]],f[1],u[E])):E<48?(C=g(n,r,i,o,h,e[s[E]],d[2],l[E]),T=g(_,w,x,S,k,e[c[E]],f[2],u[E])):E<64?(C=y(n,r,i,o,h,e[s[E]],d[3],l[E]),T=v(_,w,x,S,k,e[c[E]],f[3],u[E])):(C=b(n,r,i,o,h,e[s[E]],d[4],l[E]),T=m(_,w,x,S,k,e[c[E]],f[4],u[E])),n=h,h=o,o=p(i,10),i=r,r=C,_=k,k=S,S=p(x,10),x=w,w=T}var I=this._b+i+S|0;this._b=this._c+o+k|0,this._c=this._d+h+_|0,this._d=this._e+n+w|0,this._e=this._a+r+x|0,this._a=I},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},b622:function(e,t,n){var r=n("da84"),i=n("5692"),o=n("1a2d"),a=n("90e3"),s=n("4930"),c=n("fdbf"),l=i("wks"),u=r.Symbol,d=u&&u["for"],f=c?u:u&&u.withoutSetter||a;e.exports=function(e){if(!o(l,e)||!s&&"string"!=typeof l[e]){var t="Symbol."+e;s&&o(u,e)?l[e]=u[e]:l[e]=c&&d?d(t):f(t)}return l[e]}},b639:function(t,n,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var i=r("1fb5"),o=r("9152"),a=r("e3db");function s(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function c(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(c()=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),u.alloc(+e)}function w(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ee(e).length;default:if(r)return X(e).length;t=(""+t).toLowerCase(),r=!0}}function x(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return $(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return L(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function k(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function S(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){var o,a=1,s=e.length,c=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=n;os&&(n=s-c),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:o=e[i+1],128===(192&o)&&(c=(31&l)<<6|63&o,c>127&&(u=c));break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(c=(15&l)<<12|(63&o)<<6|63&a,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s,c>65535&&c<1114112&&(u=c))}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return D(r)}n.Buffer=u,n.SlowBuffer=_,n.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:s(),n.kMaxLength=c(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return d(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return h(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,a=n-t,s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return I(this,e,t,n);case"latin1":case"binary":return R(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var j=4096;function D(e){var t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);var n="",r=0;while(rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function z(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function W(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function K(e,t,n,r,i){return i||W(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function V(e,t,n,r,i){return i||W(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t0&&(i*=256))r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);var r=this[e],i=1,o=0;while(++o=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);var r=t,i=1,o=this[e+--r];while(r>0&&(i*=256))o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;F(this,e,t,n,i,0)}var o=1,a=0;this[t]=255&e;while(++a=0&&(a*=256))this[t+o]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):q(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;this[t]=255&e;while(++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;this[t+o]=255&e;while(--o>=0&&(a*=256))e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):q(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return K(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return K(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r)}return o}function ee(e){return i.toByteArray(H(e))}function te(e,t,n,r){for(var i=0;i=t.length||i>=e.length)break;t[i+n]=e[i]}return i}function ne(e){return e!==e}}).call(this,r("c8ba"))},b672:function(e,t,n){var r=n("8707").Buffer;function i(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},b753:function(e,t,n){var r=n("4f4d"),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var c=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:c}),Object.defineProperty(a[s],"labels",{value:l})}function u(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}a.rgb.hsl=function(e){var t,n,r,i=e[0]/255,o=e[1]/255,a=e[2]/255,s=Math.min(i,o,a),c=Math.max(i,o,a),l=c-s;return c===s?t=0:i===c?t=(o-a)/l:o===c?t=2+(a-i)/l:a===c&&(t=4+(i-o)/l),t=Math.min(60*t,360),t<0&&(t+=360),r=(s+c)/2,n=c===s?0:r<=.5?l/(c+s):l/(2-c-s),[t,100*n,100*r]},a.rgb.hsv=function(e){var t,n,r,i,o,a=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(a,s,c),u=l-Math.min(a,s,c),d=function(e){return(l-e)/6/u+.5};return 0===u?i=o=0:(o=u/l,t=d(a),n=d(s),r=d(c),a===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*l]},a.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2],i=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},a.rgb.cmyk=function(e){var t,n,r,i,o=e[0]/255,a=e[1]/255,s=e[2]/255;return i=Math.min(1-o,1-a,1-s),t=(1-o-i)/(1-i)||0,n=(1-a-i)/(1-i)||0,r=(1-s-i)/(1-i)||0,[100*t,100*n,100*r,100*i]},a.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,o=1/0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],c=u(e,s);c.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=.4124*t+.3576*n+.1805*r,o=.2126*t+.7152*n+.0722*r,a=.0193*t+.1192*n+.9505*r;return[100*i,100*o,100*a]},a.rgb.lab=function(e){var t,n,r,i=a.rgb.xyz(e),o=i[0],s=i[1],c=i[2];return o/=95.047,s/=100,c/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,c=c>.008856?Math.pow(c,1/3):7.787*c+16/116,t=116*s-16,n=500*(o-s),r=200*(s-c),[t,n,r]},a.hsl.rgb=function(e){var t,n,r,i,o,a=e[0]/360,s=e[1]/100,c=e[2]/100;if(0===s)return o=255*c,[o,o,o];n=c<.5?c*(1+s):c+s-c*s,t=2*c-n,i=[0,0,0];for(var l=0;l<3;l++)r=a+1/3*-(l-1),r<0&&r++,r>1&&r--,o=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[l]=255*o;return i},a.hsl.hsv=function(e){var t,n,r=e[0],i=e[1]/100,o=e[2]/100,a=i,s=Math.max(o,.01);return o*=2,i*=o<=1?o:2-o,a*=s<=1?s:2-s,n=(o+i)/2,t=0===o?2*a/(s+a):2*i/(o+i),[r,100*t,100*n]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,c,a];case 1:return[s,r,a];case 2:return[a,r,c];case 3:return[a,s,r];case 4:return[c,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(e){var t,n,r,i=e[0],o=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return r=(2-o)*a,t=(2-o)*s,n=o*s,n/=t<=1?t:2-t,n=n||0,r/=2,[i,100*n,100*r]},a.hwb.rgb=function(e){var t,n,r,i,o,a,s,c=e[0]/360,l=e[1]/100,u=e[2]/100,d=l+u;switch(d>1&&(l/=d,u/=d),t=Math.floor(6*c),n=1-u,r=6*c-t,0!==(1&t)&&(r=1-r),i=l+r*(n-l),t){default:case 6:case 0:o=n,a=i,s=l;break;case 1:o=i,a=n,s=l;break;case 2:o=l,a=n,s=i;break;case 3:o=l,a=i,s=n;break;case 4:o=i,a=l,s=n;break;case 5:o=n,a=l,s=i;break}return[255*o,255*a,255*s]},a.cmyk.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100,s=e[3]/100;return t=1-Math.min(1,i*(1-s)+s),n=1-Math.min(1,o*(1-s)+s),r=1-Math.min(1,a*(1-s)+s),[255*t,255*n,255*r]},a.xyz.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100;return t=3.2406*i+-1.5372*o+-.4986*a,n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,t=Math.min(Math.max(0,t),1),n=Math.min(Math.max(0,n),1),r=Math.min(Math.max(0,r),1),[255*t,255*n,255*r]},a.xyz.lab=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];return i/=95.047,o/=100,a/=108.883,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,t=116*o-16,n=500*(i-o),r=200*(o-a),[t,n,r]},a.lab.xyz=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];n=(i+16)/116,t=o/500+n,r=n-a/200;var s=Math.pow(n,3),c=Math.pow(t,3),l=Math.pow(r,3);return n=s>.008856?s:(n-16/116)/7.787,t=c>.008856?c:(t-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},a.lab.lch=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];return t=Math.atan2(a,o),n=360*t/2/Math.PI,n<0&&(n+=360),r=Math.sqrt(o*o+a*a),[i,r,n]},a.lch.lab=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];return r=a/360*2*Math.PI,t=o*Math.cos(r),n=o*Math.sin(r),[i,t,n]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(i=Math.round(i/50),0===i)return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var i=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return i},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var n=.5*(1+~~(e>50)),r=(1&t)*n*255,i=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,i,o]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;e-=16;var r=Math.floor(e/36)/5*255,i=Math.floor((n=e%36)/6)/5*255,o=n%6/5*255;return[r,i,o]},a.rgb.hex=function(e){var t=((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2])),n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16),i=r>>16&255,o=r>>8&255,a=255&r;return[i,o,a]},a.rgb.hcg=function(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,i),o),s=Math.min(Math.min(r,i),o),c=a-s;return t=c<1?s/(1-c):0,n=c<=0?0:a===r?(i-o)/c%6:a===i?2+(o-r)/c:4+(r-i)/c+4,n/=6,n%=1,[360*n,100*c,100*t]},a.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return r=n<.5?2*t*n:2*t*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},a.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},a.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i=[0,0,0],o=t%1*6,a=o%1,s=1-a,c=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[255*(n*i[0]+c),255*(n*i[1]+c),255*(n*i[2]+c)]},a.hcg.hsv=function(e){var t=e[1]/100,n=e[2]/100,r=t+n*(1-t),i=0;return r>0&&(i=t/r),[e[0],100*i,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100,r=n*(1-t)+.5*t,i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],100*i,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1-n,i=r-t,o=0;return i<1&&(o=(r-i)/(1-i)),[e[0],100*i,100*o]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=(t<<16)+(t<<8)+t,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},b79a:function(e,t,n){var r=n("438e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("1708abd6",r,e)}},b7d1:function(e,t,n){(function(t){function n(e,t){if(r("noDeprecation"))return e;var n=!1;function i(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return i}function r(e){try{if(!t.localStorage)return!1}catch(_){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=n}).call(this,n("c8ba"))},b7ef:function(e,t,n){"use strict";var r=n("23e7"),i=n("da84"),o=n("d066"),a=n("5c6c"),s=n("9bf2").f,c=n("1a2d"),l=n("19aa"),u=n("7156"),d=n("e391"),f=n("cf98"),h=n("c770"),p=n("83ab"),m=n("c430"),v="DOMException",g=o("Error"),y=o(v),b=function(){l(this,_);var e=arguments.length,t=d(e<1?void 0:arguments[0]),n=d(e<2?void 0:arguments[1],"Error"),r=new y(t,n),i=g(t);return i.name=v,s(r,"stack",a(1,h(i.stack,1))),u(r,this,b),r},_=b.prototype=y.prototype,w="stack"in g(v),x="stack"in new y(1,2),k=y&&p&&Object.getOwnPropertyDescriptor(i,v),S=!!k&&!(k.writable&&k.configurable),E=w&&!S&&!x;r({global:!0,constructor:!0,forced:m||E},{DOMException:E?b:y});var C=o(v),T=C.prototype;if(T.constructor!==C)for(var I in m||s(T,"constructor",a(1,C)),f)if(c(f,I)){var R=f[I],O=R.s;c(C,O)||s(C,O,a(6,R.c))}},b837:function(e,t,n){var r=n("3fb5"),i=n("4fd1"),o=n("b672"),a=n("8707").Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}r(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},b8d8:function(e,t,n){"use strict";function r(e,t,n){return~(e-1)&t|e-1&n}function i(e,t){if(e.length!==t.length)return 0;let n=0;for(let r=0;r>>8}function o(e,t){return 0!==e.length&&0!==t.length&&0!==i(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.select=r,t.compare=i,t.equal=o},b8fa:function(e,t){e.exports=function(e){return!(!e||"string"===typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},b93b:function(e,t,n){"use strict";n.r(t);var r=n("52ef");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},b980:function(e,t,n){var r=n("d039"),i=n("5c6c");e.exports=!r((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},bb15:function(e,t,n){var r=n("b753"),i=n("a279"),o={},a=Object.keys(r);function s(e){var t=function(t){return void 0===t||null===t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function c(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"===typeof n)for(var r=n.length,i=0;i=0;n--)t+=255&e.data[n]|0,e.data[n]=255&t,t>>>=8}n.default=a},be6a:function(e,t,n){var r=n("306eb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("57d84a74",r,e)}},bfa8:function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},c04e:function(e,t,n){var r=n("c65b"),i=n("861d"),o=n("d9b5"),a=n("dc4a"),s=n("485a"),c=n("b622"),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!i(n)||o(n))return n;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},c181:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".message[data-v-1cf419f0]{font-weight:400;text-align:center}.message div[data-v-1cf419f0]{margin:0 auto;padding:.5em 1em;background:rgb(var(--background-total-theme));border:1px solid rgba(var(--neutral-grad-1),.3);border-radius:30px;width:200px;font-size:.8em;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.iconWrapper[data-v-1cf419f0]{transform:scale(.5)}.wrapper[data-v-1cf419f0]{position:absolute;left:0;right:0;top:0;bottom:0;z-index:2900;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background:rgba(var(--background-total-theme),.2);transition:.3s}.wrapper .table[data-v-1cf419f0]{height:100%}.wrapper .table>div[data-v-1cf419f0]{vertical-align:middle}#wai-fixedmessageicon[data-v-1cf419f0]{transition:.3s}#wai-fixedmessageicon.minimized .wrapper[data-v-1cf419f0]{top:60px;bottom:100px}#wai-fixedmessageicon.minimized[data-v-1cf419f0]:not(.active){opacity:0}#wai-fixedmessageicon.active .wrapper[data-v-1cf419f0]{width:344px;transform:translateX(-300px)}",""]),e.exports=t},c1af:function(e){e.exports=JSON.parse('{"caption":{"create":"Create","addPublicChatName":"Add Public Chat Name","addGroupNamePlaceHolder":"Add Group Name","createPublicChat":"Create public chat","chatTopic":"Topic renamed","publicRoomTitle":"Public Room","asModerator":"as moderator","marked":"marked","unmarked":"unmarked","removeBan":"Remove Ban","cancelModeration":"Remove moderation","uploadFiles":"파일 업로드","header":"헤더","dragAndDropAFile":"파일 끌어서 놓기","chatInvite":"다음과 채팅하도록 초대되었습니다:","cantJoin":"다음과 채팅하기 위해 참여할 수 없습니다:","chatInviteDecline":"채팅에 참여하거나 초대를 거부할 수 있습니다.","creatorLeft":"크리에이터가 방을 나갔기 때문에","encrypted":"암호화","noImages":"이 채팅에는 아직 이미지가 없습니다","noFiles":"There are no files in this chat yet","inviteUser":"사용자 초대","invite":"초대하다","add":"추가","mute":"음소거","unmute":"음소거 해제","leave":"떠나다","Info":"정보","new":"신규","typing":"타자","accNotFound":"등록이 진행 중입니다. 잠시만 기다려 주십시오...","emptyList":"목록이 비어 있습니다(필터링되었거나 비어 있음)","welcome":"포켓넷 채팅에 오신 것을 환영합니다","startNewChat":"새 채팅 시작","chats":"채팅","shareWith":"공유","newChat":"새 채팅","moveToChat":"채팅으로 이동","queryNoResults":"쿼리가 결과를 보고하지 않음","needMoreCharacters":"결과에 대해 더 많은 문자가 필요합니다","createGroup":"그룹 만들기","unabletoDecrypt":"* 해독할 수 없음","messageDeleted":"메시지 삭제됨","sentImage":"전송된 이미지","sentVoiceMessage":"음성 메시지를 보냈다","invitationToChat":"채팅 초대","invitationToRoom":"Invitation to room","leftChat":"채팅에서 나감","joined":"가입","chatRenamed":"채팅 이름이 (으)로 변경되었습니다 ","recentComment":"최근 댓글:","share":"공유","followers":"팔로워:","reputation":"평판:","following":"팔로잉:","theme":"테마:","contacts":"연락처","phoneContacts":"전화 연락처","chooseInviteMedia":"초대 방법을 선택하십시오:","admin":"관리자","moderator":"진행자","videocall":"영상통화","call":"전화","leaveAndDelete":"나가서 삭제","donate":"기부하다","makeModerator":"모더레이터 만들기","ban":"금지","kick":"킥","members":"회원","media":"미디어","files":"파일","contactsList":"연락처 목록","send":"보내다","pageCaption":"페이지 캡션","caption":"캡션","text":"텍스트","placeholder":"자리 표시자","sendTransactionTo":"트랜잭션 보내기","toBePaidByReceiver":"수취인이 지불함","toBePaidBySender":"발신인이 지불함","source":"소스","amount":"금액","receiver":"수신자","message":"메시지","includeFeesInAmount":"금액에 수수료 포함","transactionFees":"거래 수수료","totalAmount":"총 금액","balanceTooLow":"밸런스가 너무 낮음","transactionError":"오류, 거래를 할 수 없습니다","calculateFees":"수수료 계산","startChatWith":"채팅 시작","searchResult":"검색 결과","joinedInTheChat":"채팅에 참여했습니다","invited":"초대 ","hasInvited":"초대 ","inTheChat":" 채팅 중","banned":"금지된","andRoom":"그리고 방","left":"왼쪽","theChat":" 채팅 ","made":"만든 ","aModerator":" 중재자","editedChatNameTo ":"편집된 채팅 이름을 ","somebody":"누군가","sent":"보낸","PKOINto":" PKOIN to ","response":"응답","messagefrom":"에서 전달된 메시지","edited":"편집됨","settings":"설정","unauthorized":"무단","search":"검색","replyOnMessage":"메시지에 회신","editMessage":"메시지 편집","inviteFriend":"친구 초대","emptyContactList":"연락처 목록이 비어 있습니다","joinApp":"포켓넷 가입","hasInvitedToJoin":"Pocketnet에 가입하도록 초대했습니다","contactsempty":"아직 연락처가 없습니다. 검색에서 찾으십시오","chatsearchingempty":"No chats found for the specified filter","sendmessage":"Send message"},"input":{"patientEmailPlaceholder":"이메일","refillNamePlaceholder":"리필 이름"},"message":{},"button":{"starChatButton":"채팅 시작","decline":"거절","declineandignore":"사용자 무시","join":"가입","ok":"그래","copy":"복사","forward":"앞으로","delete":"삭제","reply":"답장","share":"공유","save":"저장","download":"다운로드","downloaded":"다운로드","goToPocketnetProfile":"Pocketnet 프로필로 이동","sendFile":"파일 보내기","takePhotoOrVideo":"이미지 보내기","sendCoins":"코인 보내기","edit":"편집","select":"고르다","block":"차단","unblock":"차단 해제","blockUser":"사용자 차단"},"yes":"예","cancel":"취소","teamMessages":{"1-title":"Bastyon 비공개 채팅에 오신 것을 환영합니다!","1-list1":"전화번호와 연결되지 않은 비공개 메신저","1-list2":"기본적으로 모든 1:1 대화의 종단 간 암호화","1-list3":"채팅을 통해 주고받는 모든 이미지는 암호화되어 저장됩니다","1-list4":"메시지 기록은 7일 동안만 저장됩니다","2-title":"엄청난 발표! Pocketnet 응용 프로그램은 이제 Bastyon이라고 합니다!","2-message1":"도메인이 Bastyon.com으로 이동됩니다. 최근에 다음과 같은 주요 업데이트를 발표했습니다","2-list1":"귀하의 전화 번호에 연결되지 않은 개인 암호화 메신저","2-list2":"블로거에게 PKOIN 기부 기능","2-list3":"비디오 및 라이브 스트리밍","2-message2":"지금 친구를 초대하고 탈중앙화 인터넷의 큰 미래의 일부가 되십시오!","2-button":"친구를 초대"},"sendingerror":"An error occurred while sending the message","details":"Details","settings_pin":"Pin chat window","checked":"Yes","unchecked":"No","settings_read":"Send read receipts","messagewasburn":"This message remains only in the memory of your device","messagewillburn":"The message will be deleted soon","micaccessbrowser":"Access to the microphone is restricted, please check your browser settings.","micaccesscommonproblem":"Sorry, for some reason it is not possible to record voice messages on the device","micaccesscordova":"Access to the microphone is restricted, please check your device settings.","micdevicenotfound":"Audio recording device not found"}')},c275:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.emoji-mart,.emoji-mart *{box-sizing:border-box;line-height:1.15}.emoji-mart{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,sans-serif;font-size:16px;display:inline-block;color:#222427;border:1px solid #d9d9d9;border-radius:5px;background:#fff}.emoji-mart .emoji-mart-emoji{padding:6px}.emoji-mart-bar{border:0 solid #d9d9d9}.emoji-mart-bar:first-child{border-bottom-width:1px;border-top-left-radius:5px;border-top-right-radius:5px}.emoji-mart-bar:last-child{border-top-width:1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.emoji-mart-anchors{display:flex;flex-direction:row;justify-content:space-between;padding:0 6px;color:#858585;line-height:0}.emoji-mart-anchor{position:relative;display:block;flex:1 1 auto;text-align:center;padding:12px 4px;overflow:hidden;transition:color .1s ease-out}.emoji-mart-anchor-selected,.emoji-mart-anchor:hover{color:#464646}.emoji-mart-anchor-selected .emoji-mart-anchor-bar{bottom:0}.emoji-mart-anchor-bar{position:absolute;bottom:-3px;left:0;width:100%;height:3px;background-color:#464646}.emoji-mart-anchors i{display:inline-block;width:100%;max-width:22px}.emoji-mart-anchors svg{fill:currentColor;max-height:18px}.emoji-mart-scroll{overflow-y:scroll;height:270px;padding:0 6px 6px 6px;will-change:transform}.emoji-mart-search{margin-top:6px;padding:0 6px}.emoji-mart-search input{font-size:16px;display:block;width:100%;padding:.2em .6em;border-radius:25px;border:1px solid #d9d9d9;outline:0}.emoji-mart-category .emoji-mart-emoji span{z-index:1;position:relative;text-align:center;cursor:default}.emoji-mart-category .emoji-mart-emoji:hover:before{z-index:0;content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#f4f4f4;border-radius:100%}.emoji-mart-category-label{z-index:2;position:relative;position:sticky;top:0}.emoji-mart-category-label span{display:block;width:100%;font-weight:500;padding:5px 6px;background-color:#fff;background-color:hsla(0,0%,100%,.95)}.emoji-mart-emoji{position:relative;display:inline-block;font-size:0}.emoji-mart-no-results{font-size:14px;text-align:center;padding-top:70px;color:#858585}.emoji-mart-no-results .emoji-mart-category-label{display:none}.emoji-mart-no-results .emoji-mart-no-results-label{margin-top:.2em}.emoji-mart-no-results .emoji-mart-emoji:hover:before{content:none}.emoji-mart-preview{position:relative;height:70px}.emoji-mart-preview-data,.emoji-mart-preview-emoji,.emoji-mart-preview-skins{position:absolute;top:50%;transform:translateY(-50%)}.emoji-mart-preview-emoji{left:12px}.emoji-mart-preview-data{left:68px;right:12px;word-break:break-all}.emoji-mart-preview-skins{right:30px;text-align:right}.emoji-mart-preview-name{font-size:14px}.emoji-mart-preview-shortname{font-size:12px;color:#888}.emoji-mart-preview-emoticon+.emoji-mart-preview-emoticon,.emoji-mart-preview-shortname+.emoji-mart-preview-emoticon,.emoji-mart-preview-shortname+.emoji-mart-preview-shortname{margin-left:.5em}.emoji-mart-preview-emoticon{font-size:11px;color:#bbb}.emoji-mart-title span{display:inline-block;vertical-align:middle}.emoji-mart-title .emoji-mart-emoji{padding:0}.emoji-mart-title-label{color:#999a9c;font-size:26px;font-weight:300}.emoji-mart-skin-swatches{font-size:0;padding:2px 0;border:1px solid #d9d9d9;border-radius:12px;background-color:#fff}.emoji-mart-skin-swatches-opened .emoji-mart-skin-swatch{width:16px;padding:0 2px}.emoji-mart-skin-swatches-opened .emoji-mart-skin-swatch-selected:after{opacity:.75}.emoji-mart-skin-swatch{display:inline-block;width:0;vertical-align:middle;transition-property:width,padding;transition-duration:.125s;transition-timing-function:ease-out}.emoji-mart-skin-swatch:first-child{transition-delay:0s}.emoji-mart-skin-swatch:nth-child(2){transition-delay:.03s}.emoji-mart-skin-swatch:nth-child(3){transition-delay:.06s}.emoji-mart-skin-swatch:nth-child(4){transition-delay:.09s}.emoji-mart-skin-swatch:nth-child(5){transition-delay:.12s}.emoji-mart-skin-swatch:nth-child(6){transition-delay:.15s}.emoji-mart-skin-swatch-selected{position:relative;width:16px;padding:0 2px}.emoji-mart-skin-swatch-selected:after{content:"";position:absolute;top:50%;left:50%;width:4px;height:4px;margin:-2px 0 0 -2px;background-color:#fff;border-radius:100%;pointer-events:none;opacity:0;transition:opacity .2s ease-out}.emoji-mart-skin{display:inline-block;width:100%;padding-top:100%;max-width:12px;border-radius:100%}.emoji-mart-skin-tone-1{background-color:#ffc93a}.emoji-mart-skin-tone-2{background-color:#fadcbc}.emoji-mart-skin-tone-3{background-color:#e0bb95}.emoji-mart-skin-tone-4{background-color:#bf8f68}.emoji-mart-skin-tone-5{background-color:#9b643d}.emoji-mart-skin-tone-6{background-color:#594539}',""]),e.exports=t},c337:function(e,t,n){"use strict";n.r(t);var r=n("8b3a");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},c345:function(e,t,n){"use strict";var r=n("c532"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},c401:function(e,t,n){"use strict";var r=n("c532"),i=n("2444");e.exports=function(e,t,n){var o=this||i;return r.forEach(n,(function(n){e=n.call(o,e,t)})),e}},c412:function(e,t,n){"use strict";n.r(t);var r=n("51c5");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},c430:function(e,t){e.exports=!1},c4c0:function(e,t,n){"use strict";var r=n("966d");function i(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(a,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit("error",t)}e.exports={destroy:i,undestroy:o}},c532:function(e,t,n){"use strict";var r=n("1d2b"),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function c(e){return"[object ArrayBuffer]"===i.call(e)}function l(e){return"undefined"!==typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function d(e){return"string"===typeof e}function f(e){return"number"===typeof e}function h(e){return null!==e&&"object"===typeof e}function p(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function m(e){return"[object Date]"===i.call(e)}function v(e){return"[object File]"===i.call(e)}function g(e){return"[object Blob]"===i.call(e)}function y(e){return"[object Function]"===i.call(e)}function b(e){return h(e)&&y(e.pipe)}function _(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function x(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function k(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";var t=this.head,n=""+t.data;while(t=t.next)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);var t=u.allocUnsafe(e>>>0),n=this.head,r=0;while(n)p(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),e-=o,0===e){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),n=this.head,r=1;n.data.copy(t),e-=n.data.length;while(n=n.next){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),e-=o,0===e){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:h,value:function(e,t){return f(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},c6b6:function(e,t,n){var r=n("e330"),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},c6cd:function(e,t,n){var r=n("da84"),i=n("6374"),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},c71b:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".swiperWrapper[data-v-71d5e826]{padding-bottom:0;display:flex;overflow-x:scroll;scrollbar-width:none}.swiperWrapper[data-v-71d5e826]::-webkit-scrollbar{width:0!important;height:0!important}.swiperWrapperFlex[data-v-71d5e826]{display:flex;flex-wrap:nowrap;height:100%;align-items:center}.swiperWrapperFlex .imageSwiper[data-v-71d5e826]{width:33px;min-width:33px}.aboutRoomAvatar[data-v-71d5e826]{font-size:.5em}.userwrapper[data-v-71d5e826]{border-radius:50%}.userinfopicwrapper[data-v-71d5e826]{padding-bottom:100%;position:relative;background:none;margin:0 auto;border-radius:50%;overflow:hidden}.userinfopicwrapper .userwrapper[data-v-71d5e826]{width:50%}.threeAvatars .userwrapper[data-v-71d5e826]:first-child{position:absolute;left:50%;top:0;transform:translate(-50%,6.5%)}.threeAvatars .userwrapper[data-v-71d5e826]:nth-child(2){position:absolute;right:0;bottom:0;transform:translateY(-6.5%)}.threeAvatars .userwrapper[data-v-71d5e826]:nth-child(3){position:absolute;left:0;bottom:0;transform:translateY(-6.5%)}.twoAvatars .userwrapper[data-v-71d5e826]:first-child{position:absolute;top:0;left:0;transform:translate(6.5%,6.5%)}.twoAvatars .userwrapper[data-v-71d5e826]:last-child{position:absolute;right:0;bottom:0;transform:translate(-6.5%,-6.5%)}.fourAvatars .userwrapper[data-v-71d5e826]:first-child{position:absolute;top:0;left:0}.fourAvatars .userwrapper[data-v-71d5e826]:nth-child(2){position:absolute;right:0;top:0}.fourAvatars .userwrapper[data-v-71d5e826]:nth-child(3){position:absolute;left:0;bottom:0}.fourAvatars .userwrapper[data-v-71d5e826]:nth-child(4){position:absolute;right:0;bottom:0}.fourMore[data-v-71d5e826]{background:none}.fourMore[data-v-71d5e826],.imageSwiper[data-v-71d5e826]{margin:0 auto}.imageSwiper img[data-v-71d5e826]{display:block;border-radius:50%;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.invited[data-v-71d5e826]{opacity:.5}",""]),e.exports=t},c770:function(e,t,n){var r=n("e330"),i=Error,o=r("".replace),a=function(e){return String(i(e).stack)}("zxcasd"),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);e.exports=function(e,t){if(c&&"string"==typeof e&&!i.prepareStackTrace)while(t--)e=o(e,s,"");return e}},c8af:function(e,t,n){"use strict";var r=n("c532");e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},c8ba:function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===typeof window&&(r=window)}t.exports=r},c934:function(e,t,n){"use strict";n.r(t);var r=n("a63f");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},c973:function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,c,"next",e)}function c(e){n(a,i,o,s,c,"throw",e)}s(void 0)}))}}e.exports=r,e.exports.__esModule=!0,e.exports["default"]=e.exports},c976:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Filter=o;var r=n("4ec4");function i(e,t,n){const r=t.split(".");let i=e;for(let o=0;o2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function s(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function c(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function l(e,t,n){return"number"!==typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,i;if("string"===typeof t&&s(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",c(e," argument"))i="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var o=l(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(a(t,"type"))}return i+=". Received type ".concat(typeof n),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},ca84:function(e,t,n){var r=n("e330"),i=n("1a2d"),o=n("fc6a"),a=n("4d64").indexOf,s=n("d012"),c=r([].push);e.exports=function(e,t){var n,r=o(e),l=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&c(u,n);while(t.length>l)i(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},cb2d:function(e,t,n){var r=n("1626"),i=n("9bf2"),o=n("13d2"),a=n("6374");e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&o(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(u){}c?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},cc12:function(e,t,n){var r=n("da84"),i=n("861d"),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},ccdd:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.fadeTr-enter-active{-webkit-transition:opacity .3s ease-in;transition:opacity .3s ease-in;-webkit-transition-delay:.1s;transition-delay:.1s}.fadeTr-leave-active{-webkit-transition:opacity .1s ease-out;transition:opacity .1s ease-out}.fadeTr-enter,.fadeTr-leave-to{opacity:0}.slide-enter-active,.slide-leave-active{-webkit-transition:all 1s;transition:all 1s}.slide-enter,.slide-leave-to{opacity:0;-webkit-transform:translateX(30px);transform:translateX(30px)}.dg-backdrop-enter-active{-webkit-animation:dg-fadeIn .3s;animation:dg-fadeIn .3s}.dg-backdrop-leave-active{-webkit-animation:dg-fadeOut .5s;animation:dg-fadeOut .5s}.dg-fade-enter-active{-webkit-animation:dg-fadeIn .6s ease-out;animation:dg-fadeIn .6s ease-out}.dg-fade-leave-active{-webkit-animation:dg-fadeOut .6s ease-out;animation:dg-fadeOut .6s ease-out}@-webkit-keyframes dg-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes dg-fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes dg-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes dg-fadeOut{0%{opacity:1}to{opacity:0}}.dg-zoom-enter-active{-webkit-animation:dg-zoomIn .3s ease-out;animation:dg-zoomIn .3s ease-out}.dg-zoom-leave-active{-webkit-animation:dg-zoomOut .4s ease-out;animation:dg-zoomOut .4s ease-out}@-webkit-keyframes dg-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes dg-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@-webkit-keyframes dg-zoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes dg-zoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}.dg-bounce-enter-active{-webkit-animation:dg-bounceIn .6s;animation:dg-bounceIn .6s}.dg-bounce-leave-active{-webkit-animation:dg-zoomOut .6s;animation:dg-zoomOut .6s}@-webkit-keyframes dg-bounceIn{0%{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}40%{opacity:1;-webkit-transform:scale(1.06);transform:scale(1.06)}60%{-webkit-transform:scale(.92);transform:scale(.92)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes dg-bounceIn{0%{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}40%{opacity:1;-webkit-transform:scale(1.06);transform:scale(1.06)}60%{-webkit-transform:scale(.92);transform:scale(.92)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes dg-bounceOut{0%{-webkit-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(.95);transform:scale(.95)}50%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1)}to{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}}@keyframes dg-bounceOut{0%{-webkit-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(.95);transform:scale(.95)}50%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1)}to{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}}.dg-btn-loader{width:100%;height:100%;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;top:0;left:0}.dg-btn-loader .dg-circles{width:100%;display:block;text-align:center}.dg-btn-loader .dg-circle{width:.9em;height:.9em;opacity:0;background-color:#09a2e3;display:inline-block;border-radius:50%;-webkit-animation-name:dg-circle-oscillation;animation-name:dg-circle-oscillation;-webkit-animation-duration:.5875s;animation-duration:.5875s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:normal;animation-direction:normal}.dg-btn-loader .dg-circle:not(:last-child){margin-right:8px}.dg-btn-loader .dg-circle:first-child{-webkit-animation-delay:.1195s;animation-delay:.1195s}.dg-btn-loader .dg-circle:nth-child(2){-webkit-animation-delay:.2755s;animation-delay:.2755s}.dg-btn-loader .dg-circle:nth-child(3){-webkit-animation-delay:.3485s;animation-delay:.3485s}@-webkit-keyframes dg-circle-oscillation{50%{opacity:1}}@keyframes dg-circle-oscillation{50%{opacity:1}}body.dg-open{width:100%;height:100%;overflow:hidden}.dg-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.dg-container [disabled]{cursor:not-allowed;opacity:.3}.dg-backdrop{background-color:rgba(0,0,0,.8)}.dg-backdrop,.dg-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:5000}.dg-content-cont{width:100%;font-family:inherit}.dg-main-content{width:98%;max-width:400px;padding:15px;border-radius:5px;margin:25px auto;background-color:#fff}.dg-content{font-size:16px;line-height:1.3em}.dg-title{margin:0 0 10px 0;padding:0;font-size:18px}.dg-content-body{border-bottom:2px solid #e1e6ea;padding-bottom:15px}.dg-content-footer{position:relative;padding:15px 0 0}.dg-form{background-color:#f8f8ff;padding:10px;margin-bottom:-15px}.dg-content-cont--floating{position:absolute;top:35%;-webkit-transform:translateY(-70%);transform:translateY(-70%);margin-top:0}@media (max-height:700px){.dg-content-cont--floating{position:relative;top:10%;-webkit-transform:none;transform:none;margin-top:0}}.dg-btn{display:inline-block;position:relative;min-width:80px;padding:6px 20px;border-radius:4px;outline:0;border:2px solid transparent;text-align:center;text-decoration:none;cursor:pointer;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:16px;font-weight:700}.dg-btn:active,.dg-btn:focus,.dg-btn:link{outline:none}.dg-btn::-moz-focus-inner{border:0}.dg-btn--cancel{color:#fefefe;background-color:#0096d9}.dg-btn--ok{color:#0096d9;background-color:#fefefe;border-color:#0096d9}.dg-pull-right{float:right}.dg-btn.dg-btn--loading .dg-btn-content{visibility:hidden}.dg-clear:before{content:" ";display:block;clear:both}.dg-content-body--has-title .dg-content{font-size:14px}.dg-container--has-input .dg-main-content{max-width:450px}.dg-container--has-input .dg-content{margin-bottom:15px}.dg-container--has-input .dg-content-body{border-bottom:none}.dg-container--has-input .dg-form{border:1px solid #e1e6ea;border-bottom:none;border-top-left-radius:4px;border-top-right-radius:4px}.dg-container--has-input .dg-content-footer{background-color:#f8f8ff;border:1px solid #e1e6ea;border-top:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:0 10px 10px}.dg-container .dg-highlight-1{color:#ff8c00;font-weight:700;border-bottom:1px solid #2ba5ff}.dg-container .dg-highlight-2{color:#2ba5ff;font-weight:700;border-bottom:1px solid #ff8c00}',""]),e.exports=t},cde8:function(e,t,n){var r=n("47a0");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("4233703c",r,e)}},cee4:function(e,t,n){"use strict";var r=n("c532"),i=n("1d2b"),o=n("0a06"),a=n("4a7b"),s=n("2444");function c(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var l=c(s);l.Axios=o,l.create=function(e){return c(a(l.defaults,e))},l.Cancel=n("7a77"),l.CancelToken=n("8df4"),l.isCancel=n("2e67"),l.all=function(e){return Promise.all(e)},l.spread=n("0df6"),l.isAxiosError=n("5f02"),e.exports=l,e.exports.default=l},cf98:function(e,t){e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},d066:function(e,t,n){var r=n("da84"),i=n("1626"),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},d0f2:function(e,t,n){"use strict";(function(e){var r=n("c973").default;n("d9e2");var i=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixBaseApis=d;var o=n("788e"),a=n("63c7"),s=n("ef06"),c=i(n("3987")),l=n("1c8f");function u(e,t){switch(e){case o.SERVICE_TYPES.IS:return t+l.PREFIX_IDENTITY_V2+"/terms";case o.SERVICE_TYPES.IM:return t+"/_matrix/integrations/v1/terms";default:throw new Error("Unsupported service type")}}function d(e){c.checkObjectHasKeys(e,["baseUrl","request"]),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.identityServer=e.identityServer;const t={baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,request:e.request,prefix:l.PREFIX_R0,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader};this._http=new l.MatrixHttpApi(this,t),this._txnCtr=0}d.prototype.getHomeserverUrl=function(){return this.baseUrl},d.prototype.getIdentityServerUrl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&(this.idBaseUrl.startsWith("http://")||this.idBaseUrl.startsWith("https://"))?this.idBaseUrl.split("://")[1]:this.idBaseUrl},d.prototype.setIdentityServerUrl=function(e){this.idBaseUrl=c.ensureNoTrailingSlash(e),this._http.setIdBaseUrl(this.idBaseUrl)},d.prototype.getAccessToken=function(){return this._http.opts.accessToken||null},d.prototype.isLoggedIn=function(){return void 0!==this._http.opts.accessToken},d.prototype.makeTxnId=function(){return"m"+(new Date).getTime()+"."+this._txnCtr++},d.prototype.isUsernameAvailable=function(e){return this._http.authedRequest(void 0,"GET","/register/available",{username:e}).then(e=>e.available)},d.prototype.register=function(e,t,n,r,i,o,a,s){!0===i?i={email:!0}:null!==i&&void 0!==i||(i={}),"function"===typeof a&&(s=a,a=void 0),n&&(r.session=n);const c={auth:r};return void 0!==e&&null!==e&&(c.username=e),void 0!==t&&null!==t&&(c.password=t),i.email&&(c.bind_email=!0),i.msisdn&&(c.bind_msisdn=!0),void 0!==o&&null!==o&&(c.guest_access_token=o),void 0!==a&&null!==a&&(c.inhibit_login=a),void 0!==t&&null!==t&&(c.x_show_msisdn=!0),this.registerRequest(c,void 0,s)},d.prototype.registerGuest=function(e,t){return e=e||{},e.body=e.body||{},this.registerRequest(e.body,"guest",t)},d.prototype.registerRequest=function(e,t,n){const r={};return t&&(r.kind=t),this._http.request(n,"POST","/register",r,e)},d.prototype.loginFlows=function(e){return this._http.request(e,"GET","/login")},d.prototype.login=function(e,t,n){const r={type:e};return c.extend(r,t),this._http.authedRequest((e,t)=>{t&&t.access_token&&t.user_id&&(this._http.opts.accessToken=t.access_token,this.credentials={userId:t.user_id}),n&&n(e,t)},"POST","/login",void 0,r)},d.prototype.loginWithPassword=function(e,t,n){return this.login("m.login.password",{user:e,password:t},n)},d.prototype.loginWithSAML2=function(e,t){return this.login("m.login.saml2",{relay_state:e},t)},d.prototype.getCasLoginUrl=function(e){return this.getSsoLoginUrl(e,"cas")},d.prototype.getSsoLoginUrl=function(e,t,n){void 0===t&&(t="sso");let r=l.PREFIX_R0,i="/login/"+t+"/redirect";return n&&(i+="/"+n,r="/_matrix/client/unstable/org.matrix.msc2858"),this._http.getUrl(i,{redirectUrl:e},r)},d.prototype.loginWithToken=function(e,t){return this.login("m.login.token",{token:e},t)},d.prototype.logout=function(e){return this._http.authedRequest(e,"POST","/logout")},d.prototype.deactivateAccount=function(e,t){if("function"===typeof t)throw new Error("deactivateAccount no longer accepts a callback parameter");const n={};return e&&(n.auth=e),void 0!==t&&(n.erase=t),this._http.authedRequest(void 0,"POST","/account/deactivate",void 0,n)},d.prototype.getFallbackAuthUrl=function(e,t){const n=c.encodeUri("/auth/$loginType/fallback/web",{$loginType:e});return this._http.getUrl(n,{session:t},l.PREFIX_R0)},d.prototype.createRoom=function(){var e=r((function*(e,t){const n=(e.invite_3pid||[]).filter(e=>!e.id_access_token);if(n.length>0&&this.identityServer&&this.identityServer.getAccessToken&&(yield this.doesServerAcceptIdentityAccessToken())){const e=yield this.identityServer.getAccessToken();if(e)for(const t of n)t.id_access_token=e}return this._http.authedRequest(t,"POST","/createRoom",void 0,e)}));return function(t,n){return e.apply(this,arguments)}}(),d.prototype.fetchRelations=function(){var e=r((function*(e,t,n,r,i){const o={};i.from&&(o.from=i.from);const a=c.encodeParams(o),s=c.encodeUri("/rooms/$roomId/relations/$eventId/$relationType/$eventType?"+a,{$roomId:e,$eventId:t,$relationType:n,$eventType:r}),u=yield this._http.authedRequest(void 0,"GET",s,null,null,{prefix:l.PREFIX_UNSTABLE});return u}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),d.prototype.roomState=function(e,t){const n=c.encodeUri("/rooms/$roomId/state",{$roomId:e});return this._http.authedRequest(t,"GET",n)},d.prototype.fetchRoomEvent=function(e,t,n){const r=c.encodeUri("/rooms/$roomId/event/$eventId",{$roomId:e,$eventId:t});return this._http.authedRequest(n,"GET",r)},d.prototype.members=function(e,t,n,r,i){const o={};t&&(o.membership=t),n&&(o.not_membership=n),r&&(o.at=r);const a=c.encodeParams(o),s=c.encodeUri("/rooms/$roomId/members?"+a,{$roomId:e});return this._http.authedRequest(i,"GET",s)},d.prototype.upgradeRoom=function(e,t){const n=c.encodeUri("/rooms/$roomId/upgrade",{$roomId:e});return this._http.authedRequest(void 0,"POST",n,void 0,{new_version:t})},d.prototype.getGroupSummary=function(e){const t=c.encodeUri("/groups/$groupId/summary",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.getGroupProfile=function(e){const t=c.encodeUri("/groups/$groupId/profile",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.setGroupProfile=function(e,t){const n=c.encodeUri("/groups/$groupId/profile",{$groupId:e});return this._http.authedRequest(void 0,"POST",n,void 0,t)},d.prototype.setGroupJoinPolicy=function(e,t){const n=c.encodeUri("/groups/$groupId/settings/m.join_policy",{$groupId:e});return this._http.authedRequest(void 0,"PUT",n,void 0,{"m.join_policy":t})},d.prototype.getGroupUsers=function(e){const t=c.encodeUri("/groups/$groupId/users",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.getGroupInvitedUsers=function(e){const t=c.encodeUri("/groups/$groupId/invited_users",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.getGroupRooms=function(e){const t=c.encodeUri("/groups/$groupId/rooms",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.inviteUserToGroup=function(e,t){const n=c.encodeUri("/groups/$groupId/admin/users/invite/$userId",{$groupId:e,$userId:t});return this._http.authedRequest(void 0,"PUT",n,void 0,{})},d.prototype.removeUserFromGroup=function(e,t){const n=c.encodeUri("/groups/$groupId/admin/users/remove/$userId",{$groupId:e,$userId:t});return this._http.authedRequest(void 0,"PUT",n,void 0,{})},d.prototype.addUserToGroupSummary=function(e,t,n){const r=c.encodeUri(n?"/groups/$groupId/summary/$roleId/users/$userId":"/groups/$groupId/summary/users/$userId",{$groupId:e,$roleId:n,$userId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{})},d.prototype.removeUserFromGroupSummary=function(e,t){const n=c.encodeUri("/groups/$groupId/summary/users/$userId",{$groupId:e,$userId:t});return this._http.authedRequest(void 0,"DELETE",n,void 0,{})},d.prototype.addRoomToGroupSummary=function(e,t,n){const r=c.encodeUri(n?"/groups/$groupId/summary/$categoryId/rooms/$roomId":"/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$categoryId:n,$roomId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{})},d.prototype.removeRoomFromGroupSummary=function(e,t){const n=c.encodeUri("/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"DELETE",n,void 0,{})},d.prototype.addRoomToGroup=function(e,t,n){void 0===n&&(n=!0);const r=c.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{"m.visibility":{type:n?"public":"private"}})},d.prototype.updateGroupRoomVisibility=function(e,t,n){const r=c.encodeUri("/groups/$groupId/admin/rooms/$roomId/config/m.visibility",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{type:n?"public":"private"})},d.prototype.removeRoomFromGroup=function(e,t){const n=c.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"DELETE",n,void 0,{})},d.prototype.acceptGroupInvite=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=c.encodeUri("/groups/$groupId/self/accept_invite",{$groupId:e});return this._http.authedRequest(void 0,"PUT",n,void 0,t||{})},d.prototype.joinGroup=function(e){const t=c.encodeUri("/groups/$groupId/self/join",{$groupId:e});return this._http.authedRequest(void 0,"PUT",t,void 0,{})},d.prototype.leaveGroup=function(e){const t=c.encodeUri("/groups/$groupId/self/leave",{$groupId:e});return this._http.authedRequest(void 0,"PUT",t,void 0,{})},d.prototype.getJoinedGroups=function(){const e=c.encodeUri("/joined_groups");return this._http.authedRequest(void 0,"GET",e)},d.prototype.createGroup=function(e){const t=c.encodeUri("/create_group");return this._http.authedRequest(void 0,"POST",t,void 0,e)},d.prototype.getPublicisedGroups=function(e){const t=c.encodeUri("/publicised_groups");return this._http.authedRequest(void 0,"POST",t,void 0,{user_ids:e})},d.prototype.setGroupPublicity=function(e,t){const n=c.encodeUri("/groups/$groupId/self/update_publicity",{$groupId:e});return this._http.authedRequest(void 0,"PUT",n,void 0,{publicise:t})},d.prototype.getStateEvent=function(e,t,n,r){const i={$roomId:e,$eventType:t,$stateKey:n};let o=c.encodeUri("/rooms/$roomId/state/$eventType",i);return void 0!==n&&(o=c.encodeUri(o+"/$stateKey",i)),this._http.authedRequest(r,"GET",o)},d.prototype.sendStateEvent=function(e,t,n,r,i){const o={$roomId:e,$eventType:t,$stateKey:r};let a=c.encodeUri("/rooms/$roomId/state/$eventType",o);return void 0!==r&&(a=c.encodeUri(a+"/$stateKey",o)),this._http.authedRequest(i,"PUT",a,void 0,n)},d.prototype.roomInitialSync=function(e,t,n){c.isFunction(t)&&(n=t,t=void 0);const r=c.encodeUri("/rooms/$roomId/initialSync",{$roomId:e});return t||(t=30),this._http.authedRequest(n,"GET",r,{limit:t})},d.prototype.setRoomReadMarkersHttpRequest=function(e,t,n,r){const i=c.encodeUri("/rooms/$roomId/read_markers",{$roomId:e}),o={"m.fully_read":t,"m.read":n,"m.hidden":Boolean(!!r&&r.hidden)};return this._http.authedRequest(void 0,"POST",i,void 0,o)},d.prototype.getJoinedRooms=function(){const e=c.encodeUri("/joined_rooms");return this._http.authedRequest(void 0,"GET",e)},d.prototype.getJoinedRoomMembers=function(e){const t=c.encodeUri("/rooms/$roomId/joined_members",{$roomId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.publicRooms=function(e,t){"function"==typeof e&&(t=e,e={}),void 0===e&&(e={});const n={};return e.server&&(n.server=e.server,delete e.server),0===Object.keys(e).length&&0===Object.keys(n).length?this._http.authedRequest(t,"GET","/publicRooms"):this._http.authedRequest(t,"POST","/publicRooms",n,e)},d.prototype.createAlias=function(e,t,n){const r=c.encodeUri("/directory/room/$alias",{$alias:e}),i={room_id:t};return this._http.authedRequest(n,"PUT",r,void 0,i)},d.prototype.deleteAlias=function(e,t){const n=c.encodeUri("/directory/room/$alias",{$alias:e});return this._http.authedRequest(t,"DELETE",n,void 0,void 0)},d.prototype.unstableGetLocalAliases=function(e,t){const n=c.encodeUri("/rooms/$roomId/aliases",{$roomId:e}),r=l.PREFIX_UNSTABLE+"/org.matrix.msc2432";return this._http.authedRequest(t,"GET",n,null,null,{prefix:r})},d.prototype.getRoomIdForAlias=function(e,t){const n=c.encodeUri("/directory/room/$alias",{$alias:e});return this._http.authedRequest(t,"GET",n)},d.prototype.resolveRoomAlias=function(e,t){const n=c.encodeUri("/directory/room/$alias",{$alias:e});return this._http.request(t,"GET",n)},d.prototype.getRoomDirectoryVisibility=function(e,t){const n=c.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this._http.authedRequest(t,"GET",n)},d.prototype.setRoomDirectoryVisibility=function(e,t,n){const r=c.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this._http.authedRequest(n,"PUT",r,void 0,{visibility:t})},d.prototype.setRoomDirectoryVisibilityAppService=function(e,t,n,r){const i=c.encodeUri("/directory/list/appservice/$networkId/$roomId",{$networkId:e,$roomId:t});return this._http.authedRequest(r,"PUT",i,void 0,{visibility:n})},d.prototype.searchUserDirectory=function(e){const t={search_term:e.term};return void 0!==e.limit&&(t.limit=e.limit),this._http.authedRequest(void 0,"POST","/user_directory/search",void 0,t)},d.prototype.uploadContent=function(e,t){return this._http.uploadContent(e,t)},d.prototype.cancelUpload=function(e){return this._http.cancelUpload(e)},d.prototype.getCurrentUploads=function(){return this._http.getCurrentUploads()},d.prototype.getProfileInfo=function(e,t,n){c.isFunction(t)&&(n=t,t=void 0);const r=t?c.encodeUri("/profile/$userId/$info",{$userId:e,$info:t}):c.encodeUri("/profile/$userId",{$userId:e});return this._http.authedRequest(n,"GET",r)},d.prototype.getThreePids=function(e){const t="/account/3pid";return this._http.authedRequest(e,"GET",t,void 0,void 0)},d.prototype.addThreePid=function(e,t,n){const r="/account/3pid",i={threePidCreds:e,bind:t};return this._http.authedRequest(n,"POST",r,null,i)},d.prototype.addThreePidOnly=function(){var e=r((function*(e){const t="/account/3pid/add",n=(yield this.isVersionSupported("r0.6.0"))?l.PREFIX_R0:l.PREFIX_UNSTABLE;return this._http.authedRequest(void 0,"POST",t,null,e,{prefix:n})}));return function(t){return e.apply(this,arguments)}}(),d.prototype.bindThreePid=function(){var e=r((function*(e){const t="/account/3pid/bind",n=(yield this.isVersionSupported("r0.6.0"))?l.PREFIX_R0:l.PREFIX_UNSTABLE;return this._http.authedRequest(void 0,"POST",t,null,e,{prefix:n})}));return function(t){return e.apply(this,arguments)}}(),d.prototype.unbindThreePid=function(){var e=r((function*(e,t){const n="/account/3pid/unbind",r={medium:e,address:t,id_server:this.getIdentityServerUrl(!0)},i=(yield this.isVersionSupported("r0.6.0"))?l.PREFIX_R0:l.PREFIX_UNSTABLE;return this._http.authedRequest(void 0,"POST",n,null,r,{prefix:i})}));return function(t,n){return e.apply(this,arguments)}}(),d.prototype.deleteThreePid=function(e,t){const n="/account/3pid/delete",r={medium:e,address:t};return this._http.authedRequest(void 0,"POST",n,null,r)},d.prototype.setPassword=function(e,t,n){const r="/account/password",i={auth:e,new_password:t};return this._http.authedRequest(n,"POST",r,null,i)},d.prototype.getDevices=function(){return this._http.authedRequest(void 0,"GET","/devices",void 0,void 0)},d.prototype.getDevice=function(e){const t=c.encodeUri("/devices/$device_id",{$device_id:e});return this._http.authedRequest(void 0,"GET",t,void 0,void 0)},d.prototype.setDeviceDetails=function(e,t){const n=c.encodeUri("/devices/$device_id",{$device_id:e});return this._http.authedRequest(void 0,"PUT",n,void 0,t)},d.prototype.deleteDevice=function(e,t){const n=c.encodeUri("/devices/$device_id",{$device_id:e}),r={};return t&&(r.auth=t),this._http.authedRequest(void 0,"DELETE",n,void 0,r)},d.prototype.deleteMultipleDevices=function(e,t){const n={devices:e};t&&(n.auth=t);const r="/delete_devices";return this._http.authedRequest(void 0,"POST",r,void 0,n)},d.prototype.getPushers=function(e){const t="/pushers";return this._http.authedRequest(e,"GET",t,void 0,void 0)},d.prototype.setPusher=function(e,t){const n="/pushers/set";return this._http.authedRequest(t,"POST",n,null,e)},d.prototype.getPushRules=function(e){return this._http.authedRequest(e,"GET","/pushrules/").then(e=>s.PushProcessor.rewriteDefaultRules(e))},d.prototype.addPushRule=function(e,t,n,r,i){const o=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:n});return this._http.authedRequest(i,"PUT",o,void 0,r)},d.prototype.deletePushRule=function(e,t,n,r){const i=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:n});return this._http.authedRequest(r,"DELETE",i)},d.prototype.setPushRuleEnabled=function(e,t,n,r,i){const o=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId/enabled",{$kind:t,$ruleId:n});return this._http.authedRequest(i,"PUT",o,void 0,{enabled:r})},d.prototype.setPushRuleActions=function(e,t,n,r,i){const o=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId/actions",{$kind:t,$ruleId:n});return this._http.authedRequest(i,"PUT",o,void 0,{actions:r})},d.prototype.search=function(e,t){const n={};return e.next_batch&&(n.next_batch=e.next_batch),this._http.authedRequest(t,"POST","/search",n,e.body)},d.prototype.uploadKeysRequest=function(e,t,n){return this._http.authedRequest(n,"POST","/keys/upload",void 0,e)},d.prototype.uploadKeySignatures=function(e){return this._http.authedRequest(void 0,"POST","/keys/signatures/upload",void 0,e,{prefix:l.PREFIX_UNSTABLE})},d.prototype.downloadKeysForUsers=function(e,t){if(c.isFunction(t))throw new Error("downloadKeysForUsers no longer accepts a callback parameter");t=t||{};const n={device_keys:{}};return"token"in t&&(n.token=t.token),e.forEach(e=>{n.device_keys[e]=[]}),this._http.authedRequest(void 0,"POST","/keys/query",void 0,n)},d.prototype.claimOneTimeKeys=function(e,t,n){const r={};void 0===t&&(t="signed_curve25519");for(let a=0;a{const t=e[0].toLowerCase(),i=e[1].toLowerCase(),a=n.sha256(`${t} ${i} ${r["pepper"]}`).replace(/\+/g,"-").replace(/\//g,"_");return o[a]=e[0],a}),r["algorithm"]="sha256"}else{if(!i["algorithms"].includes("none"))throw new Error("Unsupported identity server: unknown hash algorithm");r["addresses"]=t.map(e=>{const t=e[0].toLowerCase(),n=e[1].toLowerCase(),r=`${t} ${n}`;return o[r]=e[0],r}),r["algorithm"]="none"}const a=yield this._http.idServerRequest(void 0,"POST","/lookup",r,l.PREFIX_IDENTITY_V2,n);if(!a||!a["mappings"])return[];const s=[];for(const e of Object.keys(a["mappings"])){const t=a["mappings"][e],n=o[e];if(!n)throw new Error("Identity server returned more results than expected");s.push({address:n,mxid:t})}return s}));return function(e,n){return t.apply(this,arguments)}}(),d.prototype.lookupThreePid=function(){var e=r((function*(e,t,n,r){const i=yield this.identityHashedLookup([[t,e]],r),o=i.find(e=>e.address===t);if(!o)return n&&n(null,{}),{};const a={address:t,medium:e,mxid:o.mxid};return n&&n(null,a),a}));return function(t,n,r,i){return e.apply(this,arguments)}}(),d.prototype.bulkLookupThreePids=function(){var e=r((function*(e,t){const n=yield this.identityHashedLookup(e.map(e=>[e[1],e[0]]),t),r=[];for(const i of n){const t=e.find(e=>e[1]===i.address);if(!t)throw new Error("Identity sever returned unexpected results");r.push([t[0],i.address,i.mxid])}return{threepids:r}}));return function(t,n){return e.apply(this,arguments)}}(),d.prototype.getIdentityAccount=function(e){return this._http.idServerRequest(void 0,"GET","/account",void 0,l.PREFIX_IDENTITY_V2,e)},d.prototype.sendToDevice=function(e,t,n){const r=c.encodeUri("/sendToDevice/$eventType/$txnId",{$eventType:e,$txnId:n||this.makeTxnId()}),i={messages:t},o=Object.keys(t).reduce((e,n)=>(e[n]=Object.keys(t[n]),e),{});return a.logger.log("PUT "+r,o),this._http.authedRequest(void 0,"PUT",r,void 0,i)},d.prototype.getThirdpartyProtocols=function(){return this._http.authedRequest(void 0,"GET","/thirdparty/protocols",void 0,void 0).then(e=>{if(!e||"object"!==typeof e)throw new Error("/thirdparty/protocols did not return an object: "+e);return e})},d.prototype.getThirdpartyLocation=function(e,t){const n=c.encodeUri("/thirdparty/location/$protocol",{$protocol:e});return this._http.authedRequest(void 0,"GET",n,t,void 0)},d.prototype.getThirdpartyUser=function(e,t){const n=c.encodeUri("/thirdparty/user/$protocol",{$protocol:e});return this._http.authedRequest(void 0,"GET",n,t,void 0)},d.prototype.getTerms=function(e,t){const n=u(e,t);return this._http.requestOtherUrl(void 0,"GET",n)},d.prototype.agreeToTerms=function(e,t,n,r){const i=u(e,t),o={Authorization:"Bearer "+n};return this._http.requestOtherUrl(void 0,"POST",i,null,{user_accepts:r},{headers:o})},d.prototype.reportEvent=function(e,t,n,r){const i=c.encodeUri("/rooms/$roomId/report/$eventId",{$roomId:e,$eventId:t});return this._http.authedRequest(void 0,"POST",i,null,{score:n,reason:r})},d.prototype.getSpaceSummary=function(e,t,n,r,i,o){const a=c.encodeUri("/rooms/$roomId/spaces",{$roomId:e});return this._http.authedRequest(void 0,"POST",a,null,{max_rooms_per_space:t,suggested_only:n,auto_join_only:r,limit:i,batch:o},{prefix:"/_matrix/client/unstable/org.matrix.msc2946"})}}).call(this,n("c8ba"))},d15f:function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.Group=a;var i=r(n("3987")),o=n("faa1");function a(e){this.groupId=e,this.name=null,this.avatarUrl=null,this.myMembership=null,this.inviter=null}i.inherits(a,o.EventEmitter),a.prototype.setProfile=function(e,t){this.name===e&&this.avatarUrl===t||(this.name=e||this.groupId,this.avatarUrl=t,this.emit("Group.profile",this))},a.prototype.setMyMembership=function(e){this.myMembership!==e&&(this.myMembership=e,this.emit("Group.myMembership",this))},a.prototype.setInviter=function(e){this.inviter=e}},d164:function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e}},d1e7:function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);t.f=o?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},d233:function(t,n,r){"use strict";var i=r("b313"),o=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e){while(e.length>1){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],i=0;i=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===i.RFC1738&&(40===u||41===u)?c+=a.charAt(l):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},p=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r{},watch:{},computed:Object(o["c"])({auth:e=>e.auth}),methods:{}},l=c,u=n("2877");function d(e){var t=n("d5de");t.__inject__&&t.__inject__(e)}var f=Object(u["a"])(l,a,s,!1,d,"756bd822",null,!0),h=f.exports,p=n("42cd"),m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"contactActions"}},[n("div",{staticClass:"actions"},[e.tetatetid?n("div",{staticClass:"actionWrapper"},[e.blocked?e._e():n("router-link",{attrs:{to:"chat?id="+e.tetatetid+"&u="+e.contact.id}},[0!==e.readyChat.length?n("button",{staticClass:"button bright rounded small"},[e._v(e._s(e.$t("caption.moveToChat"))+" "),n("i",{staticClass:"far fa-comment-alt"})]):n("button",{staticClass:"button bright rounded small"},[e._v(e._s(e.$t("button.starChatButton"))),n("i",{staticClass:"far fa-comment-alt"})])])],1):e._e(),e.blocked?n("button",{staticClass:"unBlockButton",on:{click:function(t){return e.unblock()}}},[e._v(e._s(e.$t("button.unblock")))]):n("button",{staticClass:"blockButton",on:{click:function(t){return e.blockUser()}}},[e._v(e._s(e.$t("button.blockUser")))])])])},v=[],g={name:"contactActions",props:{contact:Object,blocked:Boolean},data:function(){return{loading:!1}},created:()=>{},watch:{},computed:Object(o["c"])({auth:e=>e.auth,tetatetid:function(){return this.core.mtrx.kit.tetatetid(this.contact,this.core.user.userinfo)},readyChat:function(){var e=this.$store.state.chats,t=this.tetatetid;return _.filter(e,e=>e.info.title.replace(/#/,"")===t)}}),methods:{chat:function(){this.core.mtrx.kit.tetatetid(this.contact,this.core.user.userinfo)},blockUser(){this.core.mtrx.blockUser(this.contact.id).catch(e=>{console.error(e)})},unblock(){this.core.mtrx.unblockUser(this.contact.id).catch(e=>{console.error(e)})}}},y=g;function b(e){var t=n("9205");t.__inject__&&t.__inject__(e)}var w=Object(u["a"])(y,m,v,!1,b,"6fd14ec6",null,!0),x=w.exports,k={name:"contact",props:{contact:Object},components:{contactView:h,contactActions:x,userView:p["a"]},data:function(){return{loading:!1}},created:()=>{},watch:{},mounted(){this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"contact"})},destroyed(){this.$store.commit("blockactive",{value:!1,item:"contact"})},computed:Object(o["c"])({auth:e=>e.auth,activeuser:function(){return this.core.user.userinfo},blocked:function(){if(0!==this.$store.state.chats.length)return this.core.mtrx.blockeduser(this.contact.id)},pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active}),methods:{}},S=k;function E(e){var t=n("81bf");t.__inject__&&t.__inject__(e)}var C=Object(u["a"])(S,r,i,!1,E,"7650772c",null,!0);t["default"]=C.exports},d485:function(e,t,n){e.exports=o;var r=n("faa1").EventEmitter,i=n("3fb5");function o(){r.call(this)}i(o,r),o.Readable=n("0ac3"),o.Writable=n("af7e"),o.Duplex=n("7c16"),o.Transform=n("89fd"),o.PassThrough=n("51a2"),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"===typeof e.destroy&&e.destroy())}function l(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",c),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("error",l),e.on("error",l),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e}},d5de:function(e,t,n){"use strict";n.r(t);var r=n("704f");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},d613:function(e,t,n){"use strict";let r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RoomType=t.RoomCreateTypeField=t.MsgType=t.EventType=void 0,t.EventType=r,function(e){e["RoomCanonicalAlias"]="m.room.canonical_alias",e["RoomCreate"]="m.room.create",e["RoomJoinRules"]="m.room.join_rules",e["RoomMember"]="m.room.member",e["RoomThirdPartyInvite"]="m.room.third_party_invite",e["RoomPowerLevels"]="m.room.power_levels",e["RoomName"]="m.room.name",e["RoomTopic"]="m.room.topic",e["RoomAvatar"]="m.room.avatar",e["RoomPinnedEvents"]="m.room.pinned_events",e["RoomEncryption"]="m.room.encryption",e["RoomHistoryVisibility"]="m.room.history_visibility",e["RoomGuestAccess"]="m.room.guest_access",e["RoomServerAcl"]="m.room.server_acl",e["RoomTombstone"]="m.room.tombstone",e["RoomAliases"]="m.room.aliases",e["SpaceChild"]="org.matrix.msc1772.space.child",e["SpaceParent"]="org.matrix.msc1772.space.parent",e["RoomRedaction"]="m.room.redaction",e["RoomMessage"]="m.room.message",e["RoomMessageEncrypted"]="m.room.encrypted",e["Sticker"]="m.sticker",e["CallInvite"]="m.call.invite",e["CallCandidates"]="m.call.candidates",e["CallAnswer"]="m.call.answer",e["CallHangup"]="m.call.hangup",e["CallReject"]="m.call.reject",e["CallSelectAnswer"]="m.call.select_answer",e["CallNegotiate"]="m.call.negotiate",e["CallReplaces"]="m.call.replaces",e["KeyVerificationRequest"]="m.key.verification.request",e["KeyVerificationStart"]="m.key.verification.start",e["KeyVerificationCancel"]="m.key.verification.cancel",e["KeyVerificationMac"]="m.key.verification.mac",e["KeyVerificationDone"]="m.key.verification.done",e["RoomMessageFeedback"]="m.room.message.feedback",e["Typing"]="m.typing",e["Receipt"]="m.receipt",e["Presence"]="m.presence",e["FullyRead"]="m.fully_read",e["Tag"]="m.tag",e["PushRules"]="m.push_rules",e["Direct"]="m.direct",e["IgnoredUserList"]="m.ignored_user_list",e["RoomKey"]="m.room_key",e["RoomKeyRequest"]="m.room_key_request",e["ForwardedRoomKey"]="m.forwarded_room_key",e["Dummy"]="m.dummy"}(r||(t.EventType=r={})),t.MsgType=i,function(e){e["Text"]="m.text",e["Emote"]="m.emote",e["Notice"]="m.notice",e["Image"]="m.image",e["File"]="m.file",e["Audio"]="m.audio",e["Location"]="m.location",e["Video"]="m.video"}(i||(t.MsgType=i={}));const o="org.matrix.msc1772.type";let a;t.RoomCreateTypeField=o,t.RoomType=a,function(e){e["Space"]="org.matrix.msc1772.space"}(a||(t.RoomType=a={}))},d6cc:function(e,t,n){"use strict";n.r(t);var r=n("0c96");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},d6dd:function(e,t,n){"use strict";var r=n("966d"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var o=Object.create(n("3a7c"));o.inherits=n("3fb5");var a=n("6f2e"),s=n("6ffa");o.inherits(d,a);for(var c=i(s.prototype),l=0;lt==e);return t?i(t):e}},d924:function(e,t,n){var r=n("7ffb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2d7346b2",r,e)}},d925:function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},d97d:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".new[data-v-9218004e]{color:rgb(var(--color-good))}",""]),e.exports=t},d9b5:function(e,t,n){var r=n("d066"),i=n("1626"),o=n("3a9b"),a=n("fdbf"),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,s(e))}},d9e2:function(e,t,n){var r=n("23e7"),i=n("da84"),o=n("2ba4"),a=n("e5cb"),s="WebAssembly",c=i[s],l=7!==Error("e",{cause:7}).cause,u=function(e,t){var n={};n[e]=a(e,t,l),r({global:!0,constructor:!0,arity:1,forced:l},n)},d=function(e,t){if(c&&c[e]){var n={};n[e]=a(s+"."+e,t,l),r({target:s,stat:!0,constructor:!0,arity:1,forced:l},n)}};u("Error",(function(e){return function(t){return o(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),u("URIError",(function(e){return function(t){return o(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},da84:function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},da9d:function(e,t,n){"use strict";n("d9e2"),Object.defineProperty(t,"__esModule",{value:!0}),t.TimelineWindow=c,t.TimelineIndex=l;var r=n("e685"),i=n("63c7");const o=!1,a=o?i.logger.log.bind(i.logger):function(){},s=5;function c(e,t,n){n=n||{},this._client=e,this._timelineSet=t,this._start=null,this._end=null,this._eventCount=0,this._windowLimit=n.windowLimit||1e3}function l(e,t){this.timeline=e,this.index=t}c.prototype.load=function(e,t){const n=this;t=t||20;const r=function(r){let i;const o=r.getEvents();if(e){for(let t=0;t0&&this.unpaginate(t,e!=r.EventTimeline.BACKWARDS),!0}return!1},c.prototype.canPaginate=function(e){const t=this.getTimelineIndex(e);if(!t)return a("TimelineWindow: no timeline yet"),!1;if(e==r.EventTimeline.BACKWARDS){if(t.index>t.minIndex())return!0}else if(t.indexthis._eventCount||e<0)throw new Error("Attemting to unpaginate "+e+" events, but only have "+this._eventCount+" in the timeline");while(e>0){const r=t?n.advance(e):n.retreat(e);if(r<=0)throw new Error("Unable to unpaginate any further, but still have "+this._eventCount+" events");e-=r,this._eventCount-=r,a("TimelineWindow.unpaginate: dropped "+r+" (now "+this._eventCount+")")}},c.prototype.getEvents=function(){if(!this._start)return[];const e=[];let t=this._start.timeline;while(1){const n=t.getEvents();let i=0,o=n.length;t===this._start.timeline&&(i=this._start.index+t.getBaseIndex()),t===this._end.timeline&&(o=this._end.index+t.getBaseIndex());for(let t=i;t0)return this.index+=t,t;const n=this.timeline.getNeighbouringTimeline(e<0?r.EventTimeline.BACKWARDS:r.EventTimeline.FORWARDS);return n?(this.timeline=n,this.index=e<0?this.maxIndex():this.minIndex(),a("paginate: switched to new neighbour"),this.advance(e)):0},l.prototype.retreat=function(e){return-1*this.advance(-1*e)}},daf5:function(e,t,n){"use strict";var r=n("a593"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},dbce:function(e,t,n){var r=n("7037")["default"];function i(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=a?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=e[s]}return o["default"]=e,n&&n.set(e,o),o}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},dc14:function(e,t,n){"use strict";(function(t,r){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){V(t,e)}}var o;e.exports=R,R.WritableState=I;var a={deprecate:n("b7d1")},s=n("429b"),c=n("b639").Buffer,l=t.Uint8Array||function(){};function u(e){return c.from(e)}function d(e){return c.isBuffer(e)||e instanceof l}var f,h=n("4681"),p=n("0db6"),m=p.getHighWaterMark,v=n("c9b8").codes,g=v.ERR_INVALID_ARG_TYPE,y=v.ERR_METHOD_NOT_IMPLEMENTED,b=v.ERR_MULTIPLE_CALLBACK,w=v.ERR_STREAM_CANNOT_PIPE,x=v.ERR_STREAM_DESTROYED,k=v.ERR_STREAM_NULL_VALUES,S=v.ERR_STREAM_WRITE_AFTER_END,E=v.ERR_UNKNOWN_ENCODING,C=h.errorOrDestroy;function T(){}function I(e,t,r){o=o||n("b19a"),e=e||{},"boolean"!==typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=m(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function R(e){o=o||n("b19a");var t=this instanceof o;if(!t&&!f.call(R,this))return new R(e);this._writableState=new I(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),s.call(this)}function O(e,t){var n=new S;C(e,n),r.nextTick(t,n)}function M(e,t,n,i){var o;return null===n?o=new k:"string"===typeof n||t.objectMode||(o=new g("chunk",["string","Buffer"],n)),!o||(C(e,o),r.nextTick(i,o),!1)}function A(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=c.from(t,n)),t}function P(e,t,n,r,i,o){if(!n){var a=A(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,n){n(new y("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,n){var r=this._writableState;return"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||K(this,r,n),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=h.destroy,R.prototype._undestroy=h.undestroy,R.prototype._destroy=function(e,t){t(e)}}).call(this,n("c8ba"),n("4362"))},dc31:function(e,t,n){"use strict";var r=n("a593"),i=n("651d"),o=n("d35c"),a=n("8b5c");function s(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var c=s(a);c.Axios=o,c.create=function(e){return s(r.merge(a,e))},c.Cancel=n("480d"),c.CancelToken=n("827e"),c.isCancel=n("0a3f"),c.all=function(e){return Promise.all(e)},c.spread=n("8ec6"),e.exports=c,e.exports.default=c},dc4a:function(e,t,n){var r=n("59ed");e.exports=function(e,t){var n=e[t];return null==n?void 0:r(n)}},dcd0:function(e,t,n){"use strict";e.exports=a;var r=n("d6dd"),i=Object.create(n("3a7c"));function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{this._resolveFunc=e,this._rejectFunc=t;const n=this._data&&this._data.flows;if(n)this._startNextAuthStage();else{this._busyChangedCallback&&this._busyChangedCallback(!0);let e=null;this._data.session&&(e={session:this._data.session}),this._doRequest(e).finally(()=>{this._busyChangedCallback&&this._busyChangedCallback(!1)})}})},poll:function(){var e=i((function*(){if(!this._data.session)return;if(!this._resolveFunc)return;if(this._submitPromise)return;let e={};if(this._currentStage==u&&this._emailSid){const t={sid:this._emailSid,client_secret:this._clientSecret};if(yield this._matrixClient.doesServerRequireIdServerParam()){const e=s.default.parse(this._matrixClient.getIdentityServerUrl());t.id_server=e.host}e={type:u,threepid_creds:t,threepidCreds:t}}this.submitAuthDict(e,!0)}));return function(){return e.apply(this,arguments)}}(),getSessionId:function(){return this._data?this._data.session:void 0},getClientSecret:function(){return this._clientSecret},getStageParams:function(e){let t={};return this._data&&this._data.params&&(t=this._data.params),t[e]},getChosenFlow(){return this._chosenFlow},submitAuthDict:function(){var t=i((function*(t,n){if(!this._resolveFunc)throw new Error("submitAuthDict() called before attemptAuth()");!n&&this._busyChangedCallback&&this._busyChangedCallback(!0);while(this._submitPromise)try{yield this._submitPromise}catch(e){}let r;this._data.session?(r={session:this._data.session},c.extend(r,t)):r=t;try{this._submitPromise=this._doRequest(r,n),yield this._submitPromise}finally{this._submitPromise=null,!n&&this._busyChangedCallback&&this._busyChangedCallback(!1)}}));return function(e,n){return t.apply(this,arguments)}}(),getEmailSid:function(){return this._emailSid},setEmailSid:function(e){this._emailSid=e},_doRequest:function(){var t=i((function*(t,n){try{const e=yield this._requestCallback(t,n);this._resolveFunc(e),this._resolveFunc=null,this._rejectFunc=null}catch(r){const t=r.data?r.data.flows:null,i=this._data.flows||Boolean(t);401===r.httpStatus&&r.data&&i||(n?l.logger.log("Background poll request failed doing UI auth: ignoring",r):this._rejectFunc(r)),r.data.flows||r.data.completed||r.data.session||(r.data.flows=this._data.flows,r.data.completed=this._data.completed,r.data.session=this._data.session),this._data=r.data;try{this._startNextAuthStage()}catch(e){this._rejectFunc(e),this._resolveFunc=null,this._rejectFunc=null}if(!this._emailSid&&!this._requestingEmailToken&&this._chosenFlow.stages.includes("m.login.email.identity")){this._requestingEmailToken=!0;try{const e=yield this._requestEmailTokenCallback(this._inputs.emailAddress,this._clientSecret,1,this._data.session);this._emailSid=e.sid}catch(e){this._rejectFunc(e),this._resolveFunc=null,this._rejectFunc=null}finally{this._requestingEmailToken=!1}}}}));return function(e,n){return t.apply(this,arguments)}}(),_startNextAuthStage:function(){const e=this._chooseStage();if(!e)throw new Error("No incomplete flows from the server");if(this._currentStage=e,"m.login.dummy"===e)return void this.submitAuthDict({type:"m.login.dummy"});if(this._data&&this._data.errcode||this._data.error)return void this._stateUpdatedCallback(e,{errcode:this._data.errcode||"",error:this._data.error||""});const t={};e==u&&(t.emailSid=this._emailSid),this._stateUpdatedCallback(e,t)},_chooseStage:function(){null===this._chosenFlow&&(this._chosenFlow=this._chooseFlow()),l.logger.log("Active flow => %s",JSON.stringify(this._chosenFlow));const e=this._firstUncompletedStage(this._chosenFlow);return l.logger.log("Next stage: %s",e),e},_chooseFlow:function(){const e=this._data.flows||[],t=Boolean(this._inputs.emailAddress)||Boolean(this._emailSid),n=Boolean(this._inputs.phoneCountry)&&Boolean(this._inputs.phoneNumber);for(const i of e){let e=!1,r=!1;for(const t of i.stages)t===u?e=!0:t==d&&(r=!0);if(e==t&&r==n)return i}const r=new Error("No appropriate authentication flow found");throw r.name="NoAuthFlowFoundError",r.required_stages=[],t&&r.required_stages.push(u),n&&r.required_stages.push(d),r.available_flows=e,r},_firstUncompletedStage:function(e){const t=(this._data||{}).completed||[];for(let n=0;n=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e){"string"!==typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!r;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,r="/"===a.charAt(0))}return t=n(i(t.split("/"),(function(e){return!!e})),!r).join("/"),(r?"/":"")+t||"."},t.normalize=function(e){var r=t.isAbsolute(e),a="/"===o(e,-1);return e=n(i(e.split("/"),(function(e){return!!e})),!r).join("/"),e||r||(e="."),e&&a&&(e+="/"),(r?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0;n--)if(""!==e[n])break;return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,c=0;c=1;--o)if(t=e.charCodeAt(o),47===t){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=r(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=a+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n("4362"))},e07b:function(e,t,n){var r=n("5a76"),i=n("b5ca"),o=n("69f2"),a=n("8707").Buffer,s=n("7d2a"),c=n("9f9d"),l=n("8be6"),u=a.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,n){var r=h(e),i="sha512"===e||"sha384"===e?128:64;t.length>i?t=r(t):t.lengthe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}var v={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}}};function g(){return this.items.length&&"object"!==l(this.items[0])}var y=!1;if("undefined"!==typeof window){y=!1;try{var b=Object.defineProperty({},"passive",{get:function(){y=!0}});window.addEventListener("test",null,b)}catch(e){}}var _=0,w={name:"RecycleScroller",components:{ResizeObserver:i["a"]},directives:{ObserveVisibility:o["a"]},props:f({},v,{itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1}}),data:function(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes:function(){if(null===this.itemSize){for(var e,t={"-1":{accumulator:0}},n=this.items,r=this.sizeField,i=this.minItemSize,o=1e4,a=0,s=0,c=n.length;s1&&void 0!==arguments[1]&&arguments[1],n=this.$_unusedViews,r=e.nr.type,i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999,this.$_views.delete(e.nr.key))},handleResize:function(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll:function(e){var t=this;this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((function(){t.$_scrollDirty=!1;var e=t.updateVisibleItems(!1,!0),n=e.continuous;n||(clearTimeout(t.$_refreshTimout),t.$_refreshTimout=setTimeout(t.handleScroll,100))})))},handleVisibilityChange:function(e,t){var n=this;this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame((function(){n.updateVisibleItems(!1)}))):this.$emit("hidden"))},updateVisibleItems:function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.itemSize,s=this.$_computedMinItemSize,l=this.typeField,u=this.simpleArray?null:this.keyField,d=this.items,f=d.length,h=this.sizes,p=this.$_views,m=this.$_unusedViews,v=this.pool;if(f)if(this.$_prerender)t=0,n=this.prerender,r=null;else{var g=this.getScroll();if(o){var y=g.start-this.$_lastUpdateScrollPosition;if(y<0&&(y=-y),null===a&&yg.start&&(k=S),S=~~((x+k)/2)}while(S!==w);for(S<0&&(S=0),t=S,r=h[f-1].accumulator,n=S;nf&&(n=f))}else t=~~(g.start/a),n=Math.ceil(g.end/a),t<0&&(t=0),n>f&&(n=f),r=f*a}else t=n=r=0;n-t>c.itemsLimit&&this.itemsLimitError(),this.totalSize=r;var E=t<=this.$_endIndex&&n>=this.$_startIndex;if(this.$_continuous!==E){if(E){p.clear(),m.clear();for(var C=0,T=v.length;C=n)&&this.unuseView(i));for(var O,M,A,P,j=E?null:new Map,D=t;D=A.length)&&(i=this.addView(v,D,O,L,M),this.unuseView(i,!0),A=m.get(M)),i=A[P],i.item=O,i.nr.used=!0,i.nr.index=D,i.nr.key=L,i.nr.type=M,j.set(M,P+1),P++),p.set(L,i)),i.position=null===a?h[D-1].accumulator:D*a):i&&this.unuseView(i)}return this.$_startIndex=t,this.$_endIndex=n,this.emitUpdate&&this.$emit("update",t,n),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,300),{continuous:E}},getListenerTarget:function(){var e=s()(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll:function(){var e,t=this.$el,n=this.direction,r="vertical"===n;if(this.pageMode){var i=t.getBoundingClientRect(),o=r?i.height:i.width,a=-(r?i.top:i.left),s=r?window.innerHeight:window.innerWidth;a<0&&(s+=a,a=0),a+s>o&&(s=o-a),e={start:a,end:a+s}}else e=r?{start:t.scrollTop,end:t.scrollTop+t.clientHeight}:{start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return e},applyPageMode:function(){this.pageMode?this.addListeners():this.removeListeners()},addListeners:function(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!y&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners:function(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem:function(e){var t;t=null===this.itemSize?e>0?this.sizes[e-1].accumulator:0:e*this.itemSize,this.scrollToPosition(t)},scrollToPosition:function(e){"vertical"===this.direction?this.$el.scrollTop=e:this.$el.scrollLeft=e},itemsLimitError:function(){var e=this;throw setTimeout((function(){console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",e.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")})),new Error("Rendered items limit reached")},sortViews:function(){this.pool.sort((function(e,t){return e.nr.index-t.nr.index}))}}};function x(e,t,n,r,i,o,a,s,c,l){"boolean"!==typeof a&&(c=s,s=a,a=!1);const u="function"===typeof n?n.options:n;let d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=d):t&&(d=a?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),d)if(u.functional){const e=u.render;u.render=function(t,n){return d.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,d):[d]}return n}const k=w;var S=function(){var e,t,n=this,r=n.$createElement,i=n._self._c||r;return i("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:n.handleVisibilityChange,expression:"handleVisibilityChange"}],staticClass:"vue-recycle-scroller",class:(e={ready:n.ready,"page-mode":n.pageMode},e["direction-"+n.direction]=!0,e),on:{"&scroll":function(e){return n.handleScroll(e)}}},[n.$slots.before?i("div",{staticClass:"vue-recycle-scroller__slot"},[n._t("before")],2):n._e(),n._v(" "),i("div",{ref:"wrapper",staticClass:"vue-recycle-scroller__item-wrapper",style:(t={},t["vertical"===n.direction?"minHeight":"minWidth"]=n.totalSize+"px",t)},n._l(n.pool,(function(e){return i("div",{key:e.nr.id,staticClass:"vue-recycle-scroller__item-view",class:{hover:n.hoverKey===e.nr.key},style:n.ready?{transform:"translate"+("vertical"===n.direction?"Y":"X")+"("+e.position+"px)"}:null,on:{mouseenter:function(t){n.hoverKey=e.nr.key},mouseleave:function(e){n.hoverKey=null}}},[n._t("default",null,{item:e.item,index:e.nr.index,active:e.nr.used})],2)})),0),n._v(" "),n.$slots.after?i("div",{staticClass:"vue-recycle-scroller__slot"},[n._t("after")],2):n._e(),n._v(" "),i("ResizeObserver",{on:{notify:n.handleResize}})],1)},E=[];S._withStripped=!0;const C=void 0,T=void 0,I=void 0,R=!1,O=x({render:S,staticRenderFns:E},C,k,T,R,I,!1,void 0,void 0,void 0);var M={name:"DynamicScroller",components:{RecycleScroller:O},inheritAttrs:!1,provide:function(){return"undefined"!==typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((function(e){var t,n=m(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.target){var i=new CustomEvent("resize",{detail:{contentRect:r.contentRect}});r.target.dispatchEvent(i)}}}catch(o){n.e(o)}finally{n.f()}}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},props:f({},v,{minItemSize:{type:[Number,String],required:!0}}),data:function(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:g,itemsWithSize:function(){for(var e=[],t=this.items,n=this.keyField,r=this.simpleArray,i=this.vscrollData.sizes,o=0;o0&&void 0!==arguments[0])||arguments[0];(e||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem:function(e){var t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom:function(){var e=this;if(!this.$_scrollingToBottom){this.$_scrollingToBottom=!0;var t=this.$el;this.$nextTick((function(){t.scrollTop=t.scrollHeight+5e3;var n=function n(){t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame((function(){t.scrollTop=t.scrollHeight+5e3,0===e.$_undefinedSizes?e.$_scrollingToBottom=!1:requestAnimationFrame(n)}))};requestAnimationFrame(n)}))}}}};const A=M;var P=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id"},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.item,r=t.index,i=t.active;return[e._t("default",null,null,{item:n.item,index:r,active:i,itemWithSize:n})]}}],null,!0)},"RecycleScroller",e.$attrs,!1),e.listeners),[e._v(" "),n("template",{slot:"before"},[e._t("before")],2),e._v(" "),n("template",{slot:"after"},[e._t("after")],2)],2)},j=[];P._withStripped=!0;const D=void 0,L=void 0,N=void 0,$=!1,U=x({render:P,staticRenderFns:j},D,A,L,$,N,!1,void 0,void 0,void 0);var B={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id:function(){return this.vscrollData.simpleArray?this.index:this.item[this.vscrollData.keyField]},size:function(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0},finalActive:function(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id:function(){this.size||this.onDataUpdate()},finalActive:function(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created:function(){var e=this;if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){var t=function(t){e.$watch((function(){return e.sizeDependencies[t]}),e.onDataUpdate)};for(var n in this.sizeDependencies)t(n);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted:function(){this.vscrollData.active&&(this.updateSize(),this.observeSize())},beforeDestroy:function(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize),this.unobserveSize()},methods:{updateSize:function(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData:function(){var e=this;this.watchData?this.$_watchData=this.$watch("data",(function(){e.onDataUpdate()}),{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate:function(e){var t=e.force;!this.finalActive&&t&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!t&&this.size||this.updateSize()},onDataUpdate:function(){this.updateSize()},computeSize:function(e){var t=this;this.$nextTick((function(){if(t.id===e){var n=t.$el.offsetWidth,r=t.$el.offsetHeight;t.applySize(n,r)}t.$_pendingSizeUpdate=null}))},applySize:function(e,t){var n=Math.round("vertical"===this.vscrollParent.direction?t:e);n&&this.size!==n&&(this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.$set(this.vscrollData.sizes,this.id,n),this.$set(this.vscrollData.validSizes,this.id,!0),this.emitResize&&this.$emit("resize",this.id))},observeSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.observe(this.$el.parentNode),this.$el.parentNode.addEventListener("resize",this.onResize))},unobserveSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.unobserve(this.$el.parentNode),this.$el.parentNode.removeEventListener("resize",this.onResize))},onResize:function(e){var t=e.detail.contentRect,n=t.width,r=t.height;this.applySize(n,r)}},render:function(e){return e(this.tag,this.$slots.default)}};const F=B,z=void 0,q=void 0,W=void 0,K=void 0,V=x({},z,F,q,K,W,!1,void 0,void 0,void 0);function G(e,t){e.component("".concat(t,"recycle-scroller"),O),e.component("".concat(t,"RecycleScroller"),O),e.component("".concat(t,"dynamic-scroller"),U),e.component("".concat(t,"DynamicScroller"),U),e.component("".concat(t,"dynamic-scroller-item"),V),e.component("".concat(t,"DynamicScrollerItem"),V)}var H={version:"1.0.10",install:function(e,t){var n=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(var r in n)"undefined"!==typeof n[r]&&(c[r]=n[r]);n.installComponents&&G(e,n.componentsPrefix)}},Y=null;"undefined"!==typeof window?Y=window.Vue:"undefined"!==typeof t&&(Y=t.Vue),Y&&Y.use(H),n["a"]=H}).call(this,r("c8ba"))},e5cb:function(e,t,n){"use strict";var r=n("d066"),i=n("1a2d"),o=n("9112"),a=n("3a9b"),s=n("d2bb"),c=n("e893"),l=n("aeb0"),u=n("7156"),d=n("e391"),f=n("ab36"),h=n("c770"),p=n("b980"),m=n("83ab"),v=n("c430");e.exports=function(e,t,n,g){var y="stackTraceLimit",b=g?2:1,_=e.split("."),w=_[_.length-1],x=r.apply(null,_);if(x){var k=x.prototype;if(!v&&i(k,"cause")&&delete k.cause,!n)return x;var S=r("Error"),E=t((function(e,t){var n=d(g?t:e,void 0),r=g?new x(e):new x;return void 0!==n&&o(r,"message",n),p&&o(r,"stack",h(r.stack,2)),this&&a(k,this)&&u(r,this,E),arguments.length>b&&f(r,arguments[b]),r}));if(E.prototype=k,"Error"!==w?s?s(E,S):c(E,S,{name:!0}):m&&y in x&&(l(E,x,y),l(E,x,"prepareStackTrace")),c(E,x),!v)try{k.name!==w&&o(k,"name",w),k.constructor=E}catch(C){}return E}}},e683:function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},e685:function(e,t,n){"use strict";n("d9e2"),Object.defineProperty(t,"__esModule",{value:!0}),t.EventTimeline=i;var r=n("420b");function i(e){this._eventTimelineSet=e,this._roomId=e.room?e.room.roomId:null,this._events=[],this._baseIndex=0,this._startState=new r.RoomState(this._roomId),this._startState.paginationToken=null,this._endState=new r.RoomState(this._roomId),this._endState.paginationToken=null,this._prevTimeline=null,this._nextTimeline=null,this._paginationRequests={b:null,f:null},this._name=this._roomId+":"+(new Date).toISOString()}i.BACKWARDS="b",i.FORWARDS="f",i.prototype.initialiseState=function(e){if(this._events.length>0)throw new Error("Cannot initialise state after events are added");for(const t of e)Object.freeze(t);this._startState.setStateEvents(e),this._endState.setStateEvents(e)},i.prototype.forkLive=function(e){const t=this.getState(e),n=new i(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t,this._endState=t.clone(),n},i.prototype.fork=function(e){const t=this.getState(e),n=new i(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t.clone(),n},i.prototype.getRoomId=function(){return this._roomId},i.prototype.getFilter=function(){return this._eventTimelineSet.getFilter()},i.prototype.getTimelineSet=function(){return this._eventTimelineSet},i.prototype.getBaseIndex=function(){return this._baseIndex},i.prototype.getEvents=function(){return this._events},i.prototype.getState=function(e){if(e==i.BACKWARDS)return this._startState;if(e==i.FORWARDS)return this._endState;throw new Error("Invalid direction '"+e+"'")},i.prototype.getPaginationToken=function(e){return this.getState(e).paginationToken},i.prototype.setPaginationToken=function(e,t){this.getState(t).paginationToken=e},i.prototype.getNeighbouringTimeline=function(e){if(e==i.BACKWARDS)return this._prevTimeline;if(e==i.FORWARDS)return this._nextTimeline;throw new Error("Invalid direction '"+e+"'")},i.prototype.setNeighbouringTimeline=function(e,t){if(this.getNeighbouringTimeline(t))throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: "+t+")");if(t==i.BACKWARDS)this._prevTimeline=e;else{if(t!=i.FORWARDS)throw new Error("Invalid direction '"+t+"'");this._nextTimeline=e}this.setPaginationToken(null,t)},i.prototype.addEvent=function(e,t){const n=t?this._startState:this._endState,r=this.getTimelineSet();let o;r.room&&r.room.getUnfilteredTimelineSet()===r&&(i.setEventMetadata(e,n,t),e.isState()&&(n.setStateEvents([e]),e.sender&&("m.room.member"!==e.getType()||t)||i.setEventMetadata(e,n,t))),o=t?0:this._events.length,this._events.splice(o,0,e),t&&this._baseIndex++},i.setEventMetadata=function(e,t,n){e.sender=t.getSentinelMember(e.getSender()),"m.room.member"===e.getType()&&(e.target=t.getSentinelMember(e.getStateKey())),e.isState()&&n&&(e.forwardLooking=!1)},i.prototype.removeEvent=function(e){for(let t=this._events.length-1;t>=0;t--){const n=this._events[t];if(n.getId()==e)return this._events.splice(t,1),t>>24&255]^c[i>>>16&255]^l[a>>>8&255]^u[255&d],h=this._encKey[g+1]^s[i>>>24&255]^c[a>>>16&255]^l[d>>>8&255]^u[255&r],p=this._encKey[g+2]^s[a>>>24&255]^c[d>>>16&255]^l[r>>>8&255]^u[255&i],m=this._encKey[g+3]^s[d>>>24&255]^c[r>>>16&255]^l[i>>>8&255]^u[255&a],g+=4,r=f,i=h,a=p,d=m;return r=o[f>>>24]<<24|o[h>>>16&255]<<16|o[p>>>8&255]<<8|o[255&m],i=o[h>>>24]<<24|o[p>>>16&255]<<16|o[m>>>8&255]<<8|o[255&f],a=o[p>>>24]<<24|o[m>>>16&255]<<16|o[f>>>8&255]<<8|o[255&h],d=o[m>>>24]<<24|o[f>>>16&255]<<16|o[h>>>8&255]<<8|o[255&p],r^=this._encKey[g+0],i^=this._encKey[g+1],a^=this._encKey[g+2],d^=this._encKey[g+3],b(r,n,0),b(i,n,4),b(a,n,8),b(d,n,12),this._emptyPromise}}function g(){const e=283;function t(t,n){let r=t,i=n,o=0;for(let a=1;a<256&&0!==i;a<<=1)0!==(i&a)&&(o^=r,i^=a),r<<=1,0!==(256&r)&&(r^=e);return o}const n=e=>e<<24|e>>>8;s=new Uint32Array(256),c=new Uint32Array(256),l=new Uint32Array(256),u=new Uint32Array(256);for(let r=0;r<256;r++){const e=o[r];let i=t(e,2)<<24|e<<16|e<<8|t(e,3);s[r]=i,i=n(i),c[r]=i,i=n(i),l[r]=i,i=n(i),u[r]=i,i=n(i)}d=new Uint32Array(256),f=new Uint32Array(256),h=new Uint32Array(256),p=new Uint32Array(256);for(let r=0;r<256;r++){const e=a[r];let i=t(e,14)<<24|t(e,9)<<16|t(e,13)<<8|t(e,11);d[r]=i,i=n(i),f[r]=i,i=n(i),h[r]=i,i=n(i),p[r]=i,i=n(i)}m=!0}function y(e,t=0){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function b(e,t=new Uint8Array(4),n=0){return t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function _(e){return o[e>>>24&255]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[255&e]}function w(e){return e<<8|e>>>24}function x(e){const t=new Uint32Array(e.length+28),n=e.length/4|0,r=t.length;for(let i=0;i6&&o%n===4&&(e=_(e)),t[o]=t[o-n]^e}return t}t.default=v},e7f6:function(t,n,r){"use strict";(function(t){var i=r("ade3"),o=r("4f5a"),a=r("3139");class s extends o["a"]{constructor(){super(...arguments),Object(i["a"])(this,"matrixCredentials",(function(){var e=bitcoin.crypto.sha256(bitcoin.crypto.sha256(t.from(this.credentials.privateKey))).toString("hex");return Promise.resolve({address:this.credentials.address,password:e,type:"m.login.password",user:this.credentials.address,sessionId:"",username:this.credentials.address.toLowerCase()})})),Object(i["a"])(this,"path33",(function(e){return"m/33'/0'/0'/"+e+"'"}))}initKeysProcess(){return this.initKeys().catch(e=>e&&_.isNumber(e)?new Promise((t,n)=>{this.keysupdatetimeout&&clearTimeout(this.keysupdatetimeout),this.keysupdatetimeout=setTimeout((function(){initKeysProcess().then(t).catch(n)}),e)}):Promise.reject(e))}initKeys(){return this.state?!this.userinfo.name||this.userinfo.deleted||this.userinfo.keys&&this.userinfo.keys.length?Promise.resolve():(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform.sdk.keys.init().then(e=>"exist"==e||"processing"==e?Promise.reject(6e4):Promise.reject(e)).catch(e=>Promise.reject()),Promise.reject()):Promise.reject()}generateKeysLS(t,n){var r={};try{r=JSON.parse(localStorage["wifkeya"]||"{}")}catch(e){}r.address!=n&&(r={}),r.address=n,r.storage||(r.storage=[]);var{ckeys:i}=this.generateKeys(t,r.storage);return localStorage["wifkeya"]=JSON.stringify(r),i}generateKeys(e,t){var n=[];if(t||(t=[]),e)for(var r=1;r<13;r++){var i=t[r-1]||bitcoin.bip32.fromSeed(e).derivePath(this.path33(r)).toWIF();t[r-1]=i;var o=bitcoin.ECPair.fromWIF(i);n.push({pair:o,public:o.publicKey.toString("hex"),private:o.privateKey})}return{ckeys:n,storage:t}}generateprivate(){}checkCredentials(){if(!this.credentials)return Promise.reject("unauthorized");var n=a["a"].hexDecode(this.credentials.address);try{var r=t.from(this.credentials.privateKey,"hex");setTimeout(()=>{this.private=this.generateKeysLS(r,n)},1e3)}catch(e){return this.state=0,Promise.reject("unauthorized")}return this.core.api.pocketnet.userStateMe(n).then(e=>(this.state=1,Promise.resolve(this.state))).catch(e=>Promise.reject("unknown"))}convertUser(e){return{image:e.i||"",name:e.name?decodeURI(e.name):"",id:a["a"].hexEncode(e.address),source:e,keys:_.filter((e.k||"").split(","),(function(e){return e})),deleted:e.deleted,nocache:e.nocache||!1}}searchContacts(e){this.core;return this.core.api.pocketnet.search(e).then(e=>(e=_.map(e,e=>(e.nocache=!0,this.convertUser(e))),this.setUsersInfo(e),Promise.resolve(e)))}userInfo(e){return this.usersInfo(this.credentials.address,!1,e).then(e=>(this.userinfo=e[0],Promise.resolve(e[0])))}usersInfo(e,t,n){return _.isArray(e)||(e=[e]),t||(e=_.map(e,(function(e){return a["a"].hexDecode(e)}))),this.core.api.pocketnet.userInfoCached(e,n).then(e=>(e=_.map(e,e=>this.convertUser(e)),this.setUsersInfo(e,n),Promise.resolve(e)))}signature(n,r){n||(n="pocketnetproxy"),r||(r=360);try{var i=bitcoin.ECPair.fromPrivateKey(t.from(this.credentials.privateKey,"hex"));const e=(new Date).toISOString();var o="date="+e+",exp="+r+",s="+a["a"].hexEncode(n),s=i.sign(bitcoin.crypto.sha256(t.from(o))),c={nonce:o,signature:s.toString("hex"),pubkey:i.publicKey.toString("hex"),address:this.credentials.address,v:1}}catch(e){return null}return c}getContacts(){return this.state?Promise.resolve([]):Promise.reject("unauthorized")}}n["a"]=s}).call(this,r("b639").Buffer)},e86a:function(e,t,n){"use strict";n.r(t);var r=n("6a45");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},e893:function(e,t,n){var r=n("1a2d"),i=n("56ef"),o=n("06cf"),a=n("9bf2");e.exports=function(e,t,n){for(var s=i(t),c=a.f,l=o.f,u=0;u1?n("div",{staticClass:"aboutRoomAvatar"},[e.userinfo.length<5?n("div",{staticClass:"small"},[n("div",{staticClass:"userinfopicwrapper",class:{twoAvatars:2===e.userinfo.length,threeAvatars:3===e.userinfo.length,fourAvatars:4===e.userinfo.length}},e._l(e.userinfo,(function(t,r){return n("div",{staticClass:"userwrapper"},[n("userpic",{attrs:{status:e.status[t.id],userinfo:t}})],1)})),0)]):n("div",{staticClass:"swiperWrapper"},[n("div",{staticClass:"swiperWrapperFlex noswipepnt"},e._l(e.userinfo,(function(t,r){return n("div",{staticClass:"imageSwiper"},[n("userpic",{attrs:{status:e.status[t.id],userinfo:t}})],1)})),0)])]):e._e()},i=[],o={props:{userinfo:Array,slidesPerView:Number,status:{type:Object,default:{}}},data:function(){return{}}},a=o,s=n("2877");function c(e){var t=n("1570");t.__inject__&&t.__inject__(e)}var l=Object(s["a"])(a,r,i,!1,c,"71d5e826",null,!0);t["a"]=l.exports},ed03:function(t,n,r){"use strict";(function(t){var i=r("c973").default;r("d9e2");var o=r("dbce");Object.defineProperty(n,"__esModule",{value:!0}),n.IndexedDBStore=m;var a=r("696c"),s=o(r("3987")),c=r("faa1"),l=r("9e54"),u=r("0b9e"),d=r("87d6"),f=r("a120"),h=r("63c7");const p=3e5;function m(e){if(a.MemoryStore.call(this,e),!e.indexedDB)throw new Error("Missing required option: indexedDB");if(e.workerScript){let n=e.workerApi;n||(n=t.Worker),this.backend=new u.RemoteIndexedDBStoreBackend(e.workerScript,e.dbName,n)}else this.backend=new l.LocalIndexedDBStoreBackend(e.indexedDB,e.dbName);this.startedUp=!1,this._syncTs=0,this._userModifiedMap={}}function v(t,n){return i((function*(){for(var r=arguments.length,i=new Array(r),o=0;o(h.logger.log("IndexedDBStore.startup: loading presence events"),this.backend.getUserPresenceEvents())).then(e=>{h.logger.log("IndexedDBStore.startup: processing presence events"),e.forEach(e=>{let[t,n]=e;const r=new d.User(t);n&&r.setPresenceEvent(new f.MatrixEvent(n)),this._userModifiedMap[r.userId]=r.getLastModifiedTime(),this.storeUser(r)})}))},m.prototype.getSavedSync=v((function(){return this.backend.getSavedSync()}),"getSavedSync"),m.prototype.isNewlyCreated=v((function(){return this.backend.isNewlyCreated()}),"isNewlyCreated"),m.prototype.getSavedSyncToken=v((function(){return this.backend.getNextBatchToken()}),"getSavedSyncToken"),m.prototype.deleteAllData=v((function(){return a.MemoryStore.prototype.deleteAllData.call(this),this.backend.clearDatabase().then(()=>{h.logger.log("Deleted indexeddb data.")},e=>{throw h.logger.error("Failed to delete indexeddb data: "+e),e})})),m.prototype.wantsSave=function(){const e=Date.now();return e-this._syncTs>p},m.prototype.save=function(e){return e||this.wantsSave()?this._reallySave():Promise.resolve()},m.prototype._reallySave=v((function(){this._syncTs=Date.now();const e=[];for(const t of this.getUsers())this._userModifiedMap[t.userId]!==t.getLastModifiedTime()&&t.events.presence&&(e.push([t.userId,t.events.presence.event]),this._userModifiedMap[t.userId]=t.getLastModifiedTime());return this.backend.syncToDatabase(e)})),m.prototype.setSyncData=v((function(e){return this.backend.setSyncData(e)}),"setSyncData"),m.prototype.getOutOfBandMembers=v((function(e){return this.backend.getOutOfBandMembers(e)}),"getOutOfBandMembers"),m.prototype.setOutOfBandMembers=v((function(e,t){return a.MemoryStore.prototype.setOutOfBandMembers.call(this,e,t),this.backend.setOutOfBandMembers(e,t)}),"setOutOfBandMembers"),m.prototype.clearOutOfBandMembers=v((function(e){return a.MemoryStore.prototype.clearOutOfBandMembers.call(this),this.backend.clearOutOfBandMembers(e)}),"clearOutOfBandMembers"),m.prototype.getClientOptions=v((function(){return this.backend.getClientOptions()}),"getClientOptions"),m.prototype.storeClientOptions=v((function(e){return a.MemoryStore.prototype.storeClientOptions.call(this,e),this.backend.storeClientOptions(e)}),"storeClientOptions")}).call(this,r("c8ba"))},ed83:function(e,t,n){var r,i,o;(function(n,a){i=[],r=a,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})(0,(function(){var e=/(auto|scroll)/,t=function(e,n){return null===e.parentNode?n:t(e.parentNode,n.concat([e]))},n=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},r=function(e){return n(e,"overflow")+n(e,"overflow-y")+n(e,"overflow-x")},i=function(t){return e.test(r(t))},o=function(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var n=t(e.parentNode,[]),r=0;r{for(let n=0;n]*)([0-9]*)$/);if(!o)return!1;const a=o[1],s=parseInt(o[2]);if(isNaN(s))return!1;switch(a){case"":case"==":return i==s;case"<":return i":return i>s;case"<=":return i<=s;case">=":return i>=s;default:return!1}},u=function(t,n){let i=n.getContent();if(n.isEncrypted()&&n.getClearContent()&&(i=n.getClearContent()),!i||!i.body||"string"!=typeof i.body)return!1;const o=e.getRoom(n.getRoomId());if(!o||!o.currentState||!o.currentState.members||!o.currentState.getMember(e.credentials.userId))return!1;const a=o.currentState.getMember(e.credentials.userId).name,s=new RegExp("(^|\\W)"+(0,r.escapeRegExp)(a)+"(\\W|$)","i");return i.body.search(s)>-1},d=function(e,t){if(!e.key)return!1;const n=h(e.key,t);if("string"!==typeof n)return!1;if(e.value)return e.value===n;if("string"!==typeof e.pattern)return!1;let r;return r="content.body"==e.key?f("(^|\\W)",e.pattern,"(\\W|$)"):f("^",e.pattern,"$"),!!n.match(r)},f=function(e,n,i){return t[n]||(t[n]=new RegExp(e+(0,r.globToRegexp)(n)+i,"i")),t[n]},h=function(e,t){const n=e.split(".");let i;const o=n[0];"content"===o?(i=t.getContent(),n.shift()):"type"===o?(i=t.getType(),n.shift()):i=t.event;while(n.length>0){const e=n.shift();if((0,r.isNullOrUndefined)(i[e]))return null;i=i[e]}return i},p=function(t,r){return r?t.getSender()===e.credentials.userId?null:n(t,r.global):null},m=function(e,t){const n=p(e,t);if(!n)return{};const r=s.actionListToActionsObject(n.actions);return void 0===r.tweaks.highlight&&(r.tweaks.highlight="content"==n.kind),r};this.ruleMatchesEvent=function(e,t){let n=!0;for(let r=0;re.rule_id===r.rule_id);if(e)e.default=r.default,e.conditions=r.conditions,e.actions=r.actions;else{const e=r.rule_id;i.logger.warn("Adding default global override for "+e),n.push(r)}}return t}},f024:function(e,t,n){"use strict";n.r(t);var r=n("b79a");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},f0bc:function(e,t,n){"use strict";n.r(t);var r=n("0dbb");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},f206:function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=2)}([function(e,t,n){n(8);var r=n(6)(n(1),n(7),"data-v-25adc6c0",null);e.exports=r.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o="#75c791",a="#bfcbd9",s="on",c="off",l="#fff";t["default"]={name:"ToggleButton",props:{value:{type:Boolean,default:!1},name:{type:String},disabled:{type:Boolean,default:!1},tag:{type:String},sync:{type:Boolean,default:!1},speed:{type:Number,default:300},color:{type:[String,Object],validator:function(e){return n.i(r["a"])(e)||n.i(r["b"])(e,"checked")||n.i(r["b"])(e,"unchecked")||n.i(r["b"])(e,"disabled")}},switchColor:{type:[String,Object],validator:function(e){return n.i(r["a"])(e)||n.i(r["b"])(e,"checked")||n.i(r["b"])(e,"unchecked")}},cssColors:{type:Boolean,default:!1},labels:{type:[Boolean,Object],default:!1,validator:function(e){return"object"===("undefined"===typeof e?"undefined":i(e))?e.checked||e.unchecked:"boolean"===typeof e}},height:{type:Number,default:22},width:{type:Number,default:50},margin:{type:Number,default:3},fontSize:{type:Number}},computed:{className:function(){var e=this.toggled,t=this.disabled;return["vue-js-switch",{toggled:e,disabled:t}]},coreStyle:function(){return{width:n.i(r["c"])(this.width),height:n.i(r["c"])(this.height),backgroundColor:this.cssColors?null:this.disabled?this.colorDisabled:this.colorCurrent,borderRadius:n.i(r["c"])(Math.round(this.height/2))}},buttonRadius:function(){return this.height-2*this.margin},distance:function(){return n.i(r["c"])(this.width-this.height+this.margin)},buttonStyle:function(){var e="transform "+this.speed+"ms",t=n.i(r["c"])(this.margin),i=this.toggled?n.i(r["d"])(this.distance,t):n.i(r["d"])(t,t),o=this.switchColor?this.switchColorCurrent:null;return{width:n.i(r["c"])(this.buttonRadius),height:n.i(r["c"])(this.buttonRadius),transition:e,transform:i,background:o}},labelStyle:function(){return{lineHeight:n.i(r["c"])(this.height),fontSize:this.fontSize?n.i(r["c"])(this.fontSize):null}},colorChecked:function(){var e=this.color;return n.i(r["e"])(e)?n.i(r["f"])(e,"checked",o):e||o},colorUnchecked:function(){return n.i(r["f"])(this.color,"unchecked",a)},colorDisabled:function(){return n.i(r["f"])(this.color,"disabled",this.colorCurrent)},colorCurrent:function(){return this.toggled?this.colorChecked:this.colorUnchecked},labelChecked:function(){return n.i(r["f"])(this.labels,"checked",s)},labelUnchecked:function(){return n.i(r["f"])(this.labels,"unchecked",c)},switchColorChecked:function(){return n.i(r["f"])(this.switchColor,"checked",l)},switchColorUnchecked:function(){return n.i(r["f"])(this.switchColor,"unchecked",l)},switchColorCurrent:function(){this.switchColor;return n.i(r["e"])(this.switchColor)?this.toggled?this.switchColorChecked:this.switchColorUnchecked:this.switchColor||l}},watch:{value:function(e){this.sync&&(this.toggled=!!e)}},data:function(){return{toggled:!!this.value}},methods:{toggle:function(e){var t=!this.toggled;this.sync||(this.toggled=t),this.$emit("input",t),this.$emit("change",{value:t,tag:this.tag,srcEvent:e})}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n.n(r);n.d(t,"ToggleButton",(function(){return i.a}));var o=!1;t["default"]={install:function(e){o||(e.component("ToggleButton",i.a),o=!0)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return l}));var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){return"string"===typeof e},o=function(e){return"object"===("undefined"===typeof e?"undefined":r(e))},a=function(e,t){return o(e)&&e.hasOwnProperty(t)},s=function(e,t,n){return a(e,t)?e[t]:n},c=function(e){return e+"px"},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0px";return"translate3d("+e+", "+t+", "+n+")"}},function(e,t,n){t=e.exports=n(5)(),t.push([e.i,".vue-js-switch[data-v-25adc6c0]{display:inline-block;position:relative;vertical-align:middle;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input[data-v-25adc6c0]{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label[data-v-25adc6c0]{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left[data-v-25adc6c0]{left:10px}.vue-js-switch .v-switch-label.v-right[data-v-25adc6c0]{right:10px}.vue-js-switch .v-switch-core[data-v-25adc6c0]{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;user-select:none}.vue-js-switch .v-switch-core .v-switch-button[data-v-25adc6c0]{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:#fff;z-index:2}.vue-js-switch.disabled[data-v-25adc6c0]{pointer-events:none;opacity:.6}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;tn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i>>32-t}function l(e,t,n,r,i,o,a){return c(e+(t&n|~t&r)+i+o|0,a)+t|0}function u(e,t,n,r,i,o,a){return c(e+(t&r|n&~r)+i+o|0,a)+t|0}function d(e,t,n,r,i,o,a){return c(e+(t^n^r)+i+o|0,a)+t|0}function f(e,t,n,r,i,o,a){return c(e+(n^(t|~r))+i+o|0,a)+t|0}r(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=l(n,r,i,o,e[0],3614090360,7),o=l(o,n,r,i,e[1],3905402710,12),i=l(i,o,n,r,e[2],606105819,17),r=l(r,i,o,n,e[3],3250441966,22),n=l(n,r,i,o,e[4],4118548399,7),o=l(o,n,r,i,e[5],1200080426,12),i=l(i,o,n,r,e[6],2821735955,17),r=l(r,i,o,n,e[7],4249261313,22),n=l(n,r,i,o,e[8],1770035416,7),o=l(o,n,r,i,e[9],2336552879,12),i=l(i,o,n,r,e[10],4294925233,17),r=l(r,i,o,n,e[11],2304563134,22),n=l(n,r,i,o,e[12],1804603682,7),o=l(o,n,r,i,e[13],4254626195,12),i=l(i,o,n,r,e[14],2792965006,17),r=l(r,i,o,n,e[15],1236535329,22),n=u(n,r,i,o,e[1],4129170786,5),o=u(o,n,r,i,e[6],3225465664,9),i=u(i,o,n,r,e[11],643717713,14),r=u(r,i,o,n,e[0],3921069994,20),n=u(n,r,i,o,e[5],3593408605,5),o=u(o,n,r,i,e[10],38016083,9),i=u(i,o,n,r,e[15],3634488961,14),r=u(r,i,o,n,e[4],3889429448,20),n=u(n,r,i,o,e[9],568446438,5),o=u(o,n,r,i,e[14],3275163606,9),i=u(i,o,n,r,e[3],4107603335,14),r=u(r,i,o,n,e[8],1163531501,20),n=u(n,r,i,o,e[13],2850285829,5),o=u(o,n,r,i,e[2],4243563512,9),i=u(i,o,n,r,e[7],1735328473,14),r=u(r,i,o,n,e[12],2368359562,20),n=d(n,r,i,o,e[5],4294588738,4),o=d(o,n,r,i,e[8],2272392833,11),i=d(i,o,n,r,e[11],1839030562,16),r=d(r,i,o,n,e[14],4259657740,23),n=d(n,r,i,o,e[1],2763975236,4),o=d(o,n,r,i,e[4],1272893353,11),i=d(i,o,n,r,e[7],4139469664,16),r=d(r,i,o,n,e[10],3200236656,23),n=d(n,r,i,o,e[13],681279174,4),o=d(o,n,r,i,e[0],3936430074,11),i=d(i,o,n,r,e[3],3572445317,16),r=d(r,i,o,n,e[6],76029189,23),n=d(n,r,i,o,e[9],3654602809,4),o=d(o,n,r,i,e[12],3873151461,11),i=d(i,o,n,r,e[15],530742520,16),r=d(r,i,o,n,e[2],3299628645,23),n=f(n,r,i,o,e[0],4096336452,6),o=f(o,n,r,i,e[7],1126891415,10),i=f(i,o,n,r,e[14],2878612391,15),r=f(r,i,o,n,e[5],4237533241,21),n=f(n,r,i,o,e[12],1700485571,6),o=f(o,n,r,i,e[3],2399980690,10),i=f(i,o,n,r,e[10],4293915773,15),r=f(r,i,o,n,e[1],2240044497,21),n=f(n,r,i,o,e[8],1873313359,6),o=f(o,n,r,i,e[15],4264355552,10),i=f(i,o,n,r,e[6],2734768916,15),r=f(r,i,o,n,e[13],1309151649,21),n=f(n,r,i,o,e[4],4149444226,6),o=f(o,n,r,i,e[11],3174756917,10),i=f(i,o,n,r,e[2],718787259,15),r=f(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},f5af:function(e,t,n){var r=n("15aa");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("0ae72481",r,e)}},f5df:function(e,t,n){var r=n("00ee"),i=n("1626"),o=n("c6b6"),a=n("b622"),s=a("toStringTag"),c=Object,l="Arguments"==o(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(n){}};e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=u(t=c(e),s))?n:l?o(t):"Object"==(r=o(t))&&i(t.callee)?"Arguments":r}},f60b:function(e,t,n){var r=n("b639"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},f693:function(e){e.exports=JSON.parse('{"caption":{"create":"Create","addPublicChatName":"Add Public Chat Name","addGroupNamePlaceHolder":"Add Group Name","createPublicChat":"Create public chat","chatTopic":"Topic renamed","publicRoomTitle":"Public Room","asModerator":"as moderator","marked":"marked","unmarked":"unmarked","removeBan":"Remove Ban","cancelModeration":"Remove moderation","uploadFiles":"Télécharger fichiers","header":"En-tête","dragAndDropAFile":"Glisser déposer fichier","chatInvite":"Vous avez été invité à discuter avec:","cantJoin":"Vous ne pouvez pas rejoindre la conversation avec:","chatInviteDecline":"Vous pouvez rejoindre la conversation ou refuser l\'invitation","creatorLeft":"Car l\'administrateur a quitté la conversation","encrypted":"Encrypté","noImages":"Il n\'y a pas encore d\'images dans la conversation","noFiles":"Il n\'y a pas encore d\'files dans la conversation","inviteUser":"Inviter utilisateur","invite":"Inviter","add":"Ajouter","mute":"Mode silence","unmute":"Mode son","leave":"Quitter","Info":"Info","new":"Nouveau","typing":"en train d\'écrire","accNotFound":"Votre inscription est en cours, veuillez patienter...","emptyList":"liste vide (filtrée ou juste vide)","welcome":"Bienvenue sur Pocketnet chat","startNewChat":"Commencer une conversation","chats":"Conversations","shareWith":"Partager avec","newChat":"Nouvelle conversation","moveToChat":"Aller à la conversation","queryNoResults":"Auncun résulats","needMoreCharacters":"Veuillez saisir plus de caractères","createGroup":"Créer groupe","unabletoDecrypt":"* Impossible de decrypter","messageDeleted":"Message supprimé","sentImage":"envoyé image","sentVoiceMessage":"envoyé un message vocal","invitationToChat":"Invitation à discuter","invitationToRoom":"Invitation to room","leftChat":"a quitté la conversation","joined":"a rejoint","chatRenamed":"Conversation renommé en ","recentComment":"Commentaire récent:","share":"PARTAGER","followers":"Abonnés:","reputation":"Réputation:","following":"Abonnements:","theme":"Thème:","contacts":"Contacts","phoneContacts":"Contacts téléphone","chooseInviteMedia":"Veuillez choisir comment inviter:","admin":"Administrateur","moderator":"Modérateur","videocall":"Appel Vidéo","call":"Appel","leaveAndDelete":"Quitter et supprimer","donate":"Faire un don","makeModerator":"Définir comme Modérateur","ban":"Bannir","kick":"Expulser","members":"Membres","media":"Médias","files":"Fichiers","contactsList":"Liste de contacts","send":"envoyer","pageCaption":"Légende de page","caption":"Légende","text":"Texte","placeholder":"placeholder","sendTransactionTo":"Envoyer transaction à","toBePaidByReceiver":"Payé par le receveur","toBePaidBySender":"Payé par l\'expéditeur","source":"Source","amount":"Montant","receiver":"Receveur","message":"Message","includeFeesInAmount":"Inclure les frais dans le montant","transactionFees":"Frais de transaction","totalAmount":"Montant total","balanceTooLow":"Solde trop faible","transactionError":"Erreur, la transaction ne peut être effectuée","calculateFees":"Calculer les frais","startChatWith":"Discuter avec:","searchResult":"Résultat de la recherche","joinedInTheChat":"à rejoint la conversation","invited":"invité ","hasInvited":"invité ","inTheChat":" dans la conversation","banned":"banni","andRoom":"et conversation","left":"quiité","theChat":" la conversation ","made":"fait ","aModerator":" un modérateur","editedChatNameTo ":"edité le nom de la conversation en ","somebody":"Quelqu\'un","sent":"a envoyé","PKOINto":" PKOIN à ","response":"Réponse","messagefrom":"Transférer message de","edited":"Edité","settings":"Paramètres","unauthorized":"Non autorisé","search":"Recherche","replyOnMessage":"Répondre au message","editMessage":"Editer message","inviteFriend":"Inviter des amis","emptyContactList":"Liste de contacts vide","joinApp":"Rejoindre Pocketnet","hasInvitedToJoin":"vous a invité à rejoindre Pocketnet","contactsempty":"Vous n\'avez pas encore de contacts, vous pouvez utiliser la recherche","usernotgen":"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.","younotgen":"Please wait a minute, Your encryption keys are being generated...","chatsearchingempty":"No chats found for the specified filter","sendmessage":"Send message"},"input":{"patientEmailPlaceholder":"Email","refillNamePlaceholder":"Saisissez à nouveau le nom"},"message":{},"button":{"starChatButton":"Commencer une conversation ","decline":"Refuser","declineandignore":"Ignorer utilisateur","join":"Rejoindre","ok":"Ok","copy":"Copier","forward":"Transférer","delete":"Supprimer","save":"Enregistrer","reply":"Répondre","share":"Partager","download":"Télécharger","downloaded":"Téléchargé","goToPocketnetProfile":"Aller au profile Pocketnet","sendFile":"Envoyer fichier","takePhotoOrVideo":"Envoyer image","sendCoins":"Envoyer PKOIN","edit":"Editer","select":"Sélectionner","block":"Bloquer","unblock":"Débloquer","blockUser":"Bloquer utilisateur"},"yes":"Oui","cancel":"Annuler","teamMessages":{"1-title":"Bienvenue sur la messagerie privée Bastyon!","1-list1":"Messagerie privée qui n\'est PAS connectée à votre numéro de téléphone","1-list2":"Chiffrement de bout en bout pour chaque conversation","1-list3":"Toutes les images envoyées ou reçues par le biais du chat sont stockées sous forme cryptée","1-list4":"L\'historique des messages est conservé pendant 7 jours uniquement","2-title":"Bonne nouvelle! L\'application Pocketnet s\'appelle désormais Bastyon!","2-message1":"Le domaine sera déplacé vers Bastyon.com. Nous avons récemment publié les mises à jour majeures suivantes:","2-list1":"Messagerie privée cryptée non connectée à votre numéro de téléphone","2-list2":"Possibilité de faire des dons en PKOIN aux blogueurs","2-list3":"Vidéo et Streaming en direct","2-message2":"Invitez dès maintenant vos amis et faites partie du grand avenir de l\'internet décentralisé!","2-button":"Inviter des amis"},"sendingerror":"An error occurred while sending the message","details":"Details","settings_pin":"Pin chat window","checked":"Yes","unchecked":"No","settings_read":"Send read receipts","messagewasburn":"This message remains only in the memory of your device","messagewillburn":"The message will be deleted soon","micaccessbrowser":"Access to the microphone is restricted, please check your browser settings.","micaccesscommonproblem":"Sorry, for some reason it is not possible to record voice messages on the device","micaccesscordova":"Access to the microphone is restricted, please check your device settings.","micdevicenotfound":"Audio recording device not found"}')},f6b4:function(e,t,n){"use strict";var r=n("c532");function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},f6f7:function(e,t,n){var r=n("24a6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("5f2561d6",r,e)}},f726:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"#wai-logotype .items[data-v-e33cd7cc]{display:flex;align-items:center}#wai-logotype .items .item.label[data-v-e33cd7cc]{padding-left:.25em;font-weight:700}",""]),e.exports=t},f772:function(e,t,n){var r=n("5692"),i=n("90e3"),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},f922:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'#preloader[data-v-3e6353d6]{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;z-index:3500}#preloader .iospreloadercenter[data-v-3e6353d6]{position:absolute;left:50%;top:50%;margin-left:-33px;margin-top:-33px}#preloader.minimized[data-v-3e6353d6]{display:none}#preloader.minimized.active[data-v-3e6353d6]{display:block;width:344px;right:.5em;bottom:1em;top:124px;left:auto}.default .preloader[data-v-3e6353d6]{height:90px;text-align:center;overflow:hidden;padding:10px 0;margin:0 auto;filter:url(#love);position:absolute;left:50%;top:50%;margin-top:-45px;margin-left:-60px;opacity:.85}.default .preloader span[data-v-3e6353d6]{width:20px;height:20px;background-color:transparent;display:inline-block;border-radius:50%;margin:10px}.spinner-eff[data-v-3e6353d6]{position:relative;width:66px;height:66px}.spinner-eff .spinner-bar[data-v-3e6353d6]:after,.spinner-eff .spinner-bar[data-v-3e6353d6]:before,.spinner-eff[data-v-3e6353d6]:after,.spinner-eff[data-v-3e6353d6]:before{content:"";display:block}',""]),e.exports=t},f978:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"contactList",class:{minimized:e.minimized}},[n("RecycleScroller",{staticClass:"scroller",attrs:{"page-mode":"",items:e.users,"item-size":60,"key-field":"id"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.item;return[n("div",{staticClass:"previewWrapper minimizeex"},["Contacts"===e.mode||"Select"===e.mode?n("div",{staticClass:"previewContact",on:{click:function(t){return e.navigateToProfile(r.id,r)}}},[n("preview",{attrs:{contact:r,mode:e.mode}})],1):e._e(),"Selectmany"===e.mode?n("div",{staticClass:"previewBox",on:{click:function(t){return e.toggleUser(r)}}},[n("div",{staticClass:"previewContactSelect"},[n("preview",{attrs:{mode:e.mode,contact:r}})],1),n("div",{staticClass:"checkBox"},[e.selected[r.id]?n("i",{staticClass:"far fa-check-circle"}):e._e(),e.selected[r.id]?e._e():n("i",{staticClass:"far fa-circle"})])]):e._e()])]}}])})],1)},i=[],o=n("2f62"),a=n("92a6"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mod-wrapper"},[n("div",{staticClass:"modal-window"},[n("span",{staticClass:"message"},[e._v(e._s(e.message))]),n("button",{staticClass:"btn",on:{click:e.close}},[e._v("OK")])])])},c=[],l={name:"ModalWindow",props:["message"],methods:{close(){this.$emit("Close")}}},u=l,d=n("2877");function f(e){var t=n("706e");t.__inject__&&t.__inject__(e)}var h=Object(d["a"])(u,s,c,!1,f,"96a5a68e",null,!0),p=h.exports,m={name:"contactsList",data:function(){return{loading:!1}},components:{preview:a["a"],ModalWindow:p},props:{mode:{default:"",type:String},users:Array,selected:Object,title:String},watch:{},computed:Object(o["c"])({auth:e=>e.auth,minimized:e=>e.minimized,...Object(o["b"])(["PREPARE_USERDATA"]),...Object(o["c"])(["contactsMap","signedUpUsers"])}),methods:{select(e){this.$emit("select",e)},navigateToProfile(e,t){"Select"==this.mode?this.select(t):this.$router.push({path:"/contact?id="+e}).catch(e=>{})},toggleUser(e){this.$emit("toggleUser",e.id)}},mounted(){}},v=m;function g(e){var t=n("ff89");t.__inject__&&t.__inject__(e)}var y=Object(d["a"])(v,r,i,!1,g,"691bf714",null,!0);t["default"]=y.exports},f9d6:function(e,t,n){"use strict";n.r(t);var r=n("306e");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},faa1:function(e,t,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function a(e){console&&console.warn&&console.warn(e)}r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!==e};function c(){c.init.call(this)}e.exports=c,e.exports.once=_,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var l=10;function u(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,o,s;if(u(n),o=e._events,void 0===o?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"===typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=d(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?b(i):g(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"===typeof c)o(c,this,t);else{var l=c.length,u=g(c,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():y(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return m(this,e,!0)},c.prototype.rawListeners=function(e){return m(this,e,!1)},c.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},c.prototype.listenerCount=v,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},fafe:function(e,t,n){var r=n("abac");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("662871c4",r,e)}},fbbb:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".searchWrapper[data-v-1774f2a8]{display:flex;overflow:hidden;background:rgb(var(--background-secondary-theme));border-radius:30px;color:rgb(var(--neutral-grad-2));align-items:center}.searchWrapper .inputWrapper[data-v-1774f2a8]{flex-grow:1}.searchWrapper .inputWrapper input[data-v-1774f2a8]{padding:.75em 1em;padding-right:0;width:100%;font-size:.9em}.searchWrapper .iconWrapper[data-v-1774f2a8]{text-align:center;width:50px}.searchWrapper .iconWrapper i[data-v-1774f2a8]{font-size:.8em}#search.minimized:not(.active) .searchWrapper[data-v-1774f2a8]{border-radius:0;background:transparent;padding:0}#search.minimized:not(.active) .searchWrapper .inputWrapper[data-v-1774f2a8]{display:none}#search.minimized:not(.active) .searchWrapper .iconWrapper[data-v-1774f2a8]{text-align:center;width:44px;height:44px;line-height:44px;padding:0;border-radius:50%;background:rgba(var(--color-txt-gray-dark),.4);color:rgba(var(--color-txt-gray-dark),.8)}#search.minimized:not(.active) .searchWrapper .iconWrapper i[data-v-1774f2a8]{font-size:.8em}",""]),e.exports=t},fc6a:function(e,t,n){var r=n("44ad"),i=n("1d80");e.exports=function(e){return r(i(e))}},fca4:function(e,t,n){"use strict";n.r(t);var r=n("7e58");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},fdbf:function(e,t,n){var r=n("4930");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdca:function(e,t,n){"use strict";n.r(t);var r=n("2724");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},fe93:function(e,t,n){"use strict";var r=n("6de4");function i(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var o=RegExp(Object.keys(r).map(i).join("|"),"g");function a(e){return r[e]}function s(e){return e.replace(o,a)}e.exports=s},ff6c:function(e,t,n){"use strict";n.r(t);var r=n("246d");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},ff89:function(e,t,n){"use strict";n.r(t);var r=n("fafe");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},ffd9:function(e,t,n){"use strict";function r(e){for(let t=0;t=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),u.alloc(+e)}function w(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ee(e).length;default:if(r)return X(e).length;t=(""+t).toLowerCase(),r=!0}}function x(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return $(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return L(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return P(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function S(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function k(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){var o,a=1,s=e.length,c=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=n;os&&(n=s-c),o=n;o>=0;o--){for(var d=!0,f=0;fi&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:o=e[i+1],128===(192&o)&&(c=(31&l)<<6|63&o,c>127&&(u=c));break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(c=(15&l)<<12|(63&o)<<6|63&a,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s,c>65535&&c<1114112&&(u=c))}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return D(r)}n.Buffer=u,n.SlowBuffer=_,n.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:s(),n.kMaxLength=c(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return d(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return h(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,a=n-t,s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),d=0;di)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return I(this,e,t,n);case"latin1":case"binary":return R(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var j=4096;function D(e){var t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);var n="",r=0;while(rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function z(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function W(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function K(e,t,n,r,i){return i||W(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function V(e,t,n,r,i){return i||W(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t0&&(i*=256))r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);var r=this[e],i=1,o=0;while(++o=i&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||B(e,t,this.length);var r=t,i=1,o=this[e+--r];while(r>0&&(i*=256))o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;F(this,e,t,n,i,0)}var o=1,a=0;this[t]=255&e;while(++a=0&&(a*=256))this[t+o]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):q(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;this[t]=255&e;while(++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;this[t+o]=255&e;while(--o>=0&&(a*=256))e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):z(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):z(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):q(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return K(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return K(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Z(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r)}return o}function ee(e){return i.toByteArray(H(e))}function te(e,t,n,r){for(var i=0;i=t.length||i>=e.length)break;t[i+n]=e[i]}return i}function ne(e){return e!==e}}).call(this,r("c8ba"))},b672:function(e,t,n){var r=n("8707").Buffer;function i(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=r.from(e,t));for(var n=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},b753:function(e,t,n){var r=n("4f4d"),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var c=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:c}),Object.defineProperty(a[s],"labels",{value:l})}function u(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}a.rgb.hsl=function(e){var t,n,r,i=e[0]/255,o=e[1]/255,a=e[2]/255,s=Math.min(i,o,a),c=Math.max(i,o,a),l=c-s;return c===s?t=0:i===c?t=(o-a)/l:o===c?t=2+(a-i)/l:a===c&&(t=4+(i-o)/l),t=Math.min(60*t,360),t<0&&(t+=360),r=(s+c)/2,n=c===s?0:r<=.5?l/(c+s):l/(2-c-s),[t,100*n,100*r]},a.rgb.hsv=function(e){var t,n,r,i,o,a=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(a,s,c),u=l-Math.min(a,s,c),d=function(e){return(l-e)/6/u+.5};return 0===u?i=o=0:(o=u/l,t=d(a),n=d(s),r=d(c),a===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*l]},a.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2],i=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},a.rgb.cmyk=function(e){var t,n,r,i,o=e[0]/255,a=e[1]/255,s=e[2]/255;return i=Math.min(1-o,1-a,1-s),t=(1-o-i)/(1-i)||0,n=(1-a-i)/(1-i)||0,r=(1-s-i)/(1-i)||0,[100*t,100*n,100*r,100*i]},a.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,o=1/0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],c=u(e,s);c.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=.4124*t+.3576*n+.1805*r,o=.2126*t+.7152*n+.0722*r,a=.0193*t+.1192*n+.9505*r;return[100*i,100*o,100*a]},a.rgb.lab=function(e){var t,n,r,i=a.rgb.xyz(e),o=i[0],s=i[1],c=i[2];return o/=95.047,s/=100,c/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,c=c>.008856?Math.pow(c,1/3):7.787*c+16/116,t=116*s-16,n=500*(o-s),r=200*(s-c),[t,n,r]},a.hsl.rgb=function(e){var t,n,r,i,o,a=e[0]/360,s=e[1]/100,c=e[2]/100;if(0===s)return o=255*c,[o,o,o];n=c<.5?c*(1+s):c+s-c*s,t=2*c-n,i=[0,0,0];for(var l=0;l<3;l++)r=a+1/3*-(l-1),r<0&&r++,r>1&&r--,o=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[l]=255*o;return i},a.hsl.hsv=function(e){var t,n,r=e[0],i=e[1]/100,o=e[2]/100,a=i,s=Math.max(o,.01);return o*=2,i*=o<=1?o:2-o,a*=s<=1?s:2-s,n=(o+i)/2,t=0===o?2*a/(s+a):2*i/(o+i),[r,100*t,100*n]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),c=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,c,a];case 1:return[s,r,a];case 2:return[a,r,c];case 3:return[a,s,r];case 4:return[c,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(e){var t,n,r,i=e[0],o=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return r=(2-o)*a,t=(2-o)*s,n=o*s,n/=t<=1?t:2-t,n=n||0,r/=2,[i,100*n,100*r]},a.hwb.rgb=function(e){var t,n,r,i,o,a,s,c=e[0]/360,l=e[1]/100,u=e[2]/100,d=l+u;switch(d>1&&(l/=d,u/=d),t=Math.floor(6*c),n=1-u,r=6*c-t,0!==(1&t)&&(r=1-r),i=l+r*(n-l),t){default:case 6:case 0:o=n,a=i,s=l;break;case 1:o=i,a=n,s=l;break;case 2:o=l,a=n,s=i;break;case 3:o=l,a=i,s=n;break;case 4:o=i,a=l,s=n;break;case 5:o=n,a=l,s=i;break}return[255*o,255*a,255*s]},a.cmyk.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100,s=e[3]/100;return t=1-Math.min(1,i*(1-s)+s),n=1-Math.min(1,o*(1-s)+s),r=1-Math.min(1,a*(1-s)+s),[255*t,255*n,255*r]},a.xyz.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100;return t=3.2406*i+-1.5372*o+-.4986*a,n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,t=Math.min(Math.max(0,t),1),n=Math.min(Math.max(0,n),1),r=Math.min(Math.max(0,r),1),[255*t,255*n,255*r]},a.xyz.lab=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];return i/=95.047,o/=100,a/=108.883,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,t=116*o-16,n=500*(i-o),r=200*(o-a),[t,n,r]},a.lab.xyz=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];n=(i+16)/116,t=o/500+n,r=n-a/200;var s=Math.pow(n,3),c=Math.pow(t,3),l=Math.pow(r,3);return n=s>.008856?s:(n-16/116)/7.787,t=c>.008856?c:(t-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},a.lab.lch=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];return t=Math.atan2(a,o),n=360*t/2/Math.PI,n<0&&(n+=360),r=Math.sqrt(o*o+a*a),[i,r,n]},a.lch.lab=function(e){var t,n,r,i=e[0],o=e[1],a=e[2];return r=a/360*2*Math.PI,t=o*Math.cos(r),n=o*Math.sin(r),[i,t,n]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(i=Math.round(i/50),0===i)return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var i=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return i},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var n=.5*(1+~~(e>50)),r=(1&t)*n*255,i=(t>>1&1)*n*255,o=(t>>2&1)*n*255;return[r,i,o]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;e-=16;var r=Math.floor(e/36)/5*255,i=Math.floor((n=e%36)/6)/5*255,o=n%6/5*255;return[r,i,o]},a.rgb.hex=function(e){var t=((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2])),n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16),i=r>>16&255,o=r>>8&255,a=255&r;return[i,o,a]},a.rgb.hcg=function(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.max(Math.max(r,i),o),s=Math.min(Math.min(r,i),o),c=a-s;return t=c<1?s/(1-c):0,n=c<=0?0:a===r?(i-o)/c%6:a===i?2+(o-r)/c:4+(r-i)/c+4,n/=6,n%=1,[360*n,100*c,100*t]},a.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return r=n<.5?2*t*n:2*t*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},a.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},a.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i=[0,0,0],o=t%1*6,a=o%1,s=1-a,c=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[255*(n*i[0]+c),255*(n*i[1]+c),255*(n*i[2]+c)]},a.hcg.hsv=function(e){var t=e[1]/100,n=e[2]/100,r=t+n*(1-t),i=0;return r>0&&(i=t/r),[e[0],100*i,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100,r=n*(1-t)+.5*t,i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],100*i,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1-n,i=r-t,o=0;return i<1&&(o=(r-i)/(1-i)),[e[0],100*i,100*o]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=(t<<16)+(t<<8)+t,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},b79a:function(e,t,n){var r=n("438e");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("1708abd6",r,e)}},b7d1:function(e,t,n){(function(t){function n(e,t){if(r("noDeprecation"))return e;var n=!1;function i(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return i}function r(e){try{if(!t.localStorage)return!1}catch(_){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=n}).call(this,n("c8ba"))},b7ef:function(e,t,n){"use strict";var r=n("23e7"),i=n("da84"),o=n("d066"),a=n("5c6c"),s=n("9bf2").f,c=n("1a2d"),l=n("19aa"),u=n("7156"),d=n("e391"),f=n("cf98"),h=n("c770"),p=n("83ab"),m=n("c430"),v="DOMException",g=o("Error"),y=o(v),b=function(){l(this,_);var e=arguments.length,t=d(e<1?void 0:arguments[0]),n=d(e<2?void 0:arguments[1],"Error"),r=new y(t,n),i=g(t);return i.name=v,s(r,"stack",a(1,h(i.stack,1))),u(r,this,b),r},_=b.prototype=y.prototype,w="stack"in g(v),x="stack"in new y(1,2),S=y&&p&&Object.getOwnPropertyDescriptor(i,v),k=!!S&&!(S.writable&&S.configurable),E=w&&!k&&!x;r({global:!0,constructor:!0,forced:m||E},{DOMException:E?b:y});var C=o(v),T=C.prototype;if(T.constructor!==C)for(var I in m||s(T,"constructor",a(1,C)),f)if(c(f,I)){var R=f[I],O=R.s;c(C,O)||s(C,O,a(6,R.c))}},b837:function(e,t,n){var r=n("3fb5"),i=n("4fd1"),o=n("b672"),a=n("8707").Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}r(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},b8d8:function(e,t,n){"use strict";function r(e,t,n){return~(e-1)&t|e-1&n}function i(e,t){if(e.length!==t.length)return 0;let n=0;for(let r=0;r>>8}function o(e,t){return 0!==e.length&&0!==t.length&&0!==i(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.select=r,t.compare=i,t.equal=o},b8fa:function(e,t){e.exports=function(e){return!(!e||"string"===typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},b93b:function(e,t,n){"use strict";n.r(t);var r=n("52ef");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},b980:function(e,t,n){var r=n("d039"),i=n("5c6c");e.exports=!r((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},bb15:function(e,t,n){var r=n("b753"),i=n("a279"),o={},a=Object.keys(r);function s(e){var t=function(t){return void 0===t||null===t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function c(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"===typeof n)for(var r=n.length,i=0;i=0;n--)t+=255&e.data[n]|0,e.data[n]=255&t,t>>>=8}n.default=a},be6a:function(e,t,n){var r=n("306eb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("57d84a74",r,e)}},bfa8:function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},c04e:function(e,t,n){var r=n("c65b"),i=n("861d"),o=n("d9b5"),a=n("dc4a"),s=n("485a"),c=n("b622"),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!i(n)||o(n))return n;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},c181:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".message[data-v-1cf419f0]{font-weight:400;text-align:center}.message div[data-v-1cf419f0]{margin:0 auto;padding:.5em 1em;background:rgb(var(--background-total-theme));border:1px solid rgba(var(--neutral-grad-1),.3);border-radius:30px;width:200px;font-size:.8em;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.iconWrapper[data-v-1cf419f0]{transform:scale(.5)}.wrapper[data-v-1cf419f0]{position:absolute;left:0;right:0;top:0;bottom:0;z-index:2900;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background:rgba(var(--background-total-theme),.2);transition:.3s}.wrapper .table[data-v-1cf419f0]{height:100%}.wrapper .table>div[data-v-1cf419f0]{vertical-align:middle}#wai-fixedmessageicon[data-v-1cf419f0]{transition:.3s}#wai-fixedmessageicon.minimized .wrapper[data-v-1cf419f0]{top:60px;bottom:100px}#wai-fixedmessageicon.minimized[data-v-1cf419f0]:not(.active){opacity:0}#wai-fixedmessageicon.active .wrapper[data-v-1cf419f0]{width:344px;transform:translateX(-300px)}",""]),e.exports=t},c1af:function(e){e.exports=JSON.parse('{"caption":{"create":"Create","addPublicChatName":"Add Public Chat Name","addGroupNamePlaceHolder":"Add Group Name","createPublicChat":"Create public chat","chatTopic":"Topic renamed","publicRoomTitle":"Public Room","asModerator":"as moderator","marked":"marked","unmarked":"unmarked","removeBan":"Remove Ban","cancelModeration":"Remove moderation","uploadFiles":"파일 업로드","header":"헤더","dragAndDropAFile":"파일 끌어서 놓기","chatInvite":"다음과 채팅하도록 초대되었습니다:","cantJoin":"다음과 채팅하기 위해 참여할 수 없습니다:","chatInviteDecline":"채팅에 참여하거나 초대를 거부할 수 있습니다.","creatorLeft":"크리에이터가 방을 나갔기 때문에","encrypted":"암호화","noImages":"이 채팅에는 아직 이미지가 없습니다","noFiles":"There are no files in this chat yet","inviteUser":"사용자 초대","invite":"초대하다","add":"추가","mute":"음소거","unmute":"음소거 해제","leave":"떠나다","Info":"정보","new":"신규","typing":"타자","accNotFound":"등록이 진행 중입니다. 잠시만 기다려 주십시오...","emptyList":"목록이 비어 있습니다(필터링되었거나 비어 있음)","welcome":"포켓넷 채팅에 오신 것을 환영합니다","startNewChat":"새 채팅 시작","chats":"채팅","shareWith":"공유","newChat":"새 채팅","moveToChat":"채팅으로 이동","queryNoResults":"쿼리가 결과를 보고하지 않음","needMoreCharacters":"결과에 대해 더 많은 문자가 필요합니다","createGroup":"그룹 만들기","unabletoDecrypt":"* 해독할 수 없음","messageDeleted":"메시지 삭제됨","sentImage":"전송된 이미지","sentVoiceMessage":"음성 메시지를 보냈다","invitationToChat":"채팅 초대","invitationToRoom":"Invitation to room","leftChat":"채팅에서 나감","joined":"가입","chatRenamed":"채팅 이름이 (으)로 변경되었습니다 ","recentComment":"최근 댓글:","share":"공유","followers":"팔로워:","reputation":"평판:","following":"팔로잉:","theme":"테마:","contacts":"연락처","phoneContacts":"전화 연락처","chooseInviteMedia":"초대 방법을 선택하십시오:","admin":"관리자","moderator":"진행자","videocall":"영상통화","call":"전화","leaveAndDelete":"나가서 삭제","donate":"기부하다","makeModerator":"모더레이터 만들기","ban":"금지","kick":"킥","members":"회원","media":"미디어","files":"파일","contactsList":"연락처 목록","send":"보내다","pageCaption":"페이지 캡션","caption":"캡션","text":"텍스트","placeholder":"자리 표시자","sendTransactionTo":"트랜잭션 보내기","toBePaidByReceiver":"수취인이 지불함","toBePaidBySender":"발신인이 지불함","source":"소스","amount":"금액","receiver":"수신자","message":"메시지","includeFeesInAmount":"금액에 수수료 포함","transactionFees":"거래 수수료","totalAmount":"총 금액","balanceTooLow":"밸런스가 너무 낮음","transactionError":"오류, 거래를 할 수 없습니다","calculateFees":"수수료 계산","startChatWith":"채팅 시작","searchResult":"검색 결과","joinedInTheChat":"채팅에 참여했습니다","invited":"초대 ","hasInvited":"초대 ","inTheChat":" 채팅 중","banned":"금지된","andRoom":"그리고 방","left":"왼쪽","theChat":" 채팅 ","made":"만든 ","aModerator":" 중재자","editedChatNameTo ":"편집된 채팅 이름을 ","somebody":"누군가","sent":"보낸","PKOINto":" PKOIN to ","response":"응답","messagefrom":"에서 전달된 메시지","edited":"편집됨","settings":"설정","unauthorized":"무단","search":"검색","replyOnMessage":"메시지에 회신","editMessage":"메시지 편집","inviteFriend":"친구 초대","emptyContactList":"연락처 목록이 비어 있습니다","joinApp":"포켓넷 가입","hasInvitedToJoin":"Pocketnet에 가입하도록 초대했습니다","contactsempty":"아직 연락처가 없습니다. 검색에서 찾으십시오","chatsearchingempty":"No chats found for the specified filter","sendmessage":"Send message"},"input":{"patientEmailPlaceholder":"이메일","refillNamePlaceholder":"리필 이름"},"message":{},"button":{"starChatButton":"채팅 시작","decline":"거절","declineandignore":"사용자 무시","join":"가입","ok":"그래","copy":"복사","forward":"앞으로","delete":"삭제","reply":"답장","share":"공유","save":"저장","download":"다운로드","downloaded":"다운로드","goToPocketnetProfile":"Pocketnet 프로필로 이동","sendFile":"파일 보내기","takePhotoOrVideo":"이미지 보내기","sendCoins":"코인 보내기","edit":"편집","select":"고르다","block":"차단","unblock":"차단 해제","blockUser":"사용자 차단"},"yes":"예","cancel":"취소","teamMessages":{"1-title":"Bastyon 비공개 채팅에 오신 것을 환영합니다!","1-list1":"전화번호와 연결되지 않은 비공개 메신저","1-list2":"기본적으로 모든 1:1 대화의 종단 간 암호화","1-list3":"채팅을 통해 주고받는 모든 이미지는 암호화되어 저장됩니다","1-list4":"메시지 기록은 7일 동안만 저장됩니다","2-title":"엄청난 발표! Pocketnet 응용 프로그램은 이제 Bastyon이라고 합니다!","2-message1":"도메인이 Bastyon.com으로 이동됩니다. 최근에 다음과 같은 주요 업데이트를 발표했습니다","2-list1":"귀하의 전화 번호에 연결되지 않은 개인 암호화 메신저","2-list2":"블로거에게 PKOIN 기부 기능","2-list3":"비디오 및 라이브 스트리밍","2-message2":"지금 친구를 초대하고 탈중앙화 인터넷의 큰 미래의 일부가 되십시오!","2-button":"친구를 초대"},"sendingerror":"An error occurred while sending the message","details":"Details","settings_pin":"Pin chat window","checked":"Yes","unchecked":"No","settings_read":"Send read receipts","messagewasburn":"This message remains only in the memory of your device","messagewillburn":"The message will be deleted soon","micaccessbrowser":"Access to the microphone is restricted, please check your browser settings.","micaccesscommonproblem":"Sorry, for some reason it is not possible to record voice messages on the device","micaccesscordova":"Access to the microphone is restricted, please check your device settings.","micdevicenotfound":"Audio recording device not found"}')},c275:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.emoji-mart,.emoji-mart *{box-sizing:border-box;line-height:1.15}.emoji-mart{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,sans-serif;font-size:16px;display:inline-block;color:#222427;border:1px solid #d9d9d9;border-radius:5px;background:#fff}.emoji-mart .emoji-mart-emoji{padding:6px}.emoji-mart-bar{border:0 solid #d9d9d9}.emoji-mart-bar:first-child{border-bottom-width:1px;border-top-left-radius:5px;border-top-right-radius:5px}.emoji-mart-bar:last-child{border-top-width:1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.emoji-mart-anchors{display:flex;flex-direction:row;justify-content:space-between;padding:0 6px;color:#858585;line-height:0}.emoji-mart-anchor{position:relative;display:block;flex:1 1 auto;text-align:center;padding:12px 4px;overflow:hidden;transition:color .1s ease-out}.emoji-mart-anchor-selected,.emoji-mart-anchor:hover{color:#464646}.emoji-mart-anchor-selected .emoji-mart-anchor-bar{bottom:0}.emoji-mart-anchor-bar{position:absolute;bottom:-3px;left:0;width:100%;height:3px;background-color:#464646}.emoji-mart-anchors i{display:inline-block;width:100%;max-width:22px}.emoji-mart-anchors svg{fill:currentColor;max-height:18px}.emoji-mart-scroll{overflow-y:scroll;height:270px;padding:0 6px 6px 6px;will-change:transform}.emoji-mart-search{margin-top:6px;padding:0 6px}.emoji-mart-search input{font-size:16px;display:block;width:100%;padding:.2em .6em;border-radius:25px;border:1px solid #d9d9d9;outline:0}.emoji-mart-category .emoji-mart-emoji span{z-index:1;position:relative;text-align:center;cursor:default}.emoji-mart-category .emoji-mart-emoji:hover:before{z-index:0;content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#f4f4f4;border-radius:100%}.emoji-mart-category-label{z-index:2;position:relative;position:sticky;top:0}.emoji-mart-category-label span{display:block;width:100%;font-weight:500;padding:5px 6px;background-color:#fff;background-color:hsla(0,0%,100%,.95)}.emoji-mart-emoji{position:relative;display:inline-block;font-size:0}.emoji-mart-no-results{font-size:14px;text-align:center;padding-top:70px;color:#858585}.emoji-mart-no-results .emoji-mart-category-label{display:none}.emoji-mart-no-results .emoji-mart-no-results-label{margin-top:.2em}.emoji-mart-no-results .emoji-mart-emoji:hover:before{content:none}.emoji-mart-preview{position:relative;height:70px}.emoji-mart-preview-data,.emoji-mart-preview-emoji,.emoji-mart-preview-skins{position:absolute;top:50%;transform:translateY(-50%)}.emoji-mart-preview-emoji{left:12px}.emoji-mart-preview-data{left:68px;right:12px;word-break:break-all}.emoji-mart-preview-skins{right:30px;text-align:right}.emoji-mart-preview-name{font-size:14px}.emoji-mart-preview-shortname{font-size:12px;color:#888}.emoji-mart-preview-emoticon+.emoji-mart-preview-emoticon,.emoji-mart-preview-shortname+.emoji-mart-preview-emoticon,.emoji-mart-preview-shortname+.emoji-mart-preview-shortname{margin-left:.5em}.emoji-mart-preview-emoticon{font-size:11px;color:#bbb}.emoji-mart-title span{display:inline-block;vertical-align:middle}.emoji-mart-title .emoji-mart-emoji{padding:0}.emoji-mart-title-label{color:#999a9c;font-size:26px;font-weight:300}.emoji-mart-skin-swatches{font-size:0;padding:2px 0;border:1px solid #d9d9d9;border-radius:12px;background-color:#fff}.emoji-mart-skin-swatches-opened .emoji-mart-skin-swatch{width:16px;padding:0 2px}.emoji-mart-skin-swatches-opened .emoji-mart-skin-swatch-selected:after{opacity:.75}.emoji-mart-skin-swatch{display:inline-block;width:0;vertical-align:middle;transition-property:width,padding;transition-duration:.125s;transition-timing-function:ease-out}.emoji-mart-skin-swatch:first-child{transition-delay:0s}.emoji-mart-skin-swatch:nth-child(2){transition-delay:.03s}.emoji-mart-skin-swatch:nth-child(3){transition-delay:.06s}.emoji-mart-skin-swatch:nth-child(4){transition-delay:.09s}.emoji-mart-skin-swatch:nth-child(5){transition-delay:.12s}.emoji-mart-skin-swatch:nth-child(6){transition-delay:.15s}.emoji-mart-skin-swatch-selected{position:relative;width:16px;padding:0 2px}.emoji-mart-skin-swatch-selected:after{content:"";position:absolute;top:50%;left:50%;width:4px;height:4px;margin:-2px 0 0 -2px;background-color:#fff;border-radius:100%;pointer-events:none;opacity:0;transition:opacity .2s ease-out}.emoji-mart-skin{display:inline-block;width:100%;padding-top:100%;max-width:12px;border-radius:100%}.emoji-mart-skin-tone-1{background-color:#ffc93a}.emoji-mart-skin-tone-2{background-color:#fadcbc}.emoji-mart-skin-tone-3{background-color:#e0bb95}.emoji-mart-skin-tone-4{background-color:#bf8f68}.emoji-mart-skin-tone-5{background-color:#9b643d}.emoji-mart-skin-tone-6{background-color:#594539}',""]),e.exports=t},c337:function(e,t,n){"use strict";n.r(t);var r=n("8b3a");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},c345:function(e,t,n){"use strict";var r=n("c532"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},c401:function(e,t,n){"use strict";var r=n("c532"),i=n("2444");e.exports=function(e,t,n){var o=this||i;return r.forEach(n,(function(n){e=n.call(o,e,t)})),e}},c412:function(e,t,n){"use strict";n.r(t);var r=n("51c5");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},c430:function(e,t){e.exports=!1},c4c0:function(e,t,n){"use strict";var r=n("966d");function i(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(a,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(e,t){e.emit("error",t)}e.exports={destroy:i,undestroy:o}},c532:function(e,t,n){"use strict";var r=n("1d2b"),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function c(e){return"[object ArrayBuffer]"===i.call(e)}function l(e){return"undefined"!==typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function d(e){return"string"===typeof e}function f(e){return"number"===typeof e}function h(e){return null!==e&&"object"===typeof e}function p(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function m(e){return"[object Date]"===i.call(e)}function v(e){return"[object File]"===i.call(e)}function g(e){return"[object Blob]"===i.call(e)}function y(e){return"[object Function]"===i.call(e)}function b(e){return h(e)&&y(e.pipe)}function _(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function x(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function S(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";var t=this.head,n=""+t.data;while(t=t.next)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);var t=u.allocUnsafe(e>>>0),n=this.head,r=0;while(n)p(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return ei.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),e-=o,0===e){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),n=this.head,r=1;n.data.copy(t),e-=n.data.length;while(n=n.next){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),e-=o,0===e){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:h,value:function(e,t){return f(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},c6b6:function(e,t,n){var r=n("e330"),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},c6cd:function(e,t,n){var r=n("da84"),i=n("6374"),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},c71b:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".swiperWrapper[data-v-71d5e826]{padding-bottom:0;display:flex;overflow-x:scroll;scrollbar-width:none}.swiperWrapper[data-v-71d5e826]::-webkit-scrollbar{width:0!important;height:0!important}.swiperWrapperFlex[data-v-71d5e826]{display:flex;flex-wrap:nowrap;height:100%;align-items:center}.swiperWrapperFlex .imageSwiper[data-v-71d5e826]{width:33px;min-width:33px}.aboutRoomAvatar[data-v-71d5e826]{font-size:.5em}.userwrapper[data-v-71d5e826]{border-radius:50%}.userinfopicwrapper[data-v-71d5e826]{padding-bottom:100%;position:relative;background:none;margin:0 auto;border-radius:50%;overflow:hidden}.userinfopicwrapper .userwrapper[data-v-71d5e826]{width:50%}.threeAvatars .userwrapper[data-v-71d5e826]:first-child{position:absolute;left:50%;top:0;transform:translate(-50%,6.5%)}.threeAvatars .userwrapper[data-v-71d5e826]:nth-child(2){position:absolute;right:0;bottom:0;transform:translateY(-6.5%)}.threeAvatars .userwrapper[data-v-71d5e826]:nth-child(3){position:absolute;left:0;bottom:0;transform:translateY(-6.5%)}.twoAvatars .userwrapper[data-v-71d5e826]:first-child{position:absolute;top:0;left:0;transform:translate(6.5%,6.5%)}.twoAvatars .userwrapper[data-v-71d5e826]:last-child{position:absolute;right:0;bottom:0;transform:translate(-6.5%,-6.5%)}.fourAvatars .userwrapper[data-v-71d5e826]:first-child{position:absolute;top:0;left:0}.fourAvatars .userwrapper[data-v-71d5e826]:nth-child(2){position:absolute;right:0;top:0}.fourAvatars .userwrapper[data-v-71d5e826]:nth-child(3){position:absolute;left:0;bottom:0}.fourAvatars .userwrapper[data-v-71d5e826]:nth-child(4){position:absolute;right:0;bottom:0}.fourMore[data-v-71d5e826]{background:none}.fourMore[data-v-71d5e826],.imageSwiper[data-v-71d5e826]{margin:0 auto}.imageSwiper img[data-v-71d5e826]{display:block;border-radius:50%;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.invited[data-v-71d5e826]{opacity:.5}",""]),e.exports=t},c770:function(e,t,n){var r=n("e330"),i=Error,o=r("".replace),a=function(e){return String(i(e).stack)}("zxcasd"),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);e.exports=function(e,t){if(c&&"string"==typeof e&&!i.prepareStackTrace)while(t--)e=o(e,s,"");return e}},c8af:function(e,t,n){"use strict";var r=n("c532");e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},c8ba:function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===typeof window&&(r=window)}t.exports=r},c934:function(e,t,n){"use strict";n.r(t);var r=n("a63f");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},c973:function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,c,"next",e)}function c(e){n(a,i,o,s,c,"throw",e)}s(void 0)}))}}e.exports=r,e.exports.__esModule=!0,e.exports["default"]=e.exports},c976:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Filter=o;var r=n("4ec4");function i(e,t,n){const r=t.split(".");let i=e;for(let o=0;o2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function s(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function c(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function l(e,t,n){return"number"!==typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,i;if("string"===typeof t&&s(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",c(e," argument"))i="The ".concat(e," ").concat(r," ").concat(a(t,"type"));else{var o=l(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(r," ").concat(a(t,"type"))}return i+=". Received type ".concat(typeof n),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},ca84:function(e,t,n){var r=n("e330"),i=n("1a2d"),o=n("fc6a"),a=n("4d64").indexOf,s=n("d012"),c=r([].push);e.exports=function(e,t){var n,r=o(e),l=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&c(u,n);while(t.length>l)i(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},cb2d:function(e,t,n){var r=n("1626"),i=n("9bf2"),o=n("13d2"),a=n("6374");e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&o(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(u){}c?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},cc12:function(e,t,n){var r=n("da84"),i=n("861d"),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},ccdd:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'.fadeTr-enter-active{-webkit-transition:opacity .3s ease-in;transition:opacity .3s ease-in;-webkit-transition-delay:.1s;transition-delay:.1s}.fadeTr-leave-active{-webkit-transition:opacity .1s ease-out;transition:opacity .1s ease-out}.fadeTr-enter,.fadeTr-leave-to{opacity:0}.slide-enter-active,.slide-leave-active{-webkit-transition:all 1s;transition:all 1s}.slide-enter,.slide-leave-to{opacity:0;-webkit-transform:translateX(30px);transform:translateX(30px)}.dg-backdrop-enter-active{-webkit-animation:dg-fadeIn .3s;animation:dg-fadeIn .3s}.dg-backdrop-leave-active{-webkit-animation:dg-fadeOut .5s;animation:dg-fadeOut .5s}.dg-fade-enter-active{-webkit-animation:dg-fadeIn .6s ease-out;animation:dg-fadeIn .6s ease-out}.dg-fade-leave-active{-webkit-animation:dg-fadeOut .6s ease-out;animation:dg-fadeOut .6s ease-out}@-webkit-keyframes dg-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes dg-fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes dg-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes dg-fadeOut{0%{opacity:1}to{opacity:0}}.dg-zoom-enter-active{-webkit-animation:dg-zoomIn .3s ease-out;animation:dg-zoomIn .3s ease-out}.dg-zoom-leave-active{-webkit-animation:dg-zoomOut .4s ease-out;animation:dg-zoomOut .4s ease-out}@-webkit-keyframes dg-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes dg-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@-webkit-keyframes dg-zoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes dg-zoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}.dg-bounce-enter-active{-webkit-animation:dg-bounceIn .6s;animation:dg-bounceIn .6s}.dg-bounce-leave-active{-webkit-animation:dg-zoomOut .6s;animation:dg-zoomOut .6s}@-webkit-keyframes dg-bounceIn{0%{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}40%{opacity:1;-webkit-transform:scale(1.06);transform:scale(1.06)}60%{-webkit-transform:scale(.92);transform:scale(.92)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes dg-bounceIn{0%{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}40%{opacity:1;-webkit-transform:scale(1.06);transform:scale(1.06)}60%{-webkit-transform:scale(.92);transform:scale(.92)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes dg-bounceOut{0%{-webkit-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(.95);transform:scale(.95)}50%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1)}to{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}}@keyframes dg-bounceOut{0%{-webkit-transform:scale(1);transform:scale(1)}25%{-webkit-transform:scale(.95);transform:scale(.95)}50%{opacity:1;-webkit-transform:scale(1.1);transform:scale(1.1)}to{opacity:0;-webkit-transform:scale(.3);transform:scale(.3)}}.dg-btn-loader{width:100%;height:100%;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;top:0;left:0}.dg-btn-loader .dg-circles{width:100%;display:block;text-align:center}.dg-btn-loader .dg-circle{width:.9em;height:.9em;opacity:0;background-color:#09a2e3;display:inline-block;border-radius:50%;-webkit-animation-name:dg-circle-oscillation;animation-name:dg-circle-oscillation;-webkit-animation-duration:.5875s;animation-duration:.5875s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:normal;animation-direction:normal}.dg-btn-loader .dg-circle:not(:last-child){margin-right:8px}.dg-btn-loader .dg-circle:first-child{-webkit-animation-delay:.1195s;animation-delay:.1195s}.dg-btn-loader .dg-circle:nth-child(2){-webkit-animation-delay:.2755s;animation-delay:.2755s}.dg-btn-loader .dg-circle:nth-child(3){-webkit-animation-delay:.3485s;animation-delay:.3485s}@-webkit-keyframes dg-circle-oscillation{50%{opacity:1}}@keyframes dg-circle-oscillation{50%{opacity:1}}body.dg-open{width:100%;height:100%;overflow:hidden}.dg-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.dg-container [disabled]{cursor:not-allowed;opacity:.3}.dg-backdrop{background-color:rgba(0,0,0,.8)}.dg-backdrop,.dg-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:5000}.dg-content-cont{width:100%;font-family:inherit}.dg-main-content{width:98%;max-width:400px;padding:15px;border-radius:5px;margin:25px auto;background-color:#fff}.dg-content{font-size:16px;line-height:1.3em}.dg-title{margin:0 0 10px 0;padding:0;font-size:18px}.dg-content-body{border-bottom:2px solid #e1e6ea;padding-bottom:15px}.dg-content-footer{position:relative;padding:15px 0 0}.dg-form{background-color:#f8f8ff;padding:10px;margin-bottom:-15px}.dg-content-cont--floating{position:absolute;top:35%;-webkit-transform:translateY(-70%);transform:translateY(-70%);margin-top:0}@media (max-height:700px){.dg-content-cont--floating{position:relative;top:10%;-webkit-transform:none;transform:none;margin-top:0}}.dg-btn{display:inline-block;position:relative;min-width:80px;padding:6px 20px;border-radius:4px;outline:0;border:2px solid transparent;text-align:center;text-decoration:none;cursor:pointer;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:16px;font-weight:700}.dg-btn:active,.dg-btn:focus,.dg-btn:link{outline:none}.dg-btn::-moz-focus-inner{border:0}.dg-btn--cancel{color:#fefefe;background-color:#0096d9}.dg-btn--ok{color:#0096d9;background-color:#fefefe;border-color:#0096d9}.dg-pull-right{float:right}.dg-btn.dg-btn--loading .dg-btn-content{visibility:hidden}.dg-clear:before{content:" ";display:block;clear:both}.dg-content-body--has-title .dg-content{font-size:14px}.dg-container--has-input .dg-main-content{max-width:450px}.dg-container--has-input .dg-content{margin-bottom:15px}.dg-container--has-input .dg-content-body{border-bottom:none}.dg-container--has-input .dg-form{border:1px solid #e1e6ea;border-bottom:none;border-top-left-radius:4px;border-top-right-radius:4px}.dg-container--has-input .dg-content-footer{background-color:#f8f8ff;border:1px solid #e1e6ea;border-top:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:0 10px 10px}.dg-container .dg-highlight-1{color:#ff8c00;font-weight:700;border-bottom:1px solid #2ba5ff}.dg-container .dg-highlight-2{color:#2ba5ff;font-weight:700;border-bottom:1px solid #ff8c00}',""]),e.exports=t},cde8:function(e,t,n){var r=n("47a0");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("4233703c",r,e)}},cee4:function(e,t,n){"use strict";var r=n("c532"),i=n("1d2b"),o=n("0a06"),a=n("4a7b"),s=n("2444");function c(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var l=c(s);l.Axios=o,l.create=function(e){return c(a(l.defaults,e))},l.Cancel=n("7a77"),l.CancelToken=n("8df4"),l.isCancel=n("2e67"),l.all=function(e){return Promise.all(e)},l.spread=n("0df6"),l.isAxiosError=n("5f02"),e.exports=l,e.exports.default=l},cf98:function(e,t){e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},d066:function(e,t,n){var r=n("da84"),i=n("1626"),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},d0f2:function(e,t,n){"use strict";(function(e){var r=n("c973").default;n("d9e2");var i=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixBaseApis=d;var o=n("788e"),a=n("63c7"),s=n("ef06"),c=i(n("3987")),l=n("1c8f");function u(e,t){switch(e){case o.SERVICE_TYPES.IS:return t+l.PREFIX_IDENTITY_V2+"/terms";case o.SERVICE_TYPES.IM:return t+"/_matrix/integrations/v1/terms";default:throw new Error("Unsupported service type")}}function d(e){c.checkObjectHasKeys(e,["baseUrl","request"]),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.identityServer=e.identityServer;const t={baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,request:e.request,prefix:l.PREFIX_R0,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader};this._http=new l.MatrixHttpApi(this,t),this._txnCtr=0}d.prototype.getHomeserverUrl=function(){return this.baseUrl},d.prototype.getIdentityServerUrl=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&(this.idBaseUrl.startsWith("http://")||this.idBaseUrl.startsWith("https://"))?this.idBaseUrl.split("://")[1]:this.idBaseUrl},d.prototype.setIdentityServerUrl=function(e){this.idBaseUrl=c.ensureNoTrailingSlash(e),this._http.setIdBaseUrl(this.idBaseUrl)},d.prototype.getAccessToken=function(){return this._http.opts.accessToken||null},d.prototype.isLoggedIn=function(){return void 0!==this._http.opts.accessToken},d.prototype.makeTxnId=function(){return"m"+(new Date).getTime()+"."+this._txnCtr++},d.prototype.isUsernameAvailable=function(e){return this._http.authedRequest(void 0,"GET","/register/available",{username:e}).then(e=>e.available)},d.prototype.register=function(e,t,n,r,i,o,a,s){!0===i?i={email:!0}:null!==i&&void 0!==i||(i={}),"function"===typeof a&&(s=a,a=void 0),n&&(r.session=n);const c={auth:r};return void 0!==e&&null!==e&&(c.username=e),void 0!==t&&null!==t&&(c.password=t),i.email&&(c.bind_email=!0),i.msisdn&&(c.bind_msisdn=!0),void 0!==o&&null!==o&&(c.guest_access_token=o),void 0!==a&&null!==a&&(c.inhibit_login=a),void 0!==t&&null!==t&&(c.x_show_msisdn=!0),this.registerRequest(c,void 0,s)},d.prototype.registerGuest=function(e,t){return e=e||{},e.body=e.body||{},this.registerRequest(e.body,"guest",t)},d.prototype.registerRequest=function(e,t,n){const r={};return t&&(r.kind=t),this._http.request(n,"POST","/register",r,e)},d.prototype.loginFlows=function(e){return this._http.request(e,"GET","/login")},d.prototype.login=function(e,t,n){const r={type:e};return c.extend(r,t),this._http.authedRequest((e,t)=>{t&&t.access_token&&t.user_id&&(this._http.opts.accessToken=t.access_token,this.credentials={userId:t.user_id}),n&&n(e,t)},"POST","/login",void 0,r)},d.prototype.loginWithPassword=function(e,t,n){return this.login("m.login.password",{user:e,password:t},n)},d.prototype.loginWithSAML2=function(e,t){return this.login("m.login.saml2",{relay_state:e},t)},d.prototype.getCasLoginUrl=function(e){return this.getSsoLoginUrl(e,"cas")},d.prototype.getSsoLoginUrl=function(e,t,n){void 0===t&&(t="sso");let r=l.PREFIX_R0,i="/login/"+t+"/redirect";return n&&(i+="/"+n,r="/_matrix/client/unstable/org.matrix.msc2858"),this._http.getUrl(i,{redirectUrl:e},r)},d.prototype.loginWithToken=function(e,t){return this.login("m.login.token",{token:e},t)},d.prototype.logout=function(e){return this._http.authedRequest(e,"POST","/logout")},d.prototype.deactivateAccount=function(e,t){if("function"===typeof t)throw new Error("deactivateAccount no longer accepts a callback parameter");const n={};return e&&(n.auth=e),void 0!==t&&(n.erase=t),this._http.authedRequest(void 0,"POST","/account/deactivate",void 0,n)},d.prototype.getFallbackAuthUrl=function(e,t){const n=c.encodeUri("/auth/$loginType/fallback/web",{$loginType:e});return this._http.getUrl(n,{session:t},l.PREFIX_R0)},d.prototype.createRoom=function(){var e=r((function*(e,t){const n=(e.invite_3pid||[]).filter(e=>!e.id_access_token);if(n.length>0&&this.identityServer&&this.identityServer.getAccessToken&&(yield this.doesServerAcceptIdentityAccessToken())){const e=yield this.identityServer.getAccessToken();if(e)for(const t of n)t.id_access_token=e}return this._http.authedRequest(t,"POST","/createRoom",void 0,e)}));return function(t,n){return e.apply(this,arguments)}}(),d.prototype.fetchRelations=function(){var e=r((function*(e,t,n,r,i){const o={};i.from&&(o.from=i.from);const a=c.encodeParams(o),s=c.encodeUri("/rooms/$roomId/relations/$eventId/$relationType/$eventType?"+a,{$roomId:e,$eventId:t,$relationType:n,$eventType:r}),u=yield this._http.authedRequest(void 0,"GET",s,null,null,{prefix:l.PREFIX_UNSTABLE});return u}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),d.prototype.roomState=function(e,t){const n=c.encodeUri("/rooms/$roomId/state",{$roomId:e});return this._http.authedRequest(t,"GET",n)},d.prototype.fetchRoomEvent=function(e,t,n){const r=c.encodeUri("/rooms/$roomId/event/$eventId",{$roomId:e,$eventId:t});return this._http.authedRequest(n,"GET",r)},d.prototype.members=function(e,t,n,r,i){const o={};t&&(o.membership=t),n&&(o.not_membership=n),r&&(o.at=r);const a=c.encodeParams(o),s=c.encodeUri("/rooms/$roomId/members?"+a,{$roomId:e});return this._http.authedRequest(i,"GET",s)},d.prototype.upgradeRoom=function(e,t){const n=c.encodeUri("/rooms/$roomId/upgrade",{$roomId:e});return this._http.authedRequest(void 0,"POST",n,void 0,{new_version:t})},d.prototype.getGroupSummary=function(e){const t=c.encodeUri("/groups/$groupId/summary",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.getGroupProfile=function(e){const t=c.encodeUri("/groups/$groupId/profile",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.setGroupProfile=function(e,t){const n=c.encodeUri("/groups/$groupId/profile",{$groupId:e});return this._http.authedRequest(void 0,"POST",n,void 0,t)},d.prototype.setGroupJoinPolicy=function(e,t){const n=c.encodeUri("/groups/$groupId/settings/m.join_policy",{$groupId:e});return this._http.authedRequest(void 0,"PUT",n,void 0,{"m.join_policy":t})},d.prototype.getGroupUsers=function(e){const t=c.encodeUri("/groups/$groupId/users",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.getGroupInvitedUsers=function(e){const t=c.encodeUri("/groups/$groupId/invited_users",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.getGroupRooms=function(e){const t=c.encodeUri("/groups/$groupId/rooms",{$groupId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.inviteUserToGroup=function(e,t){const n=c.encodeUri("/groups/$groupId/admin/users/invite/$userId",{$groupId:e,$userId:t});return this._http.authedRequest(void 0,"PUT",n,void 0,{})},d.prototype.removeUserFromGroup=function(e,t){const n=c.encodeUri("/groups/$groupId/admin/users/remove/$userId",{$groupId:e,$userId:t});return this._http.authedRequest(void 0,"PUT",n,void 0,{})},d.prototype.addUserToGroupSummary=function(e,t,n){const r=c.encodeUri(n?"/groups/$groupId/summary/$roleId/users/$userId":"/groups/$groupId/summary/users/$userId",{$groupId:e,$roleId:n,$userId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{})},d.prototype.removeUserFromGroupSummary=function(e,t){const n=c.encodeUri("/groups/$groupId/summary/users/$userId",{$groupId:e,$userId:t});return this._http.authedRequest(void 0,"DELETE",n,void 0,{})},d.prototype.addRoomToGroupSummary=function(e,t,n){const r=c.encodeUri(n?"/groups/$groupId/summary/$categoryId/rooms/$roomId":"/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$categoryId:n,$roomId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{})},d.prototype.removeRoomFromGroupSummary=function(e,t){const n=c.encodeUri("/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"DELETE",n,void 0,{})},d.prototype.addRoomToGroup=function(e,t,n){void 0===n&&(n=!0);const r=c.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{"m.visibility":{type:n?"public":"private"}})},d.prototype.updateGroupRoomVisibility=function(e,t,n){const r=c.encodeUri("/groups/$groupId/admin/rooms/$roomId/config/m.visibility",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"PUT",r,void 0,{type:n?"public":"private"})},d.prototype.removeRoomFromGroup=function(e,t){const n=c.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this._http.authedRequest(void 0,"DELETE",n,void 0,{})},d.prototype.acceptGroupInvite=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=c.encodeUri("/groups/$groupId/self/accept_invite",{$groupId:e});return this._http.authedRequest(void 0,"PUT",n,void 0,t||{})},d.prototype.joinGroup=function(e){const t=c.encodeUri("/groups/$groupId/self/join",{$groupId:e});return this._http.authedRequest(void 0,"PUT",t,void 0,{})},d.prototype.leaveGroup=function(e){const t=c.encodeUri("/groups/$groupId/self/leave",{$groupId:e});return this._http.authedRequest(void 0,"PUT",t,void 0,{})},d.prototype.getJoinedGroups=function(){const e=c.encodeUri("/joined_groups");return this._http.authedRequest(void 0,"GET",e)},d.prototype.createGroup=function(e){const t=c.encodeUri("/create_group");return this._http.authedRequest(void 0,"POST",t,void 0,e)},d.prototype.getPublicisedGroups=function(e){const t=c.encodeUri("/publicised_groups");return this._http.authedRequest(void 0,"POST",t,void 0,{user_ids:e})},d.prototype.setGroupPublicity=function(e,t){const n=c.encodeUri("/groups/$groupId/self/update_publicity",{$groupId:e});return this._http.authedRequest(void 0,"PUT",n,void 0,{publicise:t})},d.prototype.getStateEvent=function(e,t,n,r){const i={$roomId:e,$eventType:t,$stateKey:n};let o=c.encodeUri("/rooms/$roomId/state/$eventType",i);return void 0!==n&&(o=c.encodeUri(o+"/$stateKey",i)),this._http.authedRequest(r,"GET",o)},d.prototype.sendStateEvent=function(e,t,n,r,i){const o={$roomId:e,$eventType:t,$stateKey:r};let a=c.encodeUri("/rooms/$roomId/state/$eventType",o);return void 0!==r&&(a=c.encodeUri(a+"/$stateKey",o)),this._http.authedRequest(i,"PUT",a,void 0,n)},d.prototype.roomInitialSync=function(e,t,n){c.isFunction(t)&&(n=t,t=void 0);const r=c.encodeUri("/rooms/$roomId/initialSync",{$roomId:e});return t||(t=30),this._http.authedRequest(n,"GET",r,{limit:t})},d.prototype.setRoomReadMarkersHttpRequest=function(e,t,n,r){const i=c.encodeUri("/rooms/$roomId/read_markers",{$roomId:e}),o={"m.fully_read":t,"m.read":n,"m.hidden":Boolean(!!r&&r.hidden)};return this._http.authedRequest(void 0,"POST",i,void 0,o)},d.prototype.getJoinedRooms=function(){const e=c.encodeUri("/joined_rooms");return this._http.authedRequest(void 0,"GET",e)},d.prototype.getJoinedRoomMembers=function(e){const t=c.encodeUri("/rooms/$roomId/joined_members",{$roomId:e});return this._http.authedRequest(void 0,"GET",t)},d.prototype.publicRooms=function(e,t){"function"==typeof e&&(t=e,e={}),void 0===e&&(e={});const n={};return e.server&&(n.server=e.server,delete e.server),0===Object.keys(e).length&&0===Object.keys(n).length?this._http.authedRequest(t,"GET","/publicRooms"):this._http.authedRequest(t,"POST","/publicRooms",n,e)},d.prototype.createAlias=function(e,t,n){const r=c.encodeUri("/directory/room/$alias",{$alias:e}),i={room_id:t};return this._http.authedRequest(n,"PUT",r,void 0,i)},d.prototype.deleteAlias=function(e,t){const n=c.encodeUri("/directory/room/$alias",{$alias:e});return this._http.authedRequest(t,"DELETE",n,void 0,void 0)},d.prototype.unstableGetLocalAliases=function(e,t){const n=c.encodeUri("/rooms/$roomId/aliases",{$roomId:e}),r=l.PREFIX_UNSTABLE+"/org.matrix.msc2432";return this._http.authedRequest(t,"GET",n,null,null,{prefix:r})},d.prototype.getRoomIdForAlias=function(e,t){const n=c.encodeUri("/directory/room/$alias",{$alias:e});return this._http.authedRequest(t,"GET",n)},d.prototype.resolveRoomAlias=function(e,t){const n=c.encodeUri("/directory/room/$alias",{$alias:e});return this._http.request(t,"GET",n)},d.prototype.getRoomDirectoryVisibility=function(e,t){const n=c.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this._http.authedRequest(t,"GET",n)},d.prototype.setRoomDirectoryVisibility=function(e,t,n){const r=c.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this._http.authedRequest(n,"PUT",r,void 0,{visibility:t})},d.prototype.setRoomDirectoryVisibilityAppService=function(e,t,n,r){const i=c.encodeUri("/directory/list/appservice/$networkId/$roomId",{$networkId:e,$roomId:t});return this._http.authedRequest(r,"PUT",i,void 0,{visibility:n})},d.prototype.searchUserDirectory=function(e){const t={search_term:e.term};return void 0!==e.limit&&(t.limit=e.limit),this._http.authedRequest(void 0,"POST","/user_directory/search",void 0,t)},d.prototype.uploadContent=function(e,t){return this._http.uploadContent(e,t)},d.prototype.cancelUpload=function(e){return this._http.cancelUpload(e)},d.prototype.getCurrentUploads=function(){return this._http.getCurrentUploads()},d.prototype.getProfileInfo=function(e,t,n){c.isFunction(t)&&(n=t,t=void 0);const r=t?c.encodeUri("/profile/$userId/$info",{$userId:e,$info:t}):c.encodeUri("/profile/$userId",{$userId:e});return this._http.authedRequest(n,"GET",r)},d.prototype.getThreePids=function(e){const t="/account/3pid";return this._http.authedRequest(e,"GET",t,void 0,void 0)},d.prototype.addThreePid=function(e,t,n){const r="/account/3pid",i={threePidCreds:e,bind:t};return this._http.authedRequest(n,"POST",r,null,i)},d.prototype.addThreePidOnly=function(){var e=r((function*(e){const t="/account/3pid/add",n=(yield this.isVersionSupported("r0.6.0"))?l.PREFIX_R0:l.PREFIX_UNSTABLE;return this._http.authedRequest(void 0,"POST",t,null,e,{prefix:n})}));return function(t){return e.apply(this,arguments)}}(),d.prototype.bindThreePid=function(){var e=r((function*(e){const t="/account/3pid/bind",n=(yield this.isVersionSupported("r0.6.0"))?l.PREFIX_R0:l.PREFIX_UNSTABLE;return this._http.authedRequest(void 0,"POST",t,null,e,{prefix:n})}));return function(t){return e.apply(this,arguments)}}(),d.prototype.unbindThreePid=function(){var e=r((function*(e,t){const n="/account/3pid/unbind",r={medium:e,address:t,id_server:this.getIdentityServerUrl(!0)},i=(yield this.isVersionSupported("r0.6.0"))?l.PREFIX_R0:l.PREFIX_UNSTABLE;return this._http.authedRequest(void 0,"POST",n,null,r,{prefix:i})}));return function(t,n){return e.apply(this,arguments)}}(),d.prototype.deleteThreePid=function(e,t){const n="/account/3pid/delete",r={medium:e,address:t};return this._http.authedRequest(void 0,"POST",n,null,r)},d.prototype.setPassword=function(e,t,n){const r="/account/password",i={auth:e,new_password:t};return this._http.authedRequest(n,"POST",r,null,i)},d.prototype.getDevices=function(){return this._http.authedRequest(void 0,"GET","/devices",void 0,void 0)},d.prototype.getDevice=function(e){const t=c.encodeUri("/devices/$device_id",{$device_id:e});return this._http.authedRequest(void 0,"GET",t,void 0,void 0)},d.prototype.setDeviceDetails=function(e,t){const n=c.encodeUri("/devices/$device_id",{$device_id:e});return this._http.authedRequest(void 0,"PUT",n,void 0,t)},d.prototype.deleteDevice=function(e,t){const n=c.encodeUri("/devices/$device_id",{$device_id:e}),r={};return t&&(r.auth=t),this._http.authedRequest(void 0,"DELETE",n,void 0,r)},d.prototype.deleteMultipleDevices=function(e,t){const n={devices:e};t&&(n.auth=t);const r="/delete_devices";return this._http.authedRequest(void 0,"POST",r,void 0,n)},d.prototype.getPushers=function(e){const t="/pushers";return this._http.authedRequest(e,"GET",t,void 0,void 0)},d.prototype.setPusher=function(e,t){const n="/pushers/set";return this._http.authedRequest(t,"POST",n,null,e)},d.prototype.getPushRules=function(e){return this._http.authedRequest(e,"GET","/pushrules/").then(e=>s.PushProcessor.rewriteDefaultRules(e))},d.prototype.addPushRule=function(e,t,n,r,i){const o=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:n});return this._http.authedRequest(i,"PUT",o,void 0,r)},d.prototype.deletePushRule=function(e,t,n,r){const i=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:n});return this._http.authedRequest(r,"DELETE",i)},d.prototype.setPushRuleEnabled=function(e,t,n,r,i){const o=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId/enabled",{$kind:t,$ruleId:n});return this._http.authedRequest(i,"PUT",o,void 0,{enabled:r})},d.prototype.setPushRuleActions=function(e,t,n,r,i){const o=c.encodeUri("/pushrules/"+e+"/$kind/$ruleId/actions",{$kind:t,$ruleId:n});return this._http.authedRequest(i,"PUT",o,void 0,{actions:r})},d.prototype.search=function(e,t){const n={};return e.next_batch&&(n.next_batch=e.next_batch),this._http.authedRequest(t,"POST","/search",n,e.body)},d.prototype.uploadKeysRequest=function(e,t,n){return this._http.authedRequest(n,"POST","/keys/upload",void 0,e)},d.prototype.uploadKeySignatures=function(e){return this._http.authedRequest(void 0,"POST","/keys/signatures/upload",void 0,e,{prefix:l.PREFIX_UNSTABLE})},d.prototype.downloadKeysForUsers=function(e,t){if(c.isFunction(t))throw new Error("downloadKeysForUsers no longer accepts a callback parameter");t=t||{};const n={device_keys:{}};return"token"in t&&(n.token=t.token),e.forEach(e=>{n.device_keys[e]=[]}),this._http.authedRequest(void 0,"POST","/keys/query",void 0,n)},d.prototype.claimOneTimeKeys=function(e,t,n){const r={};void 0===t&&(t="signed_curve25519");for(let a=0;a{const t=e[0].toLowerCase(),i=e[1].toLowerCase(),a=n.sha256(`${t} ${i} ${r["pepper"]}`).replace(/\+/g,"-").replace(/\//g,"_");return o[a]=e[0],a}),r["algorithm"]="sha256"}else{if(!i["algorithms"].includes("none"))throw new Error("Unsupported identity server: unknown hash algorithm");r["addresses"]=t.map(e=>{const t=e[0].toLowerCase(),n=e[1].toLowerCase(),r=`${t} ${n}`;return o[r]=e[0],r}),r["algorithm"]="none"}const a=yield this._http.idServerRequest(void 0,"POST","/lookup",r,l.PREFIX_IDENTITY_V2,n);if(!a||!a["mappings"])return[];const s=[];for(const e of Object.keys(a["mappings"])){const t=a["mappings"][e],n=o[e];if(!n)throw new Error("Identity server returned more results than expected");s.push({address:n,mxid:t})}return s}));return function(e,n){return t.apply(this,arguments)}}(),d.prototype.lookupThreePid=function(){var e=r((function*(e,t,n,r){const i=yield this.identityHashedLookup([[t,e]],r),o=i.find(e=>e.address===t);if(!o)return n&&n(null,{}),{};const a={address:t,medium:e,mxid:o.mxid};return n&&n(null,a),a}));return function(t,n,r,i){return e.apply(this,arguments)}}(),d.prototype.bulkLookupThreePids=function(){var e=r((function*(e,t){const n=yield this.identityHashedLookup(e.map(e=>[e[1],e[0]]),t),r=[];for(const i of n){const t=e.find(e=>e[1]===i.address);if(!t)throw new Error("Identity sever returned unexpected results");r.push([t[0],i.address,i.mxid])}return{threepids:r}}));return function(t,n){return e.apply(this,arguments)}}(),d.prototype.getIdentityAccount=function(e){return this._http.idServerRequest(void 0,"GET","/account",void 0,l.PREFIX_IDENTITY_V2,e)},d.prototype.sendToDevice=function(e,t,n){const r=c.encodeUri("/sendToDevice/$eventType/$txnId",{$eventType:e,$txnId:n||this.makeTxnId()}),i={messages:t},o=Object.keys(t).reduce((e,n)=>(e[n]=Object.keys(t[n]),e),{});return a.logger.log("PUT "+r,o),this._http.authedRequest(void 0,"PUT",r,void 0,i)},d.prototype.getThirdpartyProtocols=function(){return this._http.authedRequest(void 0,"GET","/thirdparty/protocols",void 0,void 0).then(e=>{if(!e||"object"!==typeof e)throw new Error("/thirdparty/protocols did not return an object: "+e);return e})},d.prototype.getThirdpartyLocation=function(e,t){const n=c.encodeUri("/thirdparty/location/$protocol",{$protocol:e});return this._http.authedRequest(void 0,"GET",n,t,void 0)},d.prototype.getThirdpartyUser=function(e,t){const n=c.encodeUri("/thirdparty/user/$protocol",{$protocol:e});return this._http.authedRequest(void 0,"GET",n,t,void 0)},d.prototype.getTerms=function(e,t){const n=u(e,t);return this._http.requestOtherUrl(void 0,"GET",n)},d.prototype.agreeToTerms=function(e,t,n,r){const i=u(e,t),o={Authorization:"Bearer "+n};return this._http.requestOtherUrl(void 0,"POST",i,null,{user_accepts:r},{headers:o})},d.prototype.reportEvent=function(e,t,n,r){const i=c.encodeUri("/rooms/$roomId/report/$eventId",{$roomId:e,$eventId:t});return this._http.authedRequest(void 0,"POST",i,null,{score:n,reason:r})},d.prototype.getSpaceSummary=function(e,t,n,r,i,o){const a=c.encodeUri("/rooms/$roomId/spaces",{$roomId:e});return this._http.authedRequest(void 0,"POST",a,null,{max_rooms_per_space:t,suggested_only:n,auto_join_only:r,limit:i,batch:o},{prefix:"/_matrix/client/unstable/org.matrix.msc2946"})}}).call(this,n("c8ba"))},d15f:function(e,t,n){"use strict";var r=n("dbce");Object.defineProperty(t,"__esModule",{value:!0}),t.Group=a;var i=r(n("3987")),o=n("faa1");function a(e){this.groupId=e,this.name=null,this.avatarUrl=null,this.myMembership=null,this.inviter=null}i.inherits(a,o.EventEmitter),a.prototype.setProfile=function(e,t){this.name===e&&this.avatarUrl===t||(this.name=e||this.groupId,this.avatarUrl=t,this.emit("Group.profile",this))},a.prototype.setMyMembership=function(e){this.myMembership!==e&&(this.myMembership=e,this.emit("Group.myMembership",this))},a.prototype.setInviter=function(e){this.inviter=e}},d164:function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e}},d1e7:function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);t.f=o?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},d233:function(t,n,r){"use strict";var i=r("b313"),o=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e){while(e.length>1){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],i=0;i=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===i.RFC1738&&(40===u||41===u)?c+=a.charAt(l):u<128?c+=s[u]:u<2048?c+=s[192|u>>6]+s[128|63&u]:u<55296||u>=57344?c+=s[224|u>>12]+s[128|u>>6&63]+s[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),c+=s[240|u>>18]+s[128|u>>12&63]+s[128|u>>6&63]+s[128|63&u])}return c},p=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r{},watch:{},computed:Object(o["c"])({auth:e=>e.auth}),methods:{}},l=c,u=n("2877");function d(e){var t=n("d5de");t.__inject__&&t.__inject__(e)}var f=Object(u["a"])(l,a,s,!1,d,"756bd822",null,!0),h=f.exports,p=n("42cd"),m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"contactActions"}},[n("div",{staticClass:"actions"},[e.tetatetid?n("div",{staticClass:"actionWrapper"},[e.blocked?e._e():n("router-link",{attrs:{to:"chat?id="+e.tetatetid+"&u="+e.contact.id}},[0!==e.readyChat.length?n("button",{staticClass:"button bright rounded small"},[e._v(e._s(e.$t("caption.moveToChat"))+" "),n("i",{staticClass:"far fa-comment-alt"})]):n("button",{staticClass:"button bright rounded small"},[e._v(e._s(e.$t("button.starChatButton"))),n("i",{staticClass:"far fa-comment-alt"})])])],1):e._e(),e.blocked?n("button",{staticClass:"unBlockButton",on:{click:function(t){return e.unblock()}}},[e._v(e._s(e.$t("button.unblock")))]):n("button",{staticClass:"blockButton",on:{click:function(t){return e.blockUser()}}},[e._v(e._s(e.$t("button.blockUser")))])])])},v=[],g={name:"contactActions",props:{contact:Object,blocked:Boolean},data:function(){return{loading:!1}},created:()=>{},watch:{},computed:Object(o["c"])({auth:e=>e.auth,tetatetid:function(){return this.core.mtrx.kit.tetatetid(this.contact,this.core.user.userinfo)},readyChat:function(){var e=this.$store.state.chats,t=this.tetatetid;return _.filter(e,e=>e.info.title.replace(/#/,"")===t)}}),methods:{chat:function(){this.core.mtrx.kit.tetatetid(this.contact,this.core.user.userinfo)},blockUser(){this.core.mtrx.blockUser(this.contact.id).catch(e=>{console.error(e)})},unblock(){this.core.mtrx.unblockUser(this.contact.id).catch(e=>{console.error(e)})}}},y=g;function b(e){var t=n("9205");t.__inject__&&t.__inject__(e)}var w=Object(u["a"])(y,m,v,!1,b,"6fd14ec6",null,!0),x=w.exports,S={name:"contact",props:{contact:Object},components:{contactView:h,contactActions:x,userView:p["a"]},data:function(){return{loading:!1}},created:()=>{},watch:{},mounted(){this.$store.commit("active",!0),this.$store.commit("blockactive",{value:!0,item:"contact"})},destroyed(){this.$store.commit("blockactive",{value:!1,item:"contact"})},computed:Object(o["c"])({auth:e=>e.auth,activeuser:function(){return this.core.user.userinfo},blocked:function(){if(0!==this.$store.state.chats.length)return this.core.mtrx.blockeduser(this.contact.id)},pocketnet:e=>e.pocketnet,minimized:e=>e.minimized,active:e=>e.active}),methods:{}},k=S;function E(e){var t=n("81bf");t.__inject__&&t.__inject__(e)}var C=Object(u["a"])(k,r,i,!1,E,"7650772c",null,!0);t["default"]=C.exports},d485:function(e,t,n){e.exports=o;var r=n("faa1").EventEmitter,i=n("3fb5");function o(){r.call(this)}i(o,r),o.Readable=n("0ac3"),o.Writable=n("af7e"),o.Duplex=n("7c16"),o.Transform=n("89fd"),o.PassThrough=n("51a2"),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"===typeof e.destroy&&e.destroy())}function l(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",c),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("error",l),e.on("error",l),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e}},d5de:function(e,t,n){"use strict";n.r(t);var r=n("704f");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},d613:function(e,t,n){"use strict";let r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RoomType=t.RoomCreateTypeField=t.MsgType=t.EventType=void 0,t.EventType=r,function(e){e["RoomCanonicalAlias"]="m.room.canonical_alias",e["RoomCreate"]="m.room.create",e["RoomJoinRules"]="m.room.join_rules",e["RoomMember"]="m.room.member",e["RoomThirdPartyInvite"]="m.room.third_party_invite",e["RoomPowerLevels"]="m.room.power_levels",e["RoomName"]="m.room.name",e["RoomTopic"]="m.room.topic",e["RoomAvatar"]="m.room.avatar",e["RoomPinnedEvents"]="m.room.pinned_events",e["RoomEncryption"]="m.room.encryption",e["RoomHistoryVisibility"]="m.room.history_visibility",e["RoomGuestAccess"]="m.room.guest_access",e["RoomServerAcl"]="m.room.server_acl",e["RoomTombstone"]="m.room.tombstone",e["RoomAliases"]="m.room.aliases",e["SpaceChild"]="org.matrix.msc1772.space.child",e["SpaceParent"]="org.matrix.msc1772.space.parent",e["RoomRedaction"]="m.room.redaction",e["RoomMessage"]="m.room.message",e["RoomMessageEncrypted"]="m.room.encrypted",e["Sticker"]="m.sticker",e["CallInvite"]="m.call.invite",e["CallCandidates"]="m.call.candidates",e["CallAnswer"]="m.call.answer",e["CallHangup"]="m.call.hangup",e["CallReject"]="m.call.reject",e["CallSelectAnswer"]="m.call.select_answer",e["CallNegotiate"]="m.call.negotiate",e["CallReplaces"]="m.call.replaces",e["KeyVerificationRequest"]="m.key.verification.request",e["KeyVerificationStart"]="m.key.verification.start",e["KeyVerificationCancel"]="m.key.verification.cancel",e["KeyVerificationMac"]="m.key.verification.mac",e["KeyVerificationDone"]="m.key.verification.done",e["RoomMessageFeedback"]="m.room.message.feedback",e["Typing"]="m.typing",e["Receipt"]="m.receipt",e["Presence"]="m.presence",e["FullyRead"]="m.fully_read",e["Tag"]="m.tag",e["PushRules"]="m.push_rules",e["Direct"]="m.direct",e["IgnoredUserList"]="m.ignored_user_list",e["RoomKey"]="m.room_key",e["RoomKeyRequest"]="m.room_key_request",e["ForwardedRoomKey"]="m.forwarded_room_key",e["Dummy"]="m.dummy"}(r||(t.EventType=r={})),t.MsgType=i,function(e){e["Text"]="m.text",e["Emote"]="m.emote",e["Notice"]="m.notice",e["Image"]="m.image",e["File"]="m.file",e["Audio"]="m.audio",e["Location"]="m.location",e["Video"]="m.video"}(i||(t.MsgType=i={}));const o="org.matrix.msc1772.type";let a;t.RoomCreateTypeField=o,t.RoomType=a,function(e){e["Space"]="org.matrix.msc1772.space"}(a||(t.RoomType=a={}))},d6cc:function(e,t,n){"use strict";n.r(t);var r=n("0c96");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},d6dd:function(e,t,n){"use strict";var r=n("966d"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var o=Object.create(n("3a7c"));o.inherits=n("3fb5");var a=n("6f2e"),s=n("6ffa");o.inherits(d,a);for(var c=i(s.prototype),l=0;lt==e);return t?i(t):e}},d924:function(e,t,n){var r=n("7ffb");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("2d7346b2",r,e)}},d925:function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},d97d:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".new[data-v-9218004e]{color:rgb(var(--color-good))}",""]),e.exports=t},d9b5:function(e,t,n){var r=n("d066"),i=n("1626"),o=n("3a9b"),a=n("fdbf"),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,s(e))}},d9e2:function(e,t,n){var r=n("23e7"),i=n("da84"),o=n("2ba4"),a=n("e5cb"),s="WebAssembly",c=i[s],l=7!==Error("e",{cause:7}).cause,u=function(e,t){var n={};n[e]=a(e,t,l),r({global:!0,constructor:!0,arity:1,forced:l},n)},d=function(e,t){if(c&&c[e]){var n={};n[e]=a(s+"."+e,t,l),r({target:s,stat:!0,constructor:!0,arity:1,forced:l},n)}};u("Error",(function(e){return function(t){return o(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),u("URIError",(function(e){return function(t){return o(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},da84:function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},da9d:function(e,t,n){"use strict";n("d9e2"),Object.defineProperty(t,"__esModule",{value:!0}),t.TimelineWindow=c,t.TimelineIndex=l;var r=n("e685"),i=n("63c7");const o=!1,a=o?i.logger.log.bind(i.logger):function(){},s=5;function c(e,t,n){n=n||{},this._client=e,this._timelineSet=t,this._start=null,this._end=null,this._eventCount=0,this._windowLimit=n.windowLimit||1e3}function l(e,t){this.timeline=e,this.index=t}c.prototype.load=function(e,t){const n=this;t=t||20;const r=function(r){let i;const o=r.getEvents();if(e){for(let t=0;t0&&this.unpaginate(t,e!=r.EventTimeline.BACKWARDS),!0}return!1},c.prototype.canPaginate=function(e){const t=this.getTimelineIndex(e);if(!t)return a("TimelineWindow: no timeline yet"),!1;if(e==r.EventTimeline.BACKWARDS){if(t.index>t.minIndex())return!0}else if(t.indexthis._eventCount||e<0)throw new Error("Attemting to unpaginate "+e+" events, but only have "+this._eventCount+" in the timeline");while(e>0){const r=t?n.advance(e):n.retreat(e);if(r<=0)throw new Error("Unable to unpaginate any further, but still have "+this._eventCount+" events");e-=r,this._eventCount-=r,a("TimelineWindow.unpaginate: dropped "+r+" (now "+this._eventCount+")")}},c.prototype.getEvents=function(){if(!this._start)return[];const e=[];let t=this._start.timeline;while(1){const n=t.getEvents();let i=0,o=n.length;t===this._start.timeline&&(i=this._start.index+t.getBaseIndex()),t===this._end.timeline&&(o=this._end.index+t.getBaseIndex());for(let t=i;t0)return this.index+=t,t;const n=this.timeline.getNeighbouringTimeline(e<0?r.EventTimeline.BACKWARDS:r.EventTimeline.FORWARDS);return n?(this.timeline=n,this.index=e<0?this.maxIndex():this.minIndex(),a("paginate: switched to new neighbour"),this.advance(e)):0},l.prototype.retreat=function(e){return-1*this.advance(-1*e)}},daf5:function(e,t,n){"use strict";var r=n("a593"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,a={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},dbce:function(e,t,n){var r=n("7037")["default"];function i(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=a?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(o,s,c):o[s]=e[s]}return o["default"]=e,n&&n.set(e,o),o}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},dc14:function(e,t,n){"use strict";(function(t,r){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){V(t,e)}}var o;e.exports=R,R.WritableState=I;var a={deprecate:n("b7d1")},s=n("429b"),c=n("b639").Buffer,l=t.Uint8Array||function(){};function u(e){return c.from(e)}function d(e){return c.isBuffer(e)||e instanceof l}var f,h=n("4681"),p=n("0db6"),m=p.getHighWaterMark,v=n("c9b8").codes,g=v.ERR_INVALID_ARG_TYPE,y=v.ERR_METHOD_NOT_IMPLEMENTED,b=v.ERR_MULTIPLE_CALLBACK,w=v.ERR_STREAM_CANNOT_PIPE,x=v.ERR_STREAM_DESTROYED,S=v.ERR_STREAM_NULL_VALUES,k=v.ERR_STREAM_WRITE_AFTER_END,E=v.ERR_UNKNOWN_ENCODING,C=h.errorOrDestroy;function T(){}function I(e,t,r){o=o||n("b19a"),e=e||{},"boolean"!==typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=m(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function R(e){o=o||n("b19a");var t=this instanceof o;if(!t&&!f.call(R,this))return new R(e);this._writableState=new I(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),s.call(this)}function O(e,t){var n=new k;C(e,n),r.nextTick(t,n)}function M(e,t,n,i){var o;return null===n?o=new S:"string"===typeof n||t.objectMode||(o=new g("chunk",["string","Buffer"],n)),!o||(C(e,o),r.nextTick(i,o),!1)}function P(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=c.from(t,n)),t}function A(e,t,n,r,i,o){if(!n){var a=P(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,n){n(new y("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,n){var r=this._writableState;return"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||K(this,r,n),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=h.destroy,R.prototype._undestroy=h.undestroy,R.prototype._destroy=function(e,t){t(e)}}).call(this,n("c8ba"),n("4362"))},dc31:function(e,t,n){"use strict";var r=n("a593"),i=n("651d"),o=n("d35c"),a=n("8b5c");function s(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var c=s(a);c.Axios=o,c.create=function(e){return s(r.merge(a,e))},c.Cancel=n("480d"),c.CancelToken=n("827e"),c.isCancel=n("0a3f"),c.all=function(e){return Promise.all(e)},c.spread=n("8ec6"),e.exports=c,e.exports.default=c},dc4a:function(e,t,n){var r=n("59ed");e.exports=function(e,t){var n=e[t];return null==n?void 0:r(n)}},dcd0:function(e,t,n){"use strict";e.exports=a;var r=n("d6dd"),i=Object.create(n("3a7c"));function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{this._resolveFunc=e,this._rejectFunc=t;const n=this._data&&this._data.flows;if(n)this._startNextAuthStage();else{this._busyChangedCallback&&this._busyChangedCallback(!0);let e=null;this._data.session&&(e={session:this._data.session}),this._doRequest(e).finally(()=>{this._busyChangedCallback&&this._busyChangedCallback(!1)})}})},poll:function(){var e=i((function*(){if(!this._data.session)return;if(!this._resolveFunc)return;if(this._submitPromise)return;let e={};if(this._currentStage==u&&this._emailSid){const t={sid:this._emailSid,client_secret:this._clientSecret};if(yield this._matrixClient.doesServerRequireIdServerParam()){const e=s.default.parse(this._matrixClient.getIdentityServerUrl());t.id_server=e.host}e={type:u,threepid_creds:t,threepidCreds:t}}this.submitAuthDict(e,!0)}));return function(){return e.apply(this,arguments)}}(),getSessionId:function(){return this._data?this._data.session:void 0},getClientSecret:function(){return this._clientSecret},getStageParams:function(e){let t={};return this._data&&this._data.params&&(t=this._data.params),t[e]},getChosenFlow(){return this._chosenFlow},submitAuthDict:function(){var t=i((function*(t,n){if(!this._resolveFunc)throw new Error("submitAuthDict() called before attemptAuth()");!n&&this._busyChangedCallback&&this._busyChangedCallback(!0);while(this._submitPromise)try{yield this._submitPromise}catch(e){}let r;this._data.session?(r={session:this._data.session},c.extend(r,t)):r=t;try{this._submitPromise=this._doRequest(r,n),yield this._submitPromise}finally{this._submitPromise=null,!n&&this._busyChangedCallback&&this._busyChangedCallback(!1)}}));return function(e,n){return t.apply(this,arguments)}}(),getEmailSid:function(){return this._emailSid},setEmailSid:function(e){this._emailSid=e},_doRequest:function(){var t=i((function*(t,n){try{const e=yield this._requestCallback(t,n);this._resolveFunc(e),this._resolveFunc=null,this._rejectFunc=null}catch(r){const t=r.data?r.data.flows:null,i=this._data.flows||Boolean(t);401===r.httpStatus&&r.data&&i||(n?l.logger.log("Background poll request failed doing UI auth: ignoring",r):this._rejectFunc(r)),r.data.flows||r.data.completed||r.data.session||(r.data.flows=this._data.flows,r.data.completed=this._data.completed,r.data.session=this._data.session),this._data=r.data;try{this._startNextAuthStage()}catch(e){this._rejectFunc(e),this._resolveFunc=null,this._rejectFunc=null}if(!this._emailSid&&!this._requestingEmailToken&&this._chosenFlow.stages.includes("m.login.email.identity")){this._requestingEmailToken=!0;try{const e=yield this._requestEmailTokenCallback(this._inputs.emailAddress,this._clientSecret,1,this._data.session);this._emailSid=e.sid}catch(e){this._rejectFunc(e),this._resolveFunc=null,this._rejectFunc=null}finally{this._requestingEmailToken=!1}}}}));return function(e,n){return t.apply(this,arguments)}}(),_startNextAuthStage:function(){const e=this._chooseStage();if(!e)throw new Error("No incomplete flows from the server");if(this._currentStage=e,"m.login.dummy"===e)return void this.submitAuthDict({type:"m.login.dummy"});if(this._data&&this._data.errcode||this._data.error)return void this._stateUpdatedCallback(e,{errcode:this._data.errcode||"",error:this._data.error||""});const t={};e==u&&(t.emailSid=this._emailSid),this._stateUpdatedCallback(e,t)},_chooseStage:function(){null===this._chosenFlow&&(this._chosenFlow=this._chooseFlow()),l.logger.log("Active flow => %s",JSON.stringify(this._chosenFlow));const e=this._firstUncompletedStage(this._chosenFlow);return l.logger.log("Next stage: %s",e),e},_chooseFlow:function(){const e=this._data.flows||[],t=Boolean(this._inputs.emailAddress)||Boolean(this._emailSid),n=Boolean(this._inputs.phoneCountry)&&Boolean(this._inputs.phoneNumber);for(const i of e){let e=!1,r=!1;for(const t of i.stages)t===u?e=!0:t==d&&(r=!0);if(e==t&&r==n)return i}const r=new Error("No appropriate authentication flow found");throw r.name="NoAuthFlowFoundError",r.required_stages=[],t&&r.required_stages.push(u),n&&r.required_stages.push(d),r.available_flows=e,r},_firstUncompletedStage:function(e){const t=(this._data||{}).completed||[];for(let n=0;n=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e){"string"!==typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!r;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,r="/"===a.charAt(0))}return t=n(i(t.split("/"),(function(e){return!!e})),!r).join("/"),(r?"/":"")+t||"."},t.normalize=function(e){var r=t.isAbsolute(e),a="/"===o(e,-1);return e=n(i(e.split("/"),(function(e){return!!e})),!r).join("/"),e||r||(e="."),e&&a&&(e+="/"),(r?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(i(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0;n--)if(""!==e[n])break;return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,c=0;c=1;--o)if(t=e.charCodeAt(o),47===t){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=r(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=a+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n("4362"))},e07b:function(e,t,n){var r=n("5a76"),i=n("b5ca"),o=n("69f2"),a=n("8707").Buffer,s=n("7d2a"),c=n("9f9d"),l=n("8be6"),u=a.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,n){var r=h(e),i="sha512"===e||"sha384"===e?128:64;t.length>i?t=r(t):t.lengthe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}var v={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}}};function g(){return this.items.length&&"object"!==l(this.items[0])}var y=!1;if("undefined"!==typeof window){y=!1;try{var b=Object.defineProperty({},"passive",{get:function(){y=!0}});window.addEventListener("test",null,b)}catch(e){}}var _=0,w={name:"RecycleScroller",components:{ResizeObserver:i["a"]},directives:{ObserveVisibility:o["a"]},props:f({},v,{itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1}}),data:function(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes:function(){if(null===this.itemSize){for(var e,t={"-1":{accumulator:0}},n=this.items,r=this.sizeField,i=this.minItemSize,o=1e4,a=0,s=0,c=n.length;s1&&void 0!==arguments[1]&&arguments[1],n=this.$_unusedViews,r=e.nr.type,i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999,this.$_views.delete(e.nr.key))},handleResize:function(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll:function(e){var t=this;this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((function(){t.$_scrollDirty=!1;var e=t.updateVisibleItems(!1,!0),n=e.continuous;n||(clearTimeout(t.$_refreshTimout),t.$_refreshTimout=setTimeout(t.handleScroll,100))})))},handleVisibilityChange:function(e,t){var n=this;this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame((function(){n.updateVisibleItems(!1)}))):this.$emit("hidden"))},updateVisibleItems:function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.itemSize,s=this.$_computedMinItemSize,l=this.typeField,u=this.simpleArray?null:this.keyField,d=this.items,f=d.length,h=this.sizes,p=this.$_views,m=this.$_unusedViews,v=this.pool;if(f)if(this.$_prerender)t=0,n=this.prerender,r=null;else{var g=this.getScroll();if(o){var y=g.start-this.$_lastUpdateScrollPosition;if(y<0&&(y=-y),null===a&&yg.start&&(S=k),k=~~((x+S)/2)}while(k!==w);for(k<0&&(k=0),t=k,r=h[f-1].accumulator,n=k;nf&&(n=f))}else t=~~(g.start/a),n=Math.ceil(g.end/a),t<0&&(t=0),n>f&&(n=f),r=f*a}else t=n=r=0;n-t>c.itemsLimit&&this.itemsLimitError(),this.totalSize=r;var E=t<=this.$_endIndex&&n>=this.$_startIndex;if(this.$_continuous!==E){if(E){p.clear(),m.clear();for(var C=0,T=v.length;C=n)&&this.unuseView(i));for(var O,M,P,A,j=E?null:new Map,D=t;D=P.length)&&(i=this.addView(v,D,O,L,M),this.unuseView(i,!0),P=m.get(M)),i=P[A],i.item=O,i.nr.used=!0,i.nr.index=D,i.nr.key=L,i.nr.type=M,j.set(M,A+1),A++),p.set(L,i)),i.position=null===a?h[D-1].accumulator:D*a):i&&this.unuseView(i)}return this.$_startIndex=t,this.$_endIndex=n,this.emitUpdate&&this.$emit("update",t,n),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,300),{continuous:E}},getListenerTarget:function(){var e=s()(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll:function(){var e,t=this.$el,n=this.direction,r="vertical"===n;if(this.pageMode){var i=t.getBoundingClientRect(),o=r?i.height:i.width,a=-(r?i.top:i.left),s=r?window.innerHeight:window.innerWidth;a<0&&(s+=a,a=0),a+s>o&&(s=o-a),e={start:a,end:a+s}}else e=r?{start:t.scrollTop,end:t.scrollTop+t.clientHeight}:{start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return e},applyPageMode:function(){this.pageMode?this.addListeners():this.removeListeners()},addListeners:function(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!y&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners:function(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem:function(e){var t;t=null===this.itemSize?e>0?this.sizes[e-1].accumulator:0:e*this.itemSize,this.scrollToPosition(t)},scrollToPosition:function(e){"vertical"===this.direction?this.$el.scrollTop=e:this.$el.scrollLeft=e},itemsLimitError:function(){var e=this;throw setTimeout((function(){console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",e.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")})),new Error("Rendered items limit reached")},sortViews:function(){this.pool.sort((function(e,t){return e.nr.index-t.nr.index}))}}};function x(e,t,n,r,i,o,a,s,c,l){"boolean"!==typeof a&&(c=s,s=a,a=!1);const u="function"===typeof n?n.options:n;let d;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=d):t&&(d=a?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),d)if(u.functional){const e=u.render;u.render=function(t,n){return d.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,d):[d]}return n}const S=w;var k=function(){var e,t,n=this,r=n.$createElement,i=n._self._c||r;return i("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:n.handleVisibilityChange,expression:"handleVisibilityChange"}],staticClass:"vue-recycle-scroller",class:(e={ready:n.ready,"page-mode":n.pageMode},e["direction-"+n.direction]=!0,e),on:{"&scroll":function(e){return n.handleScroll(e)}}},[n.$slots.before?i("div",{staticClass:"vue-recycle-scroller__slot"},[n._t("before")],2):n._e(),n._v(" "),i("div",{ref:"wrapper",staticClass:"vue-recycle-scroller__item-wrapper",style:(t={},t["vertical"===n.direction?"minHeight":"minWidth"]=n.totalSize+"px",t)},n._l(n.pool,(function(e){return i("div",{key:e.nr.id,staticClass:"vue-recycle-scroller__item-view",class:{hover:n.hoverKey===e.nr.key},style:n.ready?{transform:"translate"+("vertical"===n.direction?"Y":"X")+"("+e.position+"px)"}:null,on:{mouseenter:function(t){n.hoverKey=e.nr.key},mouseleave:function(e){n.hoverKey=null}}},[n._t("default",null,{item:e.item,index:e.nr.index,active:e.nr.used})],2)})),0),n._v(" "),n.$slots.after?i("div",{staticClass:"vue-recycle-scroller__slot"},[n._t("after")],2):n._e(),n._v(" "),i("ResizeObserver",{on:{notify:n.handleResize}})],1)},E=[];k._withStripped=!0;const C=void 0,T=void 0,I=void 0,R=!1,O=x({render:k,staticRenderFns:E},C,S,T,R,I,!1,void 0,void 0,void 0);var M={name:"DynamicScroller",components:{RecycleScroller:O},inheritAttrs:!1,provide:function(){return"undefined"!==typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((function(e){var t,n=m(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.target){var i=new CustomEvent("resize",{detail:{contentRect:r.contentRect}});r.target.dispatchEvent(i)}}}catch(o){n.e(o)}finally{n.f()}}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},props:f({},v,{minItemSize:{type:[Number,String],required:!0}}),data:function(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:g,itemsWithSize:function(){for(var e=[],t=this.items,n=this.keyField,r=this.simpleArray,i=this.vscrollData.sizes,o=0;o0&&void 0!==arguments[0])||arguments[0];(e||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem:function(e){var t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom:function(){var e=this;if(!this.$_scrollingToBottom){this.$_scrollingToBottom=!0;var t=this.$el;this.$nextTick((function(){t.scrollTop=t.scrollHeight+5e3;var n=function n(){t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame((function(){t.scrollTop=t.scrollHeight+5e3,0===e.$_undefinedSizes?e.$_scrollingToBottom=!1:requestAnimationFrame(n)}))};requestAnimationFrame(n)}))}}}};const P=M;var A=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id"},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.item,r=t.index,i=t.active;return[e._t("default",null,null,{item:n.item,index:r,active:i,itemWithSize:n})]}}],null,!0)},"RecycleScroller",e.$attrs,!1),e.listeners),[e._v(" "),n("template",{slot:"before"},[e._t("before")],2),e._v(" "),n("template",{slot:"after"},[e._t("after")],2)],2)},j=[];A._withStripped=!0;const D=void 0,L=void 0,N=void 0,$=!1,U=x({render:A,staticRenderFns:j},D,P,L,$,N,!1,void 0,void 0,void 0);var B={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id:function(){return this.vscrollData.simpleArray?this.index:this.item[this.vscrollData.keyField]},size:function(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0},finalActive:function(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id:function(){this.size||this.onDataUpdate()},finalActive:function(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created:function(){var e=this;if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){var t=function(t){e.$watch((function(){return e.sizeDependencies[t]}),e.onDataUpdate)};for(var n in this.sizeDependencies)t(n);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted:function(){this.vscrollData.active&&(this.updateSize(),this.observeSize())},beforeDestroy:function(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize),this.unobserveSize()},methods:{updateSize:function(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData:function(){var e=this;this.watchData?this.$_watchData=this.$watch("data",(function(){e.onDataUpdate()}),{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate:function(e){var t=e.force;!this.finalActive&&t&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!t&&this.size||this.updateSize()},onDataUpdate:function(){this.updateSize()},computeSize:function(e){var t=this;this.$nextTick((function(){if(t.id===e){var n=t.$el.offsetWidth,r=t.$el.offsetHeight;t.applySize(n,r)}t.$_pendingSizeUpdate=null}))},applySize:function(e,t){var n=Math.round("vertical"===this.vscrollParent.direction?t:e);n&&this.size!==n&&(this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.$set(this.vscrollData.sizes,this.id,n),this.$set(this.vscrollData.validSizes,this.id,!0),this.emitResize&&this.$emit("resize",this.id))},observeSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.observe(this.$el.parentNode),this.$el.parentNode.addEventListener("resize",this.onResize))},unobserveSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.unobserve(this.$el.parentNode),this.$el.parentNode.removeEventListener("resize",this.onResize))},onResize:function(e){var t=e.detail.contentRect,n=t.width,r=t.height;this.applySize(n,r)}},render:function(e){return e(this.tag,this.$slots.default)}};const F=B,z=void 0,q=void 0,W=void 0,K=void 0,V=x({},z,F,q,K,W,!1,void 0,void 0,void 0);function G(e,t){e.component("".concat(t,"recycle-scroller"),O),e.component("".concat(t,"RecycleScroller"),O),e.component("".concat(t,"dynamic-scroller"),U),e.component("".concat(t,"DynamicScroller"),U),e.component("".concat(t,"dynamic-scroller-item"),V),e.component("".concat(t,"DynamicScrollerItem"),V)}var H={version:"1.0.10",install:function(e,t){var n=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(var r in n)"undefined"!==typeof n[r]&&(c[r]=n[r]);n.installComponents&&G(e,n.componentsPrefix)}},Y=null;"undefined"!==typeof window?Y=window.Vue:"undefined"!==typeof t&&(Y=t.Vue),Y&&Y.use(H),n["a"]=H}).call(this,r("c8ba"))},e5cb:function(e,t,n){"use strict";var r=n("d066"),i=n("1a2d"),o=n("9112"),a=n("3a9b"),s=n("d2bb"),c=n("e893"),l=n("aeb0"),u=n("7156"),d=n("e391"),f=n("ab36"),h=n("c770"),p=n("b980"),m=n("83ab"),v=n("c430");e.exports=function(e,t,n,g){var y="stackTraceLimit",b=g?2:1,_=e.split("."),w=_[_.length-1],x=r.apply(null,_);if(x){var S=x.prototype;if(!v&&i(S,"cause")&&delete S.cause,!n)return x;var k=r("Error"),E=t((function(e,t){var n=d(g?t:e,void 0),r=g?new x(e):new x;return void 0!==n&&o(r,"message",n),p&&o(r,"stack",h(r.stack,2)),this&&a(S,this)&&u(r,this,E),arguments.length>b&&f(r,arguments[b]),r}));if(E.prototype=S,"Error"!==w?s?s(E,k):c(E,k,{name:!0}):m&&y in x&&(l(E,x,y),l(E,x,"prepareStackTrace")),c(E,x),!v)try{S.name!==w&&o(S,"name",w),S.constructor=E}catch(C){}return E}}},e683:function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},e685:function(e,t,n){"use strict";n("d9e2"),Object.defineProperty(t,"__esModule",{value:!0}),t.EventTimeline=i;var r=n("420b");function i(e){this._eventTimelineSet=e,this._roomId=e.room?e.room.roomId:null,this._events=[],this._baseIndex=0,this._startState=new r.RoomState(this._roomId),this._startState.paginationToken=null,this._endState=new r.RoomState(this._roomId),this._endState.paginationToken=null,this._prevTimeline=null,this._nextTimeline=null,this._paginationRequests={b:null,f:null},this._name=this._roomId+":"+(new Date).toISOString()}i.BACKWARDS="b",i.FORWARDS="f",i.prototype.initialiseState=function(e){if(this._events.length>0)throw new Error("Cannot initialise state after events are added");for(const t of e)Object.freeze(t);this._startState.setStateEvents(e),this._endState.setStateEvents(e)},i.prototype.forkLive=function(e){const t=this.getState(e),n=new i(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t,this._endState=t.clone(),n},i.prototype.fork=function(e){const t=this.getState(e),n=new i(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t.clone(),n},i.prototype.getRoomId=function(){return this._roomId},i.prototype.getFilter=function(){return this._eventTimelineSet.getFilter()},i.prototype.getTimelineSet=function(){return this._eventTimelineSet},i.prototype.getBaseIndex=function(){return this._baseIndex},i.prototype.getEvents=function(){return this._events},i.prototype.getState=function(e){if(e==i.BACKWARDS)return this._startState;if(e==i.FORWARDS)return this._endState;throw new Error("Invalid direction '"+e+"'")},i.prototype.getPaginationToken=function(e){return this.getState(e).paginationToken},i.prototype.setPaginationToken=function(e,t){this.getState(t).paginationToken=e},i.prototype.getNeighbouringTimeline=function(e){if(e==i.BACKWARDS)return this._prevTimeline;if(e==i.FORWARDS)return this._nextTimeline;throw new Error("Invalid direction '"+e+"'")},i.prototype.setNeighbouringTimeline=function(e,t){if(this.getNeighbouringTimeline(t))throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: "+t+")");if(t==i.BACKWARDS)this._prevTimeline=e;else{if(t!=i.FORWARDS)throw new Error("Invalid direction '"+t+"'");this._nextTimeline=e}this.setPaginationToken(null,t)},i.prototype.addEvent=function(e,t){const n=t?this._startState:this._endState,r=this.getTimelineSet();let o;r.room&&r.room.getUnfilteredTimelineSet()===r&&(i.setEventMetadata(e,n,t),e.isState()&&(n.setStateEvents([e]),e.sender&&("m.room.member"!==e.getType()||t)||i.setEventMetadata(e,n,t))),o=t?0:this._events.length,this._events.splice(o,0,e),t&&this._baseIndex++},i.setEventMetadata=function(e,t,n){e.sender=t.getSentinelMember(e.getSender()),"m.room.member"===e.getType()&&(e.target=t.getSentinelMember(e.getStateKey())),e.isState()&&n&&(e.forwardLooking=!1)},i.prototype.removeEvent=function(e){for(let t=this._events.length-1;t>=0;t--){const n=this._events[t];if(n.getId()==e)return this._events.splice(t,1),t>>24&255]^c[i>>>16&255]^l[a>>>8&255]^u[255&d],h=this._encKey[g+1]^s[i>>>24&255]^c[a>>>16&255]^l[d>>>8&255]^u[255&r],p=this._encKey[g+2]^s[a>>>24&255]^c[d>>>16&255]^l[r>>>8&255]^u[255&i],m=this._encKey[g+3]^s[d>>>24&255]^c[r>>>16&255]^l[i>>>8&255]^u[255&a],g+=4,r=f,i=h,a=p,d=m;return r=o[f>>>24]<<24|o[h>>>16&255]<<16|o[p>>>8&255]<<8|o[255&m],i=o[h>>>24]<<24|o[p>>>16&255]<<16|o[m>>>8&255]<<8|o[255&f],a=o[p>>>24]<<24|o[m>>>16&255]<<16|o[f>>>8&255]<<8|o[255&h],d=o[m>>>24]<<24|o[f>>>16&255]<<16|o[h>>>8&255]<<8|o[255&p],r^=this._encKey[g+0],i^=this._encKey[g+1],a^=this._encKey[g+2],d^=this._encKey[g+3],b(r,n,0),b(i,n,4),b(a,n,8),b(d,n,12),this._emptyPromise}}function g(){const e=283;function t(t,n){let r=t,i=n,o=0;for(let a=1;a<256&&0!==i;a<<=1)0!==(i&a)&&(o^=r,i^=a),r<<=1,0!==(256&r)&&(r^=e);return o}const n=e=>e<<24|e>>>8;s=new Uint32Array(256),c=new Uint32Array(256),l=new Uint32Array(256),u=new Uint32Array(256);for(let r=0;r<256;r++){const e=o[r];let i=t(e,2)<<24|e<<16|e<<8|t(e,3);s[r]=i,i=n(i),c[r]=i,i=n(i),l[r]=i,i=n(i),u[r]=i,i=n(i)}d=new Uint32Array(256),f=new Uint32Array(256),h=new Uint32Array(256),p=new Uint32Array(256);for(let r=0;r<256;r++){const e=a[r];let i=t(e,14)<<24|t(e,9)<<16|t(e,13)<<8|t(e,11);d[r]=i,i=n(i),f[r]=i,i=n(i),h[r]=i,i=n(i),p[r]=i,i=n(i)}m=!0}function y(e,t=0){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function b(e,t=new Uint8Array(4),n=0){return t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function _(e){return o[e>>>24&255]<<24|o[e>>>16&255]<<16|o[e>>>8&255]<<8|o[255&e]}function w(e){return e<<8|e>>>24}function x(e){const t=new Uint32Array(e.length+28),n=e.length/4|0,r=t.length;for(let i=0;i6&&o%n===4&&(e=_(e)),t[o]=t[o-n]^e}return t}t.default=v},e7f6:function(t,n,r){"use strict";(function(t){var i=r("ade3"),o=r("4f5a"),a=r("3139");class s extends o["a"]{constructor(){super(...arguments),Object(i["a"])(this,"matrixCredentials",(function(){var e=bitcoin.crypto.sha256(bitcoin.crypto.sha256(t.from(this.credentials.privateKey))).toString("hex");return Promise.resolve({address:this.credentials.address,password:e,type:"m.login.password",user:this.credentials.address,sessionId:"",username:this.credentials.address.toLowerCase()})})),Object(i["a"])(this,"path33",(function(e){return"m/33'/0'/0'/"+e+"'"}))}initKeysProcess(){return this.initKeys().catch(e=>e&&_.isNumber(e)?new Promise((t,n)=>{this.keysupdatetimeout&&clearTimeout(this.keysupdatetimeout),this.keysupdatetimeout=setTimeout((function(){initKeysProcess().then(t).catch(n)}),e)}):Promise.reject(e))}initKeys(){return this.state?!this.userinfo.name||this.userinfo.deleted||this.userinfo.keys&&this.userinfo.keys.length?Promise.resolve():(window.POCKETNETINSTANCE&&window.POCKETNETINSTANCE.platform.sdk.keys.init().then(e=>"exist"==e||"processing"==e?Promise.reject(6e4):Promise.reject(e)).catch(e=>Promise.reject()),Promise.reject()):Promise.reject()}generateKeysLS(t,n){var r={};try{r=JSON.parse(localStorage["wifkeya"]||"{}")}catch(e){}r.address!=n&&(r={}),r.address=n,r.storage||(r.storage=[]);var{ckeys:i}=this.generateKeys(t,r.storage);return localStorage["wifkeya"]=JSON.stringify(r),i}generateKeys(e,t){var n=[];if(t||(t=[]),e)for(var r=1;r<13;r++){var i=t[r-1]||bitcoin.bip32.fromSeed(e).derivePath(this.path33(r)).toWIF();t[r-1]=i;var o=bitcoin.ECPair.fromWIF(i);n.push({pair:o,public:o.publicKey.toString("hex"),private:o.privateKey})}return{ckeys:n,storage:t}}generateprivate(){}checkCredentials(){if(!this.credentials)return Promise.reject("unauthorized");var n=a["a"].hexDecode(this.credentials.address);try{var r=t.from(this.credentials.privateKey,"hex");setTimeout(()=>{this.private=this.generateKeysLS(r,n)},1e3)}catch(e){return this.state=0,Promise.reject("unauthorized")}return this.core.api.pocketnet.userStateMe(n).then(e=>(this.state=1,Promise.resolve(this.state))).catch(e=>Promise.reject("unknown"))}convertUser(e){return{image:e.i||"",name:e.name?decodeURI(e.name):"",id:a["a"].hexEncode(e.address),source:e,keys:_.filter((e.k||"").split(","),(function(e){return e})),deleted:e.deleted,nocache:e.nocache||!1}}searchContacts(e){this.core;return this.core.api.pocketnet.search(e).then(e=>(e=_.map(e,e=>(e.nocache=!0,this.convertUser(e))),this.setUsersInfo(e),Promise.resolve(e)))}userInfo(e){return this.usersInfo(this.credentials.address,!1,e).then(e=>(this.userinfo=e[0],Promise.resolve(e[0])))}usersInfo(e,t,n){return _.isArray(e)||(e=[e]),t||(e=_.map(e,(function(e){return a["a"].hexDecode(e)}))),this.core.api.pocketnet.userInfoCached(e,n).then(e=>(e=_.map(e,e=>this.convertUser(e)),this.setUsersInfo(e,n),Promise.resolve(e)))}signature(n,r){n||(n="pocketnetproxy"),r||(r=360);try{var i=bitcoin.ECPair.fromPrivateKey(t.from(this.credentials.privateKey,"hex"));const e=(new Date).toISOString();var o="date="+e+",exp="+r+",s="+a["a"].hexEncode(n),s=i.sign(bitcoin.crypto.sha256(t.from(o))),c={nonce:o,signature:s.toString("hex"),pubkey:i.publicKey.toString("hex"),address:this.credentials.address,v:1}}catch(e){return null}return c}getContacts(){return this.state?Promise.resolve([]):Promise.reject("unauthorized")}}n["a"]=s}).call(this,r("b639").Buffer)},e86a:function(e,t,n){"use strict";n.r(t);var r=n("6a45");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},e893:function(e,t,n){var r=n("1a2d"),i=n("56ef"),o=n("06cf"),a=n("9bf2");e.exports=function(e,t,n){for(var s=i(t),c=a.f,l=o.f,u=0;u1?n("div",{staticClass:"aboutRoomAvatar"},[e.userinfo.length<5?n("div",{staticClass:"small"},[n("div",{staticClass:"userinfopicwrapper",class:{twoAvatars:2===e.userinfo.length,threeAvatars:3===e.userinfo.length,fourAvatars:4===e.userinfo.length}},e._l(e.userinfo,(function(t,r){return n("div",{staticClass:"userwrapper"},[n("userpic",{attrs:{status:e.status[t.id],userinfo:t}})],1)})),0)]):n("div",{staticClass:"swiperWrapper"},[n("div",{staticClass:"swiperWrapperFlex noswipepnt"},e._l(e.userinfo,(function(t,r){return n("div",{staticClass:"imageSwiper"},[n("userpic",{attrs:{status:e.status[t.id],userinfo:t}})],1)})),0)])]):e._e()},i=[],o={props:{userinfo:Array,slidesPerView:Number,status:{type:Object,default:{}}},data:function(){return{}}},a=o,s=n("2877");function c(e){var t=n("1570");t.__inject__&&t.__inject__(e)}var l=Object(s["a"])(a,r,i,!1,c,"71d5e826",null,!0);t["a"]=l.exports},ed03:function(t,n,r){"use strict";(function(t){var i=r("c973").default;r("d9e2");var o=r("dbce");Object.defineProperty(n,"__esModule",{value:!0}),n.IndexedDBStore=m;var a=r("696c"),s=o(r("3987")),c=r("faa1"),l=r("9e54"),u=r("0b9e"),d=r("87d6"),f=r("a120"),h=r("63c7");const p=3e5;function m(e){if(a.MemoryStore.call(this,e),!e.indexedDB)throw new Error("Missing required option: indexedDB");if(e.workerScript){let n=e.workerApi;n||(n=t.Worker),this.backend=new u.RemoteIndexedDBStoreBackend(e.workerScript,e.dbName,n)}else this.backend=new l.LocalIndexedDBStoreBackend(e.indexedDB,e.dbName);this.startedUp=!1,this._syncTs=0,this._userModifiedMap={}}function v(t,n){return i((function*(){for(var r=arguments.length,i=new Array(r),o=0;o(h.logger.log("IndexedDBStore.startup: loading presence events"),this.backend.getUserPresenceEvents())).then(e=>{h.logger.log("IndexedDBStore.startup: processing presence events"),e.forEach(e=>{let[t,n]=e;const r=new d.User(t);n&&r.setPresenceEvent(new f.MatrixEvent(n)),this._userModifiedMap[r.userId]=r.getLastModifiedTime(),this.storeUser(r)})}))},m.prototype.getSavedSync=v((function(){return this.backend.getSavedSync()}),"getSavedSync"),m.prototype.isNewlyCreated=v((function(){return this.backend.isNewlyCreated()}),"isNewlyCreated"),m.prototype.getSavedSyncToken=v((function(){return this.backend.getNextBatchToken()}),"getSavedSyncToken"),m.prototype.deleteAllData=v((function(){return a.MemoryStore.prototype.deleteAllData.call(this),this.backend.clearDatabase().then(()=>{h.logger.log("Deleted indexeddb data.")},e=>{throw h.logger.error("Failed to delete indexeddb data: "+e),e})})),m.prototype.wantsSave=function(){const e=Date.now();return e-this._syncTs>p},m.prototype.save=function(e){return e||this.wantsSave()?this._reallySave():Promise.resolve()},m.prototype._reallySave=v((function(){this._syncTs=Date.now();const e=[];for(const t of this.getUsers())this._userModifiedMap[t.userId]!==t.getLastModifiedTime()&&t.events.presence&&(e.push([t.userId,t.events.presence.event]),this._userModifiedMap[t.userId]=t.getLastModifiedTime());return this.backend.syncToDatabase(e)})),m.prototype.setSyncData=v((function(e){return this.backend.setSyncData(e)}),"setSyncData"),m.prototype.getOutOfBandMembers=v((function(e){return this.backend.getOutOfBandMembers(e)}),"getOutOfBandMembers"),m.prototype.setOutOfBandMembers=v((function(e,t){return a.MemoryStore.prototype.setOutOfBandMembers.call(this,e,t),this.backend.setOutOfBandMembers(e,t)}),"setOutOfBandMembers"),m.prototype.clearOutOfBandMembers=v((function(e){return a.MemoryStore.prototype.clearOutOfBandMembers.call(this),this.backend.clearOutOfBandMembers(e)}),"clearOutOfBandMembers"),m.prototype.getClientOptions=v((function(){return this.backend.getClientOptions()}),"getClientOptions"),m.prototype.storeClientOptions=v((function(e){return a.MemoryStore.prototype.storeClientOptions.call(this,e),this.backend.storeClientOptions(e)}),"storeClientOptions")}).call(this,r("c8ba"))},ed83:function(e,t,n){var r,i,o;(function(n,a){i=[],r=a,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})(0,(function(){var e=/(auto|scroll)/,t=function(e,n){return null===e.parentNode?n:t(e.parentNode,n.concat([e]))},n=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},r=function(e){return n(e,"overflow")+n(e,"overflow-y")+n(e,"overflow-x")},i=function(t){return e.test(r(t))},o=function(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var n=t(e.parentNode,[]),r=0;r{for(let n=0;n]*)([0-9]*)$/);if(!o)return!1;const a=o[1],s=parseInt(o[2]);if(isNaN(s))return!1;switch(a){case"":case"==":return i==s;case"<":return i":return i>s;case"<=":return i<=s;case">=":return i>=s;default:return!1}},u=function(t,n){let i=n.getContent();if(n.isEncrypted()&&n.getClearContent()&&(i=n.getClearContent()),!i||!i.body||"string"!=typeof i.body)return!1;const o=e.getRoom(n.getRoomId());if(!o||!o.currentState||!o.currentState.members||!o.currentState.getMember(e.credentials.userId))return!1;const a=o.currentState.getMember(e.credentials.userId).name,s=new RegExp("(^|\\W)"+(0,r.escapeRegExp)(a)+"(\\W|$)","i");return i.body.search(s)>-1},d=function(e,t){if(!e.key)return!1;const n=h(e.key,t);if("string"!==typeof n)return!1;if(e.value)return e.value===n;if("string"!==typeof e.pattern)return!1;let r;return r="content.body"==e.key?f("(^|\\W)",e.pattern,"(\\W|$)"):f("^",e.pattern,"$"),!!n.match(r)},f=function(e,n,i){return t[n]||(t[n]=new RegExp(e+(0,r.globToRegexp)(n)+i,"i")),t[n]},h=function(e,t){const n=e.split(".");let i;const o=n[0];"content"===o?(i=t.getContent(),n.shift()):"type"===o?(i=t.getType(),n.shift()):i=t.event;while(n.length>0){const e=n.shift();if((0,r.isNullOrUndefined)(i[e]))return null;i=i[e]}return i},p=function(t,r){return r?t.getSender()===e.credentials.userId?null:n(t,r.global):null},m=function(e,t){const n=p(e,t);if(!n)return{};const r=s.actionListToActionsObject(n.actions);return void 0===r.tweaks.highlight&&(r.tweaks.highlight="content"==n.kind),r};this.ruleMatchesEvent=function(e,t){let n=!0;for(let r=0;re.rule_id===r.rule_id);if(e)e.default=r.default,e.conditions=r.conditions,e.actions=r.actions;else{const e=r.rule_id;i.logger.warn("Adding default global override for "+e),n.push(r)}}return t}},f024:function(e,t,n){"use strict";n.r(t);var r=n("b79a");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},f0bc:function(e,t,n){"use strict";n.r(t);var r=n("0dbb");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},f206:function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=2)}([function(e,t,n){n(8);var r=n(6)(n(1),n(7),"data-v-25adc6c0",null);e.exports=r.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o="#75c791",a="#bfcbd9",s="on",c="off",l="#fff";t["default"]={name:"ToggleButton",props:{value:{type:Boolean,default:!1},name:{type:String},disabled:{type:Boolean,default:!1},tag:{type:String},sync:{type:Boolean,default:!1},speed:{type:Number,default:300},color:{type:[String,Object],validator:function(e){return n.i(r["a"])(e)||n.i(r["b"])(e,"checked")||n.i(r["b"])(e,"unchecked")||n.i(r["b"])(e,"disabled")}},switchColor:{type:[String,Object],validator:function(e){return n.i(r["a"])(e)||n.i(r["b"])(e,"checked")||n.i(r["b"])(e,"unchecked")}},cssColors:{type:Boolean,default:!1},labels:{type:[Boolean,Object],default:!1,validator:function(e){return"object"===("undefined"===typeof e?"undefined":i(e))?e.checked||e.unchecked:"boolean"===typeof e}},height:{type:Number,default:22},width:{type:Number,default:50},margin:{type:Number,default:3},fontSize:{type:Number}},computed:{className:function(){var e=this.toggled,t=this.disabled;return["vue-js-switch",{toggled:e,disabled:t}]},coreStyle:function(){return{width:n.i(r["c"])(this.width),height:n.i(r["c"])(this.height),backgroundColor:this.cssColors?null:this.disabled?this.colorDisabled:this.colorCurrent,borderRadius:n.i(r["c"])(Math.round(this.height/2))}},buttonRadius:function(){return this.height-2*this.margin},distance:function(){return n.i(r["c"])(this.width-this.height+this.margin)},buttonStyle:function(){var e="transform "+this.speed+"ms",t=n.i(r["c"])(this.margin),i=this.toggled?n.i(r["d"])(this.distance,t):n.i(r["d"])(t,t),o=this.switchColor?this.switchColorCurrent:null;return{width:n.i(r["c"])(this.buttonRadius),height:n.i(r["c"])(this.buttonRadius),transition:e,transform:i,background:o}},labelStyle:function(){return{lineHeight:n.i(r["c"])(this.height),fontSize:this.fontSize?n.i(r["c"])(this.fontSize):null}},colorChecked:function(){var e=this.color;return n.i(r["e"])(e)?n.i(r["f"])(e,"checked",o):e||o},colorUnchecked:function(){return n.i(r["f"])(this.color,"unchecked",a)},colorDisabled:function(){return n.i(r["f"])(this.color,"disabled",this.colorCurrent)},colorCurrent:function(){return this.toggled?this.colorChecked:this.colorUnchecked},labelChecked:function(){return n.i(r["f"])(this.labels,"checked",s)},labelUnchecked:function(){return n.i(r["f"])(this.labels,"unchecked",c)},switchColorChecked:function(){return n.i(r["f"])(this.switchColor,"checked",l)},switchColorUnchecked:function(){return n.i(r["f"])(this.switchColor,"unchecked",l)},switchColorCurrent:function(){this.switchColor;return n.i(r["e"])(this.switchColor)?this.toggled?this.switchColorChecked:this.switchColorUnchecked:this.switchColor||l}},watch:{value:function(e){this.sync&&(this.toggled=!!e)}},data:function(){return{toggled:!!this.value}},methods:{toggle:function(e){var t=!this.toggled;this.sync||(this.toggled=t),this.$emit("input",t),this.$emit("change",{value:t,tag:this.tag,srcEvent:e})}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n.n(r);n.d(t,"ToggleButton",(function(){return i.a}));var o=!1;t["default"]={install:function(e){o||(e.component("ToggleButton",i.a),o=!0)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return l}));var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){return"string"===typeof e},o=function(e){return"object"===("undefined"===typeof e?"undefined":r(e))},a=function(e,t){return o(e)&&e.hasOwnProperty(t)},s=function(e,t,n){return a(e,t)?e[t]:n},c=function(e){return e+"px"},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0px";return"translate3d("+e+", "+t+", "+n+")"}},function(e,t,n){t=e.exports=n(5)(),t.push([e.i,".vue-js-switch[data-v-25adc6c0]{display:inline-block;position:relative;vertical-align:middle;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input[data-v-25adc6c0]{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label[data-v-25adc6c0]{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left[data-v-25adc6c0]{left:10px}.vue-js-switch .v-switch-label.v-right[data-v-25adc6c0]{right:10px}.vue-js-switch .v-switch-core[data-v-25adc6c0]{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;user-select:none}.vue-js-switch .v-switch-core .v-switch-button[data-v-25adc6c0]{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:#fff;z-index:2}.vue-js-switch.disabled[data-v-25adc6c0]{pointer-events:none;opacity:.6}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;tn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i>>32-t}function l(e,t,n,r,i,o,a){return c(e+(t&n|~t&r)+i+o|0,a)+t|0}function u(e,t,n,r,i,o,a){return c(e+(t&r|n&~r)+i+o|0,a)+t|0}function d(e,t,n,r,i,o,a){return c(e+(t^n^r)+i+o|0,a)+t|0}function f(e,t,n,r,i,o,a){return c(e+(n^(t|~r))+i+o|0,a)+t|0}r(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=l(n,r,i,o,e[0],3614090360,7),o=l(o,n,r,i,e[1],3905402710,12),i=l(i,o,n,r,e[2],606105819,17),r=l(r,i,o,n,e[3],3250441966,22),n=l(n,r,i,o,e[4],4118548399,7),o=l(o,n,r,i,e[5],1200080426,12),i=l(i,o,n,r,e[6],2821735955,17),r=l(r,i,o,n,e[7],4249261313,22),n=l(n,r,i,o,e[8],1770035416,7),o=l(o,n,r,i,e[9],2336552879,12),i=l(i,o,n,r,e[10],4294925233,17),r=l(r,i,o,n,e[11],2304563134,22),n=l(n,r,i,o,e[12],1804603682,7),o=l(o,n,r,i,e[13],4254626195,12),i=l(i,o,n,r,e[14],2792965006,17),r=l(r,i,o,n,e[15],1236535329,22),n=u(n,r,i,o,e[1],4129170786,5),o=u(o,n,r,i,e[6],3225465664,9),i=u(i,o,n,r,e[11],643717713,14),r=u(r,i,o,n,e[0],3921069994,20),n=u(n,r,i,o,e[5],3593408605,5),o=u(o,n,r,i,e[10],38016083,9),i=u(i,o,n,r,e[15],3634488961,14),r=u(r,i,o,n,e[4],3889429448,20),n=u(n,r,i,o,e[9],568446438,5),o=u(o,n,r,i,e[14],3275163606,9),i=u(i,o,n,r,e[3],4107603335,14),r=u(r,i,o,n,e[8],1163531501,20),n=u(n,r,i,o,e[13],2850285829,5),o=u(o,n,r,i,e[2],4243563512,9),i=u(i,o,n,r,e[7],1735328473,14),r=u(r,i,o,n,e[12],2368359562,20),n=d(n,r,i,o,e[5],4294588738,4),o=d(o,n,r,i,e[8],2272392833,11),i=d(i,o,n,r,e[11],1839030562,16),r=d(r,i,o,n,e[14],4259657740,23),n=d(n,r,i,o,e[1],2763975236,4),o=d(o,n,r,i,e[4],1272893353,11),i=d(i,o,n,r,e[7],4139469664,16),r=d(r,i,o,n,e[10],3200236656,23),n=d(n,r,i,o,e[13],681279174,4),o=d(o,n,r,i,e[0],3936430074,11),i=d(i,o,n,r,e[3],3572445317,16),r=d(r,i,o,n,e[6],76029189,23),n=d(n,r,i,o,e[9],3654602809,4),o=d(o,n,r,i,e[12],3873151461,11),i=d(i,o,n,r,e[15],530742520,16),r=d(r,i,o,n,e[2],3299628645,23),n=f(n,r,i,o,e[0],4096336452,6),o=f(o,n,r,i,e[7],1126891415,10),i=f(i,o,n,r,e[14],2878612391,15),r=f(r,i,o,n,e[5],4237533241,21),n=f(n,r,i,o,e[12],1700485571,6),o=f(o,n,r,i,e[3],2399980690,10),i=f(i,o,n,r,e[10],4293915773,15),r=f(r,i,o,n,e[1],2240044497,21),n=f(n,r,i,o,e[8],1873313359,6),o=f(o,n,r,i,e[15],4264355552,10),i=f(i,o,n,r,e[6],2734768916,15),r=f(r,i,o,n,e[13],1309151649,21),n=f(n,r,i,o,e[4],4149444226,6),o=f(o,n,r,i,e[11],3174756917,10),i=f(i,o,n,r,e[2],718787259,15),r=f(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},f5af:function(e,t,n){var r=n("15aa");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("0ae72481",r,e)}},f5df:function(e,t,n){var r=n("00ee"),i=n("1626"),o=n("c6b6"),a=n("b622"),s=a("toStringTag"),c=Object,l="Arguments"==o(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(n){}};e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=u(t=c(e),s))?n:l?o(t):"Object"==(r=o(t))&&i(t.callee)?"Arguments":r}},f60b:function(e,t,n){var r=n("b639"),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},f693:function(e){e.exports=JSON.parse('{"caption":{"create":"Create","addPublicChatName":"Add Public Chat Name","addGroupNamePlaceHolder":"Add Group Name","createPublicChat":"Create public chat","chatTopic":"Topic renamed","publicRoomTitle":"Public Room","asModerator":"as moderator","marked":"marked","unmarked":"unmarked","removeBan":"Remove Ban","cancelModeration":"Remove moderation","uploadFiles":"Télécharger fichiers","header":"En-tête","dragAndDropAFile":"Glisser déposer fichier","chatInvite":"Vous avez été invité à discuter avec:","cantJoin":"Vous ne pouvez pas rejoindre la conversation avec:","chatInviteDecline":"Vous pouvez rejoindre la conversation ou refuser l\'invitation","creatorLeft":"Car l\'administrateur a quitté la conversation","encrypted":"Encrypté","noImages":"Il n\'y a pas encore d\'images dans la conversation","noFiles":"Il n\'y a pas encore d\'files dans la conversation","inviteUser":"Inviter utilisateur","invite":"Inviter","add":"Ajouter","mute":"Mode silence","unmute":"Mode son","leave":"Quitter","Info":"Info","new":"Nouveau","typing":"en train d\'écrire","accNotFound":"Votre inscription est en cours, veuillez patienter...","emptyList":"liste vide (filtrée ou juste vide)","welcome":"Bienvenue sur Pocketnet chat","startNewChat":"Commencer une conversation","chats":"Conversations","shareWith":"Partager avec","newChat":"Nouvelle conversation","moveToChat":"Aller à la conversation","queryNoResults":"Auncun résulats","needMoreCharacters":"Veuillez saisir plus de caractères","createGroup":"Créer groupe","unabletoDecrypt":"* Impossible de decrypter","messageDeleted":"Message supprimé","sentImage":"envoyé image","sentVoiceMessage":"envoyé un message vocal","invitationToChat":"Invitation à discuter","invitationToRoom":"Invitation to room","leftChat":"a quitté la conversation","joined":"a rejoint","chatRenamed":"Conversation renommé en ","recentComment":"Commentaire récent:","share":"PARTAGER","followers":"Abonnés:","reputation":"Réputation:","following":"Abonnements:","theme":"Thème:","contacts":"Contacts","phoneContacts":"Contacts téléphone","chooseInviteMedia":"Veuillez choisir comment inviter:","admin":"Administrateur","moderator":"Modérateur","videocall":"Appel Vidéo","call":"Appel","leaveAndDelete":"Quitter et supprimer","donate":"Faire un don","makeModerator":"Définir comme Modérateur","ban":"Bannir","kick":"Expulser","members":"Membres","media":"Médias","files":"Fichiers","contactsList":"Liste de contacts","send":"envoyer","pageCaption":"Légende de page","caption":"Légende","text":"Texte","placeholder":"placeholder","sendTransactionTo":"Envoyer transaction à","toBePaidByReceiver":"Payé par le receveur","toBePaidBySender":"Payé par l\'expéditeur","source":"Source","amount":"Montant","receiver":"Receveur","message":"Message","includeFeesInAmount":"Inclure les frais dans le montant","transactionFees":"Frais de transaction","totalAmount":"Montant total","balanceTooLow":"Solde trop faible","transactionError":"Erreur, la transaction ne peut être effectuée","calculateFees":"Calculer les frais","startChatWith":"Discuter avec:","searchResult":"Résultat de la recherche","joinedInTheChat":"à rejoint la conversation","invited":"invité ","hasInvited":"invité ","inTheChat":" dans la conversation","banned":"banni","andRoom":"et conversation","left":"quiité","theChat":" la conversation ","made":"fait ","aModerator":" un modérateur","editedChatNameTo ":"edité le nom de la conversation en ","somebody":"Quelqu\'un","sent":"a envoyé","PKOINto":" PKOIN à ","response":"Réponse","messagefrom":"Transférer message de","edited":"Edité","settings":"Paramètres","unauthorized":"Non autorisé","search":"Recherche","replyOnMessage":"Répondre au message","editMessage":"Editer message","inviteFriend":"Inviter des amis","emptyContactList":"Liste de contacts vide","joinApp":"Rejoindre Pocketnet","hasInvitedToJoin":"vous a invité à rejoindre Pocketnet","contactsempty":"Vous n\'avez pas encore de contacts, vous pouvez utiliser la recherche","usernotgen":"User did not generate their encryption keys yet. You will be able to chat them when their keys are generated.","younotgen":"Please wait a minute, Your encryption keys are being generated...","chatsearchingempty":"No chats found for the specified filter","sendmessage":"Send message"},"input":{"patientEmailPlaceholder":"Email","refillNamePlaceholder":"Saisissez à nouveau le nom"},"message":{},"button":{"starChatButton":"Commencer une conversation ","decline":"Refuser","declineandignore":"Ignorer utilisateur","join":"Rejoindre","ok":"Ok","copy":"Copier","forward":"Transférer","delete":"Supprimer","save":"Enregistrer","reply":"Répondre","share":"Partager","download":"Télécharger","downloaded":"Téléchargé","goToPocketnetProfile":"Aller au profile Pocketnet","sendFile":"Envoyer fichier","takePhotoOrVideo":"Envoyer image","sendCoins":"Envoyer PKOIN","edit":"Editer","select":"Sélectionner","block":"Bloquer","unblock":"Débloquer","blockUser":"Bloquer utilisateur"},"yes":"Oui","cancel":"Annuler","teamMessages":{"1-title":"Bienvenue sur la messagerie privée Bastyon!","1-list1":"Messagerie privée qui n\'est PAS connectée à votre numéro de téléphone","1-list2":"Chiffrement de bout en bout pour chaque conversation","1-list3":"Toutes les images envoyées ou reçues par le biais du chat sont stockées sous forme cryptée","1-list4":"L\'historique des messages est conservé pendant 7 jours uniquement","2-title":"Bonne nouvelle! L\'application Pocketnet s\'appelle désormais Bastyon!","2-message1":"Le domaine sera déplacé vers Bastyon.com. Nous avons récemment publié les mises à jour majeures suivantes:","2-list1":"Messagerie privée cryptée non connectée à votre numéro de téléphone","2-list2":"Possibilité de faire des dons en PKOIN aux blogueurs","2-list3":"Vidéo et Streaming en direct","2-message2":"Invitez dès maintenant vos amis et faites partie du grand avenir de l\'internet décentralisé!","2-button":"Inviter des amis"},"sendingerror":"An error occurred while sending the message","details":"Details","settings_pin":"Pin chat window","checked":"Yes","unchecked":"No","settings_read":"Send read receipts","messagewasburn":"This message remains only in the memory of your device","messagewillburn":"The message will be deleted soon","micaccessbrowser":"Access to the microphone is restricted, please check your browser settings.","micaccesscommonproblem":"Sorry, for some reason it is not possible to record voice messages on the device","micaccesscordova":"Access to the microphone is restricted, please check your device settings.","micdevicenotfound":"Audio recording device not found"}')},f6b4:function(e,t,n){"use strict";var r=n("c532");function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},f6f7:function(e,t,n){var r=n("24a6");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("5f2561d6",r,e)}},f726:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,"#wai-logotype .items[data-v-e33cd7cc]{display:flex;align-items:center}#wai-logotype .items .item.label[data-v-e33cd7cc]{padding-left:.25em;font-weight:700}",""]),e.exports=t},f772:function(e,t,n){var r=n("5692"),i=n("90e3"),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},f922:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,'#preloader[data-v-3e6353d6]{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;z-index:3500}#preloader .iospreloadercenter[data-v-3e6353d6]{position:absolute;left:50%;top:50%;margin-left:-33px;margin-top:-33px}#preloader.minimized[data-v-3e6353d6]{display:none}#preloader.minimized.active[data-v-3e6353d6]{display:block;width:344px;right:.5em;bottom:1em;top:124px;left:auto}.default .preloader[data-v-3e6353d6]{height:90px;text-align:center;overflow:hidden;padding:10px 0;margin:0 auto;filter:url(#love);position:absolute;left:50%;top:50%;margin-top:-45px;margin-left:-60px;opacity:.85}.default .preloader span[data-v-3e6353d6]{width:20px;height:20px;background-color:transparent;display:inline-block;border-radius:50%;margin:10px}.spinner-eff[data-v-3e6353d6]{position:relative;width:66px;height:66px}.spinner-eff .spinner-bar[data-v-3e6353d6]:after,.spinner-eff .spinner-bar[data-v-3e6353d6]:before,.spinner-eff[data-v-3e6353d6]:after,.spinner-eff[data-v-3e6353d6]:before{content:"";display:block}',""]),e.exports=t},f978:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"contactList",class:{minimized:e.minimized}},[n("RecycleScroller",{staticClass:"scroller",attrs:{"page-mode":"",items:e.users,"item-size":60,"key-field":"id"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.item;return[n("div",{staticClass:"previewWrapper minimizeex"},["Contacts"===e.mode||"Select"===e.mode?n("div",{staticClass:"previewContact",on:{click:function(t){return e.navigateToProfile(r.id,r)}}},[n("preview",{attrs:{contact:r,mode:e.mode}})],1):e._e(),"Selectmany"===e.mode?n("div",{staticClass:"previewBox",on:{click:function(t){return e.toggleUser(r)}}},[n("div",{staticClass:"previewContactSelect"},[n("preview",{attrs:{mode:e.mode,contact:r}})],1),n("div",{staticClass:"checkBox"},[e.selected[r.id]?n("i",{staticClass:"far fa-check-circle"}):e._e(),e.selected[r.id]?e._e():n("i",{staticClass:"far fa-circle"})])]):e._e()])]}}])})],1)},i=[],o=n("2f62"),a=n("92a6"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mod-wrapper"},[n("div",{staticClass:"modal-window"},[n("span",{staticClass:"message"},[e._v(e._s(e.message))]),n("button",{staticClass:"btn",on:{click:e.close}},[e._v("OK")])])])},c=[],l={name:"ModalWindow",props:["message"],methods:{close(){this.$emit("Close")}}},u=l,d=n("2877");function f(e){var t=n("706e");t.__inject__&&t.__inject__(e)}var h=Object(d["a"])(u,s,c,!1,f,"96a5a68e",null,!0),p=h.exports,m={name:"contactsList",data:function(){return{loading:!1}},components:{preview:a["a"],ModalWindow:p},props:{mode:{default:"",type:String},users:Array,selected:Object,title:String},watch:{},computed:Object(o["c"])({auth:e=>e.auth,minimized:e=>e.minimized,...Object(o["b"])(["PREPARE_USERDATA"]),...Object(o["c"])(["contactsMap","signedUpUsers"])}),methods:{select(e){this.$emit("select",e)},navigateToProfile(e,t){"Select"==this.mode?this.select(t):this.$router.push({path:"/contact?id="+e}).catch(e=>{})},toggleUser(e){this.$emit("toggleUser",e.id)}},mounted(){}},v=m;function g(e){var t=n("ff89");t.__inject__&&t.__inject__(e)}var y=Object(d["a"])(v,r,i,!1,g,"691bf714",null,!0);t["default"]=y.exports},f9d6:function(e,t,n){"use strict";n.r(t);var r=n("306e");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},faa1:function(e,t,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function a(e){console&&console.warn&&console.warn(e)}r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!==e};function c(){c.init.call(this)}e.exports=c,e.exports.once=_,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var l=10;function u(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,o,s;if(u(n),o=e._events,void 0===o?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"===typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=d(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?b(i):g(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"===typeof c)o(c,this,t);else{var l=c.length,u=g(c,l);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():y(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return m(this,e,!0)},c.prototype.rawListeners=function(e){return m(this,e,!1)},c.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},c.prototype.listenerCount=v,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},fafe:function(e,t,n){var r=n("abac");r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var i=n("35d6").default;e.exports.__inject__=function(e){i("662871c4",r,e)}},fbbb:function(e,t,n){var r=n("24fb");t=r(!1),t.push([e.i,".searchWrapper[data-v-1774f2a8]{display:flex;overflow:hidden;background:rgb(var(--background-secondary-theme));border-radius:30px;color:rgb(var(--neutral-grad-2));align-items:center}.searchWrapper .inputWrapper[data-v-1774f2a8]{flex-grow:1}.searchWrapper .inputWrapper input[data-v-1774f2a8]{padding:.75em 1em;padding-right:0;width:100%;font-size:.9em}.searchWrapper .iconWrapper[data-v-1774f2a8]{text-align:center;width:50px}.searchWrapper .iconWrapper i[data-v-1774f2a8]{font-size:.8em}#search.minimized:not(.active) .searchWrapper[data-v-1774f2a8]{border-radius:0;background:transparent;padding:0}#search.minimized:not(.active) .searchWrapper .inputWrapper[data-v-1774f2a8]{display:none}#search.minimized:not(.active) .searchWrapper .iconWrapper[data-v-1774f2a8]{text-align:center;width:44px;height:44px;line-height:44px;padding:0;border-radius:50%;background:rgba(var(--color-txt-gray-dark),.4);color:rgba(var(--color-txt-gray-dark),.8)}#search.minimized:not(.active) .searchWrapper .iconWrapper i[data-v-1774f2a8]{font-size:.8em}",""]),e.exports=t},fc6a:function(e,t,n){var r=n("44ad"),i=n("1d80");e.exports=function(e){return r(i(e))}},fca4:function(e,t,n){"use strict";n.r(t);var r=n("7e58");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},fdbf:function(e,t,n){var r=n("4930");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdca:function(e,t,n){"use strict";n.r(t);var r=n("2724");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},fe93:function(e,t,n){"use strict";var r=n("6de4");function i(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var o=RegExp(Object.keys(r).map(i).join("|"),"g");function a(e){return r[e]}function s(e){return e.replace(o,a)}e.exports=s},ff6c:function(e,t,n){"use strict";n.r(t);var r=n("246d");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},ff89:function(e,t,n){"use strict";n.r(t);var r=n("fafe");for(var i in r)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(i)},ffd9:function(e,t,n){"use strict";function r(e){for(let t=0;t= 0,\n isMouseEvent = event.type.indexOf('mouse') >= 0,\n $el = this;\n\n if (isTouchEvent) {\n globalLastTouchTime = event.timeStamp;\n }\n\n if (isMouseEvent && globalLastTouchTime && event.timeStamp - globalLastTouchTime < 350) {\n return;\n }\n\n if ($this.touchStarted) {\n return;\n }\n\n addTouchClass(this);\n\n $this.touchStarted = true;\n\n $this.touchMoved = false;\n $this.swipeOutBounded = false;\n\n $this.startX = touchX(event);\n $this.startY = touchY(event);\n\n $this.currentX = 0;\n $this.currentY = 0;\n\n $this.touchStartTime = event.timeStamp;\n\n // Trigger touchhold event after `touchHoldTolerance`ms\n $this.touchHoldTimer = setTimeout(function() {\n $this.touchHoldTimer = null;\n triggerEvent(event, $el, 'touchhold');\n }, $this.options.touchHoldTolerance);\n\n triggerEvent(event, this, 'start');\n }\n\n function touchMoveEvent(event) {\n var $this = this.$$touchObj;\n\n $this.currentX = touchX(event);\n $this.currentY = touchY(event);\n\n if (!$this.touchMoved) {\n var tapTolerance = $this.options.tapTolerance;\n\n $this.touchMoved = Math.abs($this.startX - $this.currentX) > tapTolerance ||\n Math.abs($this.startY - $this.currentY) > tapTolerance;\n\n if($this.touchMoved){\n cancelTouchHoldTimer($this);\n triggerEvent(event, this, 'moved');\n }\n\n } else if (!$this.swipeOutBounded) {\n var swipeOutBounded = $this.options.swipeTolerance;\n\n $this.swipeOutBounded = Math.abs($this.startX - $this.currentX) > swipeOutBounded &&\n Math.abs($this.startY - $this.currentY) > swipeOutBounded;\n }\n\n if($this.touchMoved){\n triggerEvent(event, this, 'moving');\n }\n }\n\n function touchCancelEvent() {\n var $this = this.$$touchObj;\n\n cancelTouchHoldTimer($this);\n removeTouchClass(this);\n\n $this.touchStarted = $this.touchMoved = false;\n $this.startX = $this.startY = 0;\n }\n\n function touchEndEvent(event) {\n var $this = this.$$touchObj,\n isTouchEvent = event.type.indexOf('touch') >= 0,\n isMouseEvent = event.type.indexOf('mouse') >= 0;\n\n if (isTouchEvent) {\n globalLastTouchTime = event.timeStamp;\n }\n\n var touchholdEnd = isTouchEvent && !$this.touchHoldTimer;\n cancelTouchHoldTimer($this);\n\n $this.touchStarted = false;\n\n removeTouchClass(this);\n\n if (isMouseEvent && globalLastTouchTime && event.timeStamp - globalLastTouchTime < 350) {\n return;\n }\n\n // Fix #33, Trigger `end` event when touch stopped\n triggerEvent(event, this, 'end');\n\n if (!$this.touchMoved) {\n // detect if this is a longTap event or not\n if ($this.callbacks.longtap && event.timeStamp - $this.touchStartTime > $this.options.longTapTimeInterval) {\n if (event.cancelable) {\n event.preventDefault();\n }\n triggerEvent(event, this, 'longtap');\n\n } else if ($this.callbacks.touchhold && touchholdEnd) {\n if (event.cancelable) {\n event.preventDefault();\n }\n return;\n } else {\n // emit tap event\n triggerEvent(event, this, 'tap');\n }\n\n } else if (!$this.swipeOutBounded) {\n var swipeOutBounded = $this.options.swipeTolerance,\n direction,\n distanceY = Math.abs($this.startY - $this.currentY),\n distanceX = Math.abs($this.startX - $this.currentX);\n\n if (distanceY > swipeOutBounded || distanceX > swipeOutBounded) {\n if (distanceY > swipeOutBounded) {\n direction = $this.startY > $this.currentY ? 'top' : 'bottom';\n } else {\n direction = $this.startX > $this.currentX ? 'left' : 'right';\n }\n\n // Only emit the specified event when it has modifiers\n if ($this.callbacks['swipe.' + direction]) {\n triggerEvent(event, this, 'swipe.' + direction, direction);\n } else {\n // Emit a common event when it has no any modifier\n triggerEvent(event, this, 'swipe', direction);\n }\n }\n }\n }\n\n function mouseEnterEvent() {\n addTouchClass(this);\n }\n\n function mouseLeaveEvent() {\n removeTouchClass(this);\n }\n\n function triggerEvent(e, $el, eventType, param) {\n var $this = $el.$$touchObj;\n\n // get the callback list\n var callbacks = $this && $this.callbacks[eventType] || [];\n if (callbacks.length === 0) {\n return null;\n }\n\n for (var i = 0; i < callbacks.length; i++) {\n var binding = callbacks[i];\n\n if (binding.modifiers.stop) {\n e.stopPropagation();\n }\n\n if (binding.modifiers.prevent && e.cancelable) {\n e.preventDefault();\n }\n\n // handle `self` modifier`\n if (binding.modifiers.self && e.target !== e.currentTarget) {\n continue;\n }\n\n if (typeof binding.value === 'function') {\n if (param) {\n binding.value(param, e);\n } else {\n binding.value(e);\n }\n }\n }\n }\n\n function addTouchClass($el) {\n var className = $el.$$touchObj.options.touchClass;\n className && $el.classList.add(className);\n }\n\n function removeTouchClass($el) {\n var className = $el.$$touchObj.options.touchClass;\n className && $el.classList.remove(className);\n }\n\n function cancelTouchHoldTimer($this) {\n if ($this.touchHoldTimer) {\n clearTimeout($this.touchHoldTimer);\n $this.touchHoldTimer = null;\n }\n }\n\n function buildTouchObj($el, extraOptions) {\n var touchObj = $el.$$touchObj || {\n // an object contains all callbacks registered,\n // key is event name, value is an array\n callbacks: {},\n // prevent bind twice, set to true when event bound\n hasBindTouchEvents: false,\n // default options, would be override by v-touch-options\n options: globalOptions\n };\n if (extraOptions) {\n touchObj.options = Object.assign({}, touchObj.options, extraOptions);\n }\n $el.$$touchObj = touchObj;\n return $el.$$touchObj;\n }\n\n Vue.directive(globalOptions.namespace, {\n bind: function ($el, binding) {\n // build a touch configuration object\n var $this = buildTouchObj($el);\n // declare passive option for the event listener. Defaults to { passive: true } if supported\n var passiveOpt = isPassiveSupported ? { passive: true } : false;\n // register callback\n var eventType = binding.arg || 'tap';\n switch (eventType) {\n case 'swipe':\n var _m = binding.modifiers;\n if (_m.left || _m.right || _m.top || _m.bottom) {\n for (var i in binding.modifiers) {\n if (['left', 'right', 'top', 'bottom'].indexOf(i) >= 0) {\n var _e = 'swipe.' + i;\n $this.callbacks[_e] = $this.callbacks[_e] || [];\n $this.callbacks[_e].push(binding);\n }\n }\n } else {\n $this.callbacks.swipe = $this.callbacks.swipe || [];\n $this.callbacks.swipe.push(binding);\n }\n break;\n \n case 'start':\n case 'moving':\n if (binding.modifiers.disablePassive) {\n // change the passive option for the moving event if disablePassive modifier exists\n passiveOpt = false;\n }\n // fallthrough\n default:\n $this.callbacks[eventType] = $this.callbacks[eventType] || [];\n $this.callbacks[eventType].push(binding);\n }\n\n // prevent bind twice\n if ($this.hasBindTouchEvents) {\n return;\n }\n\n $el.addEventListener('touchstart', touchStartEvent, passiveOpt);\n $el.addEventListener('touchmove', touchMoveEvent, passiveOpt);\n $el.addEventListener('touchcancel', touchCancelEvent);\n $el.addEventListener('touchend', touchEndEvent);\n\n if (!$this.options.disableClick) {\n $el.addEventListener('mousedown', touchStartEvent);\n $el.addEventListener('mousemove', touchMoveEvent);\n $el.addEventListener('mouseup', touchEndEvent);\n $el.addEventListener('mouseenter', mouseEnterEvent);\n $el.addEventListener('mouseleave', mouseLeaveEvent);\n }\n\n // set bind mark to true\n $this.hasBindTouchEvents = true;\n },\n\n unbind: function ($el) {\n $el.removeEventListener('touchstart', touchStartEvent);\n $el.removeEventListener('touchmove', touchMoveEvent);\n $el.removeEventListener('touchcancel', touchCancelEvent);\n $el.removeEventListener('touchend', touchEndEvent);\n\n if ($el.$$touchObj && !$el.$$touchObj.options.disableClick) {\n $el.removeEventListener('mousedown', touchStartEvent);\n $el.removeEventListener('mousemove', touchMoveEvent);\n $el.removeEventListener('mouseup', touchEndEvent);\n $el.removeEventListener('mouseenter', mouseEnterEvent);\n $el.removeEventListener('mouseleave', mouseLeaveEvent);\n }\n\n // remove vars\n delete $el.$$touchObj;\n }\n });\n\n Vue.directive(globalOptions.namespace + '-class', {\n bind: function ($el, binding) {\n buildTouchObj($el, {\n touchClass: binding.value\n });\n }\n });\n\n Vue.directive(globalOptions.namespace + '-options', {\n bind: function($el, binding) {\n buildTouchObj($el, binding.value);\n }\n });\n }\n};\n\n\n/*\n * Exports\n */\nif (typeof module === 'object') {\n module.exports = vueTouchEvents;\n\n} else if (typeof define === 'function' && define.amd) {\n define([], function () {\n return vueTouchEvents;\n });\n} else if (window.Vue) {\n window.vueTouchEvents = vueTouchEvents;\n Vue.use(vueTouchEvents);\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=bcf20e38&scoped=true&lang=sass&\"","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","export * from \"-!../../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=54a240c2&scoped=true&lang=sass&\"","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","\"use strict\";\n/**\n * The STREAM online authenticated encryption construction.\n * See for definition.\n */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst aead_1 = require(\"./aead\");\nconst webcrypto_1 = require(\"./providers/webcrypto\");\n/** Size of a nonce required by STREAM in bytes */\nexports.NONCE_SIZE = 8;\n/** Byte flag indicating this is the last block in the STREAM (otherwise 0) */\nexports.LAST_BLOCK_FLAG = 1;\n/** Maximum value of the counter STREAM uses internally to identify messages */\nexports.COUNTER_MAX = 0xFFFFFFFF;\n/**\n * A STREAM encryptor with a 32-bit counter, generalized for any AEAD algorithm\n *\n * This corresponds to the ℰ stream encryptor object as defined in the paper\n * Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance\n */\nclass StreamEncryptor {\n /** Create a new StreamEncryptor instance with the given key */\n static importKey(keyData, nonce, alg, provider = new webcrypto_1.WebCryptoProvider()) {\n return __awaiter(this, void 0, void 0, function* () {\n return new StreamEncryptor(yield aead_1.AEAD.importKey(keyData, alg, provider), nonce);\n });\n }\n constructor(aead, nonce) {\n this._aead = aead;\n this._nonce_encoder = new NonceEncoder(nonce);\n }\n /** Encrypt and authenticate data using the selected AEAD algorithm */\n seal(plaintext, lastBlock = false, associatedData = new Uint8Array(0)) {\n return __awaiter(this, void 0, void 0, function* () {\n return this._aead.seal(plaintext, this._nonce_encoder.next(lastBlock), associatedData);\n });\n }\n /** Make a best effort to wipe memory used by this instance */\n clear() {\n this._aead.clear();\n return this;\n }\n}\nexports.StreamEncryptor = StreamEncryptor;\n/**\n * A STREAM decryptor with a 32-bit counter, generalized for any AEAD algorithm\n *\n * This corresponds to the 𝒟 stream decryptor object as defined in the paper\n * Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance\n */\nclass StreamDecryptor {\n /** Create a new StreamDecryptor instance with the given key */\n static importKey(keyData, nonce, alg, provider = new webcrypto_1.WebCryptoProvider()) {\n return __awaiter(this, void 0, void 0, function* () {\n return new StreamDecryptor(yield aead_1.AEAD.importKey(keyData, alg, provider), nonce);\n });\n }\n constructor(aead, nonce) {\n this._aead = aead;\n this._nonce_encoder = new NonceEncoder(nonce);\n }\n /** Decrypt and authenticate data using the selected AEAD algorithm */\n open(ciphertext, lastBlock = false, associatedData = new Uint8Array(0)) {\n return __awaiter(this, void 0, void 0, function* () {\n return this._aead.open(ciphertext, this._nonce_encoder.next(lastBlock), associatedData);\n });\n }\n /** Make a best effort to wipe memory used by this instance */\n clear() {\n this._aead.clear();\n return this;\n }\n}\nexports.StreamDecryptor = StreamDecryptor;\n/** Computes STREAM nonces based on the current position in the STREAM. */\nclass NonceEncoder {\n constructor(noncePrefix) {\n if (noncePrefix.length !== exports.NONCE_SIZE) {\n throw new Error(`STREAM: nonce must be 8-bits (got ${noncePrefix.length}`);\n }\n this.buffer = new ArrayBuffer(exports.NONCE_SIZE + 4 + 1);\n this.view = new DataView(this.buffer);\n this.array = new Uint8Array(this.buffer);\n this.array.set(noncePrefix);\n this.counter = 0;\n this.finished = false;\n }\n /** Compute the next nonce value, incrementing the internal counter */\n next(lastBlock) {\n if (this.finished) {\n throw new Error(\"STREAM: already finished\");\n }\n this.view.setInt32(8, this.counter, false);\n if (lastBlock) {\n this.view.setInt8(12, exports.LAST_BLOCK_FLAG);\n this.finished = true;\n }\n else {\n this.counter += 1;\n if (this.counter > exports.COUNTER_MAX) {\n throw new Error(\"STREAM counter overflowed\");\n }\n }\n return this.array;\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.main=e():(t.VuejsDialog=t.VuejsDialog||{},t.VuejsDialog.main=e())}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"/dist/\",n(n.s=23)}([function(t,e,n){\"use strict\";function o(t,e,n,o,i,r,s,a){var c,u=\"function\"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),r&&(u._scopeId=\"data-v-\"+r),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=c):i&&(c=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}n.d(e,\"a\",function(){return o})},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=e.DIALOG_TYPES={ALERT:\"alert\",CONFIRM:\"confirm\",PROMPT:\"prompt\"},i=e.CONFIRM_TYPES={BASIC:\"basic\",SOFT:\"soft\",HARD:\"hard\"};e.ANIMATION_TYPES={FADE:\"dg-fade\",ZOOM:\"dg-zoom\",BOUNCE:\"dg-bounce\"},e.CLASS_TYPES={MAIN_CONTENT:\"mainContent\",BODY:\"body\",TITLE:\"title\",FOOTER:\"footer\",OK_BTN:\"okBtn\",CANCEL_BTN:\"cancelBtn\"},e.DEFAULT_OPTIONS={html:!1,loader:!1,reverse:!1,backdropClose:!1,okText:\"Continue\",cancelText:\"Close\",view:null,type:i.BASIC,window:o.CONFIRM,message:\"Proceed with the request?\",clicksCount:3,animation:\"zoom\",customClass:\"\",verification:\"continue\",verificationHelp:'Type \"[+:verification]\" below to confirm',promptHelp:'Type in the box below and click \"[+:okText]\"'}},function(t,e,n){\"use strict\";n.r(e);var o=n(3),i=n.n(o);for(var r in o)\"default\"!==r&&function(t){n.d(e,t,function(){return o[t]})}(r);e.default=i.a},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=function(t){return t&&t.__esModule?t:{default:t}}(n(29)),i=n(16);e.default={data:function(){return{dialogsARR:[],registeredViews:{}}},created:function(){document.addEventListener(\"keydown\",this.escapeKeyListener)},destroyed:function(){document.removeEventListener(\"keydown\",this.escapeKeyListener)},watch:{dialogsARR:{handler:function(t){var e=document.getElementsByTagName(\"body\")[0];e&&(t.length&&!e.classList.contains(\"dg-open\")?e.classList.add(\"dg-open\"):!t.length&&e&&e.classList.contains(\"dg-open\")&&e.classList.remove(\"dg-open\"))}}},methods:{commit:function(t){t.escapeKeyClose=!1,this.dialogsARR.push(t)},forceCloseAll:function(){var t=this;this.dialogsARR.forEach(function(e,n){return t.$delete(t.dialogsARR,n)})},destroyDialog:function(t){var e=(0,i.firstIndex)(this.dialogsARR,t,\"id\");-1!==e&&this.$delete(this.dialogsARR,e)},escapeKeyListener:function(t){if(27===t.keyCode){var e=-1+this.dialogsARR.length;e>-1&&this.$set(this.dialogsARR[e],\"escapeKeyClose\",!0)}}},components:{DialogWindow:o.default}}},function(t,e,n){\"use strict\";n.r(e);var o=n(5),i=n.n(o);for(var r in o)\"default\"!==r&&function(t){n.d(e,t,function(){return o[t]})}(r);e.default=i.a},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=function(t){return t&&t.__esModule?t:{default:t}}(n(30)),i=n(1);e.default={data:function(){return{show:!0,closed:!1,endedAnimations:[]}},props:{options:{type:Object,required:!0},escapeKeyClose:{type:Boolean,default:!1},registeredViews:{type:Object,default:function(){return{}}}},watch:{escapeKeyClose:function(t){!0===t&&(this.cancelBtnDisabled?this.proceed():this.cancel())}},computed:{animation:function(){var t=this.options.animation.toUpperCase();return i.ANIMATION_TYPES.hasOwnProperty(t)?i.ANIMATION_TYPES[t]:i.ANIMATION_TYPES.ZOOM},loaderEnabled:function(){return!!this.options.loader},dialogView:function(){return(this.options.view?this.registeredViews[this.options.view]:null)||o.default},isHardConfirm:function(){return this.options.window===i.DIALOG_TYPES.CONFIRM&&this.options.type===i.CONFIRM_TYPES.HARD},isPrompt:function(){return this.options.window===i.DIALOG_TYPES.PROMPT}},methods:{closeAtOutsideClick:function(){!0===this.options.backdropClose&&(this.cancelBtnDisabled?this.proceed():this.cancel())},proceed:function(){this.loaderEnabled?(this.switchLoadingState(!0),this.options.promiseResolver({close:this.close,loading:this.switchLoadingState})):(this.options.promiseResolver(!0),this.close())},cancel:function(){!0!==this.loading&&this.close()},close:function(){this.show=!1,this.closed=!0},animationEnded:function(t){this.endedAnimations.push(t),-1!==this.endedAnimations.indexOf(\"backdrop\")&&-1!==this.endedAnimations.indexOf(\"content\")&&(this.options.promiseRejecter(!1),this.$emit(\"close\",this.options.id))}},beforeDestroy:function(){!1===this.closed&&(this.cancelBtnDisabled?this.proceed():this.cancel())}}},function(t,e,n){\"use strict\";n.r(e);var o=n(7),i=n.n(o);for(var r in o)\"default\"!==r&&function(t){n.d(e,t,function(){return o[t]})}(r);e.default=i.a},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=s(n(13)),i=s(n(31)),r=s(n(32));function s(t){return t&&t.__esModule?t:{default:t}}e.default={data:function(){return{}},mixins:[o.default],mounted:function(){this.isHardConfirm&&this.$refs.inputElem&&this.$refs.inputElem.focus()},components:{CancelBtn:r.default,OkBtn:i.default}}},function(t,e,n){\"use strict\";n.r(e);var o=n(9),i=n.n(o);for(var r in o)\"default\"!==r&&function(t){n.d(e,t,function(){return o[t]})}(r);e.default=i.a},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=function(t){return t&&t.__esModule?t:{default:t}}(n(36)),i=n(1);e.default={data:function(){return{clicks_count:0}},props:{enabled:{required:!1,type:Boolean,default:!0},options:{required:!0,type:Object},focus:{required:!1,type:Boolean,default:!1},loading:{required:!1,type:Boolean,default:!1}},mounted:function(){this.focus&&this.$refs.btn.focus()},computed:{soft_confirm:function(){return this.options.type===i.CONFIRM_TYPES.SOFT},hard_confirm:function(){return this.options.type===i.CONFIRM_TYPES.HARD},is_disabled:function(){return this.$parent.okBtnDisabled},clicks_remaining:function(){return Math.max(this.options.clicksCount-this.clicks_count,0)}},methods:{proceed:function(){!this.is_disabled&&this.validateProceed()&&this.$emit(\"click\")},validateProceed:function(){switch(this.options.type){case i.CONFIRM_TYPES.SOFT:return this.clicks_count++,this.clicks_count>=this.options.clicksCount;case i.CONFIRM_TYPES.BASIC:default:return!0}}},components:{BtnLoader:o.default}}},function(t,e,n){\"use strict\";n.r(e);var o=n(11),i=n.n(o);for(var r in o)\"default\"!==r&&function(t){n.d(e,t,function(){return o[t]})}(r);e.default=i.a},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.default={props:{enabled:{required:!1,type:Boolean,default:!0},options:{required:!0,type:Object},focus:{required:!1,type:Boolean,default:!1},loading:{required:!1,type:Boolean,default:!1}},mounted:function(){this.focus&&this.$refs.btn.focus()}}},function(t,e,n){},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=n(1),i=s(n(14)),r=s(n(15));function s(t){return t&&t.__esModule?t:{default:t}}e.default={data:function(){return{input:\"\",loading:!1}},props:{options:{type:Object,required:!0}},computed:{loaderEnabled:function(){return!!this.options.loader},isHardConfirm:function(){return this.options.window===o.DIALOG_TYPES.CONFIRM&&this.options.type===o.CONFIRM_TYPES.HARD},isPrompt:function(){return this.options.window===o.DIALOG_TYPES.PROMPT},leftBtnComponent:function(){return!1===this.options.reverse?\"cancel-btn\":\"ok-btn\"},rightBtnComponent:function(){return!0===this.options.reverse?\"cancel-btn\":\"ok-btn\"},hardConfirmHelpText:function(){var t=this;return this.options.verificationHelp.replace(/\\[\\+:(\\w+)]/g,function(e,n){return t.options[n]||e})},promptHelpText:function(){var t=this;return this.options.promptHelp.replace(/\\[\\+:(\\w+)]/g,function(e,n){return t.options[n]||e})}},mounted:function(){this.isHardConfirm&&this.$refs.inputElem&&this.$refs.inputElem.focus()},methods:{clickRightBtn:function(){this.options.reverse?this.cancel():this.proceed(this.getDefaultData())},clickLeftBtn:function(){this.options.reverse?this.proceed(this.getDefaultData()):this.cancel()},submitDialogForm:function(){this.okBtnDisabled||this.proceed(this.getDefaultData())},getDefaultData:function(){return this.isPrompt?this.input:null},proceed:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.loaderEnabled?(this.switchLoadingState(!0),this.options.promiseResolver({close:this.close,loading:this.switchLoadingState,data:t})):(this.options.promiseResolver({data:t}),this.close())},cancel:function(){!0!==this.loading&&this.close()},switchLoadingState:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===t&&(t=!this.loading),this.loading=!!t},close:function(){this.$emit(\"close\")}},mixins:[i.default,r.default]}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t};e.default={computed:{messageHasTitle:function(){var t=this.options.message;return\"object\"===(void 0===t?\"undefined\":o(t))&&null!==t&&t.title},messageTitle:function(){return this.messageHasTitle?this.options.message.title:null},messageBody:function(){var t=this.options.message;return\"string\"==typeof t?t:t.body||\"\"}}}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var o=n(1);e.default={computed:{cancelBtnDisabled:function(){return this.options.window===o.DIALOG_TYPES.ALERT},okBtnDisabled:function(){return this.options.window===o.DIALOG_TYPES.CONFIRM&&this.options.type===o.CONFIRM_TYPES.HARD&&this.input!==this.options.verification},leftBtnEnabled:function(){return!1===this.cancelBtnDisabled||!0===this.options.reverse},rightBtnEnabled:function(){return!1===this.cancelBtnDisabled||!1===this.options.reverse},leftBtnFocus:function(){return!this.isHardConfirm&&!0===this.options.reverse},rightBtnFocus:function(){return!this.isHardConfirm&&!1===this.options.reverse},leftBtnText:function(){return this.options.reverse?this.options.okText:this.options.cancelText},rightBtnText:function(){return this.options.reverse?this.options.cancelText:this.options.okText}}}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getElem=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?document.querySelectorAll(t):document.querySelector(t)};e.noop=function(){};var o=e.cloneObj=function(t){return Object.assign({},t)};e.mergeObjs=function(){for(var t=[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{};this.Vue=t,this.mounted=!1,this.$root={},this.registeredViews={},this.globalOptions=(0,a.mergeObjs)(r.DEFAULT_OPTIONS,e)};l.prototype.mountIfNotMounted=function(){var t=this;!0!==this.mounted&&(this.$root=function(){var e=t.Vue.extend(i.default),n=document.createElement(\"div\");document.querySelector(\"body\").appendChild(n);var o=new e;return o.registeredViews=t.registeredComponents(),o.$mount(n)}(),this.mounted=!0)},l.prototype.registeredComponents=function(){return u},l.prototype.registerComponent=function(t,e){this.mounted&&this.destroy(),u[t]=e},l.prototype.destroy=function(){if(!0===this.mounted){this.$root.forceCloseAll();var t=this.$root.$el;this.$root.$destroy(),this.$root.$off(),t.remove(),this.mounted=!1}},l.prototype.alert=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&(e.message=t),this.open(r.DIALOG_TYPES.ALERT,e)},l.prototype.prompt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&(e.message=t),this.open(r.DIALOG_TYPES.PROMPT,e)},l.prototype.confirm=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&(e.message=t),this.open(r.DIALOG_TYPES.CONFIRM,e)},l.prototype.open=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.mountIfNotMounted(),new o.default(function(o,i){n.id=\"dialog.\"+Date.now(),n.window=t,n.promiseResolver=o,n.promiseRejecter=i,e.$root.commit((0,a.mergeObjs)(e.globalOptions,n))})},l.install=function(t,e){var n=new s.default(t);t.directive(\"confirm\",n.confirmDefinition),t.dialog=new l(t,e),Object.defineProperties(t.prototype,{$dialog:{get:function(){return t.dialog}}})},e.default=l},function(t,e,n){(function(e){!function(n){var o=setTimeout;function i(){}function r(t){if(!(this instanceof r))throw new TypeError(\"Promises must be constructed via new\");if(\"function\"!=typeof t)throw new TypeError(\"not a function\");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function s(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,r._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var o;try{o=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,o)}else(1===t._state?a:c)(e.promise,t._value)})):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError(\"A promise cannot be resolved with itself.\");if(e&&(\"object\"==typeof e||\"function\"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void u(t);if(\"function\"==typeof n)return void l(function(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,u(t)}catch(e){c(t,e)}}function c(t,e){t._state=2,t._value=e,u(t)}function u(t){2===t._state&&0===t._deferreds.length&&r._immediateFn(function(){t._handled||r._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(26),e.setImmediate=\"undefined\"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate=\"undefined\"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(22))},function(t,e,n){(function(t,e){!function(t,n){\"use strict\";if(!t.setImmediate){var o,i=1,r={},s=!1,a=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,\"[object process]\"==={}.toString.call(t.process)?o=function(t){e.nextTick(function(){l(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage(\"\",\"*\"),t.onmessage=n,e}}()?function(){var e=\"setImmediate$\"+Math.random()+\"$\",n=function(n){n.source===t&&\"string\"==typeof n.data&&0===n.data.indexOf(e)&&l(+n.data.slice(e.length))};t.addEventListener?t.addEventListener(\"message\",n,!1):t.attachEvent(\"onmessage\",n),o=function(n){t.postMessage(e+n,\"*\")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){l(t.data)},o=function(e){t.port2.postMessage(e)}}():a&&\"onreadystatechange\"in a.createElement(\"script\")?function(){var t=a.documentElement;o=function(e){var n=a.createElement(\"script\");n.onreadystatechange=function(){l(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():o=function(t){setTimeout(l,0,t)},c.setImmediate=function(t){\"function\"!=typeof t&&(t=new Function(\"\"+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n\n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.Room = Room;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _eventTimelineSet = require(\"./event-timeline-set\");\r\n\r\nvar _eventTimeline = require(\"./event-timeline\");\r\n\r\nvar _contentRepo = require(\"../content-repo\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _event = require(\"./event\");\r\n\r\nvar _roomMember = require(\"./room-member\");\r\n\r\nvar _roomSummary = require(\"./room-summary\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _ReEmitter = require(\"../ReEmitter\");\r\n\r\nvar _event2 = require(\"../@types/event\");\r\n\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\r\n\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\r\n\r\n// These constants are used as sane defaults when the homeserver doesn't support\r\n// the m.room_versions capability. In practice, KNOWN_SAFE_ROOM_VERSION should be\r\n// the same as the common default room version whereas SAFE_ROOM_VERSIONS are the\r\n// room versions which are considered okay for people to run without being asked\r\n// to upgrade (ie: \"stable\"). Eventually, we should remove these when all homeservers\r\n// return an m.room_versions capability.\r\nconst KNOWN_SAFE_ROOM_VERSION = '6';\r\nconst SAFE_ROOM_VERSIONS = ['1', '2', '3', '4', '5', '6'];\r\n\r\nfunction synthesizeReceipt(userId, event, receiptType) {\r\n // console.log(\"synthesizing receipt for \"+event.getId());\r\n // This is really ugly because JS has no way to express an object literal\r\n // where the name of a key comes from an expression\r\n const fakeReceipt = {\r\n content: {},\r\n type: \"m.receipt\",\r\n room_id: event.getRoomId()\r\n };\r\n fakeReceipt.content[event.getId()] = {};\r\n fakeReceipt.content[event.getId()][receiptType] = {};\r\n fakeReceipt.content[event.getId()][receiptType][userId] = {\r\n ts: event.getTs()\r\n };\r\n return new _event.MatrixEvent(fakeReceipt);\r\n}\r\n/**\r\n * Construct a new Room.\r\n *\r\n *

For a room, we store an ordered sequence of timelines, which may or may not\r\n * be continuous. Each timeline lists a series of events, as well as tracking\r\n * the room state at the start and the end of the timeline. It also tracks\r\n * forward and backward pagination tokens, as well as containing links to the\r\n * next timeline in the sequence.\r\n *\r\n *

There is one special timeline - the 'live' timeline, which represents the\r\n * timeline to which events are being added in real-time as they are received\r\n * from the /sync API. Note that you should not retain references to this\r\n * timeline - even if it is the current timeline right now, it may not remain\r\n * so if the server gives us a timeline gap in /sync.\r\n *\r\n *

In order that we can find events from their ids later, we also maintain a\r\n * map from event_id to timeline and index.\r\n *\r\n * @constructor\r\n * @alias module:models/room\r\n * @param {string} roomId Required. The ID of this room.\r\n * @param {MatrixClient} client Required. The client, used to lazy load members.\r\n * @param {string} myUserId Required. The ID of the syncing user.\r\n * @param {Object=} opts Configuration options\r\n * @param {*} opts.storageToken Optional. The token which a data store can use\r\n * to remember the state of the room. What this means is dependent on the store\r\n * implementation.\r\n *\r\n * @param {String=} opts.pendingEventOrdering Controls where pending messages\r\n * appear in a room's timeline. If \"chronological\", messages will appear\r\n * in the timeline when the call to sendEvent was made. If\r\n * \"detached\", pending messages will appear in a separate list,\r\n * accessbile via {@link module:models/room#getPendingEvents}. Default:\r\n * \"chronological\".\r\n * @param {boolean} [opts.timelineSupport = false] Set to true to enable improved\r\n * timeline support.\r\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\r\n * Optional. Set to true to enable client-side aggregation of event relations\r\n * via `EventTimelineSet#getRelationsForEvent`.\r\n * This feature is currently unstable and the API may change without notice.\r\n *\r\n * @prop {string} roomId The ID of this room.\r\n * @prop {string} name The human-readable display name for this room.\r\n * @prop {Array} timeline The live event timeline for this room,\r\n * with the oldest event at index 0. Present for backwards compatibility -\r\n * prefer getLiveTimeline().getEvents().\r\n * @prop {object} tags Dict of room tags; the keys are the tag name and the values\r\n * are any metadata associated with the tag - e.g. { \"fav\" : { order: 1 } }\r\n * @prop {object} accountData Dict of per-room account_data events; the keys are the\r\n * event type and the values are the events.\r\n * @prop {RoomState} oldState The state of the room at the time of the oldest\r\n * event in the live timeline. Present for backwards compatibility -\r\n * prefer getLiveTimeline().getState(EventTimeline.BACKWARDS).\r\n * @prop {RoomState} currentState The state of the room at the time of the\r\n * newest event in the timeline. Present for backwards compatibility -\r\n * prefer getLiveTimeline().getState(EventTimeline.FORWARDS).\r\n * @prop {RoomSummary} summary The room summary.\r\n * @prop {*} storageToken A token which a data store can use to remember\r\n * the state of the room.\r\n */\r\n\r\n\r\nfunction Room(roomId, client, myUserId, opts) {\r\n opts = opts || {};\r\n opts.pendingEventOrdering = opts.pendingEventOrdering || \"chronological\";\r\n this._client = client; // In some cases, we add listeners for every displayed Matrix event, so it's\r\n // common to have quite a few more than the default limit.\r\n\r\n this.setMaxListeners(100);\r\n this.reEmitter = new _ReEmitter.ReEmitter(this);\r\n\r\n if ([\"chronological\", \"detached\"].indexOf(opts.pendingEventOrdering) === -1) {\r\n throw new Error(\"opts.pendingEventOrdering MUST be either 'chronological' or \" + \"'detached'. Got: '\" + opts.pendingEventOrdering + \"'\");\r\n }\r\n\r\n this.myUserId = myUserId;\r\n this.roomId = roomId;\r\n this.name = roomId;\r\n this.tags = {// $tagName: { $metadata: $value },\r\n // $tagName: { $metadata: $value },\r\n };\r\n this.accountData = {// $eventType: $event\r\n };\r\n this.summary = null;\r\n this.storageToken = opts.storageToken;\r\n this._opts = opts;\r\n this._txnToEvent = {}; // Pending in-flight requests { string: MatrixEvent }\r\n // receipts should clobber based on receipt_type and user_id pairs hence\r\n // the form of this structure. This is sub-optimal for the exposed APIs\r\n // which pass in an event ID and get back some receipts, so we also store\r\n // a pre-cached list for this purpose.\r\n\r\n this._receipts = {// receipt_type: {\r\n // user_id: {\r\n // eventId: ,\r\n // data: \r\n // }\r\n // }\r\n };\r\n this._receiptCacheByEventId = {// $event_id: [{\r\n // type: $type,\r\n // userId: $user_id,\r\n // data: \r\n // }]\r\n }; // only receipts that came from the server, not synthesized ones\r\n\r\n this._realReceipts = {};\r\n this._notificationCounts = {}; // all our per-room timeline sets. the first one is the unfiltered ones;\r\n // the subsequent ones are the filtered ones in no particular order.\r\n\r\n this._timelineSets = [new _eventTimelineSet.EventTimelineSet(this, opts)];\r\n this.reEmitter.reEmit(this.getUnfilteredTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\r\n\r\n this._fixUpLegacyTimelineFields(); // any filtered timeline sets we're maintaining for this room\r\n\r\n\r\n this._filteredTimelineSets = {// filter_id: timelineSet\r\n };\r\n\r\n if (this._opts.pendingEventOrdering == \"detached\") {\r\n this._pendingEventList = [];\r\n\r\n const serializedPendingEventList = client._sessionStore.store.getItem(pendingEventsKey(this.roomId));\r\n\r\n if (serializedPendingEventList) {\r\n JSON.parse(serializedPendingEventList).forEach(async serializedEvent => {\r\n const event = new _event.MatrixEvent(serializedEvent);\r\n\r\n if (event.getType() === \"m.room.encrypted\") {\r\n await event.attemptDecryption(this._client._crypto);\r\n }\r\n\r\n event.setStatus(_event.EventStatus.NOT_SENT);\r\n this.addPendingEvent(event, event.getTxnId());\r\n });\r\n }\r\n } // read by megolm; boolean value - null indicates \"use global value\"\r\n\r\n\r\n this._blacklistUnverifiedDevices = null;\r\n this._selfMembership = null;\r\n this._summaryHeroes = null; // awaited by getEncryptionTargetMembers while room members are loading\r\n\r\n if (!this._opts.lazyLoadMembers) {\r\n this._membersPromise = Promise.resolve();\r\n } else {\r\n this._membersPromise = null;\r\n }\r\n}\r\n/**\r\n * @param {string} roomId ID of the current room\r\n * @returns {string} Storage key to retrieve pending events\r\n */\r\n\r\n\r\nfunction pendingEventsKey(roomId) {\r\n return `mx_pending_events_${roomId}`;\r\n}\r\n\r\nutils.inherits(Room, _events.EventEmitter);\r\n/**\r\n * Gets the version of the room\r\n * @returns {string} The version of the room, or null if it could not be determined\r\n */\r\n\r\nRoom.prototype.getVersion = function () {\r\n const createEvent = this.currentState.getStateEvents(\"m.room.create\", \"\");\r\n\r\n if (!createEvent) {\r\n _logger.logger.warn(\"Room \" + this.roomId + \" does not have an m.room.create event\");\r\n\r\n return '1';\r\n }\r\n\r\n const ver = createEvent.getContent()['room_version'];\r\n if (ver === undefined) return '1';\r\n return ver;\r\n};\r\n/**\r\n * Determines whether this room needs to be upgraded to a new version\r\n * @returns {string?} What version the room should be upgraded to, or null if\r\n * the room does not require upgrading at this time.\r\n * @deprecated Use #getRecommendedVersion() instead\r\n */\r\n\r\n\r\nRoom.prototype.shouldUpgradeToVersion = function () {\r\n // TODO: Remove this function.\r\n // This makes assumptions about which versions are safe, and can easily\r\n // be wrong. Instead, people are encouraged to use getRecommendedVersion\r\n // which determines a safer value. This function doesn't use that function\r\n // because this is not async-capable, and to avoid breaking the contract\r\n // we're deprecating this.\r\n if (!SAFE_ROOM_VERSIONS.includes(this.getVersion())) {\r\n return KNOWN_SAFE_ROOM_VERSION;\r\n }\r\n\r\n return null;\r\n};\r\n/**\r\n * Determines the recommended room version for the room. This returns an\r\n * object with 3 properties: version as the new version the\r\n * room should be upgraded to (may be the same as the current version);\r\n * needsUpgrade to indicate if the room actually can be\r\n * upgraded (ie: does the current version not match?); and urgent\r\n * to indicate if the new version patches a vulnerability in a previous\r\n * version.\r\n * @returns {Promise<{version: string, needsUpgrade: bool, urgent: bool}>}\r\n * Resolves to the version the room should be upgraded to.\r\n */\r\n\r\n\r\nRoom.prototype.getRecommendedVersion = async function () {\r\n const capabilities = await this._client.getCapabilities();\r\n let versionCap = capabilities[\"m.room_versions\"];\r\n\r\n if (!versionCap) {\r\n versionCap = {\r\n default: KNOWN_SAFE_ROOM_VERSION,\r\n available: {}\r\n };\r\n\r\n for (const safeVer of SAFE_ROOM_VERSIONS) {\r\n versionCap.available[safeVer] = \"stable\";\r\n }\r\n }\r\n\r\n let result = this._checkVersionAgainstCapability(versionCap);\r\n\r\n if (result.urgent && result.needsUpgrade) {\r\n // Something doesn't feel right: we shouldn't need to update\r\n // because the version we're on should be in the protocol's\r\n // namespace. This usually means that the server was updated\r\n // before the client was, making us think the newest possible\r\n // room version is not stable. As a solution, we'll refresh\r\n // the capability we're using to determine this.\r\n _logger.logger.warn(\"Refreshing room version capability because the server looks \" + \"to be supporting a newer room version we don't know about.\");\r\n\r\n const caps = await this._client.getCapabilities(true);\r\n versionCap = caps[\"m.room_versions\"];\r\n\r\n if (!versionCap) {\r\n _logger.logger.warn(\"No room version capability - assuming upgrade required.\");\r\n\r\n return result;\r\n } else {\r\n result = this._checkVersionAgainstCapability(versionCap);\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nRoom.prototype._checkVersionAgainstCapability = function (versionCap) {\r\n const currentVersion = this.getVersion();\r\n\r\n _logger.logger.log(`[${this.roomId}] Current version: ${currentVersion}`);\r\n\r\n _logger.logger.log(`[${this.roomId}] Version capability: `, versionCap);\r\n\r\n const result = {\r\n version: currentVersion,\r\n needsUpgrade: false,\r\n urgent: false\r\n }; // If the room is on the default version then nothing needs to change\r\n\r\n if (currentVersion === versionCap.default) return result;\r\n const stableVersions = Object.keys(versionCap.available).filter(v => versionCap.available[v] === 'stable'); // Check if the room is on an unstable version. We determine urgency based\r\n // off the version being in the Matrix spec namespace or not (if the version\r\n // is in the current namespace and unstable, the room is probably vulnerable).\r\n\r\n if (!stableVersions.includes(currentVersion)) {\r\n result.version = versionCap.default;\r\n result.needsUpgrade = true;\r\n result.urgent = !!this.getVersion().match(/^[0-9]+[0-9.]*$/g);\r\n\r\n if (result.urgent) {\r\n _logger.logger.warn(`URGENT upgrade required on ${this.roomId}`);\r\n } else {\r\n _logger.logger.warn(`Non-urgent upgrade required on ${this.roomId}`);\r\n }\r\n\r\n return result;\r\n } // The room is on a stable, but non-default, version by this point.\r\n // No upgrade needed.\r\n\r\n\r\n return result;\r\n};\r\n/**\r\n * Determines whether the given user is permitted to perform a room upgrade\r\n * @param {String} userId The ID of the user to test against\r\n * @returns {bool} True if the given user is permitted to upgrade the room\r\n */\r\n\r\n\r\nRoom.prototype.userMayUpgradeRoom = function (userId) {\r\n return this.currentState.maySendStateEvent(\"m.room.tombstone\", userId);\r\n};\r\n/**\r\n * Get the list of pending sent events for this room\r\n *\r\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\r\n * waiting for remote echo.\r\n *\r\n * @throws If opts.pendingEventOrdering was not 'detached'\r\n */\r\n\r\n\r\nRoom.prototype.getPendingEvents = function () {\r\n if (this._opts.pendingEventOrdering !== \"detached\") {\r\n throw new Error(\"Cannot call getPendingEvents with pendingEventOrdering == \" + this._opts.pendingEventOrdering);\r\n }\r\n\r\n return this._pendingEventList;\r\n};\r\n/**\r\n * Removes a pending event for this room\r\n *\r\n * @param {string} eventId\r\n * @return {boolean} True if an element was removed.\r\n */\r\n\r\n\r\nRoom.prototype.removePendingEvent = function (eventId) {\r\n if (this._opts.pendingEventOrdering !== \"detached\") {\r\n throw new Error(\"Cannot call removePendingEvent with pendingEventOrdering == \" + this._opts.pendingEventOrdering);\r\n }\r\n\r\n const removed = utils.removeElement(this._pendingEventList, function (ev) {\r\n return ev.getId() == eventId;\r\n }, false);\r\n\r\n this._savePendingEvents();\r\n\r\n return removed;\r\n};\r\n/**\r\n * Check whether the pending event list contains a given event by ID.\r\n * If pending event ordering is not \"detached\" then this returns false.\r\n *\r\n * @param {string} eventId The event ID to check for.\r\n * @return {boolean}\r\n */\r\n\r\n\r\nRoom.prototype.hasPendingEvent = function (eventId) {\r\n if (this._opts.pendingEventOrdering !== \"detached\") {\r\n return false;\r\n }\r\n\r\n return this._pendingEventList.some(event => event.getId() === eventId);\r\n};\r\n/**\r\n * Get a specific event from the pending event list, if configured, null otherwise.\r\n *\r\n * @param {string} eventId The event ID to check for.\r\n * @return {MatrixEvent}\r\n */\r\n\r\n\r\nRoom.prototype.getPendingEvent = function (eventId) {\r\n if (this._opts.pendingEventOrdering !== \"detached\") {\r\n return null;\r\n }\r\n\r\n return this._pendingEventList.find(event => event.getId() === eventId);\r\n};\r\n/**\r\n * Get the live unfiltered timeline for this room.\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} live timeline\r\n */\r\n\r\n\r\nRoom.prototype.getLiveTimeline = function () {\r\n return this.getUnfilteredTimelineSet().getLiveTimeline();\r\n};\r\n/**\r\n * Get the timestamp of the last message in the room\r\n *\r\n * @return {number} the timestamp of the last message in the room\r\n */\r\n\r\n\r\nRoom.prototype.getLastActiveTimestamp = function () {\r\n const timeline = this.getLiveTimeline();\r\n const events = timeline.getEvents();\r\n\r\n if (events.length) {\r\n const lastEvent = events[events.length - 1];\r\n return lastEvent.getTs();\r\n } else {\r\n return Number.MIN_SAFE_INTEGER;\r\n }\r\n};\r\n/**\r\n * @param {string} myUserId the user id for the logged in member\r\n * @return {string} the membership type (join | leave | invite) for the logged in user\r\n */\r\n\r\n\r\nRoom.prototype.getMyMembership = function () {\r\n return this._selfMembership;\r\n};\r\n/**\r\n * If this room is a DM we're invited to,\r\n * try to find out who invited us\r\n * @return {string} user id of the inviter\r\n */\r\n\r\n\r\nRoom.prototype.getDMInviter = function () {\r\n if (this.myUserId) {\r\n const me = this.getMember(this.myUserId);\r\n\r\n if (me) {\r\n return me.getDMInviter();\r\n }\r\n }\r\n\r\n if (this._selfMembership === \"invite\") {\r\n // fall back to summary information\r\n const memberCount = this.getInvitedAndJoinedMemberCount();\r\n\r\n if (memberCount == 2 && this._summaryHeroes.length) {\r\n return this._summaryHeroes[0];\r\n }\r\n }\r\n};\r\n/**\r\n * Assuming this room is a DM room, tries to guess with which user.\r\n * @return {string} user id of the other member (could be syncing user)\r\n */\r\n\r\n\r\nRoom.prototype.guessDMUserId = function () {\r\n const me = this.getMember(this.myUserId);\r\n\r\n if (me) {\r\n const inviterId = me.getDMInviter();\r\n\r\n if (inviterId) {\r\n return inviterId;\r\n }\r\n } // remember, we're assuming this room is a DM,\r\n // so returning the first member we find should be fine\r\n\r\n\r\n const hasHeroes = Array.isArray(this._summaryHeroes) && this._summaryHeroes.length;\r\n\r\n if (hasHeroes) {\r\n return this._summaryHeroes[0];\r\n }\r\n\r\n const members = this.currentState.getMembers();\r\n const anyMember = members.find(m => m.userId !== this.myUserId);\r\n\r\n if (anyMember) {\r\n return anyMember.userId;\r\n } // it really seems like I'm the only user in the room\r\n // so I probably created a room with just me in it\r\n // and marked it as a DM. Ok then\r\n\r\n\r\n return this.myUserId;\r\n};\r\n\r\nRoom.prototype.getAvatarFallbackMember = function () {\r\n const memberCount = this.getInvitedAndJoinedMemberCount();\r\n\r\n if (memberCount > 2) {\r\n return;\r\n }\r\n\r\n const hasHeroes = Array.isArray(this._summaryHeroes) && this._summaryHeroes.length;\r\n\r\n if (hasHeroes) {\r\n const availableMember = this._summaryHeroes.map(userId => {\r\n return this.getMember(userId);\r\n }).find(member => !!member);\r\n\r\n if (availableMember) {\r\n return availableMember;\r\n }\r\n }\r\n\r\n const members = this.currentState.getMembers(); // could be different than memberCount\r\n // as this includes left members\r\n\r\n if (members.length <= 2) {\r\n const availableMember = members.find(m => {\r\n return m.userId !== this.myUserId;\r\n });\r\n\r\n if (availableMember) {\r\n return availableMember;\r\n }\r\n } // if all else fails, try falling back to a user,\r\n // and create a one-off member for it\r\n\r\n\r\n if (hasHeroes) {\r\n const availableUser = this._summaryHeroes.map(userId => {\r\n return this._client.getUser(userId);\r\n }).find(user => !!user);\r\n\r\n if (availableUser) {\r\n const member = new _roomMember.RoomMember(this.roomId, availableUser.userId);\r\n member.user = availableUser;\r\n return member;\r\n }\r\n }\r\n};\r\n/**\r\n * Sets the membership this room was received as during sync\r\n * @param {string} membership join | leave | invite\r\n */\r\n\r\n\r\nRoom.prototype.updateMyMembership = function (membership) {\r\n const prevMembership = this._selfMembership;\r\n this._selfMembership = membership;\r\n\r\n if (prevMembership !== membership) {\r\n if (membership === \"leave\") {\r\n this._cleanupAfterLeaving();\r\n }\r\n\r\n this.emit(\"Room.myMembership\", this, membership, prevMembership);\r\n }\r\n};\r\n\r\nRoom.prototype._loadMembersFromServer = async function () {\r\n const lastSyncToken = this._client.store.getSyncToken();\r\n\r\n const queryString = utils.encodeParams({\r\n not_membership: \"leave\",\r\n at: lastSyncToken\r\n });\r\n const path = utils.encodeUri(\"/rooms/$roomId/members?\" + queryString, {\r\n $roomId: this.roomId\r\n });\r\n const http = this._client._http;\r\n const response = await http.authedRequest(undefined, \"GET\", path);\r\n return response.chunk;\r\n};\r\n\r\nRoom.prototype._loadMembers = async function () {\r\n // were the members loaded from the server?\r\n let fromServer = false;\r\n let rawMembersEvents = await this._client.store.getOutOfBandMembers(this.roomId);\r\n\r\n if (rawMembersEvents === null) {\r\n fromServer = true;\r\n rawMembersEvents = await this._loadMembersFromServer();\r\n\r\n _logger.logger.log(`LL: got ${rawMembersEvents.length} ` + `members from server for room ${this.roomId}`);\r\n }\r\n\r\n const memberEvents = rawMembersEvents.map(this._client.getEventMapper());\r\n return {\r\n memberEvents,\r\n fromServer\r\n };\r\n};\r\n/**\r\n * Preloads the member list in case lazy loading\r\n * of memberships is in use. Can be called multiple times,\r\n * it will only preload once.\r\n * @return {Promise} when preloading is done and\r\n * accessing the members on the room will take\r\n * all members in the room into account\r\n */\r\n\r\n\r\nRoom.prototype.loadMembersIfNeeded = function () {\r\n if (this._membersPromise) {\r\n return this._membersPromise;\r\n } // mark the state so that incoming messages while\r\n // the request is in flight get marked as superseding\r\n // the OOB members\r\n\r\n\r\n this.currentState.markOutOfBandMembersStarted();\r\n\r\n const inMemoryUpdate = this._loadMembers().then(result => {\r\n this.currentState.setOutOfBandMembers(result.memberEvents); // now the members are loaded, start to track the e2e devices if needed\r\n\r\n if (this._client.isCryptoEnabled() && this._client.isRoomEncrypted(this.roomId)) {\r\n this._client._crypto.trackRoomDevices(this.roomId);\r\n }\r\n\r\n return result.fromServer;\r\n }).catch(err => {\r\n // allow retries on fail\r\n this._membersPromise = null;\r\n this.currentState.markOutOfBandMembersFailed();\r\n throw err;\r\n }); // update members in storage, but don't wait for it\r\n\r\n\r\n inMemoryUpdate.then(fromServer => {\r\n if (fromServer) {\r\n const oobMembers = this.currentState.getMembers().filter(m => m.isOutOfBand()).map(m => m.events.member.event);\r\n\r\n _logger.logger.log(`LL: telling store to write ${oobMembers.length}` + ` members for room ${this.roomId}`);\r\n\r\n const store = this._client.store;\r\n return store.setOutOfBandMembers(this.roomId, oobMembers) // swallow any IDB error as we don't want to fail\r\n // because of this\r\n .catch(err => {\r\n _logger.logger.log(\"LL: storing OOB room members failed, oh well\", err);\r\n });\r\n }\r\n }).catch(err => {\r\n // as this is not awaited anywhere,\r\n // at least show the error in the console\r\n _logger.logger.error(err);\r\n });\r\n this._membersPromise = inMemoryUpdate;\r\n return this._membersPromise;\r\n};\r\n/**\r\n * Removes the lazily loaded members from storage if needed\r\n */\r\n\r\n\r\nRoom.prototype.clearLoadedMembersIfNeeded = async function () {\r\n if (this._opts.lazyLoadMembers && this._membersPromise) {\r\n await this.loadMembersIfNeeded();\r\n await this._client.store.clearOutOfBandMembers(this.roomId);\r\n this.currentState.clearOutOfBandMembers();\r\n this._membersPromise = null;\r\n }\r\n};\r\n/**\r\n * called when sync receives this room in the leave section\r\n * to do cleanup after leaving a room. Possibly called multiple times.\r\n */\r\n\r\n\r\nRoom.prototype._cleanupAfterLeaving = function () {\r\n this.clearLoadedMembersIfNeeded().catch(err => {\r\n _logger.logger.error(`error after clearing loaded members from ` + `room ${this.roomId} after leaving`);\r\n\r\n _logger.logger.log(err);\r\n });\r\n};\r\n/**\r\n * Reset the live timeline of all timelineSets, and start new ones.\r\n *\r\n *

This is used when /sync returns a 'limited' timeline.\r\n *\r\n * @param {string=} backPaginationToken token for back-paginating the new timeline\r\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\r\n * if absent or null, all timelines are reset, removing old ones (including the previous live\r\n * timeline which would otherwise be unable to paginate forwards without this token).\r\n * Removing just the old live timeline whilst preserving previous ones is not supported.\r\n */\r\n\r\n\r\nRoom.prototype.resetLiveTimeline = function (backPaginationToken, forwardPaginationToken) {\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n this._timelineSets[i].resetLiveTimeline(backPaginationToken, forwardPaginationToken);\r\n }\r\n\r\n this._fixUpLegacyTimelineFields();\r\n};\r\n/**\r\n * Fix up this.timeline, this.oldState and this.currentState\r\n *\r\n * @private\r\n */\r\n\r\n\r\nRoom.prototype._fixUpLegacyTimelineFields = function () {\r\n // maintain this.timeline as a reference to the live timeline,\r\n // and this.oldState and this.currentState as references to the\r\n // state at the start and end of that timeline. These are more\r\n // for backwards-compatibility than anything else.\r\n this.timeline = this.getLiveTimeline().getEvents();\r\n this.oldState = this.getLiveTimeline().getState(_eventTimeline.EventTimeline.BACKWARDS);\r\n this.currentState = this.getLiveTimeline().getState(_eventTimeline.EventTimeline.FORWARDS);\r\n};\r\n/**\r\n * Returns whether there are any devices in the room that are unverified\r\n *\r\n * Note: Callers should first check if crypto is enabled on this device. If it is\r\n * disabled, then we aren't tracking room devices at all, so we can't answer this, and an\r\n * error will be thrown.\r\n *\r\n * @return {bool} the result\r\n */\r\n\r\n\r\nRoom.prototype.hasUnverifiedDevices = async function () {\r\n if (!this._client.isRoomEncrypted(this.roomId)) {\r\n return false;\r\n }\r\n\r\n const e2eMembers = await this.getEncryptionTargetMembers();\r\n\r\n for (const member of e2eMembers) {\r\n const devices = this._client.getStoredDevicesForUser(member.userId);\r\n\r\n if (devices.some(device => device.isUnverified())) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n/**\r\n * Return the timeline sets for this room.\r\n * @return {EventTimelineSet[]} array of timeline sets for this room\r\n */\r\n\r\n\r\nRoom.prototype.getTimelineSets = function () {\r\n return this._timelineSets;\r\n};\r\n/**\r\n * Helper to return the main unfiltered timeline set for this room\r\n * @return {EventTimelineSet} room's unfiltered timeline set\r\n */\r\n\r\n\r\nRoom.prototype.getUnfilteredTimelineSet = function () {\r\n return this._timelineSets[0];\r\n};\r\n/**\r\n * Get the timeline which contains the given event from the unfiltered set, if any\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\r\n * the given event, or null if unknown\r\n */\r\n\r\n\r\nRoom.prototype.getTimelineForEvent = function (eventId) {\r\n return this.getUnfilteredTimelineSet().getTimelineForEvent(eventId);\r\n};\r\n/**\r\n * Add a new timeline to this room's unfiltered timeline set\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\r\n */\r\n\r\n\r\nRoom.prototype.addTimeline = function () {\r\n return this.getUnfilteredTimelineSet().addTimeline();\r\n};\r\n/**\r\n * Get an event which is stored in our unfiltered timeline set\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event.MatrixEvent} the given event, or undefined if unknown\r\n */\r\n\r\n\r\nRoom.prototype.findEventById = function (eventId) {\r\n return this.getUnfilteredTimelineSet().findEventById(eventId);\r\n};\r\n/**\r\n * Get one of the notification counts for this room\r\n * @param {String} type The type of notification count to get. default: 'total'\r\n * @return {Number} The notification count, or undefined if there is no count\r\n * for this type.\r\n */\r\n\r\n\r\nRoom.prototype.getUnreadNotificationCount = function (type) {\r\n type = type || 'total';\r\n return this._notificationCounts[type];\r\n};\r\n/**\r\n * Set one of the notification counts for this room\r\n * @param {String} type The type of notification count to set.\r\n * @param {Number} count The new count\r\n */\r\n\r\n\r\nRoom.prototype.setUnreadNotificationCount = function (type, count) {\r\n this._notificationCounts[type] = count;\r\n};\r\n\r\nRoom.prototype.setSummary = function (summary) {\r\n const heroes = summary[\"m.heroes\"];\r\n const joinedCount = summary[\"m.joined_member_count\"];\r\n const invitedCount = summary[\"m.invited_member_count\"];\r\n\r\n if (Number.isInteger(joinedCount)) {\r\n this.currentState.setJoinedMemberCount(joinedCount);\r\n }\r\n\r\n if (Number.isInteger(invitedCount)) {\r\n this.currentState.setInvitedMemberCount(invitedCount);\r\n }\r\n\r\n if (Array.isArray(heroes)) {\r\n // be cautious about trusting server values,\r\n // and make sure heroes doesn't contain our own id\r\n // just to be sure\r\n this._summaryHeroes = heroes.filter(userId => {\r\n return userId !== this.myUserId;\r\n });\r\n }\r\n};\r\n/**\r\n * Whether to send encrypted messages to devices within this room.\r\n * @param {Boolean} value true to blacklist unverified devices, null\r\n * to use the global value for this room.\r\n */\r\n\r\n\r\nRoom.prototype.setBlacklistUnverifiedDevices = function (value) {\r\n this._blacklistUnverifiedDevices = value;\r\n};\r\n/**\r\n * Whether to send encrypted messages to devices within this room.\r\n * @return {Boolean} true if blacklisting unverified devices, null\r\n * if the global value should be used for this room.\r\n */\r\n\r\n\r\nRoom.prototype.getBlacklistUnverifiedDevices = function () {\r\n return this._blacklistUnverifiedDevices;\r\n};\r\n/**\r\n * Get the avatar URL for a room if one was set.\r\n * @param {String} baseUrl The homeserver base URL. See\r\n * {@link module:client~MatrixClient#getHomeserverUrl}.\r\n * @param {Number} width The desired width of the thumbnail.\r\n * @param {Number} height The desired height of the thumbnail.\r\n * @param {string} resizeMethod The thumbnail resize method to use, either\r\n * \"crop\" or \"scale\".\r\n * @param {boolean} allowDefault True to allow an identicon for this room if an\r\n * avatar URL wasn't explicitly set. Default: true. (Deprecated)\r\n * @return {?string} the avatar URL or null.\r\n */\r\n\r\n\r\nRoom.prototype.getAvatarUrl = function (baseUrl, width, height, resizeMethod, allowDefault) {\r\n const roomAvatarEvent = this.currentState.getStateEvents(_event2.EventType.RoomAvatar, \"\");\r\n\r\n if (allowDefault === undefined) {\r\n allowDefault = true;\r\n }\r\n\r\n if (!roomAvatarEvent && !allowDefault) {\r\n return null;\r\n }\r\n\r\n const mainUrl = roomAvatarEvent ? roomAvatarEvent.getContent().url : null;\r\n\r\n if (mainUrl) {\r\n return (0, _contentRepo.getHttpUriForMxc)(baseUrl, mainUrl, width, height, resizeMethod);\r\n }\r\n\r\n return null;\r\n};\r\n/**\r\n * Get the mxc avatar url for the room, if one was set.\r\n * @return {string} the mxc avatar url or falsy\r\n */\r\n\r\n\r\nRoom.prototype.getMxcAvatarUrl = function () {\r\n const roomAvatarEvent = this.currentState.getStateEvents(_event2.EventType.RoomAvatar, \"\");\r\n return roomAvatarEvent ? roomAvatarEvent.getContent().url : null;\r\n};\r\n/**\r\n * Get the aliases this room has according to the room's state\r\n * The aliases returned by this function may not necessarily\r\n * still point to this room.\r\n * @return {array} The room's alias as an array of strings\r\n */\r\n\r\n\r\nRoom.prototype.getAliases = function () {\r\n const aliasStrings = [];\r\n const aliasEvents = this.currentState.getStateEvents(\"m.room.aliases\");\r\n\r\n if (aliasEvents) {\r\n for (let i = 0; i < aliasEvents.length; ++i) {\r\n const aliasEvent = aliasEvents[i];\r\n\r\n if (utils.isArray(aliasEvent.getContent().aliases)) {\r\n const filteredAliases = aliasEvent.getContent().aliases.filter(a => {\r\n if (typeof a !== \"string\") return false;\r\n if (a[0] !== '#') return false;\r\n if (!a.endsWith(`:${aliasEvent.getStateKey()}`)) return false; // It's probably valid by here.\r\n\r\n return true;\r\n });\r\n Array.prototype.push.apply(aliasStrings, filteredAliases);\r\n }\r\n }\r\n }\r\n\r\n return aliasStrings;\r\n};\r\n/**\r\n * Get this room's canonical alias\r\n * The alias returned by this function may not necessarily\r\n * still point to this room.\r\n * @return {?string} The room's canonical alias, or null if there is none\r\n */\r\n\r\n\r\nRoom.prototype.getCanonicalAlias = function () {\r\n const canonicalAlias = this.currentState.getStateEvents(\"m.room.canonical_alias\", \"\");\r\n\r\n if (canonicalAlias) {\r\n return canonicalAlias.getContent().alias || null;\r\n }\r\n\r\n return null;\r\n};\r\n/**\r\n * Get this room's alternative aliases\r\n * @return {array} The room's alternative aliases, or an empty array\r\n */\r\n\r\n\r\nRoom.prototype.getAltAliases = function () {\r\n const canonicalAlias = this.currentState.getStateEvents(\"m.room.canonical_alias\", \"\");\r\n\r\n if (canonicalAlias) {\r\n return canonicalAlias.getContent().alt_aliases || [];\r\n }\r\n\r\n return [];\r\n};\r\n/**\r\n * Add events to a timeline\r\n *\r\n *

Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent[]} events A list of events to add.\r\n *\r\n * @param {boolean} toStartOfTimeline True to add these events to the start\r\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\r\n * event will be the last element of 'events'.\r\n *\r\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\r\n * add events to.\r\n *\r\n * @param {string=} paginationToken token for the next batch of events\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n *\r\n */\r\n\r\n\r\nRoom.prototype.addEventsToTimeline = function (events, toStartOfTimeline, timeline, paginationToken) {\r\n timeline.getTimelineSet().addEventsToTimeline(events, toStartOfTimeline, timeline, paginationToken);\r\n};\r\n/**\r\n * Get a member from the current room state.\r\n * @param {string} userId The user ID of the member.\r\n * @return {RoomMember} The member or null.\r\n */\r\n\r\n\r\nRoom.prototype.getMember = function (userId) {\r\n return this.currentState.getMember(userId);\r\n};\r\n/**\r\n * Get a list of members whose membership state is \"join\".\r\n * @return {RoomMember[]} A list of currently joined members.\r\n */\r\n\r\n\r\nRoom.prototype.getJoinedMembers = function () {\r\n return this.getMembersWithMembership(\"join\");\r\n};\r\n/**\r\n * Returns the number of joined members in this room\r\n * This method caches the result.\r\n * This is a wrapper around the method of the same name in roomState, returning\r\n * its result for the room's current state.\r\n * @return {integer} The number of members in this room whose membership is 'join'\r\n */\r\n\r\n\r\nRoom.prototype.getJoinedMemberCount = function () {\r\n return this.currentState.getJoinedMemberCount();\r\n};\r\n/**\r\n * Returns the number of invited members in this room\r\n * @return {integer} The number of members in this room whose membership is 'invite'\r\n */\r\n\r\n\r\nRoom.prototype.getInvitedMemberCount = function () {\r\n return this.currentState.getInvitedMemberCount();\r\n};\r\n/**\r\n * Returns the number of invited + joined members in this room\r\n * @return {integer} The number of members in this room whose membership is 'invite' or 'join'\r\n */\r\n\r\n\r\nRoom.prototype.getInvitedAndJoinedMemberCount = function () {\r\n return this.getInvitedMemberCount() + this.getJoinedMemberCount();\r\n};\r\n/**\r\n * Get a list of members with given membership state.\r\n * @param {string} membership The membership state.\r\n * @return {RoomMember[]} A list of members with the given membership state.\r\n */\r\n\r\n\r\nRoom.prototype.getMembersWithMembership = function (membership) {\r\n return utils.filter(this.currentState.getMembers(), function (m) {\r\n return m.membership === membership;\r\n });\r\n};\r\n/**\r\n * Get a list of members we should be encrypting for in this room\r\n * @return {Promise} A list of members who\r\n * we should encrypt messages for in this room.\r\n */\r\n\r\n\r\nRoom.prototype.getEncryptionTargetMembers = async function () {\r\n await this.loadMembersIfNeeded();\r\n let members = this.getMembersWithMembership(\"join\");\r\n\r\n if (this.shouldEncryptForInvitedMembers()) {\r\n members = members.concat(this.getMembersWithMembership(\"invite\"));\r\n }\r\n\r\n return members;\r\n};\r\n/**\r\n * Determine whether we should encrypt messages for invited users in this room\r\n * @return {boolean} if we should encrypt messages for invited users\r\n */\r\n\r\n\r\nRoom.prototype.shouldEncryptForInvitedMembers = function () {\r\n const ev = this.currentState.getStateEvents(\"m.room.history_visibility\", \"\");\r\n return ev && ev.getContent() && ev.getContent().history_visibility !== \"joined\";\r\n};\r\n/**\r\n * Get the default room name (i.e. what a given user would see if the\r\n * room had no m.room.name)\r\n * @param {string} userId The userId from whose perspective we want\r\n * to calculate the default name\r\n * @return {string} The default room name\r\n */\r\n\r\n\r\nRoom.prototype.getDefaultRoomName = function (userId) {\r\n return calculateRoomName(this, userId, true);\r\n};\r\n/**\r\n* Check if the given user_id has the given membership state.\r\n* @param {string} userId The user ID to check.\r\n* @param {string} membership The membership e.g. 'join'\r\n* @return {boolean} True if this user_id has the given membership state.\r\n*/\r\n\r\n\r\nRoom.prototype.hasMembershipState = function (userId, membership) {\r\n const member = this.getMember(userId);\r\n\r\n if (!member) {\r\n return false;\r\n }\r\n\r\n return member.membership === membership;\r\n};\r\n/**\r\n * Add a timelineSet for this room with the given filter\r\n * @param {Filter} filter The filter to be applied to this timelineSet\r\n * @return {EventTimelineSet} The timelineSet\r\n */\r\n\r\n\r\nRoom.prototype.getOrCreateFilteredTimelineSet = function (filter) {\r\n if (this._filteredTimelineSets[filter.filterId]) {\r\n return this._filteredTimelineSets[filter.filterId];\r\n }\r\n\r\n const opts = Object.assign({\r\n filter: filter\r\n }, this._opts);\r\n const timelineSet = new _eventTimelineSet.EventTimelineSet(this, opts);\r\n this.reEmitter.reEmit(timelineSet, [\"Room.timeline\", \"Room.timelineReset\"]);\r\n this._filteredTimelineSets[filter.filterId] = timelineSet;\r\n\r\n this._timelineSets.push(timelineSet); // populate up the new timelineSet with filtered events from our live\r\n // unfiltered timeline.\r\n //\r\n // XXX: This is risky as our timeline\r\n // may have grown huge and so take a long time to filter.\r\n // see https://github.com/vector-im/vector-web/issues/2109\r\n\r\n\r\n const unfilteredLiveTimeline = this.getLiveTimeline();\r\n unfilteredLiveTimeline.getEvents().forEach(function (event) {\r\n timelineSet.addLiveEvent(event);\r\n }); // find the earliest unfiltered timeline\r\n\r\n let timeline = unfilteredLiveTimeline;\r\n\r\n while (timeline.getNeighbouringTimeline(_eventTimeline.EventTimeline.BACKWARDS)) {\r\n timeline = timeline.getNeighbouringTimeline(_eventTimeline.EventTimeline.BACKWARDS);\r\n }\r\n\r\n timelineSet.getLiveTimeline().setPaginationToken(timeline.getPaginationToken(_eventTimeline.EventTimeline.BACKWARDS), _eventTimeline.EventTimeline.BACKWARDS); // alternatively, we could try to do something like this to try and re-paginate\r\n // in the filtered events from nothing, but Mark says it's an abuse of the API\r\n // to do so:\r\n //\r\n // timelineSet.resetLiveTimeline(\r\n // unfilteredLiveTimeline.getPaginationToken(EventTimeline.FORWARDS)\r\n // );\r\n\r\n return timelineSet;\r\n};\r\n/**\r\n * Forget the timelineSet for this room with the given filter\r\n *\r\n * @param {Filter} filter the filter whose timelineSet is to be forgotten\r\n */\r\n\r\n\r\nRoom.prototype.removeFilteredTimelineSet = function (filter) {\r\n const timelineSet = this._filteredTimelineSets[filter.filterId];\r\n delete this._filteredTimelineSets[filter.filterId];\r\n\r\n const i = this._timelineSets.indexOf(timelineSet);\r\n\r\n if (i > -1) {\r\n this._timelineSets.splice(i, 1);\r\n }\r\n};\r\n/**\r\n * Add an event to the end of this room's live timelines. Will fire\r\n * \"Room.timeline\".\r\n *\r\n * @param {MatrixEvent} event Event to be added\r\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n * @private\r\n */\r\n\r\n\r\nRoom.prototype._addLiveEvent = function (event, duplicateStrategy, fromCache) {\r\n if (event.isRedaction()) {\r\n const redactId = event.event.redacts; // if we know about this event, redact its contents now.\r\n\r\n const redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\r\n\r\n if (redactedEvent) {\r\n redactedEvent.makeRedacted(event); // If this is in the current state, replace it with the redacted version\r\n\r\n if (redactedEvent.getStateKey()) {\r\n const currentStateEvent = this.currentState.getStateEvents(redactedEvent.getType(), redactedEvent.getStateKey());\r\n\r\n if (currentStateEvent.getId() === redactedEvent.getId()) {\r\n this.currentState.setStateEvents([redactedEvent]);\r\n }\r\n }\r\n\r\n this.emit(\"Room.redaction\", event, this); // TODO: we stash user displaynames (among other things) in\r\n // RoomMember objects which are then attached to other events\r\n // (in the sender and target fields). We should get those\r\n // RoomMember objects to update themselves when the events that\r\n // they are based on are changed.\r\n } // FIXME: apply redactions to notification list\r\n // NB: We continue to add the redaction event to the timeline so\r\n // clients can say \"so and so redacted an event\" if they wish to. Also\r\n // this may be needed to trigger an update.\r\n\r\n }\r\n\r\n if (event.getUnsigned().transaction_id) {\r\n const existingEvent = this._txnToEvent[event.getUnsigned().transaction_id];\r\n\r\n if (existingEvent) {\r\n // remote echo of an event we sent earlier\r\n this._handleRemoteEcho(event, existingEvent);\r\n\r\n return;\r\n }\r\n } // add to our timeline sets\r\n\r\n\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n this._timelineSets[i].addLiveEvent(event, duplicateStrategy, fromCache);\r\n } // synthesize and inject implicit read receipts\r\n // Done after adding the event because otherwise the app would get a read receipt\r\n // pointing to an event that wasn't yet in the timeline\r\n // Don't synthesize RR for m.room.redaction as this causes the RR to go missing.\r\n\r\n\r\n if (event.sender && event.getType() !== \"m.room.redaction\") {\r\n this.addReceipt(synthesizeReceipt(event.sender.userId, event, \"m.read\"), true); // Any live events from a user could be taken as implicit\r\n // presence information: evidence that they are currently active.\r\n // ...except in a world where we use 'user.currentlyActive' to reduce\r\n // presence spam, this isn't very useful - we'll get a transition when\r\n // they are no longer currently active anyway. So don't bother to\r\n // reset the lastActiveAgo and lastPresenceTs from the RoomState's user.\r\n }\r\n};\r\n/**\r\n * Add a pending outgoing event to this room.\r\n *\r\n *

The event is added to either the pendingEventList, or the live timeline,\r\n * depending on the setting of opts.pendingEventOrdering.\r\n *\r\n *

This is an internal method, intended for use by MatrixClient.\r\n *\r\n * @param {module:models/event.MatrixEvent} event The event to add.\r\n *\r\n * @param {string} txnId Transaction id for this outgoing event\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\r\n *\r\n * @throws if the event doesn't have status SENDING, or we aren't given a\r\n * unique transaction id.\r\n */\r\n\r\n\r\nRoom.prototype.addPendingEvent = function (event, txnId) {\r\n if (event.status !== _event.EventStatus.SENDING && event.status !== _event.EventStatus.NOT_SENT) {\r\n throw new Error(\"addPendingEvent called on an event with status \" + event.status);\r\n }\r\n\r\n if (this._txnToEvent[txnId]) {\r\n throw new Error(\"addPendingEvent called on an event with known txnId \" + txnId);\r\n } // call setEventMetadata to set up event.sender etc\r\n // as event is shared over all timelineSets, we set up its metadata based\r\n // on the unfiltered timelineSet.\r\n\r\n\r\n _eventTimeline.EventTimeline.setEventMetadata(event, this.getLiveTimeline().getState(_eventTimeline.EventTimeline.FORWARDS), false);\r\n\r\n this._txnToEvent[txnId] = event;\r\n\r\n if (this._opts.pendingEventOrdering == \"detached\") {\r\n if (this._pendingEventList.some(e => e.status === _event.EventStatus.NOT_SENT)) {\r\n _logger.logger.warn(\"Setting event as NOT_SENT due to messages in the same state\");\r\n\r\n event.setStatus(_event.EventStatus.NOT_SENT);\r\n }\r\n\r\n this._pendingEventList.push(event);\r\n\r\n this._savePendingEvents();\r\n\r\n if (event.isRelation()) {\r\n // For pending events, add them to the relations collection immediately.\r\n // (The alternate case below already covers this as part of adding to\r\n // the timeline set.)\r\n this._aggregateNonLiveRelation(event);\r\n }\r\n\r\n if (event.isRedaction()) {\r\n const redactId = event.event.redacts;\r\n\r\n let redactedEvent = this._pendingEventList && this._pendingEventList.find(e => e.getId() === redactId);\r\n\r\n if (!redactedEvent) {\r\n redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\r\n }\r\n\r\n if (redactedEvent) {\r\n redactedEvent.markLocallyRedacted(event);\r\n this.emit(\"Room.redaction\", event, this);\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n const timelineSet = this._timelineSets[i];\r\n\r\n if (timelineSet.getFilter()) {\r\n if (timelineSet.getFilter().filterRoomTimeline([event]).length) {\r\n timelineSet.addEventToTimeline(event, timelineSet.getLiveTimeline(), false);\r\n }\r\n } else {\r\n timelineSet.addEventToTimeline(event, timelineSet.getLiveTimeline(), false);\r\n }\r\n }\r\n }\r\n\r\n this.emit(\"Room.localEchoUpdated\", event, this, null, null);\r\n};\r\n/**\r\n * Persists all pending events to local storage\r\n *\r\n * If the current room is encrypted only encrypted events will be persisted\r\n * all messages that are not yet encrypted will be discarded\r\n *\r\n * This is because the flow of EVENT_STATUS transition is\r\n * queued => sending => encrypting => sending => sent\r\n *\r\n * Steps 3 and 4 are skipped for unencrypted room.\r\n * It is better to discard an unencrypted message rather than persisting\r\n * it locally for everyone to read\r\n */\r\n\r\n\r\nRoom.prototype._savePendingEvents = function () {\r\n if (this._pendingEventList) {\r\n const pendingEvents = this._pendingEventList.map(event => {\r\n return _objectSpread(_objectSpread({}, event.event), {}, {\r\n txn_id: event.getTxnId()\r\n });\r\n }).filter(event => {\r\n // Filter out the unencrypted messages if the room is encrypted\r\n const isEventEncrypted = event.type === \"m.room.encrypted\";\r\n\r\n const isRoomEncrypted = this._client.isRoomEncrypted(this.roomId);\r\n\r\n return isEventEncrypted || !isRoomEncrypted;\r\n });\r\n\r\n const {\r\n store\r\n } = this._client._sessionStore;\r\n\r\n if (this._pendingEventList.length > 0) {\r\n store.setItem(pendingEventsKey(this.roomId), JSON.stringify(pendingEvents));\r\n } else {\r\n store.removeItem(pendingEventsKey(this.roomId));\r\n }\r\n }\r\n};\r\n/**\r\n * Used to aggregate the local echo for a relation, and also\r\n * for re-applying a relation after it's redaction has been cancelled,\r\n * as the local echo for the redaction of the relation would have\r\n * un-aggregated the relation. Note that this is different from regular messages,\r\n * which are just kept detached for their local echo.\r\n *\r\n * Also note that live events are aggregated in the live EventTimelineSet.\r\n * @param {module:models/event.MatrixEvent} event the relation event that needs to be aggregated.\r\n */\r\n\r\n\r\nRoom.prototype._aggregateNonLiveRelation = function (event) {\r\n // TODO: We should consider whether this means it would be a better\r\n // design to lift the relations handling up to the room instead.\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n const timelineSet = this._timelineSets[i];\r\n\r\n if (timelineSet.getFilter()) {\r\n if (timelineSet.getFilter().filterRoomTimeline([event]).length) {\r\n timelineSet.aggregateRelations(event);\r\n }\r\n } else {\r\n timelineSet.aggregateRelations(event);\r\n }\r\n }\r\n};\r\n/**\r\n * Deal with the echo of a message we sent.\r\n *\r\n *

We move the event to the live timeline if it isn't there already, and\r\n * update it.\r\n *\r\n * @param {module:models/event.MatrixEvent} remoteEvent The event received from\r\n * /sync\r\n * @param {module:models/event.MatrixEvent} localEvent The local echo, which\r\n * should be either in the _pendingEventList or the timeline.\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\r\n * @private\r\n */\r\n\r\n\r\nRoom.prototype._handleRemoteEcho = function (remoteEvent, localEvent) {\r\n const oldEventId = localEvent.getId();\r\n const newEventId = remoteEvent.getId();\r\n const oldStatus = localEvent.status;\r\n\r\n _logger.logger.debug(`Got remote echo for event ${oldEventId} -> ${newEventId} ` + `old status ${oldStatus}`); // no longer pending\r\n\r\n\r\n delete this._txnToEvent[remoteEvent.getUnsigned().transaction_id]; // if it's in the pending list, remove it\r\n\r\n if (this._pendingEventList) {\r\n this.removePendingEvent(oldEventId);\r\n } // replace the event source (this will preserve the plaintext payload if\r\n // any, which is good, because we don't want to try decoding it again).\r\n\r\n\r\n localEvent.handleRemoteEcho(remoteEvent.event);\r\n\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n const timelineSet = this._timelineSets[i]; // if it's already in the timeline, update the timeline map. If it's not, add it.\r\n\r\n timelineSet.handleRemoteEcho(localEvent, oldEventId, newEventId);\r\n }\r\n\r\n this.emit(\"Room.localEchoUpdated\", localEvent, this, oldEventId, oldStatus);\r\n};\r\n/* a map from current event status to a list of allowed next statuses\r\n */\r\n\r\n\r\nconst ALLOWED_TRANSITIONS = {};\r\nALLOWED_TRANSITIONS[_event.EventStatus.ENCRYPTING] = [_event.EventStatus.SENDING, _event.EventStatus.NOT_SENT];\r\nALLOWED_TRANSITIONS[_event.EventStatus.SENDING] = [_event.EventStatus.ENCRYPTING, _event.EventStatus.QUEUED, _event.EventStatus.NOT_SENT, _event.EventStatus.SENT];\r\nALLOWED_TRANSITIONS[_event.EventStatus.QUEUED] = [_event.EventStatus.SENDING, _event.EventStatus.CANCELLED];\r\nALLOWED_TRANSITIONS[_event.EventStatus.SENT] = [];\r\nALLOWED_TRANSITIONS[_event.EventStatus.NOT_SENT] = [_event.EventStatus.SENDING, _event.EventStatus.QUEUED, _event.EventStatus.CANCELLED];\r\nALLOWED_TRANSITIONS[_event.EventStatus.CANCELLED] = [];\r\n/**\r\n * Update the status / event id on a pending event, to reflect its transmission\r\n * progress.\r\n *\r\n *

This is an internal method.\r\n *\r\n * @param {MatrixEvent} event local echo event\r\n * @param {EventStatus} newStatus status to assign\r\n * @param {string} newEventId new event id to assign. Ignored unless\r\n * newStatus == EventStatus.SENT.\r\n * @fires module:client~MatrixClient#event:\"Room.localEchoUpdated\"\r\n */\r\n\r\nRoom.prototype.updatePendingEvent = function (event, newStatus, newEventId) {\r\n _logger.logger.log(`setting pendingEvent status to ${newStatus} in ${event.getRoomId()} ` + `event ID ${event.getId()} -> ${newEventId}`); // if the message was sent, we expect an event id\r\n\r\n\r\n if (newStatus == _event.EventStatus.SENT && !newEventId) {\r\n throw new Error(\"updatePendingEvent called with status=SENT, \" + \"but no new event id\");\r\n } // SENT races against /sync, so we have to special-case it.\r\n\r\n\r\n if (newStatus == _event.EventStatus.SENT) {\r\n const timeline = this.getUnfilteredTimelineSet().eventIdToTimeline(newEventId);\r\n\r\n if (timeline) {\r\n // we've already received the event via the event stream.\r\n // nothing more to do here.\r\n return;\r\n }\r\n }\r\n\r\n const oldStatus = event.status;\r\n const oldEventId = event.getId();\r\n\r\n if (!oldStatus) {\r\n throw new Error(\"updatePendingEventStatus called on an event which is \" + \"not a local echo.\");\r\n }\r\n\r\n const allowed = ALLOWED_TRANSITIONS[oldStatus];\r\n\r\n if (!allowed || allowed.indexOf(newStatus) < 0) {\r\n throw new Error(\"Invalid EventStatus transition \" + oldStatus + \"->\" + newStatus);\r\n }\r\n\r\n event.setStatus(newStatus);\r\n\r\n if (newStatus == _event.EventStatus.SENT) {\r\n // update the event id\r\n event.replaceLocalEventId(newEventId); // if the event was already in the timeline (which will be the case if\r\n // opts.pendingEventOrdering==chronological), we need to update the\r\n // timeline map.\r\n\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n this._timelineSets[i].replaceEventId(oldEventId, newEventId);\r\n }\r\n } else if (newStatus == _event.EventStatus.CANCELLED) {\r\n // remove it from the pending event list, or the timeline.\r\n if (this._pendingEventList) {\r\n const idx = this._pendingEventList.findIndex(ev => ev.getId() === oldEventId);\r\n\r\n if (idx !== -1) {\r\n const [removedEvent] = this._pendingEventList.splice(idx, 1);\r\n\r\n if (removedEvent.isRedaction()) {\r\n this._revertRedactionLocalEcho(removedEvent);\r\n }\r\n }\r\n }\r\n\r\n this.removeEvent(oldEventId);\r\n }\r\n\r\n this._savePendingEvents();\r\n\r\n this.emit(\"Room.localEchoUpdated\", event, this, oldEventId, oldStatus);\r\n};\r\n\r\nRoom.prototype._revertRedactionLocalEcho = function (redactionEvent) {\r\n const redactId = redactionEvent.event.redacts;\r\n\r\n if (!redactId) {\r\n return;\r\n }\r\n\r\n const redactedEvent = this.getUnfilteredTimelineSet().findEventById(redactId);\r\n\r\n if (redactedEvent) {\r\n redactedEvent.unmarkLocallyRedacted(); // re-render after undoing redaction\r\n\r\n this.emit(\"Room.redactionCancelled\", redactionEvent, this); // reapply relation now redaction failed\r\n\r\n if (redactedEvent.isRelation()) {\r\n this._aggregateNonLiveRelation(redactedEvent);\r\n }\r\n }\r\n};\r\n/**\r\n * Add some events to this room. This can include state events, message\r\n * events and typing notifications. These events are treated as \"live\" so\r\n * they will go to the end of the timeline.\r\n *\r\n * @param {MatrixEvent[]} events A list of events to add.\r\n *\r\n * @param {string} duplicateStrategy Optional. Applies to events in the\r\n * timeline only. If this is 'replace' then if a duplicate is encountered, the\r\n * event passed to this function will replace the existing event in the\r\n * timeline. If this is not specified, or is 'ignore', then the event passed to\r\n * this function will be ignored entirely, preserving the existing event in the\r\n * timeline. Events are identical based on their event ID only.\r\n *\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n * @throws If duplicateStrategy is not falsey, 'replace' or 'ignore'.\r\n */\r\n\r\n\r\nRoom.prototype.addLiveEvents = function (events, duplicateStrategy, fromCache) {\r\n let i;\r\n\r\n if (duplicateStrategy && [\"replace\", \"ignore\"].indexOf(duplicateStrategy) === -1) {\r\n throw new Error(\"duplicateStrategy MUST be either 'replace' or 'ignore'\");\r\n } // sanity check that the live timeline is still live\r\n\r\n\r\n for (i = 0; i < this._timelineSets.length; i++) {\r\n const liveTimeline = this._timelineSets[i].getLiveTimeline();\r\n\r\n if (liveTimeline.getPaginationToken(_eventTimeline.EventTimeline.FORWARDS)) {\r\n throw new Error(\"live timeline \" + i + \" is no longer live - it has a pagination token \" + \"(\" + liveTimeline.getPaginationToken(_eventTimeline.EventTimeline.FORWARDS) + \")\");\r\n }\r\n\r\n if (liveTimeline.getNeighbouringTimeline(_eventTimeline.EventTimeline.FORWARDS)) {\r\n throw new Error(\"live timeline \" + i + \" is no longer live - \" + \"it has a neighbouring timeline\");\r\n }\r\n }\r\n\r\n for (i = 0; i < events.length; i++) {\r\n // TODO: We should have a filter to say \"only add state event\r\n // types X Y Z to the timeline\".\r\n this._addLiveEvent(events[i], duplicateStrategy, fromCache);\r\n }\r\n};\r\n/**\r\n * Adds/handles ephemeral events such as typing notifications and read receipts.\r\n * @param {MatrixEvent[]} events A list of events to process\r\n */\r\n\r\n\r\nRoom.prototype.addEphemeralEvents = function (events) {\r\n for (const event of events) {\r\n if (event.getType() === 'm.typing') {\r\n this.currentState.setTypingEvent(event);\r\n } else if (event.getType() === 'm.receipt') {\r\n this.addReceipt(event);\r\n } // else ignore - life is too short for us to care about these events\r\n\r\n }\r\n};\r\n/**\r\n * Removes events from this room.\r\n * @param {String[]} eventIds A list of eventIds to remove.\r\n */\r\n\r\n\r\nRoom.prototype.removeEvents = function (eventIds) {\r\n for (let i = 0; i < eventIds.length; ++i) {\r\n this.removeEvent(eventIds[i]);\r\n }\r\n};\r\n/**\r\n * Removes a single event from this room.\r\n *\r\n * @param {String} eventId The id of the event to remove\r\n *\r\n * @return {bool} true if the event was removed from any of the room's timeline sets\r\n */\r\n\r\n\r\nRoom.prototype.removeEvent = function (eventId) {\r\n let removedAny = false;\r\n\r\n for (let i = 0; i < this._timelineSets.length; i++) {\r\n const removed = this._timelineSets[i].removeEvent(eventId);\r\n\r\n if (removed) {\r\n if (removed.isRedaction()) {\r\n this._revertRedactionLocalEcho(removed);\r\n }\r\n\r\n removedAny = true;\r\n }\r\n }\r\n\r\n return removedAny;\r\n};\r\n/**\r\n * Recalculate various aspects of the room, including the room name and\r\n * room summary. Call this any time the room's current state is modified.\r\n * May fire \"Room.name\" if the room name is updated.\r\n * @fires module:client~MatrixClient#event:\"Room.name\"\r\n */\r\n\r\n\r\nRoom.prototype.recalculate = function () {\r\n // set fake stripped state events if this is an invite room so logic remains\r\n // consistent elsewhere.\r\n const self = this;\r\n const membershipEvent = this.currentState.getStateEvents(\"m.room.member\", this.myUserId);\r\n\r\n if (membershipEvent && membershipEvent.getContent().membership === \"invite\") {\r\n const strippedStateEvents = membershipEvent.event.invite_room_state || [];\r\n utils.forEach(strippedStateEvents, function (strippedEvent) {\r\n const existingEvent = self.currentState.getStateEvents(strippedEvent.type, strippedEvent.state_key);\r\n\r\n if (!existingEvent) {\r\n // set the fake stripped event instead\r\n self.currentState.setStateEvents([new _event.MatrixEvent({\r\n type: strippedEvent.type,\r\n state_key: strippedEvent.state_key,\r\n content: strippedEvent.content,\r\n event_id: \"$fake\" + Date.now(),\r\n room_id: self.roomId,\r\n user_id: self.myUserId // technically a lie\r\n\r\n })]);\r\n }\r\n });\r\n }\r\n\r\n const oldName = this.name;\r\n this.name = calculateRoomName(this, this.myUserId);\r\n this.summary = new _roomSummary.RoomSummary(this.roomId, {\r\n title: this.name\r\n });\r\n\r\n if (oldName !== this.name) {\r\n this.emit(\"Room.name\", this);\r\n }\r\n};\r\n/**\r\n * Get a list of user IDs who have read up to the given event.\r\n * @param {MatrixEvent} event the event to get read receipts for.\r\n * @return {String[]} A list of user IDs.\r\n */\r\n\r\n\r\nRoom.prototype.getUsersReadUpTo = function (event) {\r\n return this.getReceiptsForEvent(event).filter(function (receipt) {\r\n return receipt.type === \"m.read\";\r\n }).map(function (receipt) {\r\n return receipt.userId;\r\n });\r\n};\r\n/**\r\n * Get the ID of the event that a given user has read up to, or null if we\r\n * have received no read receipts from them.\r\n * @param {String} userId The user ID to get read receipt event ID for\r\n * @param {Boolean} ignoreSynthesized If true, return only receipts that have been\r\n * sent by the server, not implicit ones generated\r\n * by the JS SDK.\r\n * @return {String} ID of the latest event that the given user has read, or null.\r\n */\r\n\r\n\r\nRoom.prototype.getEventReadUpTo = function (userId, ignoreSynthesized) {\r\n let receipts = this._receipts;\r\n\r\n if (ignoreSynthesized) {\r\n receipts = this._realReceipts;\r\n }\r\n\r\n if (receipts[\"m.read\"] === undefined || receipts[\"m.read\"][userId] === undefined) {\r\n return null;\r\n }\r\n\r\n return receipts[\"m.read\"][userId].eventId;\r\n};\r\n/**\r\n * Determines if the given user has read a particular event ID with the known\r\n * history of the room. This is not a definitive check as it relies only on\r\n * what is available to the room at the time of execution.\r\n * @param {String} userId The user ID to check the read state of.\r\n * @param {String} eventId The event ID to check if the user read.\r\n * @returns {Boolean} True if the user has read the event, false otherwise.\r\n */\r\n\r\n\r\nRoom.prototype.hasUserReadEvent = function (userId, eventId) {\r\n const readUpToId = this.getEventReadUpTo(userId, false);\r\n if (readUpToId === eventId) return true;\r\n\r\n if (this.timeline.length && this.timeline[this.timeline.length - 1].getSender() && this.timeline[this.timeline.length - 1].getSender() === userId) {\r\n // It doesn't matter where the event is in the timeline, the user has read\r\n // it because they've sent the latest event.\r\n return true;\r\n }\r\n\r\n for (let i = this.timeline.length - 1; i >= 0; --i) {\r\n const ev = this.timeline[i]; // If we encounter the target event first, the user hasn't read it\r\n // however if we encounter the readUpToId first then the user has read\r\n // it. These rules apply because we're iterating bottom-up.\r\n\r\n if (ev.getId() === eventId) return false;\r\n if (ev.getId() === readUpToId) return true;\r\n } // We don't know if the user has read it, so assume not.\r\n\r\n\r\n return false;\r\n};\r\n/**\r\n * Get a list of receipts for the given event.\r\n * @param {MatrixEvent} event the event to get receipts for\r\n * @return {Object[]} A list of receipts with a userId, type and data keys or\r\n * an empty list.\r\n */\r\n\r\n\r\nRoom.prototype.getReceiptsForEvent = function (event) {\r\n return this._receiptCacheByEventId[event.getId()] || [];\r\n};\r\n/**\r\n * Add a receipt event to the room.\r\n * @param {MatrixEvent} event The m.receipt event.\r\n * @param {Boolean} fake True if this event is implicit\r\n */\r\n\r\n\r\nRoom.prototype.addReceipt = function (event, fake) {\r\n // event content looks like:\r\n // content: {\r\n // $event_id: {\r\n // $receipt_type: {\r\n // $user_id: {\r\n // ts: $timestamp\r\n // }\r\n // }\r\n // }\r\n // }\r\n if (fake === undefined) {\r\n fake = false;\r\n }\r\n\r\n if (!fake) {\r\n this._addReceiptsToStructure(event, this._realReceipts); // we don't bother caching real receipts by event ID\r\n // as there's nothing that would read it.\r\n\r\n }\r\n\r\n this._addReceiptsToStructure(event, this._receipts);\r\n\r\n this._receiptCacheByEventId = this._buildReceiptCache(this._receipts); // send events after we've regenerated the cache, otherwise things that\r\n // listened for the event would read from a stale cache\r\n\r\n this.emit(\"Room.receipt\", event, this);\r\n};\r\n/**\r\n * Add a receipt event to the room.\r\n * @param {MatrixEvent} event The m.receipt event.\r\n * @param {Object} receipts The object to add receipts to\r\n */\r\n\r\n\r\nRoom.prototype._addReceiptsToStructure = function (event, receipts) {\r\n const self = this;\r\n utils.keys(event.getContent()).forEach(function (eventId) {\r\n utils.keys(event.getContent()[eventId]).forEach(function (receiptType) {\r\n utils.keys(event.getContent()[eventId][receiptType]).forEach(function (userId) {\r\n const receipt = event.getContent()[eventId][receiptType][userId];\r\n\r\n if (!receipts[receiptType]) {\r\n receipts[receiptType] = {};\r\n }\r\n\r\n const existingReceipt = receipts[receiptType][userId];\r\n\r\n if (!existingReceipt) {\r\n receipts[receiptType][userId] = {};\r\n } else {\r\n // we only want to add this receipt if we think it is later\r\n // than the one we already have. (This is managed\r\n // server-side, but because we synthesize RRs locally we\r\n // have to do it here too.)\r\n const ordering = self.getUnfilteredTimelineSet().compareEventOrdering(existingReceipt.eventId, eventId);\r\n\r\n if (ordering !== null && ordering >= 0) {\r\n return;\r\n }\r\n }\r\n\r\n receipts[receiptType][userId] = {\r\n eventId: eventId,\r\n data: receipt\r\n };\r\n });\r\n });\r\n });\r\n};\r\n/**\r\n * Build and return a map of receipts by event ID\r\n * @param {Object} receipts A map of receipts\r\n * @return {Object} Map of receipts by event ID\r\n */\r\n\r\n\r\nRoom.prototype._buildReceiptCache = function (receipts) {\r\n const receiptCacheByEventId = {};\r\n utils.keys(receipts).forEach(function (receiptType) {\r\n utils.keys(receipts[receiptType]).forEach(function (userId) {\r\n const receipt = receipts[receiptType][userId];\r\n\r\n if (!receiptCacheByEventId[receipt.eventId]) {\r\n receiptCacheByEventId[receipt.eventId] = [];\r\n }\r\n\r\n receiptCacheByEventId[receipt.eventId].push({\r\n userId: userId,\r\n type: receiptType,\r\n data: receipt.data\r\n });\r\n });\r\n });\r\n return receiptCacheByEventId;\r\n};\r\n/**\r\n * Add a temporary local-echo receipt to the room to reflect in the\r\n * client the fact that we've sent one.\r\n * @param {string} userId The user ID if the receipt sender\r\n * @param {MatrixEvent} e The event that is to be acknowledged\r\n * @param {string} receiptType The type of receipt\r\n */\r\n\r\n\r\nRoom.prototype._addLocalEchoReceipt = function (userId, e, receiptType) {\r\n this.addReceipt(synthesizeReceipt(userId, e, receiptType), true);\r\n};\r\n/**\r\n * Update the room-tag event for the room. The previous one is overwritten.\r\n * @param {MatrixEvent} event the m.tag event\r\n */\r\n\r\n\r\nRoom.prototype.addTags = function (event) {\r\n // event content looks like:\r\n // content: {\r\n // tags: {\r\n // $tagName: { $metadata: $value },\r\n // $tagName: { $metadata: $value },\r\n // }\r\n // }\r\n // XXX: do we need to deep copy here?\r\n this.tags = event.getContent().tags || {}; // XXX: we could do a deep-comparison to see if the tags have really\r\n // changed - but do we want to bother?\r\n\r\n this.emit(\"Room.tags\", event, this);\r\n};\r\n/**\r\n * Update the account_data events for this room, overwriting events of the same type.\r\n * @param {Array} events an array of account_data events to add\r\n */\r\n\r\n\r\nRoom.prototype.addAccountData = function (events) {\r\n for (let i = 0; i < events.length; i++) {\r\n const event = events[i];\r\n\r\n if (event.getType() === \"m.tag\") {\r\n this.addTags(event);\r\n }\r\n\r\n const lastEvent = this.accountData[event.getType()];\r\n this.accountData[event.getType()] = event;\r\n this.emit(\"Room.accountData\", event, this, lastEvent);\r\n }\r\n};\r\n/**\r\n * Access account_data event of given event type for this room\r\n * @param {string} type the type of account_data event to be accessed\r\n * @return {?MatrixEvent} the account_data event in question\r\n */\r\n\r\n\r\nRoom.prototype.getAccountData = function (type) {\r\n return this.accountData[type];\r\n};\r\n/**\r\n * Returns whether the syncing user has permission to send a message in the room\r\n * @return {boolean} true if the user should be permitted to send\r\n * message events into the room.\r\n */\r\n\r\n\r\nRoom.prototype.maySendMessage = function () {\r\n return this.getMyMembership() === 'join' && this.currentState.maySendEvent('m.room.message', this.myUserId);\r\n};\r\n/**\r\n * Returns whether the given user has permissions to issue an invite for this room.\r\n * @param {string} userId the ID of the Matrix user to check permissions for\r\n * @returns {boolean} true if the user should be permitted to issue invites for this room.\r\n */\r\n\r\n\r\nRoom.prototype.canInvite = function (userId) {\r\n let canInvite = this.getMyMembership() === \"join\";\r\n const powerLevelsEvent = this.currentState.getStateEvents(_event2.EventType.RoomPowerLevels, \"\");\r\n const powerLevels = powerLevelsEvent && powerLevelsEvent.getContent();\r\n const me = this.getMember(userId);\r\n\r\n if (powerLevels && me && powerLevels.invite > me.powerLevel) {\r\n canInvite = false;\r\n }\r\n\r\n return canInvite;\r\n};\r\n/**\r\n * Returns the join rule based on the m.room.join_rule state event, defaulting to `invite`.\r\n * @returns {string} the join_rule applied to this room\r\n */\r\n\r\n\r\nRoom.prototype.getJoinRule = function () {\r\n return this.currentState.getJoinRule();\r\n};\r\n/**\r\n * Returns the type of the room from the `m.room.create` event content or undefined if none is set\r\n * @returns {?string} the type of the room. Currently only RoomType.Space is known.\r\n */\r\n\r\n\r\nRoom.prototype.getType = function () {\r\n const createEvent = this.currentState.getStateEvents(\"m.room.create\", \"\");\r\n\r\n if (!createEvent) {\r\n _logger.logger.warn(\"Room \" + this.roomId + \" does not have an m.room.create event\");\r\n\r\n return undefined;\r\n }\r\n\r\n return createEvent.getContent()[_event2.RoomCreateTypeField];\r\n};\r\n/**\r\n * Returns whether the room is a space-room as defined by MSC1772.\r\n * @returns {boolean} true if the room's type is RoomType.Space\r\n */\r\n\r\n\r\nRoom.prototype.isSpaceRoom = function () {\r\n return this.getType() === _event2.RoomType.Space;\r\n};\r\n/**\r\n * This is an internal method. Calculates the name of the room from the current\r\n * room state.\r\n * @param {Room} room The matrix room.\r\n * @param {string} userId The client's user ID. Used to filter room members\r\n * correctly.\r\n * @param {bool} ignoreRoomNameEvent Return the implicit room name that we'd see if there\r\n * was no m.room.name event.\r\n * @return {string} The calculated room name.\r\n */\r\n\r\n\r\nfunction calculateRoomName(room, userId, ignoreRoomNameEvent) {\r\n if (!ignoreRoomNameEvent) {\r\n // check for an alias, if any. for now, assume first alias is the\r\n // official one.\r\n const mRoomName = room.currentState.getStateEvents(\"m.room.name\", \"\");\r\n\r\n if (mRoomName && mRoomName.getContent() && mRoomName.getContent().name) {\r\n return mRoomName.getContent().name;\r\n }\r\n }\r\n\r\n let alias = room.getCanonicalAlias();\r\n\r\n if (!alias) {\r\n const aliases = room.getAltAliases();\r\n\r\n if (aliases.length) {\r\n alias = aliases[0];\r\n }\r\n }\r\n\r\n if (alias) {\r\n return alias;\r\n }\r\n\r\n const joinedMemberCount = room.currentState.getJoinedMemberCount();\r\n const invitedMemberCount = room.currentState.getInvitedMemberCount(); // -1 because these numbers include the syncing user\r\n\r\n const inviteJoinCount = joinedMemberCount + invitedMemberCount - 1; // get members that are NOT ourselves and are actually in the room.\r\n\r\n let otherNames = null;\r\n\r\n if (room._summaryHeroes) {\r\n // if we have a summary, the member state events\r\n // should be in the room state\r\n otherNames = room._summaryHeroes.map(userId => {\r\n const member = room.getMember(userId);\r\n return member ? member.name : userId;\r\n });\r\n } else {\r\n let otherMembers = room.currentState.getMembers().filter(m => {\r\n return m.userId !== userId && (m.membership === \"invite\" || m.membership === \"join\");\r\n }); // make sure members have stable order\r\n\r\n otherMembers.sort((a, b) => a.userId.localeCompare(b.userId)); // only 5 first members, immitate _summaryHeroes\r\n\r\n otherMembers = otherMembers.slice(0, 5);\r\n otherNames = otherMembers.map(m => m.name);\r\n }\r\n\r\n if (inviteJoinCount) {\r\n return memberNamesToRoomName(otherNames, inviteJoinCount);\r\n }\r\n\r\n const myMembership = room.getMyMembership(); // if I have created a room and invited people throuh\r\n // 3rd party invites\r\n\r\n if (myMembership == 'join') {\r\n const thirdPartyInvites = room.currentState.getStateEvents(\"m.room.third_party_invite\");\r\n\r\n if (thirdPartyInvites && thirdPartyInvites.length) {\r\n const thirdPartyNames = thirdPartyInvites.map(i => {\r\n return i.getContent().display_name;\r\n });\r\n return `Inviting ${memberNamesToRoomName(thirdPartyNames)}`;\r\n }\r\n } // let's try to figure out who was here before\r\n\r\n\r\n let leftNames = otherNames; // if we didn't have heroes, try finding them in the room state\r\n\r\n if (!leftNames.length) {\r\n leftNames = room.currentState.getMembers().filter(m => {\r\n return m.userId !== userId && m.membership !== \"invite\" && m.membership !== \"join\";\r\n }).map(m => m.name);\r\n }\r\n\r\n if (leftNames.length) {\r\n return `Empty room (was ${memberNamesToRoomName(leftNames)})`;\r\n } else {\r\n return \"Empty room\";\r\n }\r\n}\r\n\r\nfunction memberNamesToRoomName(names, count = names.length + 1) {\r\n const countWithoutMe = count - 1;\r\n\r\n if (!names.length) {\r\n return \"Empty room\";\r\n } else if (names.length === 1 && countWithoutMe <= 1) {\r\n return names[0];\r\n } else if (names.length === 2 && countWithoutMe <= 2) {\r\n return `${names[0]} and ${names[1]}`;\r\n } else {\r\n const plural = countWithoutMe > 1;\r\n\r\n if (plural) {\r\n return `${names[0]} and ${countWithoutMe} others`;\r\n } else {\r\n return `${names[0]} and 1 other`;\r\n }\r\n }\r\n}\r\n/**\r\n * Fires when an event we had previously received is redacted.\r\n *\r\n * (Note this is *not* fired when the redaction happens before we receive the\r\n * event).\r\n *\r\n * @event module:client~MatrixClient#\"Room.redaction\"\r\n * @param {MatrixEvent} event The matrix redaction event\r\n * @param {Room} room The room containing the redacted event\r\n */\r\n\r\n/**\r\n * Fires when an event that was previously redacted isn't anymore.\r\n * This happens when the redaction couldn't be sent and\r\n * was subsequently cancelled by the user. Redactions have a local echo\r\n * which is undone in this scenario.\r\n *\r\n * @event module:client~MatrixClient#\"Room.redactionCancelled\"\r\n * @param {MatrixEvent} event The matrix redaction event that was cancelled.\r\n * @param {Room} room The room containing the unredacted event\r\n */\r\n\r\n/**\r\n * Fires whenever the name of a room is updated.\r\n * @event module:client~MatrixClient#\"Room.name\"\r\n * @param {Room} room The room whose Room.name was updated.\r\n * @example\r\n * matrixClient.on(\"Room.name\", function(room){\r\n * var newName = room.name;\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever a receipt is received for a room\r\n * @event module:client~MatrixClient#\"Room.receipt\"\r\n * @param {event} event The receipt event\r\n * @param {Room} room The room whose receipts was updated.\r\n * @example\r\n * matrixClient.on(\"Room.receipt\", function(event, room){\r\n * var receiptContent = event.getContent();\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever a room's tags are updated.\r\n * @event module:client~MatrixClient#\"Room.tags\"\r\n * @param {event} event The tags event\r\n * @param {Room} room The room whose Room.tags was updated.\r\n * @example\r\n * matrixClient.on(\"Room.tags\", function(event, room){\r\n * var newTags = event.getContent().tags;\r\n * if (newTags[\"favourite\"]) showStar(room);\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever a room's account_data is updated.\r\n * @event module:client~MatrixClient#\"Room.accountData\"\r\n * @param {event} event The account_data event\r\n * @param {Room} room The room whose account_data was updated.\r\n * @param {MatrixEvent} prevEvent The event being replaced by\r\n * the new account data, if known.\r\n * @example\r\n * matrixClient.on(\"Room.accountData\", function(event, room, oldEvent){\r\n * if (event.getType() === \"m.room.colorscheme\") {\r\n * applyColorScheme(event.getContents());\r\n * }\r\n * });\r\n */\r\n\r\n/**\r\n * Fires when the status of a transmitted event is updated.\r\n *\r\n *

When an event is first transmitted, a temporary copy of the event is\r\n * inserted into the timeline, with a temporary event id, and a status of\r\n * 'SENDING'.\r\n *\r\n *

Once the echo comes back from the server, the content of the event\r\n * (MatrixEvent.event) is replaced by the complete event from the homeserver,\r\n * thus updating its event id, as well as server-generated fields such as the\r\n * timestamp. Its status is set to null.\r\n *\r\n *

Once the /send request completes, if the remote echo has not already\r\n * arrived, the event is updated with a new event id and the status is set to\r\n * 'SENT'. The server-generated fields are of course not updated yet.\r\n *\r\n *

If the /send fails, In this case, the event's status is set to\r\n * 'NOT_SENT'. If it is later resent, the process starts again, setting the\r\n * status to 'SENDING'. Alternatively, the message may be cancelled, which\r\n * removes the event from the room, and sets the status to 'CANCELLED'.\r\n *\r\n *

This event is raised to reflect each of the transitions above.\r\n *\r\n * @event module:client~MatrixClient#\"Room.localEchoUpdated\"\r\n *\r\n * @param {MatrixEvent} event The matrix event which has been updated\r\n *\r\n * @param {Room} room The room containing the redacted event\r\n *\r\n * @param {string} oldEventId The previous event id (the temporary event id,\r\n * except when updating a successfully-sent event when its echo arrives)\r\n *\r\n * @param {EventStatus} oldStatus The previous event status.\r\n */\r\n\r\n/**\r\n * Fires when the logged in user's membership in the room is updated.\r\n *\r\n * @event module:models/room~Room#\"Room.myMembership\"\r\n * @param {Room} room The room in which the membership has been updated\r\n * @param {string} membership The new membership value\r\n * @param {string} prevMembership The previous membership value\r\n */","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","module.exports = function () {\n throw new Error('Readable.from is not available in the browser')\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.getHttpUriForMxc = getHttpUriForMxc;\r\n\r\nvar utils = _interopRequireWildcard(require(\"./utils\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module content-repo\r\n */\r\n\r\n/**\r\n * Get the HTTP URL for an MXC URI.\r\n * @param {string} baseUrl The base homeserver url which has a content repo.\r\n * @param {string} mxc The mxc:// URI.\r\n * @param {Number} width The desired width of the thumbnail.\r\n * @param {Number} height The desired height of the thumbnail.\r\n * @param {string} resizeMethod The thumbnail resize method to use, either\r\n * \"crop\" or \"scale\".\r\n * @param {Boolean} allowDirectLinks If true, return any non-mxc URLs\r\n * directly. Fetching such URLs will leak information about the user to\r\n * anyone they share a room with. If false, will return the emptry string\r\n * for such URLs.\r\n * @return {string} The complete URL to the content.\r\n */\r\nfunction getHttpUriForMxc(baseUrl, mxc, width, height, resizeMethod, allowDirectLinks) {\r\n if (typeof mxc !== \"string\" || !mxc) {\r\n return '';\r\n }\r\n\r\n if (mxc.indexOf(\"mxc://\") !== 0) {\r\n if (allowDirectLinks) {\r\n return mxc;\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n let serverAndMediaId = mxc.slice(6); // strips mxc://\r\n\r\n let prefix = \"/_matrix/media/r0/download/\";\r\n const params = {};\r\n\r\n if (width) {\r\n params.width = Math.round(width);\r\n }\r\n\r\n if (height) {\r\n params.height = Math.round(height);\r\n }\r\n\r\n if (resizeMethod) {\r\n params.method = resizeMethod;\r\n }\r\n\r\n if (utils.keys(params).length > 0) {\r\n // these are thumbnailing params so they probably want the\r\n // thumbnailing API...\r\n prefix = \"/_matrix/media/r0/thumbnail/\";\r\n }\r\n\r\n const fragmentOffset = serverAndMediaId.indexOf(\"#\");\r\n let fragment = \"\";\r\n\r\n if (fragmentOffset >= 0) {\r\n fragment = serverAndMediaId.substr(fragmentOffset);\r\n serverAndMediaId = serverAndMediaId.substr(0, fragmentOffset);\r\n }\r\n\r\n return baseUrl + prefix + serverAndMediaId + (utils.keys(params).length === 0 ? \"\" : \"?\" + utils.encodeParams(params)) + fragment;\r\n}","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"chatsPreview\",class:{minimized: _vm.minimized, active: _vm.active}},[_c('div',{staticClass:\"work\"},[_c('div',{staticClass:\"previewWrapper\"},[_c('div',{staticClass:\"iconWrapper\"},[(!_vm.dummy)?_c('chatIcon',{key:_vm.key,attrs:{\"m_chat\":_vm.m_chat,\"chat\":_vm.chat,\"dontuseslides\":true}}):_c('div',{staticClass:\"dummyicon loadinggradient\"})],1),_c('div',{staticClass:\"infoWrapper\"},[(!_vm.dummy && _vm.ready)?_c('div',{staticClass:\"summaryLine\"},[_c('div',{staticClass:\"caption flexBlock\"},[_c('chatName',{attrs:{\"preview\":true,\"chat\":_vm.chat,\"m_chat\":_vm.m_chat}}),(_vm.roomMuted)?_c('div',{staticClass:\"roomMuted\"},[_c('i',{staticClass:\"fas fa-bell-slash\"})]):_vm._e()],1),_c('div',{staticClass:\"time\"},[_c('chatTime',{attrs:{\"chat\":_vm.chat,\"m_chat\":_vm.m_chat}})],1)]):_vm._e(),(!_vm.dummy && _vm.ready)?_c('div',{staticClass:\"eventsLine maxwidth\"},[(_vm.event)?_c('eventsEvent',{attrs:{\"event\":_vm.matrixevent,\"chat\":_vm.m_chat,\"preview\":true}}):_vm._e()],1):_vm._e(),(_vm.dummy)?_c('div',{staticClass:\"eventsLine\"},[_c('div',{staticClass:\"dummyline loadinggradient\"})]):_vm._e()])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"chatTime\"},[(_vm.time)?_c('date',{attrs:{\"date\":_vm.time}}):_c('span',{staticClass:\"new\"},[_vm._v(_vm._s(_vm.$t(\"caption.new\")))])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./time.vue?vue&type=template&id=9218004e&scoped=true&\"\nimport script from \"./time.vue?vue&type=script&lang=js&\"\nexport * from \"./time.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./time.vue?vue&type=style&index=0&id=9218004e&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"9218004e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapState} from 'vuex';\r\nimport chatName from '@/components/chats/assets/name.vue'\r\nimport chatTime from '@/components/chats/assets/time.vue'\r\nimport chatIcon from '@/components/chats/assets/icon.vue'\r\n\r\n\r\nexport default {\r\n name: 'preview',\r\n props: {\r\n chat: Object,\r\n dummy: Boolean,\r\n },\r\n\r\n components: {\r\n chatName,\r\n chatTime,\r\n chatIcon,\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n roomMuted: false,\r\n ready: false,\r\n lastEvent: {},\r\n userStatusRoom: String,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n m_chat: {\r\n immediate: true,\r\n handler: function () {\r\n\r\n this.ready = false\r\n\r\n if (this.m_chat && !_.isEmpty(this.m_chat)) {\r\n\r\n this.core.mtrx.kit.prepareChat(this.m_chat).then(r => {\r\n this.ready = true\r\n })\r\n }\r\n \r\n }\r\n }\r\n\r\n },\r\n\r\n\r\n mounted : function(){\r\n\r\n \r\n },\r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n blockedCheck: function () {\r\n var users = this.core.mtrx.anotherChatUsers(this.m_chat.roomId)\r\n\r\n if (users.length == 1) {\r\n return this.core.mtrx.blockeduser(users[0].userId)\r\n }\r\n\r\n },\r\n m_chat: function () {\r\n\r\n if (!this.core.mtrx.client || !this.chat) return null\r\n\r\n let pushRules = this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId)\r\n\r\n if (pushRules !== null) {\r\n this.roomMuted = true\r\n }\r\n\r\n if (this.chat.roomId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(this.chat.roomId)\r\n\r\n return m_chat || null\r\n }\r\n\r\n },\r\n chatevents: function () {\r\n return (this.events[this.chat.roomId] || {}).timeline || []\r\n },\r\n\r\n key: function () {\r\n if (this.event) return this.event.event_id\r\n\r\n return 'key'\r\n },\r\n\r\n unknowngroupusers : function(){\r\n return this.core.mtrx.kit.unknowngroupusers(this.chat)\r\n },\r\n\r\n matrixevent : function(){\r\n var e = this.event\r\n\r\n if (e){\r\n return e.get()\r\n }\r\n },\r\n\r\n event: function () {\r\n\r\n if (this.chat && this.chat.roomId) {\r\n\r\n var members = this.m_chat.currentState.getMembers()\r\n\r\n var events = _.filter(this.chatevents, (e) => {\r\n \r\n if (members.length <= 2 &&\r\n (e.event.type === 'm.room.power_levels' || (\r\n e.event.type === 'm.room.member' && e.event.content.membership !== 'invite'\r\n ))\r\n\r\n ) {\r\n return false\r\n }\r\n if (e.event.type === 'm.room.redaction') {\r\n return false\r\n }\r\n\r\n return !(e.event.content['m.relates_to'] && e.event.content['m.relates_to'][\"rel_type\"] === 'm.replace');\r\n\r\n })\r\n\r\n events = _.sortBy(events, function (e) {\r\n return e.event.origin_server_ts\r\n })\r\n\r\n if (events.length) {\r\n return events[events.length - 1]\r\n }\r\n\r\n }\r\n\r\n },\r\n\r\n ...mapState([\r\n 'minimized',\r\n 'active',\r\n 'events'\r\n ]),\r\n }),\r\n\r\n methods: {},\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=33d22462&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"33d22462\",\n null\n ,true\n)\n\nexport default component.exports","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"topheader\"},on:{\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"topheader \"},[_c('div',{staticClass:\"work\"},[_c('div',{staticClass:\"headerLine\"},[_c('div',{staticClass:\"leftIcon icon\",on:{\"mouseenter\":_vm.mouseenter}},[_vm._t(\"left\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"leftaddIcon iconsmall\"},[_vm._t(\"leftadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"infoPart\",on:{\"mouseenter\":_vm.mouseenter}},[_c('div',[_vm._t(\"info\",function(){return [_vm._v(\"   \")]})],2)]),_c('div',{staticClass:\"rightaddIcons iconsmall\"},[_vm._t(\"rightadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"rightIcons icon\"},[_vm._t(\"right\",function(){return [_vm._v(\"   \")]})],2)]),_vm._t(\"additional\")],2)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'topheader',\r\n props: { },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : function() {\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n mouseenter : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'header'})\r\n },\r\n\r\n mouseleave : function(){\r\n if (this.$store.state.autohide)\r\n this.$store.commit('active', false)\r\n\r\n this.$store.commit('blockactive', {value : false, item : 'header'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=52afd868&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=52afd868&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"52afd868\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {};\r\nexports.default = void 0;\r\n\r\nvar matrixcs = _interopRequireWildcard(require(\"./matrix\"));\r\n\r\nObject.keys(matrixcs).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === matrixcs[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return matrixcs[key];\r\n }\r\n });\r\n});\r\n\r\nvar _browserRequest = _interopRequireDefault(require(\"browser-request\"));\r\n\r\nvar _qs = _interopRequireDefault(require(\"qs\"));\r\n\r\n/*\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nmatrixcs.request(function (opts, fn) {\r\n // We manually fix the query string for browser-request because\r\n // it doesn't correctly handle cases like ?via=one&via=two. Instead\r\n // we mimic `request`'s query string interface to make it all work\r\n // as expected.\r\n // browser-request will happily take the constructed string as the\r\n // query string without trying to modify it further.\r\n opts.qs = _qs.default.stringify(opts.qs || {}, opts.qsStringifyOptions);\r\n return (0, _browserRequest.default)(opts, fn);\r\n}); // just *accessing* indexedDB throws an exception in firefox with\r\n// indexeddb disabled.\r\n\r\nlet indexedDB;\r\n\r\ntry {\r\n indexedDB = global.indexedDB;\r\n} catch (e) {} // if our browser (appears to) support indexeddb, use an indexeddb crypto store.\r\n\r\n\r\nif (indexedDB) {\r\n matrixcs.setCryptoStoreFactory(function () {\r\n return new matrixcs.IndexedDBCryptoStore(indexedDB, \"matrix-js-sdk:crypto\");\r\n });\r\n} // We export 3 things to make browserify happy as well as downstream projects.\r\n// It's awkward, but required.\r\n\r\n\r\nvar _default = matrixcs; // keep export for browserify package deps\r\n\r\nexports.default = _default;\r\nglobal.matrixcs = matrixcs;","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=332740e2&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=332740e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"332740e2\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.getDesktopCapturerSources = getDesktopCapturerSources;\r\nexports.setAudioOutput = setAudioOutput;\r\nexports.setAudioInput = setAudioInput;\r\nexports.setVideoInput = setVideoInput;\r\nexports.createNewMatrixCall = createNewMatrixCall;\r\nexports.MatrixCall = exports.CallError = exports.CallErrorCode = exports.CallEvent = exports.CallParty = exports.CallDirection = exports.CallType = exports.CallState = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _event = require(\"../@types/event\");\r\n\r\nvar _randomstring = require(\"../randomstring\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link createNewMatrixCall} for the public API.\r\n * @module webrtc/call\r\n */\r\nlet CallState;\r\nexports.CallState = CallState;\r\n\r\n(function (CallState) {\r\n CallState[\"Fledgling\"] = \"fledgling\";\r\n CallState[\"InviteSent\"] = \"invite_sent\";\r\n CallState[\"WaitLocalMedia\"] = \"wait_local_media\";\r\n CallState[\"CreateOffer\"] = \"create_offer\";\r\n CallState[\"CreateAnswer\"] = \"create_answer\";\r\n CallState[\"Connecting\"] = \"connecting\";\r\n CallState[\"Connected\"] = \"connected\";\r\n CallState[\"Ringing\"] = \"ringing\";\r\n CallState[\"Ended\"] = \"ended\";\r\n})(CallState || (exports.CallState = CallState = {}));\r\n\r\nlet CallType;\r\nexports.CallType = CallType;\r\n\r\n(function (CallType) {\r\n CallType[\"Voice\"] = \"voice\";\r\n CallType[\"Video\"] = \"video\";\r\n})(CallType || (exports.CallType = CallType = {}));\r\n\r\nlet CallDirection;\r\nexports.CallDirection = CallDirection;\r\n\r\n(function (CallDirection) {\r\n CallDirection[\"Inbound\"] = \"inbound\";\r\n CallDirection[\"Outbound\"] = \"outbound\";\r\n})(CallDirection || (exports.CallDirection = CallDirection = {}));\r\n\r\nlet CallParty;\r\nexports.CallParty = CallParty;\r\n\r\n(function (CallParty) {\r\n CallParty[\"Local\"] = \"local\";\r\n CallParty[\"Remote\"] = \"remote\";\r\n})(CallParty || (exports.CallParty = CallParty = {}));\r\n\r\nlet CallEvent;\r\nexports.CallEvent = CallEvent;\r\n\r\n(function (CallEvent) {\r\n CallEvent[\"Hangup\"] = \"hangup\";\r\n CallEvent[\"State\"] = \"state\";\r\n CallEvent[\"Error\"] = \"error\";\r\n CallEvent[\"Replaced\"] = \"replaced\";\r\n CallEvent[\"LocalHoldUnhold\"] = \"local_hold_unhold\";\r\n CallEvent[\"RemoteHoldUnhold\"] = \"remote_hold_unhold\";\r\n CallEvent[\"HoldUnhold\"] = \"hold_unhold\";\r\n})(CallEvent || (exports.CallEvent = CallEvent = {}));\r\n\r\nlet CallErrorCode;\r\nexports.CallErrorCode = CallErrorCode;\r\n\r\n(function (CallErrorCode) {\r\n CallErrorCode[\"UserHangup\"] = \"user_hangup\";\r\n CallErrorCode[\"LocalOfferFailed\"] = \"local_offer_failed\";\r\n CallErrorCode[\"NoUserMedia\"] = \"no_user_media\";\r\n CallErrorCode[\"UnknownDevices\"] = \"unknown_devices\";\r\n CallErrorCode[\"SendInvite\"] = \"send_invite\";\r\n CallErrorCode[\"CreateAnswer\"] = \"create_answer\";\r\n CallErrorCode[\"SendAnswer\"] = \"send_answer\";\r\n CallErrorCode[\"SetRemoteDescription\"] = \"set_remote_description\";\r\n CallErrorCode[\"SetLocalDescription\"] = \"set_local_description\";\r\n CallErrorCode[\"AnsweredElsewhere\"] = \"answered_elsewhere\";\r\n CallErrorCode[\"IceFailed\"] = \"ice_failed\";\r\n CallErrorCode[\"InviteTimeout\"] = \"invite_timeout\";\r\n CallErrorCode[\"Replaced\"] = \"replaced\";\r\n CallErrorCode[\"SignallingFailed\"] = \"signalling_timeout\";\r\n})(CallErrorCode || (exports.CallErrorCode = CallErrorCode = {}));\r\n\r\nvar ConstraintsType;\r\n/**\r\n * The version field that we set in m.call.* events\r\n */\r\n\r\n(function (ConstraintsType) {\r\n ConstraintsType[\"Audio\"] = \"audio\";\r\n ConstraintsType[\"Video\"] = \"video\";\r\n})(ConstraintsType || (ConstraintsType = {}));\r\n\r\nconst VOIP_PROTO_VERSION = 1;\r\n/** The fallback ICE server to use for STUN or TURN protocols. */\r\n\r\nconst FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';\r\n/** The length of time a call can be ringing for. */\r\n\r\nconst CALL_TIMEOUT_MS = 60000;\r\n/** Retrieves sources from desktopCapturer */\r\n\r\nfunction getDesktopCapturerSources() {\r\n const options = {\r\n thumbnailSize: {\r\n height: 176,\r\n width: 312\r\n },\r\n types: [\"screen\", \"window\"]\r\n };\r\n return window.electron.getDesktopCapturerSources(options);\r\n}\r\n\r\nclass CallError extends Error {\r\n constructor(code, msg, err) {\r\n // Stil ldon't think there's any way to have proper nested errors\r\n super(msg + \": \" + err);\r\n (0, _defineProperty2.default)(this, \"code\", void 0);\r\n this.code = code;\r\n }\r\n\r\n}\r\n\r\nexports.CallError = CallError;\r\n\r\nfunction genCallID() {\r\n return Date.now().toString() + (0, _randomstring.randomString)(16);\r\n}\r\n/**\r\n * Construct a new Matrix Call.\r\n * @constructor\r\n * @param {Object} opts Config options.\r\n * @param {string} opts.roomId The room ID for this call.\r\n * @param {Object} opts.webRtc The WebRTC globals from the browser.\r\n * @param {boolean} opts.forceTURN whether relay through TURN should be forced.\r\n * @param {Object} opts.URL The URL global.\r\n * @param {Array} opts.turnServers Optional. A list of TURN servers.\r\n * @param {MatrixClient} opts.client The Matrix Client instance to send events to.\r\n */\r\n\r\n\r\nclass MatrixCall extends _events.EventEmitter {\r\n // Fix when client is TSified\r\n // XXX: I don't know why this is called 'config'.\r\n // The party ID of the other side: undefined if we haven't chosen a partner\r\n // yet, null if we have but they didn't send a party ID.\r\n // in the browser it's 'number'\r\n // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold\r\n // This flag represents whether we want the other party to be on hold\r\n // and this one we set when we're transitioning out of the hold state because we\r\n // can't tell the difference between that and the other party holding us\r\n // the stats for the call at the point it ended. We can't get these after we\r\n // tear the call down, so we just grab a snapshot before we stop the call.\r\n // The typescript definitions have this type as 'any' :(\r\n // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example\r\n // If candidates arrive before we've picked an opponent (which, in particular,\r\n // will happen if the opponent sends candidates eagerly before the user answers\r\n // the call) we buffer them up here so we can then add the ones from the party we pick\r\n constructor(opts) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"roomId\", void 0);\r\n (0, _defineProperty2.default)(this, \"type\", void 0);\r\n (0, _defineProperty2.default)(this, \"callId\", void 0);\r\n (0, _defineProperty2.default)(this, \"state\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupParty\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupReason\", void 0);\r\n (0, _defineProperty2.default)(this, \"direction\", void 0);\r\n (0, _defineProperty2.default)(this, \"ourPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"client\", void 0);\r\n (0, _defineProperty2.default)(this, \"forceTURN\", void 0);\r\n (0, _defineProperty2.default)(this, \"turnServers\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendQueue\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendTries\", void 0);\r\n (0, _defineProperty2.default)(this, \"sentEndOfCandidates\", void 0);\r\n (0, _defineProperty2.default)(this, \"peerConn\", void 0);\r\n (0, _defineProperty2.default)(this, \"localVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteAudioElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"screenSharingStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"localAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteOrAnswerSent\", void 0);\r\n (0, _defineProperty2.default)(this, \"waitForLocalAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"config\", void 0);\r\n (0, _defineProperty2.default)(this, \"successor\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentMember\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentVersion\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentCaps\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteTimeout\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteOnHold\", void 0);\r\n (0, _defineProperty2.default)(this, \"unholdingRemote\", void 0);\r\n (0, _defineProperty2.default)(this, \"micMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"vidMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"callStatsAtEnd\", void 0);\r\n (0, _defineProperty2.default)(this, \"makingOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"ignoreOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteCandidateBuffer\", new Map());\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForInvite\", async stream => {\r\n if (this.successor) {\r\n this.successor.gotUserMediaForAnswer(stream);\r\n return;\r\n }\r\n\r\n if (this.callHasEnded()) {\r\n this.stopAllMedia();\r\n return;\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n this.setState(CallState.CreateOffer);\r\n\r\n _logger.logger.debug(\"gotUserMediaForInvite -> \" + this.type);\r\n\r\n const videoEl = this.getLocalVideoElement();\r\n\r\n if (videoEl && this.type === CallType.Video) {\r\n videoEl.autoplay = true;\r\n\r\n if (this.screenSharingStream) {\r\n _logger.logger.debug(\"Setting screen sharing stream to the local video element\");\r\n\r\n videoEl.srcObject = this.screenSharingStream;\r\n } else {\r\n videoEl.srcObject = stream;\r\n }\r\n\r\n videoEl.muted = true;\r\n\r\n try {\r\n await videoEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n } // why do we enable audio (and only audio) tracks here? -- matthew\r\n\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const audioTrack of stream.getAudioTracks()) {\r\n _logger.logger.info(\"Adding audio track with id \" + audioTrack.id);\r\n\r\n this.peerConn.addTrack(audioTrack, stream);\r\n }\r\n\r\n for (const videoTrack of (this.screenSharingStream || stream).getVideoTracks()) {\r\n _logger.logger.info(\"Adding video track with id \" + videoTrack.id);\r\n\r\n this.peerConn.addTrack(videoTrack, stream);\r\n } // Now we wait for the negotiationneeded event\r\n\r\n });\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForAnswer\", async stream => {\r\n if (this.callHasEnded()) {\r\n return;\r\n }\r\n\r\n const localVidEl = this.getLocalVideoElement();\r\n\r\n if (localVidEl && this.type === CallType.Video) {\r\n localVidEl.autoplay = true;\r\n localVidEl.srcObject = stream;\r\n localVidEl.muted = true;\r\n\r\n try {\r\n await localVidEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const track of stream.getTracks()) {\r\n this.peerConn.addTrack(track, stream);\r\n }\r\n\r\n this.setState(CallState.CreateAnswer);\r\n let myAnswer;\r\n\r\n try {\r\n myAnswer = await this.peerConn.createAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Failed to create answer: \", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.CreateAnswer, true);\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(myAnswer);\r\n this.setState(CallState.Connecting); // Allow a short time for initial candidates to be gathered\r\n\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n this.sendAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalIceCandidate\", event => {\r\n if (event.candidate) {\r\n _logger.logger.debug(\"Call \" + this.callId + \" got local ICE \" + event.candidate.sdpMid + \" candidate: \" + event.candidate.candidate);\r\n\r\n if (this.callHasEnded()) return; // As with the offer, note we need to make a copy of this object, not\r\n // pass the original: that broke in Chrome ~m43.\r\n\r\n if (event.candidate.candidate !== '' || !this.sentEndOfCandidates) {\r\n this.queueCandidate(event.candidate);\r\n if (event.candidate.candidate === '') this.sentEndOfCandidates = true;\r\n }\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceGatheringStateChange\", event => {\r\n _logger.logger.debug(\"ice gathering state changed to \" + this.peerConn.iceGatheringState);\r\n\r\n if (this.peerConn.iceGatheringState === 'complete' && !this.sentEndOfCandidates) {\r\n // If we didn't get an empty-string candidate to signal the end of candidates,\r\n // create one ourselves now gathering has finished.\r\n // We cast because the interface lists all the properties as required but we\r\n // only want to send 'candidate'\r\n // XXX: We probably want to send either sdpMid or sdpMLineIndex, as it's not strictly\r\n // correct to have a candidate that lacks both of these. We'd have to figure out what\r\n // previous candidates had been sent with and copy them.\r\n const c = {\r\n candidate: ''\r\n };\r\n this.queueCandidate(c);\r\n this.sentEndOfCandidates = true;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalOffer\", async description => {\r\n _logger.logger.debug(\"Created offer: \", description);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(\"Ignoring newly created offer on call ID \" + this.callId + \" because the call has ended\");\r\n\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(description);\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n\r\n if (this.peerConn.iceGatheringState === 'gathering') {\r\n // Allow a short time for initial candidates to be gathered\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n }\r\n\r\n if (this.callHasEnded()) return;\r\n const eventType = this.state === CallState.CreateOffer ? _event.EventType.CallInvite : _event.EventType.CallNegotiate;\r\n const content = {\r\n lifetime: CALL_TIMEOUT_MS\r\n }; // clunky because TypeScript can't folow the types through if we use an expression as the key\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n content.offer = this.peerConn.localDescription;\r\n } else {\r\n content.description = this.peerConn.localDescription;\r\n }\r\n\r\n if (this.client._supportsCallTransfer) {\r\n content.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // Get rid of any candidates waiting to be sent: they'll be included in the local\r\n // description we just got and will send in the offer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(eventType, content);\r\n } catch (error) {\r\n _logger.logger.error(\"Failed to send invite\", error);\r\n\r\n if (error.event) this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SignallingFailed;\r\n let message = \"Signalling failed\";\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n code = CallErrorCode.SendInvite;\r\n message = \"Failed to send invite\";\r\n }\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.terminate(CallParty.Local, code, false); // no need to carry on & send the candidate queue, but we also\r\n // don't want to rethrow the error\r\n\r\n return;\r\n }\r\n\r\n this.sendCandidateQueue();\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n this.inviteOrAnswerSent = true;\r\n this.setState(CallState.InviteSent);\r\n this.inviteTimeout = setTimeout(() => {\r\n this.inviteTimeout = null;\r\n\r\n if (this.state === CallState.InviteSent) {\r\n this.hangup(CallErrorCode.InviteTimeout, false);\r\n }\r\n }, CALL_TIMEOUT_MS);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"getLocalOfferFailed\", err => {\r\n _logger.logger.error(\"Failed to get local offer\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.LocalOfferFailed, \"Failed to get local offer!\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.LocalOfferFailed, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"getUserMediaFailed\", err => {\r\n if (this.successor) {\r\n this.successor.getUserMediaFailed(err);\r\n return;\r\n }\r\n\r\n _logger.logger.warn(\"Failed to get user media - ending call\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Couldn't start capturing media! Is your microphone set up and \" + \"does this app have permission?\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceConnectionStateChanged\", () => {\r\n if (this.callHasEnded()) {\r\n return; // because ICE can still complete as we're ending the call\r\n }\r\n\r\n _logger.logger.debug(\"Call ID \" + this.callId + \": ICE connection state changed to: \" + this.peerConn.iceConnectionState); // ideally we'd consider the call to be connected when we get media but\r\n // chrome doesn't implement any of the 'onstarted' events yet\r\n\r\n\r\n if (this.peerConn.iceConnectionState == 'connected') {\r\n this.setState(CallState.Connected);\r\n } else if (this.peerConn.iceConnectionState == 'failed') {\r\n this.hangup(CallErrorCode.IceFailed, false);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onSignallingStateChanged\", () => {\r\n _logger.logger.debug(\"call \" + this.callId + \": Signalling state changed to: \" + this.peerConn.signalingState);\r\n });\r\n (0, _defineProperty2.default)(this, \"onTrack\", ev => {\r\n if (ev.streams.length === 0) {\r\n _logger.logger.warn(`Streamless ${ev.track.kind} found: ignoring.`);\r\n\r\n return;\r\n } // If we already have a stream, check this track is from the same one\r\n\r\n\r\n if (this.remoteStream && ev.streams[0].id !== this.remoteStream.id) {\r\n _logger.logger.warn(`Ignoring new stream ID ${ev.streams[0].id}: we already have stream ID ${this.remoteStream.id}`);\r\n\r\n return;\r\n }\r\n\r\n if (!this.remoteStream) {\r\n _logger.logger.info(\"Got remote stream with id \" + ev.streams[0].id);\r\n } // Note that we check by ID above and always set the remote stream: Chrome appears\r\n // to make new stream objects when tranciever directionality is changed and the 'active'\r\n // status of streams change\r\n\r\n\r\n this.remoteStream = ev.streams[0];\r\n\r\n _logger.logger.debug(`Track id ${ev.track.id} of kind ${ev.track.kind} added`);\r\n\r\n if (ev.track.kind === 'video') {\r\n if (this.remoteVideoElement) {\r\n this.playRemoteVideo();\r\n }\r\n } else {\r\n if (this.remoteAudioElement) this.playRemoteAudio();\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onNegotiationNeeded\", async () => {\r\n _logger.logger.info(\"Negotation is needed!\");\r\n\r\n if (this.state !== CallState.CreateOffer && this.opponentVersion === 0) {\r\n _logger.logger.info(\"Opponent does not support renegotiation: ignoring negotiationneeded event\");\r\n\r\n return;\r\n }\r\n\r\n this.makingOffer = true;\r\n\r\n try {\r\n const myOffer = await this.peerConn.createOffer();\r\n await this.gotLocalOffer(myOffer);\r\n } catch (e) {\r\n this.getLocalOfferFailed(e);\r\n return;\r\n } finally {\r\n this.makingOffer = false;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onHangupReceived\", msg => {\r\n _logger.logger.debug(\"Hangup received for call ID \" + this.callId); // party ID must match (our chosen partner hanging up the call) or be undefined (we haven't chosen\r\n // a partner yet but we're treating the hangup as a reject as per VoIP v0)\r\n\r\n\r\n if (this.partyIdMatches(msg) || this.state === CallState.Ringing) {\r\n // default reason is user_hangup\r\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.info(`Ignoring message from party ID ${msg.party_id}: our partner is ${this.opponentPartyId}`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onRejectReceived\", msg => {\r\n _logger.logger.debug(\"Reject received for call ID \" + this.callId); // No need to check party_id for reject because if we'd received either\r\n // an answer or reject, we wouldn't be in state InviteSent\r\n\r\n\r\n const shouldTerminate = // reject events also end the call if it's ringing: it's another of\r\n // our devices rejecting the call.\r\n [CallState.InviteSent, CallState.Ringing].includes(this.state) || // also if we're in the init state and it's an inbound call, since\r\n // this means we just haven't entered the ringing state yet\r\n this.state === CallState.Fledgling && this.direction === CallDirection.Inbound;\r\n\r\n if (shouldTerminate) {\r\n this.terminate(CallParty.Remote, CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.debug(`Call is in state: ${this.state}: ignoring reject`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onAnsweredElsewhere\", msg => {\r\n _logger.logger.debug(\"Call ID \" + this.callId + \" answered elsewhere\");\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n });\r\n this.roomId = opts.roomId;\r\n this.client = opts.client;\r\n this.type = null;\r\n this.forceTURN = opts.forceTURN;\r\n this.ourPartyId = this.client.deviceId; // Array of Objects with urls, username, credential keys\r\n\r\n this.turnServers = opts.turnServers || [];\r\n\r\n if (this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed()) {\r\n this.turnServers.push({\r\n urls: [FALLBACK_ICE_SERVER]\r\n });\r\n }\r\n\r\n for (const server of this.turnServers) {\r\n utils.checkObjectHasKeys(server, [\"urls\"]);\r\n }\r\n\r\n this.callId = genCallID();\r\n this.state = CallState.Fledgling; // A queue for candidates waiting to go out.\r\n // We try to amalgamate candidates into a single candidate message where\r\n // possible\r\n\r\n this.candidateSendQueue = [];\r\n this.candidateSendTries = 0;\r\n this.sentEndOfCandidates = false;\r\n this.inviteOrAnswerSent = false;\r\n this.makingOffer = false;\r\n this.remoteOnHold = false;\r\n this.unholdingRemote = false;\r\n this.micMuted = false;\r\n this.vidMuted = false;\r\n }\r\n /**\r\n * Place a voice call to this room.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVoiceCall() {\r\n _logger.logger.debug(\"placeVoiceCall\");\r\n\r\n this.checkForErrorListener();\r\n const constraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.type = CallType.Voice;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a video call to this room.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVideoCall(remoteVideoElement, localVideoElement) {\r\n _logger.logger.debug(\"placeVideoCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n const constraints = getUserMediaContraints(ConstraintsType.Video);\r\n this.type = CallType.Video;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a screen-sharing call to this room. This includes audio.\r\n * This method is EXPERIMENTAL and subject to change without warning. It\r\n * only works in Google Chrome and Firefox >= 44.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeScreenSharingCall(remoteVideoElement, localVideoElement, selectDesktopCapturerSource) {\r\n _logger.logger.debug(\"placeScreenSharingCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n\r\n try {\r\n var _window$electron;\r\n\r\n const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);\r\n\r\n if (!screenshareConstraints) {\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n return;\r\n }\r\n\r\n if ((_window$electron = window.electron) !== null && _window$electron !== void 0 && _window$electron.getDesktopCapturerSources) {\r\n // We are using Electron\r\n _logger.logger.debug(\"Getting screen stream using getUserMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getUserMedia(screenshareConstraints);\r\n } else {\r\n // We are not using Electron\r\n _logger.logger.debug(\"Getting screen stream using getDisplayMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getDisplayMedia(screenshareConstraints);\r\n }\r\n\r\n _logger.logger.debug(\"Got screen stream, requesting audio stream...\");\r\n\r\n const audioConstraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.placeCallWithConstraints(audioConstraints);\r\n } catch (err) {\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n }\r\n\r\n this.type = CallType.Video;\r\n }\r\n\r\n getOpponentMember() {\r\n return this.opponentMember;\r\n }\r\n\r\n opponentCanBeTransferred() {\r\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.transferee\"]);\r\n }\r\n /**\r\n * Retrieve the local <video> DOM element.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getLocalVideoElement() {\r\n return this.localVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <video> DOM element\r\n * used for playing back video capable streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteVideoElement() {\r\n return this.remoteVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <audio> DOM element\r\n * used for playing back audio only streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteAudioElement() {\r\n return this.remoteAudioElement;\r\n }\r\n /**\r\n * Set the local <video> DOM element. If this call is active,\r\n * video will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setLocalVideoElement(element) {\r\n this.localVideoElement = element;\r\n\r\n if (element && this.localAVStream && this.type === CallType.Video) {\r\n element.autoplay = true;\r\n element.srcObject = this.localAVStream;\r\n element.muted = true;\r\n\r\n try {\r\n await element.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n }\r\n /**\r\n * Set the remote <video> DOM element. If this call is active,\r\n * the first received video-capable stream will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n setRemoteVideoElement(element) {\r\n if (element === this.remoteVideoElement) return;\r\n element.autoplay = true; // if we already have an audio element set, use that instead and mute the audio\r\n // on this video element.\r\n\r\n if (this.remoteAudioElement) element.muted = true;\r\n this.remoteVideoElement = element;\r\n\r\n if (this.remoteStream) {\r\n this.playRemoteVideo();\r\n }\r\n }\r\n /**\r\n * Set the remote <audio> DOM element. If this call is active,\r\n * the first received audio-only stream will be rendered to it immediately.\r\n * The audio will *not* be rendered from the remoteVideoElement.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setRemoteAudioElement(element) {\r\n if (element === this.remoteAudioElement) return;\r\n this.remoteAudioElement = element;\r\n if (this.remoteStream) this.playRemoteAudio();\r\n } // The typescript definitions have this type as 'any' :(\r\n\r\n\r\n async getCurrentCallStats() {\r\n if (this.callHasEnded()) {\r\n return this.callStatsAtEnd;\r\n }\r\n\r\n return this.collectCallStats();\r\n }\r\n\r\n async collectCallStats() {\r\n // This happens when the call fails before it starts.\r\n // For example when we fail to get capture sources\r\n if (!this.peerConn) return;\r\n const statsReport = await this.peerConn.getStats();\r\n const stats = [];\r\n\r\n for (const item of statsReport) {\r\n stats.push(item[1]);\r\n }\r\n\r\n return stats;\r\n }\r\n /**\r\n * Configure this call from an invite event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.invite event\r\n */\r\n\r\n\r\n async initWithInvite(event) {\r\n const invite = event.getContent();\r\n this.direction = CallDirection.Inbound; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n }\r\n\r\n this.peerConn = this.createPeerConnection(); // we must set the party ID before await-ing on anything: the call event\r\n // handler will start giving us more call events (eg. candidates) so if\r\n // we haven't set the party ID, we'll ignore them.\r\n\r\n this.chooseOpponent(event);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(invite.offer);\r\n await this.addBufferedIceCandidates();\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // According to previous comments in this file, firefox at some point did not\r\n // add streams until media started ariving on them. Testing latest firefox\r\n // (81 at time of writing), this is no longer a problem, so let's do it the correct way.\r\n\r\n\r\n if (!this.remoteStream || this.remoteStream.getTracks().length === 0) {\r\n _logger.logger.error(\"No remote stream or no tracks after setting remote description!\");\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n }\r\n\r\n this.type = this.remoteStream.getTracks().some(t => t.kind === 'video') ? CallType.Video : CallType.Voice;\r\n this.setState(CallState.Ringing);\r\n\r\n if (event.getLocalAge()) {\r\n setTimeout(() => {\r\n if (this.state == CallState.Ringing) {\r\n _logger.logger.debug(\"Call invite has expired. Hanging up.\");\r\n\r\n this.hangupParty = CallParty.Remote; // effectively\r\n\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn.signalingState != 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n this.emit(CallEvent.Hangup);\r\n }\r\n }, invite.lifetime - event.getLocalAge());\r\n }\r\n }\r\n /**\r\n * Configure this call from a hangup or reject event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.hangup event\r\n */\r\n\r\n\r\n initWithHangup(event) {\r\n // perverse as it may seem, sometimes we want to instantiate a call with a\r\n // hangup message (because when getting the state of the room on load, events\r\n // come in reverse order and we want to remember that a call has been hung up)\r\n this.setState(CallState.Ended);\r\n }\r\n /**\r\n * Answer a call.\r\n */\r\n\r\n\r\n async answer() {\r\n if (this.inviteOrAnswerSent) {\r\n return;\r\n }\r\n\r\n _logger.logger.debug(`Answering call ${this.callId} of type ${this.type}`);\r\n\r\n if (!this.localAVStream && !this.waitForLocalAVStream) {\r\n const constraints = getUserMediaContraints(this.type == CallType.Video ? ConstraintsType.Video : ConstraintsType.Audio);\r\n\r\n _logger.logger.log(\"Getting user media with constraints\", constraints);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.waitForLocalAVStream = true;\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.waitForLocalAVStream = false;\r\n this.gotUserMediaForAnswer(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n } else if (this.localAVStream) {\r\n this.gotUserMediaForAnswer(this.localAVStream);\r\n } else if (this.waitForLocalAVStream) {\r\n this.setState(CallState.WaitLocalMedia);\r\n }\r\n }\r\n /**\r\n * Replace this call with a new call, e.g. for glare resolution. Used by\r\n * MatrixClient.\r\n * @param {MatrixCall} newCall The new call.\r\n */\r\n\r\n\r\n replacedBy(newCall) {\r\n _logger.logger.debug(this.callId + \" being replaced by \" + newCall.callId);\r\n\r\n if (this.state === CallState.WaitLocalMedia) {\r\n _logger.logger.debug(\"Telling new call to wait for local media\");\r\n\r\n newCall.waitForLocalAVStream = true;\r\n } else if (this.state === CallState.CreateOffer) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n } else if (this.state === CallState.InviteSent) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n }\r\n\r\n newCall.localVideoElement = this.localVideoElement;\r\n newCall.remoteVideoElement = this.remoteVideoElement;\r\n newCall.remoteAudioElement = this.remoteAudioElement;\r\n this.successor = newCall;\r\n this.emit(CallEvent.Replaced, newCall);\r\n this.hangup(CallErrorCode.Replaced, true);\r\n }\r\n /**\r\n * Hangup a call.\r\n * @param {string} reason The reason why the call is being hung up.\r\n * @param {boolean} suppressEvent True to suppress emitting an event.\r\n */\r\n\r\n\r\n hangup(reason, suppressEvent) {\r\n if (this.callHasEnded()) return;\r\n\r\n _logger.logger.debug(\"Ending call \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, reason, !suppressEvent); // We don't want to send hangup here if we didn't even get to sending an invite\r\n\r\n if (this.state === CallState.WaitLocalMedia) return;\r\n const content = {}; // Continue to send no reason for user hangups temporarily, until\r\n // clients understand the user_hangup reason (voip v1)\r\n\r\n if (reason !== CallErrorCode.UserHangup) content['reason'] = reason;\r\n this.sendVoipEvent(_event.EventType.CallHangup, {});\r\n }\r\n /**\r\n * Reject a call\r\n * This used to be done by calling hangup, but is a separate method and protocol\r\n * event as of MSC2746.\r\n */\r\n\r\n\r\n reject() {\r\n if (this.state !== CallState.Ringing) {\r\n throw Error(\"Call must be in 'ringing' state to reject!\");\r\n }\r\n\r\n if (this.opponentVersion < 1) {\r\n _logger.logger.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`);\r\n\r\n this.hangup(CallErrorCode.UserHangup, true);\r\n return;\r\n }\r\n\r\n _logger.logger.debug(\"Rejecting call: \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.UserHangup, true);\r\n this.sendVoipEvent(_event.EventType.CallReject, {});\r\n }\r\n /**\r\n * Set whether our outbound video should be muted or not.\r\n * @param {boolean} muted True to mute the outbound video.\r\n */\r\n\r\n\r\n setLocalVideoMuted(muted) {\r\n this.vidMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if local video is muted.\r\n *\r\n * If there are multiple video tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no video tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the local preview video is muted, else false\r\n * (including if the call is not set up yet).\r\n */\r\n\r\n\r\n isLocalVideoMuted() {\r\n return this.vidMuted;\r\n }\r\n /**\r\n * Set whether the microphone should be muted or not.\r\n * @param {boolean} muted True to mute the mic.\r\n */\r\n\r\n\r\n setMicrophoneMuted(muted) {\r\n this.micMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if the microphone is muted.\r\n *\r\n * If there are multiple audio tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no audio tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the mic is muted, else false (including if the call\r\n * is not set up yet).\r\n */\r\n\r\n\r\n isMicrophoneMuted() {\r\n return this.micMuted;\r\n }\r\n /**\r\n * @returns true if we have put the party on the other side of the call on hold\r\n * (that is, we are signalling to them that we are not listening)\r\n */\r\n\r\n\r\n isRemoteOnHold() {\r\n return this.remoteOnHold;\r\n }\r\n\r\n setRemoteOnHold(onHold) {\r\n if (this.isRemoteOnHold() === onHold) return;\r\n this.remoteOnHold = onHold;\r\n if (!onHold) this.unholdingRemote = true;\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n // We set 'inactive' rather than 'sendonly' because we're not planning on\r\n // playing music etc. to the other side.\r\n tranceiver.direction = onHold ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n this.updateMuteStatus();\r\n\r\n if (!onHold) {\r\n this.playRemoteAudio();\r\n }\r\n\r\n this.emit(CallEvent.RemoteHoldUnhold, this.remoteOnHold);\r\n }\r\n /**\r\n * Indicates whether we are 'on hold' to the remote party (ie. if true,\r\n * they cannot hear us). Note that this will return true when we put the\r\n * remote on hold too due to the way hold is implemented (since we don't\r\n * wish to play hold music when we put a call on hold, we use 'inactive'\r\n * rather than 'sendonly')\r\n * @returns true if the other party has put us on hold\r\n */\r\n\r\n\r\n isLocalOnHold() {\r\n if (this.state !== CallState.Connected) return false;\r\n if (this.unholdingRemote) return false;\r\n let callOnHold = true; // We consider a call to be on hold only if *all* the tracks are on hold\r\n // (is this the right thing to do?)\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n const trackOnHold = ['inactive', 'recvonly'].includes(tranceiver.currentDirection);\r\n if (!trackOnHold) callOnHold = false;\r\n }\r\n\r\n return callOnHold;\r\n }\r\n /**\r\n * Sends a DTMF digit to the other party\r\n * @param digit The digit (nb. string - '#' and '*' are dtmf too)\r\n */\r\n\r\n\r\n sendDtmfDigit(digit) {\r\n for (const sender of this.peerConn.getSenders()) {\r\n if (sender.track.kind === 'audio' && sender.dtmf) {\r\n sender.dtmf.insertDTMF(digit);\r\n return;\r\n }\r\n }\r\n\r\n throw new Error(\"Unable to find a track to send DTMF on\");\r\n }\r\n\r\n updateMuteStatus() {\r\n if (!this.localAVStream) {\r\n return;\r\n }\r\n\r\n const micShouldBeMuted = this.micMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getAudioTracks(), !micShouldBeMuted);\r\n const vidShouldBeMuted = this.vidMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getVideoTracks(), !vidShouldBeMuted);\r\n\r\n if (this.remoteOnHold) {\r\n if (this.remoteAudioElement && this.remoteAudioElement.srcObject === this.remoteStream) {\r\n this.remoteAudioElement.muted = true;\r\n } else if (this.remoteVideoElement && this.remoteVideoElement.srcObject === this.remoteStream) {\r\n this.remoteVideoElement.muted = true;\r\n }\r\n } else {\r\n this.playRemoteAudio();\r\n }\r\n }\r\n /**\r\n * Internal\r\n * @param {Object} stream\r\n */\r\n\r\n\r\n async sendAnswer() {\r\n const answerContent = {\r\n answer: {\r\n sdp: this.peerConn.localDescription.sdp,\r\n // type is now deprecated as of Matrix VoIP v1, but\r\n // required to still be sent for backwards compat\r\n type: this.peerConn.localDescription.type\r\n }\r\n };\r\n\r\n if (this.client._supportsCallTransfer) {\r\n answerContent.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // We have just taken the local description from the peerconnection which will\r\n // contain all the local candidates added so far, so we can discard any candidates\r\n // we had queued up because they'll be in the answer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallAnswer, answerContent); // If this isn't the first time we've tried to send the answer,\r\n // we may have candidates queued up, so send them now.\r\n\r\n this.inviteOrAnswerSent = true;\r\n } catch (error) {\r\n // We've failed to answer: back to the ringing state\r\n this.setState(CallState.Ringing);\r\n this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SendAnswer;\r\n let message = \"Failed to send answer\";\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n throw error;\r\n } // error handler re-throws so this won't happen on error, but\r\n // we don't want the same error handling on the candidate queue\r\n\r\n\r\n this.sendCandidateQueue();\r\n }\r\n\r\n async onRemoteIceCandidatesReceived(ev) {\r\n if (this.callHasEnded()) {\r\n //debuglog(\"Ignoring remote ICE candidate because call has ended\");\r\n return;\r\n }\r\n\r\n const cands = ev.getContent().candidates;\r\n\r\n if (!cands) {\r\n _logger.logger.info(\"Ignoring candidates event with no candidates!\");\r\n\r\n return;\r\n }\r\n\r\n const fromPartyId = ev.getContent().version === 0 ? null : ev.getContent().party_id || null;\r\n\r\n if (this.opponentPartyId === undefined) {\r\n // we haven't picked an opponent yet so save the candidates\r\n _logger.logger.info(`Bufferring ${cands.length} candidates until we pick an opponent`);\r\n\r\n const bufferedCands = this.remoteCandidateBuffer.get(fromPartyId) || [];\r\n bufferedCands.push(...cands);\r\n this.remoteCandidateBuffer.set(fromPartyId, bufferedCands);\r\n return;\r\n }\r\n\r\n if (!this.partyIdMatches(ev.getContent())) {\r\n _logger.logger.info(`Ignoring candidates from party ID ${ev.getContent().party_id}: ` + `we have chosen party ID ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n await this.addIceCandidates(cands);\r\n }\r\n /**\r\n * Used by MatrixClient.\r\n * @param {Object} msg\r\n */\r\n\r\n\r\n async onAnswerReceived(event) {\r\n _logger.logger.debug(`Got answer for call ID ${this.callId} from party ID ${event.getContent().party_id}`);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);\r\n\r\n return;\r\n }\r\n\r\n if (this.opponentPartyId !== undefined) {\r\n _logger.logger.info(`Ignoring answer from party ID ${event.getContent().party_id}: ` + `we already have an answer/reject from ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n this.chooseOpponent(event);\r\n await this.addBufferedIceCandidates();\r\n this.setState(CallState.Connecting);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(event.getContent().answer);\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // If the answer we selected has a party_id, send a select_answer event\r\n // We do this after setting the remote description since otherwise we'd block\r\n // call setup on it\r\n\r\n\r\n if (this.opponentPartyId !== null) {\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallSelectAnswer, {\r\n selected_party_id: this.opponentPartyId\r\n });\r\n } catch (err) {\r\n // This isn't fatal, and will just mean that if another party has raced to answer\r\n // the call, they won't know they got rejected, so we carry on & don't retry.\r\n _logger.logger.warn(\"Failed to send select_answer event\", err);\r\n }\r\n }\r\n }\r\n\r\n async onSelectAnswerReceived(event) {\r\n if (this.direction !== CallDirection.Inbound) {\r\n _logger.logger.warn(\"Got select_answer for an outbound call: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n const selectedPartyId = event.getContent().selected_party_id;\r\n\r\n if (selectedPartyId === undefined || selectedPartyId === null) {\r\n _logger.logger.warn(\"Got nonsensical select_answer with null/undefined selected_party_id: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n if (selectedPartyId !== this.ourPartyId) {\r\n _logger.logger.info(`Got select_answer for party ID ${selectedPartyId}: we are party ID ${this.ourPartyId}.`); // The other party has picked somebody else's answer\r\n\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n }\r\n }\r\n\r\n async onNegotiateReceived(event) {\r\n const description = event.getContent().description;\r\n\r\n if (!description || !description.sdp || !description.type) {\r\n _logger.logger.info(\"Ignoring invalid m.call.negotiate event\");\r\n\r\n return;\r\n } // Politeness always follows the direction of the call: in a glare situation,\r\n // we pick either the inbound or outbound call, so one side will always be\r\n // inbound and one outbound\r\n\r\n\r\n const polite = this.direction === CallDirection.Inbound; // Here we follow the perfect negotiation logic from\r\n // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation\r\n\r\n const offerCollision = description.type === 'offer' && (this.makingOffer || this.peerConn.signalingState != 'stable');\r\n this.ignoreOffer = !polite && offerCollision;\r\n\r\n if (this.ignoreOffer) {\r\n _logger.logger.info(\"Ignoring colliding negotiate event because we're impolite\");\r\n\r\n return;\r\n }\r\n\r\n const prevLocalOnHold = this.isLocalOnHold();\r\n\r\n if (description.type === 'answer') {\r\n // whenever we get an answer back, clear the flag we set whilst trying to un-hold\r\n // the other party: the state of the channels now reflects reality\r\n this.unholdingRemote = false;\r\n }\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(description);\r\n\r\n if (description.type === 'offer') {\r\n // First we sent the direction of the tranciever to what we'd like it to be,\r\n // irresepective of whether the other side has us on hold - so just whether we\r\n // want the call to be on hold or not. This is necessary because in a few lines,\r\n // we'll adjust the direction and unless we do this too, we'll never come off hold.\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = this.isRemoteOnHold() ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n const localDescription = await this.peerConn.createAnswer();\r\n await this.peerConn.setLocalDescription(localDescription); // Now we've got our answer, set the direction to the outcome of the negotiation.\r\n // We need to do this otherwise Firefox will notice that the direction is not the\r\n // currentDirection and try to negotiate itself off hold again.\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = tranceiver.currentDirection;\r\n }\r\n\r\n this.sendVoipEvent(_event.EventType.CallNegotiate, {\r\n description: this.peerConn.localDescription\r\n });\r\n }\r\n } catch (err) {\r\n _logger.logger.warn(\"Failed to complete negotiation\", err);\r\n }\r\n\r\n const newLocalOnHold = this.isLocalOnHold();\r\n\r\n if (prevLocalOnHold !== newLocalOnHold) {\r\n this.emit(CallEvent.LocalHoldUnhold, newLocalOnHold); // also this one for backwards compat\r\n\r\n this.emit(CallEvent.HoldUnhold, newLocalOnHold);\r\n }\r\n }\r\n\r\n callHasEnded() {\r\n // This exists as workaround to typescript trying to be clever and erroring\r\n // when putting if (this.state === CallState.Ended) return; twice in the same\r\n // function, even though that function is async.\r\n return this.state === CallState.Ended;\r\n }\r\n\r\n async playRemoteAudio() {\r\n if (this.remoteVideoElement) this.remoteVideoElement.muted = true;\r\n this.remoteAudioElement.muted = false;\r\n this.remoteAudioElement.srcObject = this.remoteStream; // if audioOutput is non-default:\r\n\r\n try {\r\n if (audioOutput) {\r\n // This seems quite unreliable in Chrome, although I haven't yet managed to make a jsfiddle where\r\n // it fails.\r\n // It seems reliable if you set the sink ID after setting the srcObject and then set the sink ID\r\n // back to the default after the call is over\r\n _logger.logger.info(\"Setting audio sink to \" + audioOutput + \", was \" + this.remoteAudioElement.sinkId);\r\n\r\n await this.remoteAudioElement.setSinkId(audioOutput);\r\n }\r\n } catch (e) {\r\n _logger.logger.warn(\"Couldn't set requested audio output device: using default\", e);\r\n }\r\n\r\n try {\r\n await this.remoteAudioElement.play();\r\n } catch (e) {\r\n _logger.logger.error(\"Failed to play remote audio element\", e);\r\n }\r\n }\r\n\r\n async playRemoteVideo() {\r\n // A note on calling methods on media elements:\r\n // We used to have queues per media element to serialise all calls on those elements.\r\n // The reason given for this was that load() and play() were racing. However, we now\r\n // never call load() explicitly so this seems unnecessary. However, serialising every\r\n // operation was causing bugs where video would not resume because some play command\r\n // had got stuck and all media operations were queued up behind it. If necessary, we\r\n // should serialise the ones that need to be serialised but then be able to interrupt\r\n // them with another load() which will cancel the pending one, but since we don't call\r\n // load() explicitly, it shouldn't be a problem.\r\n this.remoteVideoElement.srcObject = this.remoteStream;\r\n\r\n _logger.logger.info(\"playing remote video. stream active? \" + this.remoteStream.active);\r\n\r\n try {\r\n await this.remoteVideoElement.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play remote video element\", e);\r\n }\r\n }\r\n\r\n setState(state) {\r\n const oldState = this.state;\r\n this.state = state;\r\n this.emit(CallEvent.State, state, oldState);\r\n }\r\n /**\r\n * Internal\r\n * @param {string} eventType\r\n * @param {Object} content\r\n * @return {Promise}\r\n */\r\n\r\n\r\n sendVoipEvent(eventType, content) {\r\n return this.client.sendEvent(this.roomId, eventType, Object.assign({}, content, {\r\n version: VOIP_PROTO_VERSION,\r\n call_id: this.callId,\r\n party_id: this.ourPartyId\r\n }));\r\n }\r\n\r\n queueCandidate(content) {\r\n // Sends candidates with are sent in a special way because we try to amalgamate\r\n // them into one message\r\n this.candidateSendQueue.push(content); // Don't send the ICE candidates yet if the call is in the ringing state: this\r\n // means we tried to pick (ie. started generating candidates) and then failed to\r\n // send the answer and went back to the ringing state. Queue up the candidates\r\n // to send if we sucessfully send the answer.\r\n // Equally don't send if we haven't yet sent the answer because we can send the\r\n // first batch of candidates along with the answer\r\n\r\n if (this.state === CallState.Ringing || !this.inviteOrAnswerSent) return; // MSC2746 reccomends these values (can be quite long when calling because the\r\n // callee will need a while to answer the call)\r\n\r\n const delay = this.direction === CallDirection.Inbound ? 500 : 2000;\r\n\r\n if (this.candidateSendTries === 0) {\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delay);\r\n }\r\n }\r\n /*\r\n * Transfers this call to another user\r\n */\r\n\r\n\r\n async transfer(targetUserId) {\r\n // Fetch the target user's global profile info: their room avatar / displayname\r\n // could be different in whatever room we shae with them.\r\n const profileInfo = await this.client.getProfileInfo(targetUserId);\r\n const replacementId = genCallID();\r\n const body = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: targetUserId,\r\n display_name: profileInfo.display_name,\r\n avatar_url: profileInfo.avatar_url\r\n },\r\n create_call: replacementId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, body);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n /*\r\n * Transfers this call to the target call, effectively 'joining' the\r\n * two calls (so the remote parties on each call are connected together).\r\n */\r\n\r\n\r\n async transferToCall(transferTargetCall) {\r\n const targetProfileInfo = await this.client.getProfileInfo(transferTargetCall.getOpponentMember().userId);\r\n const transfereeProfileInfo = await this.client.getProfileInfo(this.getOpponentMember().userId);\r\n const newCallId = genCallID();\r\n const bodyToTransferTarget = {\r\n // the replacements on each side have their own ID, and it's distinct from the\r\n // ID of the new call (but we can use the same function to generate it)\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: this.getOpponentMember().userId,\r\n display_name: transfereeProfileInfo.display_name,\r\n avatar_url: transfereeProfileInfo.avatar_url\r\n },\r\n await_call: newCallId\r\n };\r\n await transferTargetCall.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferTarget);\r\n const bodyToTransferee = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: transferTargetCall.getOpponentMember().userId,\r\n display_name: targetProfileInfo.display_name,\r\n avatar_url: targetProfileInfo.avatar_url\r\n },\r\n create_call: newCallId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferee);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n await transferTargetCall.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n\r\n async terminate(hangupParty, hangupReason, shouldEmit) {\r\n if (this.callHasEnded()) return;\r\n this.callStatsAtEnd = await this.collectCallStats();\r\n\r\n if (this.inviteTimeout) {\r\n clearTimeout(this.inviteTimeout);\r\n this.inviteTimeout = null;\r\n }\r\n\r\n const remoteVid = this.getRemoteVideoElement();\r\n const remoteAud = this.getRemoteAudioElement();\r\n const localVid = this.getLocalVideoElement();\r\n\r\n if (remoteVid) {\r\n remoteVid.pause();\r\n remoteVid.srcObject = null;\r\n }\r\n\r\n if (remoteAud) {\r\n remoteAud.pause();\r\n remoteAud.srcObject = null;\r\n\r\n try {\r\n // As per comment in playRemoteAudio, setting the sink ID back to the default\r\n // once the call is over makes setSinkId work reliably.\r\n await this.remoteAudioElement.setSinkId('');\r\n } catch (e) {\r\n _logger.logger.warn(\"Failed to set sink ID back to default\");\r\n }\r\n }\r\n\r\n if (localVid) {\r\n localVid.pause();\r\n localVid.srcObject = null;\r\n }\r\n\r\n this.hangupParty = hangupParty;\r\n this.hangupReason = hangupReason;\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn && this.peerConn.signalingState !== 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n if (shouldEmit) {\r\n this.emit(CallEvent.Hangup, this);\r\n }\r\n }\r\n\r\n stopAllMedia() {\r\n _logger.logger.debug(`stopAllMedia (stream=${this.localAVStream})`);\r\n\r\n if (this.localAVStream) {\r\n for (const track of this.localAVStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.screenSharingStream) {\r\n for (const track of this.screenSharingStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.remoteStream) {\r\n for (const track of this.remoteStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n }\r\n\r\n checkForErrorListener() {\r\n if (this.listeners(\"error\").length === 0) {\r\n throw new Error(\"You MUST attach an error listener using call.on('error', function() {})\");\r\n }\r\n }\r\n\r\n async sendCandidateQueue() {\r\n if (this.candidateSendQueue.length === 0) {\r\n return;\r\n }\r\n\r\n const cands = this.candidateSendQueue;\r\n this.candidateSendQueue = [];\r\n ++this.candidateSendTries;\r\n const content = {\r\n candidates: cands\r\n };\r\n\r\n _logger.logger.debug(\"Attempting to send \" + cands.length + \" candidates\");\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallCandidates, content);\r\n } catch (error) {\r\n // don't retry this event: we'll send another one later as we might\r\n // have more candidates by then.\r\n if (error.event) this.client.cancelPendingEvent(error.event); // put all the candidates we failed to send back in the queue\r\n\r\n this.candidateSendQueue.push(...cands);\r\n\r\n if (this.candidateSendTries > 5) {\r\n _logger.logger.debug(\"Failed to send candidates on attempt \" + this.candidateSendTries + \". Giving up on this call.\", error);\r\n\r\n const code = CallErrorCode.SignallingFailed;\r\n const message = \"Signalling failed\";\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.hangup(code, false);\r\n return;\r\n }\r\n\r\n const delayMs = 500 * Math.pow(2, this.candidateSendTries);\r\n ++this.candidateSendTries;\r\n\r\n _logger.logger.debug(\"Failed to send candidates. Retrying in \" + delayMs + \"ms\", error);\r\n\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delayMs);\r\n }\r\n }\r\n\r\n async placeCallWithConstraints(constraints) {\r\n _logger.logger.log(\"Getting user media with constraints\", constraints); // XXX Find a better way to do this\r\n\r\n\r\n this.client._callEventHandler.calls.set(this.callId, this);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.direction = CallDirection.Outbound;\r\n this.config = constraints; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n } // create the peer connection now so it can be gathering candidates while we get user\r\n // media (assuming a candidate pool size is configured)\r\n\r\n\r\n this.peerConn = this.createPeerConnection();\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.gotUserMediaForInvite(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n }\r\n\r\n createPeerConnection() {\r\n const pc = new window.RTCPeerConnection({\r\n iceTransportPolicy: this.forceTURN ? 'relay' : undefined,\r\n iceServers: this.turnServers,\r\n iceCandidatePoolSize: this.client._iceCandidatePoolSize\r\n }); // 'connectionstatechange' would be better, but firefox doesn't implement that.\r\n\r\n pc.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChanged);\r\n pc.addEventListener('signalingstatechange', this.onSignallingStateChanged);\r\n pc.addEventListener('icecandidate', this.gotLocalIceCandidate);\r\n pc.addEventListener('icegatheringstatechange', this.onIceGatheringStateChange);\r\n pc.addEventListener('track', this.onTrack);\r\n pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);\r\n return pc;\r\n }\r\n\r\n partyIdMatches(msg) {\r\n // They must either match or both be absent (in which case opponentPartyId will be null)\r\n // Also we ignore party IDs on the invite/offer if the version is 0, so we must do the same\r\n // here and use null if the version is 0 (woe betide any opponent sending messages in the\r\n // same call with different versions)\r\n const msgPartyId = msg.version === 0 ? null : msg.party_id || null;\r\n return msgPartyId === this.opponentPartyId;\r\n } // Commits to an opponent for the call\r\n // ev: An invite or answer event\r\n\r\n\r\n chooseOpponent(ev) {\r\n // I choo-choo-choose you\r\n const msg = ev.getContent();\r\n\r\n _logger.logger.debug(`Choosing party ID ${msg.party_id} for call ID ${this.callId}`);\r\n\r\n this.opponentVersion = msg.version;\r\n\r\n if (this.opponentVersion === 0) {\r\n // set to null to indicate that we've chosen an opponent, but because\r\n // they're v0 they have no party ID (even if they sent one, we're ignoring it)\r\n this.opponentPartyId = null;\r\n } else {\r\n // set to their party ID, or if they're naughty and didn't send one despite\r\n // not being v0, set it to null to indicate we picked an opponent with no\r\n // party ID\r\n this.opponentPartyId = msg.party_id || null;\r\n }\r\n\r\n this.opponentCaps = msg.capabilities || {};\r\n this.opponentMember = ev.sender;\r\n }\r\n\r\n async addBufferedIceCandidates() {\r\n const bufferedCands = this.remoteCandidateBuffer.get(this.opponentPartyId);\r\n\r\n if (bufferedCands) {\r\n _logger.logger.info(`Adding ${bufferedCands.length} buffered candidates for opponent ${this.opponentPartyId}`);\r\n\r\n await this.addIceCandidates(bufferedCands);\r\n }\r\n\r\n this.remoteCandidateBuffer = null;\r\n }\r\n\r\n async addIceCandidates(cands) {\r\n for (const cand of cands) {\r\n if ((cand.sdpMid === null || cand.sdpMid === undefined) && (cand.sdpMLineIndex === null || cand.sdpMLineIndex === undefined)) {\r\n _logger.logger.debug(\"Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex\");\r\n\r\n continue;\r\n }\r\n\r\n _logger.logger.debug(\"Call \" + this.callId + \" got remote ICE \" + cand.sdpMid + \" candidate: \" + cand.candidate);\r\n\r\n try {\r\n await this.peerConn.addIceCandidate(cand);\r\n } catch (err) {\r\n if (!this.ignoreOffer) {\r\n _logger.logger.info(\"Failed to add remote ICE candidate\", err);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.MatrixCall = MatrixCall;\r\n\r\nfunction setTracksEnabled(tracks, enabled) {\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].enabled = enabled;\r\n }\r\n}\r\n\r\nfunction getUserMediaContraints(type) {\r\n const isWebkit = !!navigator.webkitGetUserMedia;\r\n\r\n switch (type) {\r\n case ConstraintsType.Audio:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: false\r\n };\r\n }\r\n\r\n case ConstraintsType.Video:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: {\r\n deviceId: videoInput ? {\r\n ideal: videoInput\r\n } : undefined,\r\n\r\n /* We want 640x360. Chrome will give it only if we ask exactly,\r\n FF refuses entirely if we ask exactly, so have to ask for ideal\r\n instead\r\n XXX: Is this still true?\r\n */\r\n width: isWebkit ? {\r\n exact: 640\r\n } : {\r\n ideal: 640\r\n },\r\n height: isWebkit ? {\r\n exact: 360\r\n } : {\r\n ideal: 360\r\n }\r\n }\r\n };\r\n }\r\n }\r\n}\r\n\r\nasync function getScreenshareContraints(selectDesktopCapturerSource) {\r\n var _window$electron2;\r\n\r\n if ((_window$electron2 = window.electron) !== null && _window$electron2 !== void 0 && _window$electron2.getDesktopCapturerSources && selectDesktopCapturerSource) {\r\n // We have access to getDesktopCapturerSources()\r\n _logger.logger.debug(\"Electron getDesktopCapturerSources() is available...\");\r\n\r\n const selectedSource = await selectDesktopCapturerSource();\r\n if (!selectedSource) return null;\r\n return {\r\n audio: false,\r\n video: {\r\n mandatory: {\r\n chromeMediaSource: \"desktop\",\r\n chromeMediaSourceId: selectedSource.id\r\n }\r\n }\r\n };\r\n } else {\r\n // We do not have access to the Electron desktop capturer,\r\n // therefore we can assume we are on the web\r\n _logger.logger.debug(\"Electron desktopCapturer is not available...\");\r\n\r\n return {\r\n audio: false,\r\n video: true\r\n };\r\n }\r\n}\r\n\r\nlet audioOutput;\r\nlet audioInput;\r\nlet videoInput;\r\n/**\r\n * Set an audio output device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\nfunction setAudioOutput(deviceId) {\r\n audioOutput = deviceId;\r\n}\r\n/**\r\n * Set an audio input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setAudioInput(deviceId) {\r\n audioInput = deviceId;\r\n}\r\n/**\r\n * Set a video input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setVideoInput(deviceId) {\r\n videoInput = deviceId;\r\n}\r\n/**\r\n * Create a new Matrix call for the browser.\r\n * @param {MatrixClient} client The client instance to use.\r\n * @param {string} roomId The room the call is in.\r\n * @param {Object?} options DEPRECATED optional options map.\r\n * @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be\r\n * forced. This option is deprecated - use opts.forceTURN when creating the matrix client\r\n * since it's only possible to set this option on outbound calls.\r\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\r\n */\r\n\r\n\r\nfunction createNewMatrixCall(client, roomId, options) {\r\n // typeof prevents Node from erroring on an undefined reference\r\n if (typeof window === 'undefined' || typeof document === 'undefined') {\r\n // NB. We don't log here as apps try to create a call object as a test for\r\n // whether calls are supported, so we shouldn't fill the logs up.\r\n return null;\r\n } // Firefox throws on so little as accessing the RTCPeerConnection when operating in\r\n // a secure mode. There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616\r\n // though the concern is that the browser throwing a SecurityError will brick the\r\n // client creation process.\r\n\r\n\r\n try {\r\n const supported = Boolean(window.RTCPeerConnection || window.RTCSessionDescription || window.RTCIceCandidate || navigator.mediaDevices);\r\n\r\n if (!supported) {\r\n _logger.logger.error(\"WebRTC is not supported in this browser / environment\");\r\n\r\n return null;\r\n }\r\n } catch (e) {\r\n _logger.logger.error(\"Exception thrown when trying to access WebRTC\", e);\r\n\r\n return null;\r\n }\r\n\r\n const optionsForceTURN = options ? options.forceTURN : false;\r\n const opts = {\r\n client: client,\r\n roomId: roomId,\r\n turnServers: client.getTurnServers(),\r\n // call level options\r\n forceTURN: client._forceTURN || optionsForceTURN\r\n };\r\n const call = new MatrixCall(opts);\r\n client.reEmitter.reEmit(call, Object.values(CallEvent));\r\n return call;\r\n}","\r\nvar createHash = null\r\n\r\nvar f = {}\r\n\r\nf.sha224 = function(text){\r\n\r\n if(!createHash){\r\n createHash = require('create-hash')\r\n }\r\n\r\n var hash = createHash('sha224')\r\n hash.update(text)\r\n return hash.digest()\r\n\r\n}\r\n\r\n\r\nf.language = function () {\r\n\r\n var language;\r\n if (window.navigator.languages) {\r\n language = window.navigator.languages[0];\r\n } else {\r\n language = window.navigator.userLanguage || window.navigator.language;\r\n }\r\n\r\n return language\r\n}\r\nf.deep = function (obj, key) {\r\n var _key = _.isArray(key) ? key : key.split(\".\");\r\n\r\n var tkey = _key[0];\r\n\r\n if (typeof obj == 'undefined' || !obj) return undefined;\r\n\r\n if (typeof obj[tkey] != 'undefined') {\r\n _key.splice(0, 1);\r\n\r\n if (_key.length === 0) {\r\n return obj[tkey];\r\n }\r\n else {\r\n return f.deep(obj[tkey], _key)\r\n }\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n\r\nvar renderFrameEqualizer = function (canvas, ctx, analyser, stop, colornumbers, offset) {\r\n\r\n\r\n\r\n if (!colornumbers) {\r\n colornumbers = {\r\n r: 25,\r\n g: 250,\r\n b: 50\r\n }\r\n }\r\n\r\n if (!offset) {\r\n offset = {\r\n x: 25,\r\n offset: [0, 0]\r\n }\r\n }\r\n\r\n var WIDTH = canvas.width;\r\n var HEIGHT = canvas.height;\r\n\r\n var bufferLength = analyser.frequencyBinCount;\r\n var dataArray = new Uint8Array(bufferLength);\r\n\r\n var barWidth = (WIDTH / bufferLength) / 2.5;\r\n var barHeight;\r\n\r\n var x = offset.x // offset[0] -15;\r\n\r\n analyser.getByteFrequencyData(dataArray);\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n for (var i = 0; i < bufferLength; i++) {\r\n\r\n barHeight = dataArray[i];\r\n\r\n var r = barHeight + (colornumbers.r * (i / bufferLength));\r\n var g = colornumbers.g * (i / bufferLength);\r\n var b = colornumbers.b;\r\n\r\n var opacity = - Math.abs(i - bufferLength / 2) / bufferLength + 1 / 2\r\n\r\n\r\n if (i > offset.offset[0] && i < bufferLength - offset.offset[1]) {\r\n ctx.fillStyle = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + opacity * 2 + \")\";\r\n ctx.fillRect(x, HEIGHT / 2 - (barHeight * opacity), barWidth, barHeight * opacity * 2);\r\n }\r\n\r\n\r\n x += barWidth + 1;\r\n }\r\n\r\n requestAnimationFrame(function () {\r\n if (stop()) {\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n return\r\n }\r\n\r\n renderFrameEqualizer(canvas, ctx, analyser, stop, colornumbers, offset)\r\n });\r\n\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nf.permutations = function (array, k) {\r\n\r\n k || (k = 1)\r\n\r\n var m = [];\r\n var combinations = [];\r\n var indices = [];\r\n var len = array.length;\r\n function run(level) {\r\n for (var i = 0; i < len; i++) {\r\n if (!indices[i]) {\r\n indices[i] = true;\r\n combinations[level] = array[i];\r\n if (level < k - 1) {\r\n run(level + 1, i + 1);\r\n } else {\r\n m.push(([]).concat(combinations));\r\n }\r\n indices[i] = false;\r\n }\r\n }\r\n }\r\n run(0);\r\n return m;\r\n}\r\n\r\nvar copytext = function (text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // IE specific code path to prevent textarea being shown while dialog is visible.\r\n return clipboardData.setData(\"Text\", text);\r\n\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in MS Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return false;\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\r\nvar makeid = function (valid) {\r\n\r\n function s4() {\r\n return Math.floor((1 + Math.random()) * 0x10000)\r\n .toString(16)\r\n .substring(1);\r\n }\r\n\r\n if (!valid) {\r\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\r\n s4() + '-' + s4() + s4() + s4();\r\n }\r\n\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\r\n for (var i = 0; i < 16; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n return text;\r\n}\r\n// roomalias\r\n\r\nvar flball = function (str) {\r\n\r\n //return flbb(str)\r\n\r\n if (!str || !str.split) return str\r\n\r\n var exception = [\"2ndEdison, 3dCarbon\", \"A-Pmcs\"];\r\n var lower = [\"TO\", \"K\", \"X\", \"10X\", \"THE\", \"AN\", \"AND\", \"OR\", \"AT\", \"BUT\", \"BY\", \"FOR\", \"IN\", \"OF\", \"OFF\", \"ON\", \"OUT\", \"PER\", \"UP\", \"VIA\", \"AS\", \"FOR\"];\r\n var upper = [\"2MCBL\", \"USA\", \"TONS\", \"BHCC\", \"LLC\", \"LTD\", \"1BWK\", \"AGMA\", \"VIII\", \"XIII\", \"BHCC\"];\r\n var capital = [\"LAS\", \"LAW\", \"SON\", \"DEE\", \"ST\", \"PET\", \"BIG\", \"WAY\", \"AIR\", \"ALL\", \"TOP\", \"JOY\", \"CO\", \"INC\", \"INC.\", \"AVE\", \"PAY\", \"ST.\", \"FOX\", \"CAR\", \"TAX\", \"DAY\", \"MAN\", \"CO.\", \"NEW\"];\r\n var capitalReg = new RegExp(capital.join('|'));\r\n var upperReg = new RegExp(upper.join('|'));\r\n\r\n\r\n var nameArr = str.split(' ').map(function (word) {\r\n if (exception.some(function (w) { return w.toUpperCase() === word })) {\r\n\r\n return exception.find(function (w) { return w.toUpperCase() === word });\r\n }\r\n\r\n if (\r\n lower.some(function (w) {\r\n if (w === word) {\r\n return true;\r\n };\r\n var wArr = w.split(' ');\r\n for (var i = 0; i < wArr.length; i++) {\r\n if (/[0-9]/.test(wArr[i]) && /ST|ND|RD|TH|K/.test(wArr[i + 1] + wArr[i + 2])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n })\r\n ) {\r\n return word.toLowerCase();\r\n }\r\n\r\n if (capitalReg.test(word)) {\r\n return word[0] + word.slice(1).toLowerCase();\r\n }\r\n if (word.replace(/\\(|\\)/g, '').length <= 3 || upperReg.test(word)) {\r\n return word;\r\n }\r\n var wordCap = word.toLowerCase().replace(/[A-Za-z]/, function (l) { return l.toUpperCase() });\r\n var wordArr = [];\r\n wordArr.push(wordCap[0]);\r\n for (var i = 0; i < wordCap.length; i++) {\r\n if (wordCap[i + 1] && (/\\.|\\/|[0-9]|\\&|\\-|\\s/.test(wordCap[i]) || (wordCap[i - 1] + wordCap[i]).toLowerCase() === 'mc')) {\r\n wordArr.push(wordCap[i + 1].toUpperCase());\r\n } else if (wordCap[i + 1]) {\r\n wordArr.push(wordCap[i + 1])\r\n }\r\n };\r\n return wordArr.join('')\r\n })\r\n\r\n return flb(nameArr.join(' '))\r\n}\r\n\r\nvar flb = function (str) {\r\n return str[0].toUpperCase() + str.substr(1);\r\n}\r\n\r\nvar flbs = function (str) {\r\n\r\n return str[0].toUpperCase() + str.substr(1).toLowerCase();\r\n}\r\n\r\nvar flbb = function (str) {\r\n\r\n var s = str.split(' ');\r\n\r\n return _.map(s, function (s) {\r\n return flbs(s);\r\n }).join(' ')\r\n\r\n}\r\nvar group = function (array, _function) {\r\n var group = {};\r\n\r\n _.each(array, function (el, i) {\r\n\r\n var index = _function(el, i);\r\n\r\n if (!index) return;\r\n\r\n if (!group[index])\r\n group[index] = [];\r\n\r\n group[index].push(el);\r\n\r\n })\r\n\r\n return group;\r\n}\r\n\r\nvar _scrollTop = function (scrollTop, el, time) {\r\n\r\n if (!el) el = $(\"body,html\");\r\n\r\n if (!time) time = 200;\r\n\r\n el.animate({ scrollTop: scrollTop }, time);\r\n}\r\n\r\nvar _scrollTo = function (to, el, time) {\r\n\r\n if (!to) to = $(this);\r\n\r\n var ofssetObj = to.offset();\r\n\r\n var offset = (to.height() - $(window).height()) / 2;\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTop = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.offset();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTopP = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.position();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar stringEq = function (s1, s2) {\r\n\r\n if (!s1) s1 = ''\r\n if (!s2) s2 = ''\r\n\r\n var bw = function (s) {\r\n return s.split(/[ \\t\\v\\r\\n\\f,.]+/)\r\n }\r\n\r\n var hash = function (s) {\r\n\r\n var ps = bw(s).join(' ')\r\n\r\n return ps.toLowerCase().replace(/[^a-zа-я0-9&]*/g, '');\r\n }\r\n\r\n\r\n\r\n var makeTr = function (w) {\r\n var trs = {};\r\n\r\n var takeC = function (index) {\r\n var c;\r\n\r\n if (index < 0 || index >= w.length) c = \"_\";\r\n\r\n else c = w[index];\r\n\r\n return c;\r\n }\r\n\r\n for (var i = -1; i <= w.length; i++) {\r\n\r\n var tr = \"\";\r\n\r\n for (var j = i - 1; j <= i + 1; j++) {\r\n tr = tr + takeC(j);\r\n }\r\n\r\n\r\n trs[tr] = 1;\r\n }\r\n\r\n return trs;\r\n }\r\n\r\n\r\n var t1 = makeTr(hash(s1)),\r\n t2 = makeTr(hash(s2));\r\n\r\n\r\n var c = 0,\r\n m = Math.max(_.toArray(t1).length, _.toArray(t2).length)\r\n\r\n _.each(t1, function (t, index) {\r\n\r\n if (t2[index]) c++;\r\n\r\n })\r\n\r\n return c / m;\r\n\r\n\r\n}\r\n\r\nvar pretry = function (_function, time, totaltime) {\r\n\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n retry(_function, resolve, time, totaltime)\r\n\r\n })\r\n}\r\n\r\nvar retry = function (_function, clbk, time, totaltime) {\r\n\r\n if (_function()){\r\n\r\n \r\n\r\n if (clbk) clbk();\r\n\r\n return\r\n }\r\n\r\n if (!time) time = 20;\r\n\r\n var totalTimeCounter = 0\r\n\r\n var interval = setInterval(function () {\r\n\r\n if (_function() || (totaltime && totaltime <= totalTimeCounter)) {\r\n\r\n\r\n clearInterval(interval);\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n totalTimeCounter += time\r\n\r\n }, time);\r\n}\r\n\r\nvar md5 = function (d) {\r\n var result = M(V(Y(X(d), 8 * d.length))); return result.toLowerCase()\r\n}; function M(d) { for (var _, m = \"0123456789ABCDEF\", f = \"\", r = 0; r < d.length; r++)_ = d.charCodeAt(r), f += m.charAt(_ >>> 4 & 15) + m.charAt(15 & _); return f } function X(d) { for (var _ = Array(d.length >> 2), m = 0; m < _.length; m++)_[m] = 0; for (m = 0; m < 8 * d.length; m += 8)_[m >> 5] |= (255 & d.charCodeAt(m / 8)) << m % 32; return _ } function V(d) { for (var _ = \"\", m = 0; m < 32 * d.length; m += 8)_ += String.fromCharCode(d[m >> 5] >>> m % 32 & 255); return _ } function Y(d, _) { d[_ >> 5] |= 128 << _ % 32, d[14 + (_ + 64 >>> 9 << 4)] = _; for (var m = 1732584193, f = -271733879, r = -1732584194, i = 271733878, n = 0; n < d.length; n += 16) { var h = m, t = f, g = r, e = i; f = md5_ii(f = md5_ii(f = md5_ii(f = md5_ii(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_ff(f = md5_ff(f = md5_ff(f = md5_ff(f, r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = safe_add(m, h), f = safe_add(f, t), r = safe_add(r, g), i = safe_add(i, e) } return Array(m, f, r, i) } function md5_cmn(d, _, m, f, r, i) { return safe_add(bit_rol(safe_add(safe_add(_, d), safe_add(f, i)), r), m) } function md5_ff(d, _, m, f, r, i, n) { return md5_cmn(_ & m | ~_ & f, d, _, r, i, n) } function md5_gg(d, _, m, f, r, i, n) { return md5_cmn(_ & f | m & ~f, d, _, r, i, n) } function md5_hh(d, _, m, f, r, i, n) { return md5_cmn(_ ^ m ^ f, d, _, r, i, n) } function md5_ii(d, _, m, f, r, i, n) { return md5_cmn(m ^ (_ | ~f), d, _, r, i, n) } function safe_add(d, _) { var m = (65535 & d) + (65535 & _); return (d >> 16) + (_ >> 16) + (m >> 16) << 16 | 65535 & m } function bit_rol(d, _) { return d << _ | d >>> 32 - _ }\r\n\r\nvar retryLazy = function (_function, clbk, time) {\r\n if (!time) time = 200;\r\n\r\n var f = function () {\r\n _function(function (result) {\r\n\r\n if (result) {\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n else {\r\n setTimeout(f, time)\r\n }\r\n\r\n })\r\n }\r\n\r\n f();\r\n}\r\n\r\nvar isAndroid = function () {\r\n var ua = navigator.userAgent.toLowerCase();\r\n var isAndroid = ua.indexOf(\"android\") > -1;\r\n\r\n if (isAndroid) {\r\n return true\r\n }\r\n}\r\n\r\nvar isMobile = function () {\r\n return $('html').hasClass('mobile');\r\n}\r\n\r\nvar isTablet = function () {\r\n return $('html').hasClass('mobile') || $('html').hasClass('tablet');\r\n}\r\n\r\nvar slowMade = function (_function, timer, time) {\r\n\r\n if (!time) time = 20\r\n\r\n if (timer)\r\n clearTimeout(timer);\r\n\r\n timer = setTimeout(_function, time);\r\n\r\n return timer;\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nvar trim = function (s) {\r\n return rtrim(ltrim(s));\r\n}\r\n\r\nvar ltrim = function (s) {\r\n return (s || \"\").replace(/^\\s+/, '');\r\n}\r\n\r\nvar rtrim = function (s) {\r\n return (s || \"\").replace(/\\s+$/, '');\r\n}\r\n\r\nvar ltrimrn = function (s) {\r\n return (s || \"\").replace(/^[\\r\\n\\t ]+/, '');\r\n}\r\n\r\nvar rtrimrn = function (s) {\r\n return (s || \"\").replace(/[\\r\\n\\t ]+$/, '');\r\n}\r\n\r\nvar trimrn = function (s) {\r\n return rtrimrn(ltrimrn(s));\r\n}\r\n\r\nvar hexEncode = function (text) {\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 0; i < text.length; i++) {\r\n ch = text.charCodeAt(i);\r\n if (ch > 0xFF) ch -= 0x350;\r\n ch = ch.toString(16);\r\n while (ch.length < 2) ch = \"0\" + ch;\r\n result += ch;\r\n }\r\n return result;\r\n}\r\n\r\nvar stringify = function(e){\r\n\r\n if(!e) return null\r\n\r\n if(e.toString) {\r\n\r\n var s = e.toString()\r\n\r\n if (s != '[object Object]')\r\n return s\r\n }\r\n\r\n if(_.isObject(e)) return JSON.stringify(e)\r\n\r\n return e\r\n}\r\n\r\nvar hexstorage = {}\r\n\r\n\r\nvar hexDecode = function (hex) {\r\n\r\n if (hexstorage[hex]) return hexstorage[hex]\r\n\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 2; i <= hex.length; i += 2) {\r\n ch = parseInt(hex.substring(i - 2, i), 16);\r\n if (ch >= 128) ch += 0x350;\r\n ch = String.fromCharCode(\"0x\" + ch.toString(16));\r\n result += ch;\r\n }\r\n\r\n hexstorage[hex] = result\r\n\r\n return result;\r\n}\r\nvar imgDimensions = function (data) {\r\n let img = new Image()\r\n img.src = data.base64\r\n data.width = img.width\r\n data.height = img.height\r\n return data\r\n}\r\n\r\nvar knsites = ['bastyon.com', 'pocketnet.app', 'zoom.us', 'youtube', 'facebook', 'instagram', 'vk.com', 'twitter', 'pinterest', 'vimeo', 'ask.fm', 'change.org', 'wikipedia', 'livejournal', 'linkedin', 'myspace', 'reddit', 'tumblr', 'ok.ru', 'flickr', 'google', 'yandex', 'yahoo', 'bing', 'gmail', 'mail']\r\n\r\nvar knsite = function (url) {\r\n return _.find(knsites, function (u) {\r\n return url.indexOf(u) > -1\r\n })\r\n}\r\n\r\nvar getUrl = function (data) {\r\n\r\n /*if(!linkify){\r\n linkify = require('linkifyjs');\r\n linkify.registerCustomProtocol('pocketnet')\r\n linkify.registerCustomProtocol('bastyon')\r\n }*/\r\n\r\n var links = linkify.find(data)\r\n\r\n if (links.length) {\r\n return links[0].href\r\n }\r\n}\r\nvar getTxt = function (data) {\r\n return data.replace(/\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/g, '')\r\n}\r\nvar getmatrixid = function (str) {\r\n return str.split(\":\")[0].replace(\"@\", '')\r\n}\r\nvar getMatrixIdFull = function (id, domain) {\r\n id || (id = '')\r\n\r\n if (id.indexOf(\"@\") == 0) return id\r\n return '@' + id + ':' + domain\r\n}\r\nvar ObjDiff = function (x, y) {\r\n var target = {};\r\n var diffProps = Object.keys(x).filter(function (i) {\r\n return x[i] !== y[i];\r\n\r\n }).map(function (j) {\r\n var obj = {};\r\n obj[j] = x[j];\r\n target = Object.assign(target, obj)\r\n });\r\n return target;\r\n}\r\nvar filterByUserId = function (arr, data) {\r\n var a = arr.map(function (e) {\r\n return e.id;\r\n });\r\n var d = data.map(function (e) {\r\n return e.id;\r\n });\r\n\r\n var x = [];\r\n a.forEach(function (e) {\r\n x.push(data[d.indexOf(e)]);\r\n });\r\n\r\n return x;\r\n}\r\nvar formatBytes = function (bytes, decimals = 2) {\r\n if (bytes === 0) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\r\n}\r\n\r\nvar poketnetUrlParser = function (url) {\r\n var newURL = new URL(url)\r\n return {\r\n post: newURL.searchParams.get('s'),\r\n user: newURL.pathname.replace('/', ''),\r\n }\r\n}\r\n\r\n// Takes a url and returns another one that fits into iframe\r\nvar videoUrlParser = function (url) {\r\n var youtube_host = ['www.youtube.com', 'youtube.com', 'youtu.be']\r\n var vimeo_host = ['www.vimeo.com', 'vimeo.com']\r\n var peertube_host = ['peer.tube', 'peertube.social']\r\n\r\n var newURL = new URL(url)\r\n\r\n if (youtube_host.indexOf(newURL.hostname) > -1) return `https://www.youtube.com/embed/${newURL.searchParams.get('v')}`\r\n if (vimeo_host.indexOf(newURL.hostname) > -1) return `https://player.vimeo.com/video${newURL.pathname}`\r\n if (peertube_host.indexOf(newURL.hostname) > -1) return `https://pocketnetpeertube1.nohost.me/${newURL.pathname.replace('watch', 'embed')}`\r\n}\r\n\r\n// Cuts string if its length longer than 'lenght'\r\nvar textFormatter = function (text, length) {\r\n return text.slice(0, length) + `...`\r\n}\r\n\r\n// takes a text and returns it without url in it\r\nvar urlSeparator = function (text) {\r\n var url = getUrl(text)\r\n return text.replace(url, \"\")\r\n}\r\n\r\n// takes a timestamp and turns it into a string like `Dec 25, 2000 at 2:15 PM`\r\nvar dateParser = function (data) {\r\n var parsedDate = new Date(data * 1000)\r\n\r\n var year = parsedDate.getFullYear()\r\n var month = parsedDate.getMonth()\r\n var day = parsedDate.getDate()\r\n\r\n var meridian = parsedDate.getHours() > 13 ? `PM` : `AM`\r\n var hour = parsedDate.getHours() > 13 ? parsedDate.getHours() - 12 : parsedDate.getHours()\r\n var minutes = parsedDate.getMinutes() < 10 ? `0${parsedDate.getMinutes()}` : parsedDate.getMinutes()\r\n\r\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\r\n\r\n return `${months[month]} ${day}, ${year} at ${hour}:${minutes} ${meridian}`\r\n}\r\n\r\n// calculates rating and returns star icons\r\nvar setRating = function (total_score, votes) {\r\n\r\n var average_score = total_score / votes\r\n\r\n var full_star = ``\r\n var half_star = ``\r\n var emply_star = ``\r\n\r\n var rating = [``, ``, ``, ``, ``]\r\n\r\n if (total_score === 0) {\r\n return rating.map(item => item = emply_star)\r\n }\r\n\r\n return rating.map(item => {\r\n if (average_score >= 1) {\r\n average_score--\r\n return item = full_star\r\n }\r\n if (average_score < 1 && average_score >= 0.5) {\r\n average_score--\r\n return item = half_star\r\n }\r\n if (average_score < 0.5) {\r\n average_score--\r\n return item = emply_star\r\n }\r\n })\r\n}\r\n\r\n// Indicates whether an object is on at least 80% within viewport or not\r\nvar isVisible = function (element) {\r\n var topY = element.getBoundingClientRect().top\r\n var bottomY = element.getBoundingClientRect().bottom\r\n var window_height = document.documentElement.clientHeight\r\n var elem_height = bottomY - topY\r\n\r\n var isVisibleOnTop = bottomY >= elem_height * 0.8\r\n var isVisibleOnbottom = bottomY <= window_height + elem_height * 0.2\r\n\r\n if (isVisibleOnTop && isVisibleOnbottom) return true\r\n else return false\r\n}\r\nvar _arrayBufferToBase64 = function (buffer) {\r\n var binary = '';\r\n var bytes = new Uint8Array(buffer);\r\n var len = bytes.byteLength;\r\n for (var i = 0; i < len; i++) {\r\n binary += String.fromCharCode(bytes[i]);\r\n }\r\n return window.btoa(binary);\r\n}\r\n\r\nvar _base64ToArrayBuffer = function (base64) {\r\n var binary_string = window.atob(base64);\r\n var len = binary_string.length;\r\n var bytes = new Uint8Array(len);\r\n for (var i = 0; i < len; i++) {\r\n bytes[i] = binary_string.charCodeAt(i);\r\n }\r\n return bytes.buffer;\r\n}\r\n\r\nvar Base64 = {\r\n // private property\r\n _keyStr: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\r\n\r\n // public method for encoding\r\n encode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = Base64._utf8_encode(input);\r\n\r\n while (i < input.length) {\r\n\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output +\r\n Base64._keyStr.charAt(enc1) + Base64._keyStr.charAt(enc2) +\r\n Base64._keyStr.charAt(enc3) + Base64._keyStr.charAt(enc4);\r\n\r\n }\r\n\r\n return output;\r\n },\r\n\r\n // public method for decoding\r\n decode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3;\r\n var enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\r\n\r\n while (i < input.length) {\r\n\r\n enc1 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc2 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc3 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc4 = Base64._keyStr.indexOf(input.charAt(i++));\r\n\r\n chr1 = (enc1 << 2) | (enc2 >> 4);\r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\r\n chr3 = ((enc3 & 3) << 6) | enc4;\r\n\r\n output = output + String.fromCharCode(chr1);\r\n\r\n if (enc3 != 64) {\r\n output = output + String.fromCharCode(chr2);\r\n }\r\n if (enc4 != 64) {\r\n output = output + String.fromCharCode(chr3);\r\n }\r\n\r\n }\r\n\r\n output = Base64._utf8_decode(output);\r\n\r\n return output;\r\n\r\n },\r\n\r\n // private method for UTF-8 encoding\r\n _utf8_encode: function (string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < string.length; n++) {\r\n\r\n var c = string.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n\r\n }\r\n\r\n return utftext;\r\n },\r\n\r\n // private method for UTF-8 decoding\r\n _utf8_decode: function (utftext) {\r\n var string = \"\";\r\n var i = 0;\r\n var c = 0, c1 = 0, c2 = 0;\r\n\r\n while (i < utftext.length) {\r\n\r\n c = utftext.charCodeAt(i);\r\n\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n }\r\n else if ((c > 191) && (c < 224)) {\r\n c2 = utftext.charCodeAt(i + 1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n }\r\n else {\r\n c2 = utftext.charCodeAt(i + 1);\r\n c3 = utftext.charCodeAt(i + 2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n\r\n }\r\n return string;\r\n },\r\n\r\n fromFile: file => new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n\r\n reader.readAsDataURL(file);\r\n reader.onloadend = () => resolve(reader.result);\r\n reader.onerror = error => reject(error);\r\n }),\r\n\r\n toFileFetch: function (base64) {\r\n return fetch(base64).then(res => {\r\n return res.blob()\r\n }).then(blob => {\r\n return new (window.wFile || window.File)([blob], \"File name\", { type: \"image/png\" })\r\n })\r\n },\r\n\r\n toFile: function (base64) {\r\n\r\n try {\r\n var arr = base64.split(','),\r\n mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]),\r\n n = bstr.length,\r\n u8arr = new Uint8Array(n);\r\n\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n var file = new (window.wFile || window.File)([u8arr], \"Filename\", { type: mime });\r\n\r\n return Promise.resolve(file)\r\n }\r\n catch (e) {\r\n return Promise.reject(e)\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nf.copyArrayBuffer = function(src){\r\n var dst = new ArrayBuffer(src.byteLength);\r\n new Uint8Array(dst).set(new Uint8Array(src));\r\n return dst;\r\n}\r\n\r\nf.readFile = function (file) {\r\n\r\n let reader = new FileReader();\r\n\r\n reader.readAsArrayBuffer(file);\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n reader.onload = function () {\r\n resolve(reader.result);\r\n };\r\n\r\n reader.onerror = function () {\r\n reject(reader.error);\r\n };\r\n })\r\n}\r\n\r\nf.fetchLocal = function (url) {\r\n\r\n\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest\r\n\r\n xhr.onload = function () {\r\n\r\n var type = xhr.getResponseHeader('content-type')\r\n\r\n\r\n resolve({\r\n data: new Blob([xhr.response], { type: type, name: 'file' })\r\n })\r\n\r\n // resolve()\r\n }\r\n\r\n xhr.onerror = function (e) {\r\n console.error(e, url)\r\n reject(new TypeError('Local request failed'))\r\n }\r\n\r\n xhr.open('GET', url)\r\n xhr.responseType = \"arraybuffer\";\r\n xhr.send(null)\r\n })\r\n};\r\n\r\n\r\n\r\nf.saveFileCordova = function(file, name, clbk, todownloads){\r\n\r\n var storageLocation = \"\";\r\n\r\n switch (device.platform) {\r\n case \"Android\":\r\n storageLocation = 'file:///storage/emulated/0/'; //LocalFileSystem.PERSISTENT\r\n break;\r\n case \"iOS\":\r\n storageLocation = cordova.file.cacheDirectory;\r\n break;\r\n }\r\n\r\n\r\n var onsuccess = function (fileSystem) {\r\n\r\n fileSystem.getDirectory('Download', { exclusive: false }, function (directory) {\r\n\r\n directory.getFile(name, { create: true, exclusive: false }, function (entry) {\r\n // After you save the file, you can access it with this URL\r\n var myFileUrl = entry.toURL();\r\n\r\n\r\n entry.createWriter(function (writer) {\r\n\r\n writer.onwriteend = function (evt) {\r\n //sitemessage(\"File \" + name + \" successfully downloaded\");\r\n\r\n if (window.galleryRefresh){\r\n\r\n window.galleryRefresh.refresh(myFileUrl, function (msg) {\r\n\r\n }, function (err) {\r\n\r\n\r\n })\r\n\r\n }\r\n\r\n if (clbk)\r\n clbk({\r\n name,\r\n url : myFileUrl\r\n })\r\n };\r\n\r\n writer.onerror = function (e) {\r\n\r\n if (clbk)\r\n clbk(null, e)\r\n\r\n };\r\n\r\n // Write to the file\r\n writer.seek(0);\r\n\r\n writer.write(file);\r\n\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file writer, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n\r\n })\r\n }\r\n\r\n var onerror = function (evt) {\r\n if(clbk) clbk(null, evt)\r\n }\r\n \r\n if(todownloads){\r\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){\r\n\r\n\r\n onsuccess(fileSystem.root)\r\n }, onerror)\r\n }\r\n else{\r\n window.resolveLocalFileSystemURL(storageLocation, onsuccess, onerror)\r\n }\r\n\r\n}\r\n\r\nfunction iOS() {\r\n return [\r\n 'iPad Simulator',\r\n 'iPhone Simulator',\r\n 'iPod Simulator',\r\n 'iPad',\r\n 'iPhone',\r\n 'iPod'\r\n ].includes(navigator.platform)\r\n // iPad on iOS 13 detection\r\n || (navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document)\r\n}\r\n\r\nf.isios = function () {\r\n return (window.cordova && window.device && deep(window, 'device.platform') == 'iOS') || iOS()\r\n}\r\n\r\nf.now = function (date) {\r\n var now = date || (new Date);\r\n var UTCseconds = (now.getTime() + now.getTimezoneOffset() * 60 * 1000);\r\n var d = new Date(UTCseconds);\r\n d.toString();\r\n\r\n return d\r\n}\r\n\r\nf.date = {\r\n addseconds: function (now, seconds) {\r\n if (!now) now = new Date\r\n\r\n var ntime = now.getTime() + seconds * 1000\r\n var d = new Date(ntime);\r\n\r\n return d\r\n }\r\n}\r\n\r\nf.getservers = function(arr, mult, address) {\r\n\r\n if(!arr.length) return []\r\n\r\n mult || (mult = 1)\r\n\r\n if(mult > arr.length) mult = arr.length\r\n\r\n var mutations = f.permutations(arr, mult);\r\n\r\n var index = f.helpers.base58.decode(address) % mutations.length;\r\n\r\n return mutations[index]\r\n}\r\n\r\nf.helpers = {\r\n base58: {\r\n ALPHABET: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',\r\n ALPHABET_MAP: {},\r\n i: 0,\r\n\r\n encode(buffer) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var carry, digits, j;\r\n if (buffer.length === 0) {\r\n return '';\r\n }\r\n i = void 0;\r\n j = void 0;\r\n digits = [0];\r\n i = 0;\r\n while (i < buffer.length) {\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] <<= 8;\r\n j++;\r\n }\r\n digits[0] += buffer[i];\r\n carry = 0;\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] += carry;\r\n carry = (digits[j] / 58) | 0;\r\n digits[j] %= 58;\r\n ++j;\r\n }\r\n while (carry) {\r\n digits.push(carry % 58);\r\n carry = (carry / 58) | 0;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (buffer[i] === 0 && i < buffer.length - 1) {\r\n digits.push(0);\r\n i++;\r\n }\r\n return digits\r\n .reverse()\r\n .map(function (digit) {\r\n return ALPHABET[digit];\r\n })\r\n .join('');\r\n },\r\n\r\n decode(string) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var bytes, c, carry, j;\r\n if (string.length === 0) {\r\n return new (\r\n typeof Uint8Array !== 'undefined' && Uint8Array !== null\r\n ? Uint8Array\r\n : Buffer\r\n )(0);\r\n }\r\n i = void 0;\r\n j = void 0;\r\n bytes = [0];\r\n i = 0;\r\n while (i < string.length) {\r\n c = string[i];\r\n if (!(c in ALPHABET_MAP)) {\r\n throw (\r\n \"Base58.decode received unacceptable input. Character '\" +\r\n c +\r\n \"' is not in the Base58 alphabet.\"\r\n );\r\n }\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] *= 58;\r\n j++;\r\n }\r\n bytes[0] += ALPHABET_MAP[c];\r\n carry = 0;\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] += carry;\r\n carry = bytes[j] >> 8;\r\n bytes[j] &= 0xff;\r\n ++j;\r\n }\r\n while (carry) {\r\n bytes.push(carry & 0xff);\r\n carry >>= 8;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (string[i] === '1' && i < string.length - 1) {\r\n bytes.push(0);\r\n i++;\r\n }\r\n\r\n const outputArray = new Uint8Array(bytes.reverse());\r\n\r\n let buffer = Buffer.from(outputArray);\r\n return buffer.readUIntBE(0, outputArray.length);\r\n },\r\n },\r\n};\r\n\r\nf.getCaretPosition = function(ctrl){\r\n // IE < 9 Support \r\n if (document.selection) {\r\n ctrl.focus();\r\n var range = document.selection.createRange();\r\n var rangelen = range.text.length;\r\n range.moveStart('character', -ctrl.value.length);\r\n var start = range.text.length - rangelen;\r\n return {\r\n 'start': start,\r\n 'end': start + rangelen\r\n };\r\n } // IE >=9 and other browsers\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\r\n return {\r\n 'start': ctrl.selectionStart,\r\n 'end': ctrl.selectionEnd\r\n };\r\n } else {\r\n return {\r\n 'start': 0,\r\n 'end': 0\r\n };\r\n }\r\n}\r\n\r\nf.setCaretPosition = function(ctrl, start, end) {\r\n // IE >= 9 and other browsers\r\n if (ctrl.setSelectionRange) {\r\n ctrl.focus();\r\n ctrl.setSelectionRange(start, end);\r\n }\r\n // IE < 9 \r\n else if (ctrl.createTextRange) {\r\n var range = ctrl.createTextRange();\r\n range.collapse(true);\r\n range.moveEnd('character', end);\r\n range.moveStart('character', start);\r\n range.select();\r\n }\r\n}\r\n\r\nf.ObjDiff = ObjDiff\r\nf._arrayBufferToBase64 = _arrayBufferToBase64\r\nf._base64ToArrayBuffer = _base64ToArrayBuffer\r\nf.Base64 = Base64\r\nf.getmatrixid = getmatrixid\r\nf.getMatrixIdFull = getMatrixIdFull\r\nf.formatBytes = formatBytes\r\nf.filterByUserId = filterByUserId\r\nf.trim = trim\r\nf.isAndroid = isAndroid\r\nf.isMobile = isMobile\r\nf.isTablet = isTablet\r\nf.rand = rand\r\nf.group = group\r\nf.flball = flball\r\nf.flb = flb\r\nf.flbs = flbs\r\nf.flbb = flbb\r\nf.makeid = makeid\r\nf.scrollTo = _scrollTo\r\nf.stringEq = stringEq\r\nf.pretry = pretry\r\nf.retry = retry\r\nf.retryLazy = retryLazy\r\nf.slowMade = slowMade\r\nf.renderFrameEqualizer = renderFrameEqualizer\r\nf.hexEncode = hexEncode\r\nf.hexDecode = hexDecode\r\nf.imgDimensions = imgDimensions\r\nf.getUrl = getUrl\r\nf.getTxt = getTxt\r\nf.poketnetUrlParser = poketnetUrlParser\r\nf.textFormatter = textFormatter\r\nf.urlSeparator = urlSeparator\r\nf.dateParser = dateParser\r\nf.setRating = setRating\r\nf.videoUrlParser = videoUrlParser\r\nf.isVisible = isVisible\r\nf.copytext = copytext\r\nf.md5 = md5\r\nf.knsite = knsite\r\nf.stringify = stringify\r\nexport default f","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","import listToStyles from './listToStyles'\n\nexport default function addStylesToShadowDOM (parentId, list, shadowRoot) {\n var styles = listToStyles(parentId, list)\n addStyles(styles, shadowRoot)\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nfunction addStyles (styles /* Array */, shadowRoot) {\n const injectedStyles =\n shadowRoot._injectedStyles ||\n (shadowRoot._injectedStyles = {})\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i]\n var style = injectedStyles[item.id]\n if (!style) {\n for (var j = 0; j < item.parts.length; j++) {\n addStyle(item.parts[j], shadowRoot)\n }\n injectedStyles[item.id] = true\n }\n }\n}\n\nfunction createStyleElement (shadowRoot) {\n var styleElement = document.createElement('style')\n styleElement.type = 'text/css'\n shadowRoot.appendChild(styleElement)\n return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */, shadowRoot) {\n var styleElement = createStyleElement(shadowRoot)\n var css = obj.css\n var media = obj.media\n var sourceMap = obj.sourceMap\n\n if (media) {\n styleElement.setAttribute('media', media)\n }\n\n if (sourceMap) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n }\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild)\n }\n styleElement.appendChild(document.createTextNode(css))\n }\n}\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.AutoDiscovery = void 0;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _url = require(\"url\");\r\n\r\n/*\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/** @module auto-discovery */\r\n// Dev note: Auto discovery is part of the spec.\r\n// See: https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery\r\n\r\n/**\r\n * Description for what an automatically discovered client configuration\r\n * would look like. Although this is a class, it is recommended that it\r\n * be treated as an interface definition rather than as a class.\r\n *\r\n * Additional properties than those defined here may be present, and\r\n * should follow the Java package naming convention.\r\n */\r\nclass DiscoveredClientConfig {\r\n // eslint-disable-line no-unused-vars\r\n // Dev note: this is basically a copy/paste of the .well-known response\r\n // object as defined in the spec. It does have additional information,\r\n // however. Overall, this exists to serve as a place for documentation\r\n // and not functionality.\r\n // See https://matrix.org/docs/spec/client_server/r0.4.0.html#get-well-known-matrix-client\r\n constructor() {\r\n /**\r\n * The homeserver configuration the client should use. This will\r\n * always be present on the object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n this[\"m.homeserver\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey. Additionally,\r\n * if this is not AutoDiscovery.SUCCESS then the client should\r\n * assume the other properties in the client config (such as\r\n * the identity server configuration) are not valid.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * If the state is AutoDiscovery.FAIL_ERROR or .FAIL_PROMPT\r\n * then this will contain a human-readable (English) message\r\n * for what went wrong. If the state is none of those previously\r\n * mentioned, this will be falsey.\r\n */\r\n error: \"Something went wrong\",\r\n\r\n /**\r\n * The base URL clients should use to talk to the homeserver,\r\n * particularly for the login process. May be falsey if the\r\n * state is not AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://matrix.org\"\r\n };\r\n /**\r\n * The identity server configuration the client should use. This\r\n * will always be present on teh object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n\r\n this[\"m.identity_server\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * The base URL clients should use for interacting with the\r\n * identity server. May be falsey if the state is not\r\n * AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://vector.im\"\r\n };\r\n }\r\n\r\n}\r\n/**\r\n * Utilities for automatically discovery resources, such as homeservers\r\n * for users to log in to.\r\n */\r\n\r\n\r\nclass AutoDiscovery {\r\n // Dev note: the constants defined here are related to but not\r\n // exactly the same as those in the spec. This is to hopefully\r\n // translate the meaning of the states in the spec, but also\r\n // support our own if needed.\r\n static get ERROR_INVALID() {\r\n return \"Invalid homeserver discovery response\";\r\n }\r\n\r\n static get ERROR_GENERIC_FAILURE() {\r\n return \"Failed to get autodiscovery configuration from server\";\r\n }\r\n\r\n static get ERROR_INVALID_HS_BASE_URL() {\r\n return \"Invalid base_url for m.homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_HOMESERVER() {\r\n return \"Homeserver URL does not appear to be a valid Matrix homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_IS_BASE_URL() {\r\n return \"Invalid base_url for m.identity_server\";\r\n }\r\n\r\n static get ERROR_INVALID_IDENTITY_SERVER() {\r\n return \"Identity server URL does not appear to be a valid identity server\";\r\n }\r\n\r\n static get ERROR_INVALID_IS() {\r\n return \"Invalid identity server discovery response\";\r\n }\r\n\r\n static get ERROR_MISSING_WELLKNOWN() {\r\n return \"No .well-known JSON file found\";\r\n }\r\n\r\n static get ERROR_INVALID_JSON() {\r\n return \"Invalid JSON\";\r\n }\r\n\r\n static get ALL_ERRORS() {\r\n return [AutoDiscovery.ERROR_INVALID, AutoDiscovery.ERROR_GENERIC_FAILURE, AutoDiscovery.ERROR_INVALID_HS_BASE_URL, AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IS_BASE_URL, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, AutoDiscovery.ERROR_INVALID_IS, AutoDiscovery.ERROR_MISSING_WELLKNOWN, AutoDiscovery.ERROR_INVALID_JSON];\r\n }\r\n /**\r\n * The auto discovery failed. The client is expected to communicate\r\n * the error to the user and refuse logging in.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_ERROR() {\r\n return \"FAIL_ERROR\";\r\n }\r\n /**\r\n * The auto discovery failed, however the client may still recover\r\n * from the problem. The client is recommended to that the same\r\n * action it would for PROMPT while also warning the user about\r\n * what went wrong. The client may also treat this the same as\r\n * a FAIL_ERROR state.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_PROMPT() {\r\n return \"FAIL_PROMPT\";\r\n }\r\n /**\r\n * The auto discovery didn't fail but did not find anything of\r\n * interest. The client is expected to prompt the user for more\r\n * information, or fail if it prefers.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get PROMPT() {\r\n return \"PROMPT\";\r\n }\r\n /**\r\n * The auto discovery was successful.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get SUCCESS() {\r\n return \"SUCCESS\";\r\n }\r\n /**\r\n * Validates and verifies client configuration information for purposes\r\n * of logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be included, and will be transparently brought into the\r\n * response object unaltered.\r\n * @param {string} wellknown The configuration object itself, as returned\r\n * by the .well-known auto-discovery endpoint.\r\n * @return {Promise} Resolves to the verified\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when verification fails.\r\n */\r\n\r\n\r\n static async fromDiscoveryConfig(wellknown) {\r\n // Step 1 is to get the config, which is provided to us here.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n };\r\n\r\n if (!wellknown || !wellknown[\"m.homeserver\"]) {\r\n _logger.logger.error(\"No m.homeserver key in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n return Promise.resolve(clientConfig);\r\n }\r\n\r\n if (!wellknown[\"m.homeserver\"][\"base_url\"]) {\r\n _logger.logger.error(\"No m.homeserver base_url in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Make sure the homeserver URL is valid *looking*. We'll make\r\n // sure it points to a homeserver in Step 3.\r\n\r\n\r\n const hsUrl = this._sanitizeWellKnownUrl(wellknown[\"m.homeserver\"][\"base_url\"]);\r\n\r\n if (!hsUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.homeserver\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 3: Make sure the homeserver URL points to a homeserver.\r\n\r\n\r\n const hsVersions = await this._fetchWellKnownObject(`${hsUrl}/_matrix/client/versions`);\r\n\r\n if (!hsVersions || !hsVersions.raw[\"versions\"]) {\r\n _logger.logger.error(\"Invalid /versions response\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER; // Supply the base_url to the caller because they may be ignoring liveliness\r\n // errors, like this one.\r\n\r\n clientConfig[\"m.homeserver\"].base_url = hsUrl;\r\n return Promise.resolve(clientConfig);\r\n } // Step 4: Now that the homeserver looks valid, update our client config.\r\n\r\n\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: hsUrl\r\n }; // Step 5: Try to pull out the identity server configuration\r\n\r\n let isUrl = \"\";\r\n\r\n if (wellknown[\"m.identity_server\"]) {\r\n // We prepare a failing identity server response to save lines later\r\n // in this branch.\r\n const failingClientConfig = {\r\n \"m.homeserver\": clientConfig[\"m.homeserver\"],\r\n \"m.identity_server\": {\r\n state: AutoDiscovery.FAIL_PROMPT,\r\n error: AutoDiscovery.ERROR_INVALID_IS,\r\n base_url: null\r\n }\r\n }; // Step 5a: Make sure the URL is valid *looking*. We'll make sure it\r\n // points to an identity server in Step 5b.\r\n\r\n isUrl = this._sanitizeWellKnownUrl(wellknown[\"m.identity_server\"][\"base_url\"]);\r\n\r\n if (!isUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.identity_server\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IS_BASE_URL;\r\n return Promise.resolve(failingClientConfig);\r\n } // Step 5b: Verify there is an identity server listening on the provided\r\n // URL.\r\n\r\n\r\n const isResponse = await this._fetchWellKnownObject(`${isUrl}/_matrix/identity/api/v1`);\r\n\r\n if (!isResponse || !isResponse.raw || isResponse.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"Invalid /api/v1 response\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER; // Supply the base_url to the caller because they may be ignoring\r\n // liveliness errors, like this one.\r\n\r\n failingClientConfig[\"m.identity_server\"].base_url = isUrl;\r\n return Promise.resolve(failingClientConfig);\r\n }\r\n } // Step 6: Now that the identity server is valid, or never existed,\r\n // populate the IS section.\r\n\r\n\r\n if (isUrl && isUrl.length > 0) {\r\n clientConfig[\"m.identity_server\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: isUrl\r\n };\r\n } // Step 7: Copy any other keys directly into the clientConfig. This is for\r\n // things like custom configuration of services.\r\n\r\n\r\n Object.keys(wellknown).map(k => {\r\n if (k === \"m.homeserver\" || k === \"m.identity_server\") {\r\n // Only copy selected parts of the config to avoid overwriting\r\n // properties computed by the validation logic above.\r\n const notProps = [\"error\", \"state\", \"base_url\"];\r\n\r\n for (const prop of Object.keys(wellknown[k])) {\r\n if (notProps.includes(prop)) continue;\r\n clientConfig[k][prop] = wellknown[k][prop];\r\n }\r\n } else {\r\n // Just copy the whole thing over otherwise\r\n clientConfig[k] = wellknown[k];\r\n }\r\n }); // Step 8: Give the config to the caller (finally)\r\n\r\n return Promise.resolve(clientConfig);\r\n }\r\n /**\r\n * Attempts to automatically discover client configuration information\r\n * prior to logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be discovered, and will be transparently included in the\r\n * response object unaltered.\r\n * @param {string} domain The homeserver domain to perform discovery\r\n * on. For example, \"matrix.org\".\r\n * @return {Promise} Resolves to the discovered\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when discovery fails.\r\n */\r\n\r\n\r\n static async findClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n } // We use a .well-known lookup for all cases. According to the spec, we\r\n // can do other discovery mechanisms if we want such as custom lookups\r\n // however we won't bother with that here (mostly because the spec only\r\n // supports .well-known right now).\r\n //\r\n // By using .well-known, we need to ensure we at least pull out a URL\r\n // for the homeserver. We don't really need an identity server configuration\r\n // but will return one anyways (with state PROMPT) to make development\r\n // easier for clients. If we can't get a homeserver URL, all bets are\r\n // off on the rest of the config and we'll assume it is invalid too.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n\r\n\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n }; // Step 1: Actually request the .well-known JSON file and make sure it\r\n // at least has a homeserver definition.\r\n\r\n const wellknown = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n\r\n if (!wellknown || wellknown.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"No response or error when parsing .well-known\");\r\n\r\n if (wellknown.reason) _logger.logger.error(wellknown.reason);\r\n\r\n if (wellknown.action === \"IGNORE\") {\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n };\r\n } else {\r\n // this can only ever be FAIL_PROMPT at this point.\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n }\r\n\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Validate and parse the config\r\n\r\n\r\n return AutoDiscovery.fromDiscoveryConfig(wellknown.raw);\r\n }\r\n /**\r\n * Gets the raw discovery client configuration for the given domain name.\r\n * Should only be used if there's no validation to be done on the resulting\r\n * object, otherwise use findClientConfig().\r\n * @param {string} domain The domain to get the client config for.\r\n * @returns {Promise} Resolves to the domain's client config. Can\r\n * be an empty object.\r\n */\r\n\r\n\r\n static async getRawClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n }\r\n\r\n const response = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n if (!response) return {};\r\n return response.raw || {};\r\n }\r\n /**\r\n * Sanitizes a given URL to ensure it is either an HTTP or HTTP URL and\r\n * is suitable for the requirements laid out by .well-known auto discovery.\r\n * If valid, the URL will also be stripped of any trailing slashes.\r\n * @param {string} url The potentially invalid URL to sanitize.\r\n * @return {string|boolean} The sanitized URL or a falsey value if the URL is invalid.\r\n * @private\r\n */\r\n\r\n\r\n static _sanitizeWellKnownUrl(url) {\r\n if (!url) return false;\r\n\r\n try {\r\n // We have to try and parse the URL using the NodeJS URL\r\n // library if we're on NodeJS and use the browser's URL\r\n // library when we're in a browser. To accomplish this, we\r\n // try the NodeJS version first and fall back to the browser.\r\n let parsed = null;\r\n\r\n try {\r\n if (_url.URL) parsed = new _url.URL(url);else parsed = new URL(url);\r\n } catch (e) {\r\n parsed = new URL(url);\r\n }\r\n\r\n if (!parsed || !parsed.hostname) return false;\r\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return false;\r\n const port = parsed.port ? `:${parsed.port}` : \"\";\r\n const path = parsed.pathname ? parsed.pathname : \"\";\r\n let saferUrl = `${parsed.protocol}//${parsed.hostname}${port}${path}`;\r\n\r\n if (saferUrl.endsWith(\"/\")) {\r\n saferUrl = saferUrl.substring(0, saferUrl.length - 1);\r\n }\r\n\r\n return saferUrl;\r\n } catch (e) {\r\n _logger.logger.error(e);\r\n\r\n return false;\r\n }\r\n }\r\n /**\r\n * Fetches a JSON object from a given URL, as expected by all .well-known\r\n * related lookups. If the server gives a 404 then the `action` will be\r\n * IGNORE. If the server returns something that isn't JSON, the `action`\r\n * will be FAIL_PROMPT. For any other failure the `action` will be FAIL_PROMPT.\r\n *\r\n * The returned object will be a result of the call in object form with\r\n * the following properties:\r\n * raw: The JSON object returned by the server.\r\n * action: One of SUCCESS, IGNORE, or FAIL_PROMPT.\r\n * reason: Relatively human readable description of what went wrong.\r\n * error: The actual Error, if one exists.\r\n * @param {string} url The URL to fetch a JSON object from.\r\n * @return {Promise} Resolves to the returned state.\r\n * @private\r\n */\r\n\r\n\r\n static async _fetchWellKnownObject(url) {\r\n return new Promise(function (resolve, reject) {\r\n const request = require(\"./matrix\").getRequest();\r\n\r\n if (!request) throw new Error(\"No request library available\");\r\n request({\r\n method: \"GET\",\r\n uri: url,\r\n timeout: 5000\r\n }, (err, response, body) => {\r\n if (err || response && (response.statusCode < 200 || response.statusCode >= 300)) {\r\n let action = \"FAIL_PROMPT\";\r\n let reason = (err ? err.message : null) || \"General failure\";\r\n\r\n if (response && response.statusCode === 404) {\r\n action = \"IGNORE\";\r\n reason = AutoDiscovery.ERROR_MISSING_WELLKNOWN;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: action,\r\n reason: reason,\r\n error: err\r\n });\r\n return;\r\n }\r\n\r\n try {\r\n resolve({\r\n raw: JSON.parse(body),\r\n action: \"SUCCESS\"\r\n });\r\n } catch (e) {\r\n let reason = AutoDiscovery.ERROR_INVALID;\r\n\r\n if (e.name === \"SyntaxError\") {\r\n reason = AutoDiscovery.ERROR_INVALID_JSON;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: \"FAIL_PROMPT\",\r\n reason: reason,\r\n error: e\r\n });\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.AutoDiscovery = AutoDiscovery;","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"label[data-v-6b3704ba]{display:inline}.likelink[data-v-6b3704ba]{text-decoration:underline;cursor:pointer}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.setNow = setNow;\r\nexports.setTimeout = setTimeout;\r\nexports.clearTimeout = clearTimeout;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* A re-implementation of the javascript callback functions (setTimeout,\r\n * clearTimeout; setInterval and clearInterval are not yet implemented) which\r\n * try to improve handling of large clock jumps (as seen when\r\n * suspending/resuming the system).\r\n *\r\n * In particular, if a timeout would have fired while the system was suspended,\r\n * it will instead fire as soon as possible after resume.\r\n */\r\n// we schedule a callback at least this often, to check if we've missed out on\r\n// some wall-clock time due to being suspended.\r\nconst TIMER_CHECK_PERIOD_MS = 1000; // counter, for making up ids to return from setTimeout\r\n\r\nlet _count = 0; // the key for our callback with the real global.setTimeout\r\n\r\nlet _realCallbackKey; // a sorted list of the callbacks to be run.\r\n// each is an object with keys [runAt, func, params, key].\r\n\r\n\r\nconst _callbackList = []; // var debuglog = logger.log.bind(logger);\r\n\r\nconst debuglog = function () {};\r\n/**\r\n * Replace the function used by this module to get the current time.\r\n *\r\n * Intended for use by the unit tests.\r\n *\r\n * @param {function} [f] function which should return a millisecond counter\r\n *\r\n * @internal\r\n */\r\n\r\n\r\nfunction setNow(f) {\r\n _now = f || Date.now;\r\n}\r\n\r\nlet _now = Date.now;\r\n/**\r\n * reimplementation of window.setTimeout, which will call the callback if\r\n * the wallclock time goes past the deadline.\r\n *\r\n * @param {function} func callback to be called after a delay\r\n * @param {Number} delayMs number of milliseconds to delay by\r\n *\r\n * @return {Number} an identifier for this callback, which may be passed into\r\n * clearTimeout later.\r\n */\r\n\r\nfunction setTimeout(func, delayMs) {\r\n delayMs = delayMs || 0;\r\n\r\n if (delayMs < 0) {\r\n delayMs = 0;\r\n }\r\n\r\n const params = Array.prototype.slice.call(arguments, 2);\r\n const runAt = _now() + delayMs;\r\n const key = _count++;\r\n debuglog(\"setTimeout: scheduling cb\", key, \"at\", runAt, \"(delay\", delayMs, \")\");\r\n const data = {\r\n runAt: runAt,\r\n func: func,\r\n params: params,\r\n key: key\r\n }; // figure out where it goes in the list\r\n\r\n const idx = binarySearch(_callbackList, function (el) {\r\n return el.runAt - runAt;\r\n });\r\n\r\n _callbackList.splice(idx, 0, data);\r\n\r\n _scheduleRealCallback();\r\n\r\n return key;\r\n}\r\n/**\r\n * reimplementation of window.clearTimeout, which mirrors setTimeout\r\n *\r\n * @param {Number} key result from an earlier setTimeout call\r\n */\r\n\r\n\r\nfunction clearTimeout(key) {\r\n if (_callbackList.length === 0) {\r\n return;\r\n } // remove the element from the list\r\n\r\n\r\n let i;\r\n\r\n for (i = 0; i < _callbackList.length; i++) {\r\n const cb = _callbackList[i];\r\n\r\n if (cb.key == key) {\r\n _callbackList.splice(i, 1);\r\n\r\n break;\r\n }\r\n } // iff it was the first one in the list, reschedule our callback.\r\n\r\n\r\n if (i === 0) {\r\n _scheduleRealCallback();\r\n }\r\n} // use the real global.setTimeout to schedule a callback to _runCallbacks.\r\n\r\n\r\nfunction _scheduleRealCallback() {\r\n if (_realCallbackKey) {\r\n global.clearTimeout(_realCallbackKey);\r\n }\r\n\r\n const first = _callbackList[0];\r\n\r\n if (!first) {\r\n debuglog(\"_scheduleRealCallback: no more callbacks, not rescheduling\");\r\n return;\r\n }\r\n\r\n const now = _now();\r\n\r\n const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);\r\n debuglog(\"_scheduleRealCallback: now:\", now, \"delay:\", delayMs);\r\n _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);\r\n}\r\n\r\nfunction _runCallbacks() {\r\n let cb;\r\n\r\n const now = _now();\r\n\r\n debuglog(\"_runCallbacks: now:\", now); // get the list of things to call\r\n\r\n const callbacksToRun = [];\r\n\r\n while (true) {\r\n const first = _callbackList[0];\r\n\r\n if (!first || first.runAt > now) {\r\n break;\r\n }\r\n\r\n cb = _callbackList.shift();\r\n debuglog(\"_runCallbacks: popping\", cb.key);\r\n callbacksToRun.push(cb);\r\n } // reschedule the real callback before running our functions, to\r\n // keep the codepaths the same whether or not our functions\r\n // register their own setTimeouts.\r\n\r\n\r\n _scheduleRealCallback();\r\n\r\n for (let i = 0; i < callbacksToRun.length; i++) {\r\n cb = callbacksToRun[i];\r\n\r\n try {\r\n cb.func.apply(global, cb.params);\r\n } catch (e) {\r\n _logger.logger.error(\"Uncaught exception in callback function\", e.stack || e);\r\n }\r\n }\r\n}\r\n/* search in a sorted array.\r\n *\r\n * returns the index of the last element for which func returns\r\n * greater than zero, or array.length if no such element exists.\r\n */\r\n\r\n\r\nfunction binarySearch(array, func) {\r\n // min is inclusive, max exclusive.\r\n let min = 0;\r\n let max = array.length;\r\n\r\n while (min < max) {\r\n const mid = min + max >> 1;\r\n const res = func(array[mid]);\r\n\r\n if (res > 0) {\r\n // the element at 'mid' is too big; set it as the new max.\r\n max = mid;\r\n } else {\r\n // the element at 'mid' is too small. 'min' is inclusive, so +1.\r\n min = mid + 1;\r\n }\r\n } // presumably, min==max now.\r\n\r\n\r\n return min;\r\n}","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {\r\n request: true,\r\n getRequest: true,\r\n wrapRequest: true,\r\n setCryptoStoreFactory: true,\r\n createClient: true,\r\n ContentHelpers: true,\r\n createNewMatrixCall: true,\r\n setMatrixCallAudioOutput: true,\r\n setMatrixCallAudioInput: true,\r\n setMatrixCallVideoInput: true\r\n};\r\nexports.request = request;\r\nexports.getRequest = getRequest;\r\nexports.wrapRequest = wrapRequest;\r\nexports.setCryptoStoreFactory = setCryptoStoreFactory;\r\nexports.createClient = createClient;\r\nObject.defineProperty(exports, \"createNewMatrixCall\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.createNewMatrixCall;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioOutput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioOutput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioInput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallVideoInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setVideoInput;\r\n }\r\n});\r\nexports.ContentHelpers = void 0;\r\n\r\nvar _memoryCryptoStore = require(\"./crypto/store/memory-crypto-store\");\r\n\r\nObject.keys(_memoryCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memoryCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memoryCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _memory = require(\"./store/memory\");\r\n\r\nObject.keys(_memory).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memory[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memory[key];\r\n }\r\n });\r\n});\r\n\r\nvar _scheduler = require(\"./scheduler\");\r\n\r\nObject.keys(_scheduler).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _scheduler[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _scheduler[key];\r\n }\r\n });\r\n});\r\n\r\nvar _client = require(\"./client\");\r\n\r\nObject.keys(_client).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _client[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _client[key];\r\n }\r\n });\r\n});\r\n\r\nvar _httpApi = require(\"./http-api\");\r\n\r\nObject.keys(_httpApi).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _httpApi[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _httpApi[key];\r\n }\r\n });\r\n});\r\n\r\nvar _autodiscovery = require(\"./autodiscovery\");\r\n\r\nObject.keys(_autodiscovery).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _autodiscovery[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _autodiscovery[key];\r\n }\r\n });\r\n});\r\n\r\nvar _syncAccumulator = require(\"./sync-accumulator\");\r\n\r\nObject.keys(_syncAccumulator).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _syncAccumulator[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _syncAccumulator[key];\r\n }\r\n });\r\n});\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\nObject.keys(_errors).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _errors[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _errors[key];\r\n }\r\n });\r\n});\r\n\r\nvar _event = require(\"./models/event\");\r\n\r\nObject.keys(_event).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _event[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _event[key];\r\n }\r\n });\r\n});\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nObject.keys(_room).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _room[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _room[key];\r\n }\r\n });\r\n});\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nObject.keys(_group).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _group[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _group[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nObject.keys(_eventTimeline).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimeline[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimeline[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimelineSet = require(\"./models/event-timeline-set\");\r\n\r\nObject.keys(_eventTimelineSet).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimelineSet[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimelineSet[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomMember = require(\"./models/room-member\");\r\n\r\nObject.keys(_roomMember).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomMember[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomMember[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomState = require(\"./models/room-state\");\r\n\r\nObject.keys(_roomState).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomState[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomState[key];\r\n }\r\n });\r\n});\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nObject.keys(_user).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _user[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _user[key];\r\n }\r\n });\r\n});\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nObject.keys(_filter).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _filter[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _filter[key];\r\n }\r\n });\r\n});\r\n\r\nvar _timelineWindow = require(\"./timeline-window\");\r\n\r\nObject.keys(_timelineWindow).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _timelineWindow[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _timelineWindow[key];\r\n }\r\n });\r\n});\r\n\r\nvar _interactiveAuth = require(\"./interactive-auth\");\r\n\r\nObject.keys(_interactiveAuth).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _interactiveAuth[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _interactiveAuth[key];\r\n }\r\n });\r\n});\r\n\r\nvar _serviceTypes = require(\"./service-types\");\r\n\r\nObject.keys(_serviceTypes).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _serviceTypes[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _serviceTypes[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddb = require(\"./store/indexeddb\");\r\n\r\nObject.keys(_indexeddb).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddb[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddb[key];\r\n }\r\n });\r\n});\r\n\r\nvar _webstorage = require(\"./store/session/webstorage\");\r\n\r\nObject.keys(_webstorage).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _webstorage[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _webstorage[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddbCryptoStore = require(\"./crypto/store/indexeddb-crypto-store\");\r\n\r\nObject.keys(_indexeddbCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddbCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddbCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _contentRepo = require(\"./content-repo\");\r\n\r\nObject.keys(_contentRepo).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _contentRepo[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _contentRepo[key];\r\n }\r\n });\r\n});\r\n\r\nvar _ContentHelpers = _interopRequireWildcard(require(\"./content-helpers\"));\r\n\r\nexports.ContentHelpers = _ContentHelpers;\r\n\r\nvar _call = require(\"./webrtc/call\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n// expose the underlying request object so different environments can use\r\n// different request libs (e.g. request or browser-request)\r\nlet requestInstance;\r\n/**\r\n * The function used to perform HTTP requests. Only use this if you want to\r\n * use a different HTTP library, e.g. Angular's $http. This should\r\n * be set prior to calling {@link createClient}.\r\n * @param {requestFunction} r The request function to use.\r\n */\r\n\r\nfunction request(r) {\r\n requestInstance = r;\r\n}\r\n/**\r\n * Return the currently-set request function.\r\n * @return {requestFunction} The current request function.\r\n */\r\n\r\n\r\nfunction getRequest() {\r\n return requestInstance;\r\n}\r\n/**\r\n * Apply wrapping code around the request function. The wrapper function is\r\n * installed as the new request handler, and when invoked it is passed the\r\n * previous value, along with the options and callback arguments.\r\n * @param {requestWrapperFunction} wrapper The wrapping function.\r\n */\r\n\r\n\r\nfunction wrapRequest(wrapper) {\r\n const origRequest = requestInstance;\r\n\r\n requestInstance = function (options, callback) {\r\n return wrapper(origRequest, options, callback);\r\n };\r\n}\r\n\r\nlet cryptoStoreFactory = () => new _memoryCryptoStore.MemoryCryptoStore();\r\n/**\r\n * Configure a different factory to be used for creating crypto stores\r\n *\r\n * @param {Function} fac a function which will return a new\r\n * {@link module:crypto.store.base~CryptoStore}.\r\n */\r\n\r\n\r\nfunction setCryptoStoreFactory(fac) {\r\n cryptoStoreFactory = fac;\r\n}\r\n\r\n/**\r\n * Construct a Matrix Client. Similar to {@link module:client.MatrixClient}\r\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\r\n * @param {(Object|string)} opts The configuration options for this client. If\r\n * this is a string, it is assumed to be the base URL. These configuration\r\n * options will be passed directly to {@link module:client.MatrixClient}.\r\n * @param {Object} opts.store If not set, defaults to\r\n * {@link module:store/memory.MemoryStore}.\r\n * @param {Object} opts.scheduler If not set, defaults to\r\n * {@link module:scheduler~MatrixScheduler}.\r\n * @param {requestFunction} opts.request If not set, defaults to the function\r\n * supplied to {@link request} which defaults to the request module from NPM.\r\n *\r\n * @param {module:crypto.store.base~CryptoStore=} opts.cryptoStore\r\n * crypto store implementation. Calls the factory supplied to\r\n * {@link setCryptoStoreFactory} if unspecified; or if no factory has been\r\n * specified, uses a default implementation (indexeddb in the browser,\r\n * in-memory otherwise).\r\n *\r\n * @return {MatrixClient} A new matrix client.\r\n * @see {@link module:client.MatrixClient} for the full list of options for\r\n * opts.\r\n */\r\nfunction createClient(opts) {\r\n if (typeof opts === \"string\") {\r\n opts = {\r\n \"baseUrl\": opts\r\n };\r\n }\r\n\r\n opts.request = opts.request || requestInstance;\r\n opts.store = opts.store || new _memory.MemoryStore({\r\n localStorage: global.localStorage\r\n });\r\n opts.scheduler = opts.scheduler || new _scheduler.MatrixScheduler();\r\n opts.cryptoStore = opts.cryptoStore || cryptoStoreFactory();\r\n return new _client.MatrixClient(opts);\r\n}\r\n/**\r\n * The request function interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will attempt to call this function in order to\r\n * perform an HTTP request.\r\n * @callback requestFunction\r\n * @param {Object} opts The options for this HTTP request.\r\n * @param {string} opts.uri The complete URI.\r\n * @param {string} opts.method The HTTP method.\r\n * @param {Object} opts.qs The query parameters to append to the URI.\r\n * @param {Object} opts.body The JSON-serializable object.\r\n * @param {boolean} opts.json True if this is a JSON request.\r\n * @param {Object} opts._matrix_opts The underlying options set for\r\n * {@link MatrixHttpApi}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * A wrapper for the request function interface.\r\n * @callback requestWrapperFunction\r\n * @param {requestFunction} origRequest The underlying request function being\r\n * wrapped\r\n * @param {Object} opts The options for this HTTP request, given in the same\r\n * form as {@link requestFunction}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * The request callback interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will implement a callback which meets this\r\n * interface in order to handle the HTTP response.\r\n * @callback requestCallback\r\n * @param {Error} err The error if one occurred, else falsey.\r\n * @param {Object} response The HTTP response which consists of\r\n * {statusCode: {Number}, headers: {Object}}\r\n * @param {Object} body The parsed HTTP response body.\r\n */","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.encodeParams = encodeParams;\r\nexports.encodeUri = encodeUri;\r\nexports.map = map;\r\nexports.filter = filter;\r\nexports.keys = keys;\r\nexports.values = values;\r\nexports.forEach = forEach;\r\nexports.findElement = findElement;\r\nexports.removeElement = removeElement;\r\nexports.isFunction = isFunction;\r\nexports.isArray = isArray;\r\nexports.checkObjectHasKeys = checkObjectHasKeys;\r\nexports.checkObjectHasNoAdditionalKeys = checkObjectHasNoAdditionalKeys;\r\nexports.deepCopy = deepCopy;\r\nexports.deepCompare = deepCompare;\r\nexports.extend = extend;\r\nexports.runPolyfills = runPolyfills;\r\nexports.inherits = inherits;\r\nexports.polyfillSuper = polyfillSuper;\r\nexports.isNumber = isNumber;\r\nexports.removeHiddenChars = removeHiddenChars;\r\nexports.escapeRegExp = escapeRegExp;\r\nexports.globToRegexp = globToRegexp;\r\nexports.ensureNoTrailingSlash = ensureNoTrailingSlash;\r\nexports.sleep = sleep;\r\nexports.isNullOrUndefined = isNullOrUndefined;\r\nexports.defer = defer;\r\nexports.promiseMapSeries = promiseMapSeries;\r\nexports.promiseTry = promiseTry;\r\nexports.chunkPromises = chunkPromises;\r\nexports.setCrypto = setCrypto;\r\nexports.getCrypto = getCrypto;\r\n\r\nvar _unhomoglyph = _interopRequireDefault(require(\"unhomoglyph\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module.\r\n * @module utils\r\n */\r\n\r\n/**\r\n * Encode a dictionary of query parameters.\r\n * @param {Object} params A dict of key/values to encode e.g.\r\n * {\"foo\": \"bar\", \"baz\": \"taz\"}\r\n * @return {string} The encoded string e.g. foo=bar&baz=taz\r\n */\r\nfunction encodeParams(params) {\r\n let qs = \"\";\r\n\r\n for (const key in params) {\r\n if (!params.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n qs += \"&\" + encodeURIComponent(key) + \"=\" + encodeURIComponent(params[key]);\r\n }\r\n\r\n return qs.substring(1);\r\n}\r\n/**\r\n * Encodes a URI according to a set of template variables. Variables will be\r\n * passed through encodeURIComponent.\r\n * @param {string} pathTemplate The path with template variables e.g. '/foo/$bar'.\r\n * @param {Object} variables The key/value pairs to replace the template\r\n * variables with. E.g. { \"$bar\": \"baz\" }.\r\n * @return {string} The result of replacing all template variables e.g. '/foo/baz'.\r\n */\r\n\r\n\r\nfunction encodeUri(pathTemplate, variables) {\r\n for (const key in variables) {\r\n if (!variables.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n pathTemplate = pathTemplate.replace(key, encodeURIComponent(variables[key]));\r\n }\r\n\r\n return pathTemplate;\r\n}\r\n/**\r\n * Applies a map function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array with the signature fn(element){...}\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction map(array, fn) {\r\n const results = new Array(array.length);\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n results[i] = fn(array[i]);\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Applies a filter function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array. It should return true to keep the element. The function signature\r\n * looks like fn(element, index, array){...}.\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction filter(array, fn) {\r\n const results = [];\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n results.push(array[i]);\r\n }\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Get the keys for an object. Same as Object.keys().\r\n * @param {Object} obj The object to get the keys for.\r\n * @return {string[]} The keys of the object.\r\n */\r\n\r\n\r\nfunction keys(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(key);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Get the values for an object.\r\n * @param {Object} obj The object to get the values for.\r\n * @return {Array<*>} The values of the object.\r\n */\r\n\r\n\r\nfunction values(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(obj[key]);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Invoke a function for each item in the array.\r\n * @param {Array} array The array.\r\n * @param {Function} fn The function to invoke for each element. Has the\r\n * function signature fn(element, index).\r\n */\r\n\r\n\r\nfunction forEach(array, fn) {\r\n for (let i = 0; i < array.length; i++) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * The findElement() method returns a value in the array, if an element in the array\r\n * satisfies (returns true) the provided testing function. Otherwise undefined\r\n * is returned.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array)\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {*} The first value in the array which returns true for\r\n * the given function.\r\n */\r\n\r\n\r\nfunction findElement(array, fn, reverse) {\r\n let i;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * The removeElement() method removes the first element in the array that\r\n * satisfies (returns true) the provided testing function.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array). Return true to\r\n * remove this element and break.\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {boolean} True if an element was removed.\r\n */\r\n\r\n\r\nfunction removeElement(array, fn, reverse) {\r\n let i;\r\n let removed;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n/**\r\n * Checks if the given thing is a function.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is a function.\r\n */\r\n\r\n\r\nfunction isFunction(value) {\r\n return Object.prototype.toString.call(value) === \"[object Function]\";\r\n}\r\n/**\r\n * Checks if the given thing is an array.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is an array.\r\n */\r\n\r\n\r\nfunction isArray(value) {\r\n return Array.isArray ? Array.isArray(value) : Boolean(value && value.constructor === Array);\r\n}\r\n/**\r\n * Checks that the given object has the specified keys.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} keys The list of keys that 'obj' must have.\r\n * @throws If the object is missing keys.\r\n */\r\n// note using 'keys' here would shadow the 'keys' function defined above\r\n\r\n\r\nfunction checkObjectHasKeys(obj, keys_) {\r\n for (let i = 0; i < keys_.length; i++) {\r\n if (!obj.hasOwnProperty(keys_[i])) {\r\n throw new Error(\"Missing required key: \" + keys_[i]);\r\n }\r\n }\r\n}\r\n/**\r\n * Checks that the given object has no extra keys other than the specified ones.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} allowedKeys The list of allowed key names.\r\n * @throws If there are extra keys.\r\n */\r\n\r\n\r\nfunction checkObjectHasNoAdditionalKeys(obj, allowedKeys) {\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n if (allowedKeys.indexOf(key) === -1) {\r\n throw new Error(\"Unknown key: \" + key);\r\n }\r\n }\r\n}\r\n/**\r\n * Deep copy the given object. The object MUST NOT have circular references and\r\n * MUST NOT have functions.\r\n * @param {Object} obj The object to deep copy.\r\n * @return {Object} A copy of the object without any references to the original.\r\n */\r\n\r\n\r\nfunction deepCopy(obj) {\r\n return JSON.parse(JSON.stringify(obj));\r\n}\r\n/**\r\n * Compare two objects for equality. The objects MUST NOT have circular references.\r\n *\r\n * @param {Object} x The first object to compare.\r\n * @param {Object} y The second object to compare.\r\n *\r\n * @return {boolean} true if the two objects are equal\r\n */\r\n\r\n\r\nfunction deepCompare(x, y) {\r\n // Inspired by\r\n // http://stackoverflow.com/questions/1068834/object-comparison-in-javascript#1144249\r\n // Compare primitives and functions.\r\n // Also check if both arguments link to the same object.\r\n if (x === y) {\r\n return true;\r\n }\r\n\r\n if (typeof x !== typeof y) {\r\n return false;\r\n } // special-case NaN (since NaN !== NaN)\r\n\r\n\r\n if (typeof x === 'number' && isNaN(x) && isNaN(y)) {\r\n return true;\r\n } // special-case null (since typeof null == 'object', but null.constructor\r\n // throws)\r\n\r\n\r\n if (x === null || y === null) {\r\n return x === y;\r\n } // everything else is either an unequal primitive, or an object\r\n\r\n\r\n if (!(x instanceof Object)) {\r\n return false;\r\n } // check they are the same type of object\r\n\r\n\r\n if (x.constructor !== y.constructor || x.prototype !== y.prototype) {\r\n return false;\r\n } // special-casing for some special types of object\r\n\r\n\r\n if (x instanceof RegExp || x instanceof Date) {\r\n return x.toString() === y.toString();\r\n } // the object algorithm works for Array, but it's sub-optimal.\r\n\r\n\r\n if (x instanceof Array) {\r\n if (x.length !== y.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < x.length; i++) {\r\n if (!deepCompare(x[i], y[i])) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n // disable jshint \"The body of a for in should be wrapped in an if\r\n // statement\"\r\n\r\n /* jshint -W089 */\r\n // check that all of y's direct keys are in x\r\n let p;\r\n\r\n for (p in y) {\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n } // finally, compare each of x's keys with y\r\n\r\n\r\n for (p in y) {\r\n // eslint-disable-line guard-for-in\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n\r\n if (!deepCompare(x[p], y[p])) {\r\n return false;\r\n }\r\n }\r\n }\r\n /* jshint +W089 */\r\n\r\n\r\n return true;\r\n}\r\n/**\r\n * Copy properties from one object to another.\r\n *\r\n * All enumerable properties, included inherited ones, are copied.\r\n *\r\n * This is approximately equivalent to ES6's Object.assign, except\r\n * that the latter doesn't copy inherited properties.\r\n *\r\n * @param {Object} target The object that will receive new properties\r\n * @param {...Object} source Objects from which to copy properties\r\n *\r\n * @return {Object} target\r\n */\r\n\r\n\r\nfunction extend(...restParams) {\r\n const target = restParams[0] || {};\r\n\r\n for (let i = 1; i < restParams.length; i++) {\r\n const source = restParams[i];\r\n if (!source) continue;\r\n\r\n for (const propName in source) {\r\n // eslint-disable-line guard-for-in\r\n target[propName] = source[propName];\r\n }\r\n }\r\n\r\n return target;\r\n}\r\n/**\r\n * Run polyfills to add Array.map and Array.filter if they are missing.\r\n */\r\n\r\n\r\nfunction runPolyfills() {\r\n // Array.prototype.filter\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\r\n if (!Array.prototype.filter) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.filter = function (fun,\r\n /*, thisArg*/\r\n ...restProps) {\r\n if (this === void 0 || this === null) {\r\n throw new TypeError();\r\n }\r\n\r\n const t = Object(this);\r\n const len = t.length >>> 0;\r\n\r\n if (typeof fun !== 'function') {\r\n throw new TypeError();\r\n }\r\n\r\n const res = [];\r\n const thisArg = restProps ? restProps[0] : void 0;\r\n\r\n for (let i = 0; i < len; i++) {\r\n if (i in t) {\r\n const val = t[i]; // NOTE: Technically this should Object.defineProperty at\r\n // the next index, as push can be affected by\r\n // properties on Object.prototype and Array.prototype.\r\n // But that method's new, and collisions should be\r\n // rare, so use the more-compatible alternative.\r\n\r\n if (fun.call(thisArg, val, i, t)) {\r\n res.push(val);\r\n }\r\n }\r\n }\r\n\r\n return res;\r\n };\r\n } // Array.prototype.map\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.19\r\n // Reference: http://es5.github.io/#x15.4.4.19\r\n\r\n\r\n if (!Array.prototype.map) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.map = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this|\r\n // value as the argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal\r\n // method of O with the argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== 'function') {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let A be a new array created as if by the expression new Array(len)\r\n // where Array is the standard built-in constructor with that name and\r\n // len is the value of len.\r\n\r\n\r\n const A = new Array(len); // 7. Let k be 0\r\n\r\n k = 0; // 8. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue;\r\n let mappedValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal\r\n // method of O with argument Pk.\r\n kValue = O[k]; // ii. Let mappedValue be the result of calling the Call internal\r\n // method of callback with T as the this value and argument\r\n // list containing kValue, k, and O.\r\n\r\n mappedValue = callback.call(T, kValue, k, O); // iii. Call the DefineOwnProperty internal method of A with arguments\r\n // Pk, Property Descriptor\r\n // { Value: mappedValue,\r\n // Writable: true,\r\n // Enumerable: true,\r\n // Configurable: true },\r\n // and false.\r\n // In browsers that support Object.defineProperty, use the following:\r\n // Object.defineProperty(A, k, {\r\n // value: mappedValue,\r\n // writable: true,\r\n // enumerable: true,\r\n // configurable: true\r\n // });\r\n // For best browser support, use the following:\r\n\r\n A[k] = mappedValue;\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 9. return A\r\n\r\n\r\n return A;\r\n };\r\n } // Array.prototype.forEach\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.18\r\n // Reference: http://es5.github.io/#x15.4.4.18\r\n\r\n\r\n if (!Array.prototype.forEach) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.forEach = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this| value as the\r\n // argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal method of O with the\r\n // argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== \"function\") {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let k be 0\r\n\r\n\r\n k = 0; // 7. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with\r\n // argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal method of O with\r\n // argument Pk\r\n kValue = O[k]; // ii. Call the Call internal method of callback with T as the this value and\r\n // argument list containing kValue, k, and O.\r\n\r\n callback.call(T, kValue, k, O);\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 8. return undefined\r\n\r\n };\r\n }\r\n}\r\n/**\r\n * Inherit the prototype methods from one constructor into another. This is a\r\n * port of the Node.js implementation with an Object.create polyfill.\r\n *\r\n * @param {function} ctor Constructor function which needs to inherit the\r\n * prototype.\r\n * @param {function} superCtor Constructor function to inherit prototype from.\r\n */\r\n\r\n\r\nfunction inherits(ctor, superCtor) {\r\n // Add util.inherits from Node.js\r\n // Source:\r\n // https://github.com/joyent/node/blob/master/lib/util.js\r\n // Copyright Joyent, Inc. and other Node contributors.\r\n //\r\n // Permission is hereby granted, free of charge, to any person obtaining a\r\n // copy of this software and associated documentation files (the\r\n // \"Software\"), to deal in the Software without restriction, including\r\n // without limitation the rights to use, copy, modify, merge, publish,\r\n // distribute, sublicense, and/or sell copies of the Software, and to permit\r\n // persons to whom the Software is furnished to do so, subject to the\r\n // following conditions:\r\n //\r\n // The above copyright notice and this permission notice shall be included\r\n // in all copies or substantial portions of the Software.\r\n //\r\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n ctor.super_ = superCtor;\r\n ctor.prototype = Object.create(superCtor.prototype, {\r\n constructor: {\r\n value: ctor,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true\r\n }\r\n });\r\n}\r\n/**\r\n * Polyfills inheritance for prototypes by allowing different kinds of\r\n * super types. Typically prototypes would use `SuperType.call(this, params)`\r\n * though this doesn't always work in some environments - this function\r\n * falls back to using `Object.assign()` to clone a constructed copy\r\n * of the super type onto `thisArg`.\r\n * @param {any} thisArg The child instance. Modified in place.\r\n * @param {any} SuperType The type to act as a super instance\r\n * @param {any} params Arguments to supply to the super type's constructor\r\n */\r\n\r\n\r\nfunction polyfillSuper(thisArg, SuperType, ...params) {\r\n try {\r\n SuperType.call(thisArg, ...params);\r\n } catch (e) {\r\n // fall back to Object.assign to just clone the thing\r\n const fakeSuper = new SuperType(...params);\r\n Object.assign(thisArg, fakeSuper);\r\n }\r\n}\r\n/**\r\n * Returns whether the given value is a finite number without type-coercion\r\n *\r\n * @param {*} value the value to test\r\n * @return {boolean} whether or not value is a finite number without type-coercion\r\n */\r\n\r\n\r\nfunction isNumber(value) {\r\n return typeof value === 'number' && isFinite(value);\r\n}\r\n/**\r\n * Removes zero width chars, diacritics and whitespace from the string\r\n * Also applies an unhomoglyph on the string, to prevent similar looking chars\r\n * @param {string} str the string to remove hidden characters from\r\n * @return {string} a string with the hidden characters removed\r\n */\r\n\r\n\r\nfunction removeHiddenChars(str) {\r\n if (typeof str === \"string\") {\r\n return (0, _unhomoglyph.default)(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));\r\n }\r\n\r\n return \"\";\r\n} // Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.\r\n// Includes:\r\n// various width spaces U+2000 - U+200D\r\n// LTR and RTL marks U+200E and U+200F\r\n// LTR/RTL and other directional formatting marks U+202A - U+202F\r\n// Combining characters U+0300 - U+036F\r\n// Zero width no-break space (BOM) U+FEFF\r\n// eslint-disable-next-line no-misleading-character-class\r\n\r\n\r\nconst removeHiddenCharsRegex = /[\\u2000-\\u200F\\u202A-\\u202F\\u0300-\\u036f\\uFEFF\\s]/g;\r\n\r\nfunction escapeRegExp(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n}\r\n\r\nfunction globToRegexp(glob, extended) {\r\n extended = typeof extended === 'boolean' ? extended : true; // From\r\n // https://github.com/matrix-org/synapse/blob/abbee6b29be80a77e05730707602f3bbfc3f38cb/synapse/push/__init__.py#L132\r\n // Because micromatch is about 130KB with dependencies,\r\n // and minimatch is not much better.\r\n\r\n let pat = escapeRegExp(glob);\r\n pat = pat.replace(/\\\\\\*/g, '.*');\r\n pat = pat.replace(/\\?/g, '.');\r\n\r\n if (extended) {\r\n pat = pat.replace(/\\\\\\[(!|)(.*)\\\\]/g, function (match, p1, p2, offset, string) {\r\n const first = p1 && '^' || '';\r\n const second = p2.replace(/\\\\-/, '-');\r\n return '[' + first + second + ']';\r\n });\r\n }\r\n\r\n return pat;\r\n}\r\n\r\nfunction ensureNoTrailingSlash(url) {\r\n if (url && url.endsWith(\"/\")) {\r\n return url.substr(0, url.length - 1);\r\n } else {\r\n return url;\r\n }\r\n} // Returns a promise which resolves with a given value after the given number of ms\r\n\r\n\r\nfunction sleep(ms, value) {\r\n return new Promise(resolve => {\r\n setTimeout(resolve, ms, value);\r\n });\r\n}\r\n\r\nfunction isNullOrUndefined(val) {\r\n return val === null || val === undefined;\r\n} // Returns a Deferred\r\n\r\n\r\nfunction defer() {\r\n let resolve;\r\n let reject;\r\n const promise = new Promise((_resolve, _reject) => {\r\n resolve = _resolve;\r\n reject = _reject;\r\n });\r\n return {\r\n resolve,\r\n reject,\r\n promise\r\n };\r\n}\r\n\r\nasync function promiseMapSeries(promises, fn) {\r\n for (const o of await promises) {\r\n await fn(await o);\r\n }\r\n}\r\n\r\nfunction promiseTry(fn) {\r\n return new Promise(resolve => resolve(fn()));\r\n} // Creates and awaits all promises, running no more than `chunkSize` at the same time\r\n\r\n\r\nasync function chunkPromises(fns, chunkSize) {\r\n const results = [];\r\n\r\n for (let i = 0; i < fns.length; i += chunkSize) {\r\n results.push(...(await Promise.all(fns.slice(i, i + chunkSize).map(fn => fn()))));\r\n }\r\n\r\n return results;\r\n} // We need to be able to access the Node.js crypto library from within the\r\n// Matrix SDK without needing to `require(\"crypto\")`, which will fail in\r\n// browsers. So `index.ts` will call `setCrypto` to store it, and when we need\r\n// it, we can call `getCrypto`.\r\n\r\n\r\nlet crypto;\r\n\r\nfunction setCrypto(c) {\r\n crypto = c;\r\n}\r\n\r\nfunction getCrypto() {\r\n return crypto;\r\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"body[data-v-0635047f]{--sweetalert-icons-animation-background:transparent}.sa[data-v-0635047f]{width:140px;height:140px;padding:26px;margin:auto}.sa-loading[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);left:-4px;top:-4px;z-index:2;border-top:4px solid var(--icon-color);-webkit-animation:animateLoadingSpin-data-v-0635047f .75s infinite;animation:animateLoadingSpin-data-v-0635047f .75s infinite}.sa-error[data-v-0635047f],.sa-loading[data-v-0635047f]{box-sizing:content-box;height:80px;position:relative;width:80px}.sa-error[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);padding:0;-webkit-animation:animateErrorIcon-data-v-0635047f .5s;animation:animateErrorIcon-data-v-0635047f .5s}.sa-error[data-v-0635047f]:after,.sa-error[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-error[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-error[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-error-x[data-v-0635047f]{display:block;position:relative;z-index:2}.sa-error-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-error-fix[data-v-0635047f]{height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-error-left[data-v-0635047f],.sa-error-right[data-v-0635047f]{border-radius:2px;display:block;height:5px;position:absolute;z-index:2;background-color:var(--icon-color);top:37px;width:47px}.sa-error-left[data-v-0635047f]{left:17px;transform:rotate(45deg);-webkit-animation:animateXLeft-data-v-0635047f .75s;animation:animateXLeft-data-v-0635047f .75s}.sa-error-right[data-v-0635047f]{right:16px;transform:rotate(-45deg);-webkit-animation:animateXRight-data-v-0635047f .75s;animation:animateXRight-data-v-0635047f .75s}.sa-warning[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleWarning-data-v-0635047f .75s infinite alternate;animation:scaleWarning-data-v-0635047f .75s infinite alternate}.sa-warning[data-v-0635047f]:after,.sa-warning[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-warning[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseWarning-data-v-0635047f 2s linear infinite;animation:pulseWarning-data-v-0635047f 2s linear infinite}.sa-warning[data-v-0635047f]:after{display:block;z-index:1}.sa-warning-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-warning-body[data-v-0635047f],.sa-warning-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseWarningIns-data-v-0635047f .75s infinite alternate;animation:pulseWarningIns-data-v-0635047f .75s infinite alternate}.sa-warning-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-info[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleInfo-data-v-0635047f .75s infinite alternate;animation:scaleInfo-data-v-0635047f .75s infinite alternate}.sa-info[data-v-0635047f]:after,.sa-info[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-info[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseInfo-data-v-0635047f 2s linear infinite;animation:pulseInfo-data-v-0635047f 2s linear infinite}.sa-info[data-v-0635047f]:after{display:block;z-index:1}.sa-info-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-info-body[data-v-0635047f],.sa-info-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseInfoIns-data-v-0635047f .75s infinite alternate;animation:pulseInfoIns-data-v-0635047f .75s infinite alternate}.sa-info-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-success[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px}.sa-success[data-v-0635047f],.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{background-color:var(--sweetalert-icons-animation-background)}.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-success[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-success[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-success-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-success-fix[data-v-0635047f]{background-color:var(--sweetalert-icons-animation-background);height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-success-long[data-v-0635047f],.sa-success-tip[data-v-0635047f]{background-color:var(--icon-color);border-radius:2px;height:5px;position:absolute;z-index:2}.sa-success-tip[data-v-0635047f]{left:14px;top:46px;transform:rotate(45deg);width:25px;-webkit-animation:animateSuccessTip-data-v-0635047f .75s;animation:animateSuccessTip-data-v-0635047f .75s}.sa-success-long[data-v-0635047f]{right:8px;top:38px;transform:rotate(-45deg);width:47px;-webkit-animation:animateSuccessLong-data-v-0635047f .75s;animation:animateSuccessLong-data-v-0635047f .75s}@-webkit-keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@-webkit-keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@-webkit-keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@-webkit-keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@-webkit-keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@-webkit-keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@-webkit-keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@-webkit-keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}@keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.upgradeDatabase = upgradeDatabase;\r\nexports.Backend = exports.VERSION = void 0;\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nconst VERSION = 10;\r\nexports.VERSION = VERSION;\r\nconst PROFILE_TRANSACTIONS = false;\r\n/**\r\n * Implementation of a CryptoStore which is backed by an existing\r\n * IndexedDB connection. Generally you want IndexedDBCryptoStore\r\n * which connects to the database and defers to one of these.\r\n *\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\n\r\nclass Backend {\r\n /**\r\n * @param {IDBDatabase} db\r\n */\r\n constructor(db) {\r\n this._db = db;\r\n this._nextTxnId = 0; // make sure we close the db on `onversionchange` - otherwise\r\n // attempts to delete the database will block (and subsequent\r\n // attempts to re-create it will also block).\r\n\r\n db.onversionchange = ev => {\r\n _logger.logger.log(`versionchange for indexeddb ${this._dbName}: closing`);\r\n\r\n db.close();\r\n };\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n txn.onerror = reject; // first see if we already have an entry for this request.\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n resolve(existing);\r\n return;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n txn.oncomplete = () => {\r\n resolve(request);\r\n };\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n store.add(request);\r\n });\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n resolve(existing);\r\n });\r\n });\r\n }\r\n /**\r\n * look for an existing room key request in the db\r\n *\r\n * @private\r\n * @param {IDBTransaction} txn database transaction\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n * @param {Function} callback function to call with the results of the\r\n * search. Either passed a matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found.\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(txn, requestBody, callback) {\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const idx = store.index(\"session\");\r\n const cursorReq = idx.openCursor([requestBody.room_id, requestBody.session_id]);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n // no match found\r\n callback(null);\r\n return;\r\n }\r\n\r\n const existing = cursor.value;\r\n\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n // got a match\r\n callback(existing);\r\n return;\r\n } // look at the next entry in the index\r\n\r\n\r\n cursor.continue();\r\n };\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states. If there are multiple\r\n * requests in those states, an arbitrary one is chosen.\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n if (wantedStates.length === 0) {\r\n return Promise.resolve(null);\r\n } // this is a bit tortuous because we need to make sure we do the lookup\r\n // in a single transaction, to avoid having a race with the insertion\r\n // code.\r\n // index into the wantedStates array\r\n\r\n\r\n let stateIndex = 0;\r\n let result;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n // got a match\r\n result = cursor.value;\r\n return;\r\n } // try the next state in the list\r\n\r\n\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All elements in a given state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const index = store.index(\"state\");\r\n const request = index.getAll(wantedState);\r\n\r\n request.onsuccess = ev => resolve(ev.target.result);\r\n\r\n request.onerror = ev => reject(ev.target.error);\r\n });\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n let stateIndex = 0;\r\n const results = [];\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n const keyReq = cursor.value;\r\n\r\n if (keyReq.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(keyReq);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n // try the next state in the list\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n let result = null;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${data.state}`);\r\n\r\n return;\r\n }\r\n\r\n Object.assign(data, updates);\r\n cursor.update(data);\r\n result = data;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${data.state} ` + `(expected ${expectedState})`);\r\n\r\n return;\r\n }\r\n\r\n cursor.delete();\r\n };\r\n\r\n return promiseifyTxn(txn);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(newData, \"-\");\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"crossSigningKeys\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(`ssss_cache:${type}`);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(keys, \"crossSigningKeys\");\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(key, `ssss_cache:${type}`);\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const countReq = objectStore.count();\r\n\r\n countReq.onsuccess = function () {\r\n try {\r\n func(countReq.result);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const idx = objectStore.index(\"deviceKey\");\r\n const getReq = idx.openCursor(deviceKey);\r\n const results = {};\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n results[cursor.value.sessionId] = {\r\n session: cursor.value.session,\r\n lastReceivedMessageTs: cursor.value.lastReceivedMessageTs\r\n };\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(results);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.get([deviceKey, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n func({\r\n session: getReq.result.session,\r\n lastReceivedMessageTs: getReq.result.lastReceivedMessageTs\r\n });\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n func(cursor.value);\r\n cursor.continue();\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n objectStore.put({\r\n deviceKey,\r\n sessionId,\r\n session: sessionInfo.session,\r\n lastReceivedMessageTs: sessionInfo.lastReceivedMessageTs\r\n });\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n objectStore.put({\r\n deviceKey,\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n return promiseifyTxn(txn);\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n let result;\r\n\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n const index = objectStore.index(\"deviceKey\");\r\n const req = index.getAll(deviceKey);\r\n\r\n req.onsuccess = event => {\r\n const problems = req.result;\r\n\r\n if (!problems.length) {\r\n result = null;\r\n return;\r\n }\r\n\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n result = Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n return;\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n result = null;\r\n } else {\r\n result = lastProblem;\r\n }\r\n };\r\n\r\n await promiseifyTxn(txn);\r\n return result;\r\n } // FIXME: we should probably prune this when devices get deleted\r\n\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const txn = this._db.transaction(\"notified_error_devices\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"notified_error_devices\");\r\n const ret = [];\r\n await Promise.all(devices.map(device => {\r\n return new Promise(resolve => {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n const getReq = objectStore.get([userId, deviceInfo.deviceId]);\r\n\r\n getReq.onsuccess = function () {\r\n if (!getReq.result) {\r\n objectStore.put({\r\n userId,\r\n deviceId: deviceInfo.deviceId\r\n });\r\n ret.push(device);\r\n }\r\n\r\n resolve();\r\n };\r\n });\r\n }));\r\n return ret;\r\n } // Inbound group sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n let session = false;\r\n let withheld = false;\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n session = getReq.result.session;\r\n } else {\r\n session = null;\r\n }\r\n\r\n if (withheld !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n\r\n const withheldObjectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n const withheldGetReq = withheldObjectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n withheldGetReq.onsuccess = function () {\r\n try {\r\n if (withheldGetReq.result) {\r\n withheld = withheldGetReq.result.session;\r\n } else {\r\n withheld = null;\r\n }\r\n\r\n if (session !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n try {\r\n func({\r\n senderKey: cursor.value.senderCurve25519Key,\r\n sessionId: cursor.value.sessionId,\r\n sessionData: cursor.value.session\r\n });\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const addReq = objectStore.add({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n\r\n addReq.onerror = ev => {\r\n if (addReq.error.name === 'ConstraintError') {\r\n // This stops the error from triggering the txn's onerror\r\n ev.stopPropagation(); // ...and this stops it from aborting the transaction\r\n\r\n ev.preventDefault();\r\n\r\n _logger.logger.log(\"Ignoring duplicate inbound group session: \" + senderCurve25519Key + \" / \" + sessionId);\r\n } else {\r\n abortWithException(txn, new Error(\"Failed to add inbound group session: \" + addReq.error));\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n objectStore.put(deviceData, \"-\");\r\n }\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n const objectStore = txn.objectStore(\"rooms\");\r\n objectStore.put(roomInfo, roomId);\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n const rooms = {};\r\n const objectStore = txn.objectStore(\"rooms\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n rooms[cursor.key] = cursor.value;\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(rooms);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n } // session backups\r\n\r\n\r\n getSessionsNeedingBackup(limit) {\r\n return new Promise((resolve, reject) => {\r\n const sessions = [];\r\n\r\n const txn = this._db.transaction([\"sessions_needing_backup\", \"inbound_group_sessions\"], \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n txn.oncomplete = function () {\r\n resolve(sessions);\r\n };\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n const sessionStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n const sessionGetReq = sessionStore.get(cursor.key);\r\n\r\n sessionGetReq.onsuccess = function () {\r\n sessions.push({\r\n senderKey: sessionGetReq.result.senderCurve25519Key,\r\n sessionId: sessionGetReq.result.sessionId,\r\n sessionData: sessionGetReq.result.session\r\n });\r\n };\r\n\r\n if (!limit || sessions.length < limit) {\r\n cursor.continue();\r\n }\r\n }\r\n };\r\n });\r\n }\r\n\r\n countSessionsNeedingBackup(txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.count();\r\n req.onerror = reject;\r\n\r\n req.onsuccess = () => resolve(req.result);\r\n });\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.delete([session.senderKey, session.sessionId]);\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n markSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.put({\r\n senderCurve25519Key: session.senderKey,\r\n sessionId: session.sessionId\r\n });\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n sessions.push([senderKey, sessionId]);\r\n objectStore.put({\r\n roomId,\r\n sessions\r\n });\r\n };\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n return new Promise((resolve, reject) => {\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n resolve(sessions);\r\n };\r\n\r\n req.onerror = reject;\r\n });\r\n }\r\n\r\n doTxn(mode, stores, func, log = _logger.logger) {\r\n let startTime;\r\n let description;\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n const txnId = this._nextTxnId++;\r\n startTime = Date.now();\r\n description = `${mode} crypto store transaction ${txnId} in ${stores}`;\r\n log.debug(`Starting ${description}`);\r\n }\r\n\r\n const txn = this._db.transaction(stores, mode);\r\n\r\n const promise = promiseifyTxn(txn);\r\n const result = func(txn);\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n promise.then(() => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.debug(`Finished ${description}, took ${elapsedTime} ms`);\r\n }, () => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.error(`Failed ${description}, took ${elapsedTime} ms`);\r\n });\r\n }\r\n\r\n return promise.then(() => {\r\n return result;\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.Backend = Backend;\r\n\r\nfunction upgradeDatabase(db, oldVersion) {\r\n _logger.logger.log(`Upgrading IndexedDBCryptoStore from version ${oldVersion}` + ` to ${VERSION}`);\r\n\r\n if (oldVersion < 1) {\r\n // The database did not previously exist.\r\n createDatabase(db);\r\n }\r\n\r\n if (oldVersion < 2) {\r\n db.createObjectStore(\"account\");\r\n }\r\n\r\n if (oldVersion < 3) {\r\n const sessionsStore = db.createObjectStore(\"sessions\", {\r\n keyPath: [\"deviceKey\", \"sessionId\"]\r\n });\r\n sessionsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n }\r\n\r\n if (oldVersion < 4) {\r\n db.createObjectStore(\"inbound_group_sessions\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 5) {\r\n db.createObjectStore(\"device_data\");\r\n }\r\n\r\n if (oldVersion < 6) {\r\n db.createObjectStore(\"rooms\");\r\n }\r\n\r\n if (oldVersion < 7) {\r\n db.createObjectStore(\"sessions_needing_backup\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 8) {\r\n db.createObjectStore(\"inbound_group_sessions_withheld\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 9) {\r\n const problemsStore = db.createObjectStore(\"session_problems\", {\r\n keyPath: [\"deviceKey\", \"time\"]\r\n });\r\n problemsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n db.createObjectStore(\"notified_error_devices\", {\r\n keyPath: [\"userId\", \"deviceId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 10) {\r\n db.createObjectStore(\"shared_history_inbound_group_sessions\", {\r\n keyPath: [\"roomId\"]\r\n });\r\n } // Expand as needed.\r\n\r\n}\r\n\r\nfunction createDatabase(db) {\r\n const outgoingRoomKeyRequestsStore = db.createObjectStore(\"outgoingRoomKeyRequests\", {\r\n keyPath: \"requestId\"\r\n }); // we assume that the RoomKeyRequestBody will have room_id and session_id\r\n // properties, to make the index efficient.\r\n\r\n outgoingRoomKeyRequestsStore.createIndex(\"session\", [\"requestBody.room_id\", \"requestBody.session_id\"]);\r\n outgoingRoomKeyRequestsStore.createIndex(\"state\", \"state\");\r\n}\r\n/*\r\n * Aborts a transaction with a given exception\r\n * The transaction promise will be rejected with this exception.\r\n */\r\n\r\n\r\nfunction abortWithException(txn, e) {\r\n // We cheekily stick our exception onto the transaction object here\r\n // We could alternatively make the thing we pass back to the app\r\n // an object containing the transaction and exception.\r\n txn._mx_abortexception = e;\r\n\r\n try {\r\n txn.abort();\r\n } catch (e) {// sometimes we won't be able to abort the transaction\r\n // (ie. if it's aborted or completed)\r\n }\r\n}\r\n\r\nfunction promiseifyTxn(txn) {\r\n return new Promise((resolve, reject) => {\r\n txn.oncomplete = () => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n }\r\n\r\n resolve();\r\n };\r\n\r\n txn.onerror = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n\r\n txn.onabort = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n });\r\n}","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#linepreloader[data-v-bcf20e38]{display:inline-block;font-size:0;padding:0}#linepreloader span[data-v-bcf20e38]{vertical-align:middle;border-radius:50%;background:rgb(var(--neutral-grad-2));display:inline-block;width:6px;height:6px;margin:3px 2px;-webkit-animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate;animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate}#linepreloader span[data-v-bcf20e38]:first-child{-webkit-animation-delay:-.8;animation-delay:-.8s}#linepreloader span[data-v-bcf20e38]:nth-child(2){-webkit-animation-delay:-.53333s;animation-delay:-.53333s}#linepreloader span[data-v-bcf20e38]:nth-child(3){-webkit-animation-delay:-.26666s;animation-delay:-.26666s}@keyframes linepreloader-data-v-bcf20e38{0%{transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes linepreloader-data-v-bcf20e38{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.ReEmitter = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nclass ReEmitter {\r\n constructor(target) {\r\n (0, _defineProperty2.default)(this, \"target\", void 0);\r\n this.target = target;\r\n }\r\n\r\n reEmit(source, eventNames) {\r\n for (const eventName of eventNames) {\r\n // We include the source as the last argument for event handlers which may need it,\r\n // such as read receipt listeners on the client class which won't have the context\r\n // of the room.\r\n const forSource = (...args) => {\r\n // EventEmitter special cases 'error' to make the emit function throw if no\r\n // handler is attached, which sort of makes sense for making sure that something\r\n // handles an error, but for re-emitting, there could be a listener on the original\r\n // source object so the test doesn't really work. We *could* try to replicate the\r\n // same logic and throw if there is no listener on either the source or the target,\r\n // but this behaviour is fairly undesireable for us anyway: the main place we throw\r\n // 'error' events is for calls, where error events are usually emitted some time\r\n // later by a different part of the code where 'emit' throwing because the app hasn't\r\n // added an error handler isn't terribly helpful. (A better fix in retrospect may\r\n // have been to just avoid using the event name 'error', but backwards compat...)\r\n if (eventName === 'error' && this.target.listenerCount('error') === 0) return;\r\n this.target.emit(eventName, ...args, source);\r\n };\r\n\r\n source.on(eventName, forSource);\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.ReEmitter = ReEmitter;","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Exceptions */\n__export(require(\"./exceptions\"));\n/** Symmetric encryption APIs */\nvar aead_1 = require(\"./aead\");\nexports.AEAD = aead_1.AEAD;\nvar siv_1 = require(\"./siv\");\nexports.SIV = siv_1.SIV;\n/** STREAM streaming encryption */\nvar stream_1 = require(\"./stream\");\nexports.StreamEncryptor = stream_1.StreamEncryptor;\nexports.StreamDecryptor = stream_1.StreamDecryptor;\n/** MAC functions */\nvar cmac_1 = require(\"./mac/cmac\");\nexports.CMAC = cmac_1.CMAC;\nvar pmac_1 = require(\"./mac/pmac\");\nexports.PMAC = pmac_1.PMAC;\n/** Crypto providers */\nvar polyfill_1 = require(\"./providers/polyfill\");\nexports.PolyfillCryptoProvider = polyfill_1.PolyfillCryptoProvider;\nvar webcrypto_1 = require(\"./providers/webcrypto\");\nexports.WebCryptoProvider = webcrypto_1.WebCryptoProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Number of trailing zeros in a given byte value */\nconst CTZ_TABLE = new Uint8Array([\n 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n]);\n/** Count the number of trailing zeroes in a given number */\nfunction ctz(value) {\n return CTZ_TABLE[value];\n}\nexports.ctz = ctz;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".footer-chat[data-v-517e1e1f]{bottom:0;left:0;right:0;background:rgb(var(--background-total-theme));border-top:1px solid rgb(var(--background-secondary-theme));position:absolute;height:90px;padding-bottom:30px}.footer-chat.bout[data-v-517e1e1f]{position:fixed;will-change:transform}.footer-chat .work[data-v-517e1e1f]{height:100%;padding:0!important}.footer-chat.bin[data-v-517e1e1f]{border-top:0;position:static}.footer-chat.fix[data-v-517e1e1f]{position:absolute;height:auto}.footer-chat.fix.minimized[data-v-517e1e1f]{background:transparent;padding-bottom:0}.footer-chat.fix.minimized .menuItems[data-v-517e1e1f]{display:block;transition:.3s;padding-top:.5em}.footer-chat.fix.minimized .menuItems a[data-v-517e1e1f]{padding:0}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]{width:44px;height:44px;background:rgba(var(--neutral-grad-3),.4);color:rgba(var(--neutral-grad-3),.8);border-radius:50%;border:1px solid transparent;margin-bottom:.25em;line-height:40px;transition:.3s}.footer-chat.fix.minimized .menuItems .menuItem .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem .label[data-v-517e1e1f]{display:none}.footer-chat.fix.minimized .menuItems .menuItem i[data-v-517e1e1f]{vertical-align:middle;font-size:.8em}.footer-chat.fix.minimized .menuItems .menuItem.active[data-v-517e1e1f]{text-shadow:0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright));background:rgba(var(--color-bg-ac-bright),.9);border:1px solid rgba(var(--color-bg-ac-bright),.9);color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]:hover:not(.active){background:rgba(var(--color-bg-ac-bright),.95);color:#fff;text-shadow:0 0 10px rgb(var(--color-bg-ac-bright)),0 0 15px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 25px rgb(var(--color-bg-ac-bright)),0 0 30px #02061a,0 0 35px rgb(var(--color-bg-ac-bright)),0 0 40px #02061a}.footer-chat.fix.minimized.active .menuItems[data-v-517e1e1f]{border-top:0}.menuItems[data-v-517e1e1f]{display:flex;justify-content:space-around;align-items:center;height:100%}.menuItems a[data-v-517e1e1f]{display:block;flex-grow:1;text-align:center;padding:1em;color:#213850}.menuItems .icon[data-v-517e1e1f]{font-size:.9em;color:rgba(var(--color-txt-gray-dark),.7)}.menuItems .label[data-v-517e1e1f]{font-size:.7em;position:absolute;bottom:0;left:0;right:0;line-height:1em;text-align:center;opacity:.7}.menuItems .menuItem[data-v-517e1e1f]{position:relative;text-align:center;cursor:pointer;width:64px;height:44px;line-height:44px}.menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--color-txt-ac))}.menuItems .menuItem .unseen[data-v-517e1e1f]{position:absolute;width:22px;height:22px;right:-10%;bottom:-10%;background:rgba(var(--color-txt-ac),.9);line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em;color:rgb(var(--text-on-bg-ac-color))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.Relations = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2019 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * A container for relation events that supports easy access to common ways of\r\n * aggregating such events. Each instance holds events that of a single relation\r\n * type and event type. All of the events also relate to the same original event.\r\n *\r\n * The typical way to get one of these containers is via\r\n * EventTimelineSet#getRelationsForEvent.\r\n */\r\nclass Relations extends _events.EventEmitter {\r\n /**\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\",\r\n * \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @param {?Room} room\r\n * Room for this container. May be null for non-room cases, such as the\r\n * notification timeline.\r\n */\r\n constructor(relationType, eventType, room) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"_onEventStatus\", (event, status) => {\r\n if (!event.isSending()) {\r\n // Sending is done, so we don't need to listen anymore\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n return;\r\n }\r\n\r\n if (status !== _event.EventStatus.CANCELLED) {\r\n return;\r\n } // Event was cancelled, remove from the collection\r\n\r\n\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n\r\n this._removeEvent(event);\r\n });\r\n (0, _defineProperty2.default)(this, \"_onBeforeRedaction\", redactedEvent => {\r\n if (!this._relations.has(redactedEvent)) {\r\n return;\r\n }\r\n\r\n this._relations.delete(redactedEvent);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n // Remove the redacted annotation from aggregation by key\r\n this._removeAnnotationFromAggregation(redactedEvent);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n redactedEvent.removeListener(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.redaction\", redactedEvent);\r\n });\r\n this.relationType = relationType;\r\n this.eventType = eventType;\r\n this._relations = new Set();\r\n this._annotationsByKey = {};\r\n this._annotationsBySender = {};\r\n this._sortedAnnotationsByKey = [];\r\n this._targetEvent = null;\r\n }\r\n /**\r\n * Add relation events to this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be added.\r\n */\r\n\r\n\r\n addEvent(event) {\r\n if (this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n } // If the event is in the process of being sent, listen for cancellation\r\n // so we can remove the event from the collection.\r\n\r\n\r\n if (event.isSending()) {\r\n event.on(\"Event.status\", this._onEventStatus);\r\n }\r\n\r\n this._relations.add(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._addAnnotationToAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n event.on(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.add\", event);\r\n }\r\n /**\r\n * Remove relation event from this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The relation event to remove.\r\n */\r\n\r\n\r\n _removeEvent(event) {\r\n if (!this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n }\r\n\r\n this._relations.delete(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._removeAnnotationFromAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n this.emit(\"Relations.remove\", event);\r\n }\r\n /**\r\n * Listens for event status changes to remove cancelled events.\r\n *\r\n * @param {MatrixEvent} event The event whose status has changed\r\n * @param {EventStatus} status The new status\r\n */\r\n\r\n\r\n /**\r\n * Get all relation events in this collection.\r\n *\r\n * These are currently in the order of insertion to this collection, which\r\n * won't match timeline order in the case of scrollback.\r\n * TODO: Tweak `addEvent` to insert correctly for scrollback.\r\n *\r\n * @return {Array}\r\n * Relation events in insertion order.\r\n */\r\n getRelations() {\r\n return [...this._relations];\r\n }\r\n\r\n _addAnnotationToAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n let eventsForKey = this._annotationsByKey[key];\r\n\r\n if (!eventsForKey) {\r\n eventsForKey = this._annotationsByKey[key] = new Set();\r\n\r\n this._sortedAnnotationsByKey.push([key, eventsForKey]);\r\n } // Add the new event to the set for this key\r\n\r\n\r\n eventsForKey.add(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n\r\n const sender = event.getSender();\r\n let eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (!eventsFromSender) {\r\n eventsFromSender = this._annotationsBySender[sender] = new Set();\r\n } // Add the new event to the set for this sender\r\n\r\n\r\n eventsFromSender.add(event);\r\n }\r\n\r\n _removeAnnotationFromAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n const eventsForKey = this._annotationsByKey[key];\r\n\r\n if (eventsForKey) {\r\n eventsForKey.delete(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n }\r\n\r\n const sender = event.getSender();\r\n const eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (eventsFromSender) {\r\n eventsFromSender.delete(event);\r\n }\r\n }\r\n /**\r\n * For relations that have been redacted, we want to remove them from\r\n * aggregation data sets and emit an update event.\r\n *\r\n * To do so, we listen for `Event.beforeRedaction`, which happens:\r\n * - after the server accepted the redaction and remote echoed back to us\r\n * - before the original event has been marked redacted in the client\r\n *\r\n * @param {MatrixEvent} redactedEvent\r\n * The original relation event that is about to be redacted.\r\n */\r\n\r\n\r\n /**\r\n * Get all events in this collection grouped by key and sorted by descending\r\n * event count in each group.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Array}\r\n * An array of [key, events] pairs sorted by descending event count.\r\n * The events are stored in a Set (which preserves insertion order).\r\n */\r\n getSortedAnnotationsByKey() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._sortedAnnotationsByKey;\r\n }\r\n /**\r\n * Get all events in this collection grouped by sender.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Object}\r\n * An object with each relation sender as a key and the matching Set of\r\n * events for that sender as a value.\r\n */\r\n\r\n\r\n getAnnotationsBySender() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._annotationsBySender;\r\n }\r\n /**\r\n * Returns the most recent (and allowed) m.replace relation, if any.\r\n *\r\n * This is currently only supported for the m.replace relation type,\r\n * once the target event is known, see `addEvent`.\r\n *\r\n * @return {MatrixEvent?}\r\n */\r\n\r\n\r\n getLastReplacement() {\r\n if (this.relationType !== \"m.replace\") {\r\n // Aggregating on last only makes sense for this relation type\r\n return null;\r\n }\r\n\r\n if (!this._targetEvent) {\r\n // Don't know which replacements to accept yet.\r\n // This method shouldn't be called before the original\r\n // event is known anyway.\r\n return null;\r\n } // the all-knowning server tells us that the event at some point had\r\n // this timestamp for its replacement, so any following replacement should definitely not be less\r\n\r\n\r\n const replaceRelation = this._targetEvent.getServerAggregatedRelation(\"m.replace\");\r\n\r\n const minTs = replaceRelation && replaceRelation.origin_server_ts;\r\n return this.getRelations().reduce((last, event) => {\r\n if (event.getSender() !== this._targetEvent.getSender()) {\r\n return last;\r\n }\r\n\r\n if (minTs && minTs > event.getTs()) {\r\n return last;\r\n }\r\n\r\n if (last && last.getTs() > event.getTs()) {\r\n return last;\r\n }\r\n\r\n return event;\r\n }, null);\r\n }\r\n /*\r\n * @param {MatrixEvent} targetEvent the event the relations are related to.\r\n */\r\n\r\n\r\n setTargetEvent(event) {\r\n if (this._targetEvent) {\r\n return;\r\n }\r\n\r\n this._targetEvent = event;\r\n\r\n if (this.relationType === \"m.replace\") {\r\n const replacement = this.getLastReplacement(); // this is the initial update, so only call it if we already have something\r\n // to not emit Event.replaced needlessly\r\n\r\n if (replacement) {\r\n this._targetEvent.makeReplaced(replacement);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.Relations = Relations;","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\"","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=951b8314&scoped=true&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".nameofchat[data-v-72a9c575]{white-space:nowrap}.nameline[data-v-72a9c575]{display:flex;align-items:flex-end;justify-content:center}.iconGroup[data-v-72a9c575]{font-size:.4em;width:16px;text-align:center;height:16px;line-height:16px;border-radius:8px;background:rgb(var(--neutral-grad-2));margin-right:.5em;margin-block:.25em}.iconGroup i[data-v-72a9c575]{color:rgb(var(--neutral-grad-1))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./VuePageTransition.vue?vue&type=template&id=108c57b8&scoped=true&\"\nimport script from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nexport * from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./VuePageTransition.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./VuePageTransition.vue?vue&type=style&index=1&id=108c57b8&lang=scss&scoped=true&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"108c57b8\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root{--overlay-bg:#1867c0;--transition-duration:.35s}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"\", \"\"]);\n// Exports\nmodule.exports = exports;\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=06594ccd&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * AES-CTR using a WebCrypto (or similar) API\n */\nclass WebCryptoAesCtr {\n constructor(key, crypto) {\n this.key = key;\n this.crypto = crypto;\n }\n static importKey(crypto, keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n // Only AES-128 and AES-256 supported. AES-192 is not.\n if (keyData.length !== 16 && keyData.length !== 32) {\n throw new Error(`Miscreant: invalid key length: ${keyData.length} (expected 16 or 32 bytes)`);\n }\n const key = yield crypto.subtle.importKey(\"raw\", keyData, \"AES-CTR\", false, [\"encrypt\"]);\n return new WebCryptoAesCtr(key, crypto);\n });\n }\n encryptCtr(iv, plaintext) {\n return __awaiter(this, void 0, void 0, function* () {\n const ciphertext = yield this.crypto.subtle.encrypt({ name: \"AES-CTR\", counter: iv, length: 16 }, this.key, plaintext);\n return new Uint8Array(ciphertext);\n });\n }\n clear() {\n // TODO: actually clear something. Do we need to?\n return this;\n }\n}\nexports.default = WebCryptoAesCtr;\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryCryptoStore = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\r\n\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\r\n\r\n/**\r\n * Internal module. in-memory storage for e2e.\r\n *\r\n * @module\r\n */\r\n\r\n/**\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\nclass MemoryCryptoStore {\r\n constructor() {\r\n this._outgoingRoomKeyRequests = [];\r\n this._account = null;\r\n this._crossSigningKeys = null;\r\n this._privateKeys = {};\r\n this._backupKeys = {}; // Map of {devicekey -> {sessionId -> session pickle}}\r\n\r\n this._sessions = {}; // Map of {devicekey -> array of problems}\r\n\r\n this._sessionProblems = {}; // Map of {userId -> deviceId -> true}\r\n\r\n this._notifiedErrorDevices = {}; // Map of {senderCurve25519Key+'/'+sessionId -> session data object}\r\n\r\n this._inboundGroupSessions = {};\r\n this._inboundGroupSessionsWithheld = {}; // Opaque device data object\r\n\r\n this._deviceData = null; // roomId -> Opaque roomInfo object\r\n\r\n this._rooms = {}; // Set of {senderCurve25519Key+'/'+sessionId}\r\n\r\n this._sessionsNeedingBackup = {}; // roomId -> array of [senderKey, sessionId]\r\n\r\n this._sharedHistoryInboundGroupSessions = {};\r\n }\r\n /**\r\n * Ensure the database exists and is up-to-date.\r\n *\r\n * This must be called before the store can be used.\r\n *\r\n * @return {Promise} resolves to the store.\r\n */\r\n\r\n\r\n async startup() {\r\n // No startup work to do for the memory store.\r\n return this;\r\n }\r\n /**\r\n * Delete all data from this store.\r\n *\r\n * @returns {Promise} Promise which resolves when the store has been cleared.\r\n */\r\n\r\n\r\n deleteAllData() {\r\n return Promise.resolve();\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return utils.promiseTry(() => {\r\n // first see if we already have an entry for this request.\r\n const existing = this._getOutgoingRoomKeyRequest(requestBody);\r\n\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n return existing;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n this._outgoingRoomKeyRequests.push(request);\r\n\r\n return request;\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return Promise.resolve(this._getOutgoingRoomKeyRequest(requestBody));\r\n }\r\n /**\r\n * Looks for existing room key request, and returns the result synchronously.\r\n *\r\n * @internal\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {module:crypto/store/base~OutgoingRoomKeyRequest?}\r\n * the matching request, or null if not found\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(requestBody) {\r\n for (const existing of this._outgoingRoomKeyRequests) {\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n return existing;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state) {\r\n return Promise.resolve(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All OutgoingRoomKeyRequests in state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return Promise.resolve(this._outgoingRoomKeyRequests.filter(r => r.state == wantedState));\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n const results = [];\r\n\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state && req.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${req.state}`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n Object.assign(req, updates);\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n for (let i = 0; i < this._outgoingRoomKeyRequests.length; i++) {\r\n const req = this._outgoingRoomKeyRequests[i];\r\n\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${req.state} ` + `(expected ${expectedState})`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n this._outgoingRoomKeyRequests.splice(i, 1);\r\n\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n func(this._account);\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n this._account = newData;\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n func(this._crossSigningKeys);\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const result = this._privateKeys[type];\r\n return func(result || null);\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n this._crossSigningKeys = keys;\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n this._privateKeys[type] = key;\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n return Object.keys(this._sessions).length;\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const deviceSessions = this._sessions[deviceKey] || {};\r\n func(deviceSessions[sessionId] || null);\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n func(this._sessions[deviceKey] || {});\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n Object.entries(this._sessions).forEach(([deviceKey, deviceSessions]) => {\r\n Object.entries(deviceSessions).forEach(([sessionId, session]) => {\r\n func(_objectSpread(_objectSpread({}, session), {}, {\r\n deviceKey,\r\n sessionId\r\n }));\r\n });\r\n });\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n let deviceSessions = this._sessions[deviceKey];\r\n\r\n if (deviceSessions === undefined) {\r\n deviceSessions = {};\r\n this._sessions[deviceKey] = deviceSessions;\r\n }\r\n\r\n deviceSessions[sessionId] = sessionInfo;\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const problems = this._sessionProblems[deviceKey] = this._sessionProblems[deviceKey] || [];\r\n problems.push({\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n const problems = this._sessionProblems[deviceKey] || [];\r\n\r\n if (!problems.length) {\r\n return null;\r\n }\r\n\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n return Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n return null;\r\n } else {\r\n return lastProblem;\r\n }\r\n }\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const notifiedErrorDevices = this._notifiedErrorDevices;\r\n const ret = [];\r\n\r\n for (const device of devices) {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n\r\n if (userId in notifiedErrorDevices) {\r\n if (!(deviceInfo.deviceId in notifiedErrorDevices[userId])) {\r\n ret.push(device);\r\n notifiedErrorDevices[userId][deviceInfo.deviceId] = true;\r\n }\r\n } else {\r\n ret.push(device);\r\n notifiedErrorDevices[userId] = {\r\n [deviceInfo.deviceId]: true\r\n };\r\n }\r\n }\r\n\r\n return ret;\r\n } // Inbound Group Sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n func(this._inboundGroupSessions[k] || null, this._inboundGroupSessionsWithheld[k] || null);\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n for (const key of Object.keys(this._inboundGroupSessions)) {\r\n // we can't use split, as the components we are trying to split out\r\n // might themselves contain '/' characters. We rely on the\r\n // senderKey being a (32-byte) curve25519 key, base64-encoded\r\n // (hence 43 characters long).\r\n func({\r\n senderKey: key.substr(0, 43),\r\n sessionId: key.substr(44),\r\n sessionData: this._inboundGroupSessions[key]\r\n });\r\n }\r\n\r\n func(null);\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n\r\n if (this._inboundGroupSessions[k] === undefined) {\r\n this._inboundGroupSessions[k] = sessionData;\r\n }\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n this._inboundGroupSessions[senderCurve25519Key + '/' + sessionId] = sessionData;\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n this._inboundGroupSessionsWithheld[k] = sessionData;\r\n } // Device Data\r\n\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n func(this._deviceData);\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n this._deviceData = deviceData;\r\n } // E2E rooms\r\n\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n this._rooms[roomId] = roomInfo;\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n func(this._rooms);\r\n }\r\n\r\n getSessionsNeedingBackup(limit) {\r\n const sessions = [];\r\n\r\n for (const session in this._sessionsNeedingBackup) {\r\n if (this._inboundGroupSessions[session]) {\r\n sessions.push({\r\n senderKey: session.substr(0, 43),\r\n sessionId: session.substr(44),\r\n sessionData: this._inboundGroupSessions[session]\r\n });\r\n\r\n if (limit && session.length >= limit) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(sessions);\r\n }\r\n\r\n countSessionsNeedingBackup() {\r\n return Promise.resolve(Object.keys(this._sessionsNeedingBackup).length);\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n delete this._sessionsNeedingBackup[sessionKey];\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n markSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n this._sessionsNeedingBackup[sessionKey] = true;\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId) {\r\n const sessions = this._sharedHistoryInboundGroupSessions[roomId] || [];\r\n sessions.push([senderKey, sessionId]);\r\n this._sharedHistoryInboundGroupSessions[roomId] = sessions;\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId) {\r\n return Promise.resolve(this._sharedHistoryInboundGroupSessions[roomId] || []);\r\n } // Session key backups\r\n\r\n\r\n doTxn(mode, stores, func) {\r\n return Promise.resolve(func(null));\r\n }\r\n\r\n}\r\n\r\nexports.MemoryCryptoStore = MemoryCryptoStore;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.FilterComponent = FilterComponent;\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module filter-component\r\n */\r\n\r\n/**\r\n * Checks if a value matches a given field value, which may be a * terminated\r\n * wildcard pattern.\r\n * @param {String} actual_value The value to be compared\r\n * @param {String} filter_value The filter pattern to be compared\r\n * @return {bool} true if the actual_value matches the filter_value\r\n */\r\nfunction _matches_wildcard(actual_value, filter_value) {\r\n if (filter_value.endsWith(\"*\")) {\r\n const type_prefix = filter_value.slice(0, -1);\r\n return actual_value.substr(0, type_prefix.length) === type_prefix;\r\n } else {\r\n return actual_value === filter_value;\r\n }\r\n}\r\n/**\r\n * FilterComponent is a section of a Filter definition which defines the\r\n * types, rooms, senders filters etc to be applied to a particular type of resource.\r\n * This is all ported over from synapse's Filter object.\r\n *\r\n * N.B. that synapse refers to these as 'Filters', and what js-sdk refers to as\r\n * 'Filters' are referred to as 'FilterCollections'.\r\n *\r\n * @constructor\r\n * @param {Object} filter_json the definition of this filter JSON, e.g. { 'contains_url': true }\r\n */\r\n\r\n\r\nfunction FilterComponent(filter_json) {\r\n this.filter_json = filter_json;\r\n this.types = filter_json.types || null;\r\n this.not_types = filter_json.not_types || [];\r\n this.rooms = filter_json.rooms || null;\r\n this.not_rooms = filter_json.not_rooms || [];\r\n this.senders = filter_json.senders || null;\r\n this.not_senders = filter_json.not_senders || [];\r\n this.contains_url = filter_json.contains_url || null;\r\n}\r\n/**\r\n * Checks with the filter component matches the given event\r\n * @param {MatrixEvent} event event to be checked against the filter\r\n * @return {bool} true if the event matches the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype.check = function (event) {\r\n return this._checkFields(event.getRoomId(), event.getSender(), event.getType(), event.getContent() ? event.getContent().url !== undefined : false);\r\n};\r\n/**\r\n * Checks whether the filter component matches the given event fields.\r\n * @param {String} room_id the room_id for the event being checked\r\n * @param {String} sender the sender of the event being checked\r\n * @param {String} event_type the type of the event being checked\r\n * @param {String} contains_url whether the event contains a content.url field\r\n * @return {bool} true if the event fields match the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype._checkFields = function (room_id, sender, event_type, contains_url) {\r\n const literal_keys = {\r\n \"rooms\": function (v) {\r\n return room_id === v;\r\n },\r\n \"senders\": function (v) {\r\n return sender === v;\r\n },\r\n \"types\": function (v) {\r\n return _matches_wildcard(event_type, v);\r\n }\r\n };\r\n const self = this;\r\n\r\n for (let n = 0; n < Object.keys(literal_keys).length; n++) {\r\n const name = Object.keys(literal_keys)[n];\r\n const match_func = literal_keys[name];\r\n const not_name = \"not_\" + name;\r\n const disallowed_values = self[not_name];\r\n\r\n if (disallowed_values.filter(match_func).length > 0) {\r\n return false;\r\n }\r\n\r\n const allowed_values = self[name];\r\n\r\n if (allowed_values && allowed_values.length > 0) {\r\n const anyMatch = allowed_values.some(match_func);\r\n\r\n if (!anyMatch) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n const contains_url_filter = this.filter_json.contains_url;\r\n\r\n if (contains_url_filter !== undefined) {\r\n if (contains_url_filter !== contains_url) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n/**\r\n * Filters a list of events down to those which match this filter component\r\n * @param {MatrixEvent[]} events Events to be checked againt the filter component\r\n * @return {MatrixEvent[]} events which matched the filter component\r\n */\r\n\r\n\r\nFilterComponent.prototype.filter = function (events) {\r\n return events.filter(this.check, this);\r\n};\r\n/**\r\n * Returns the limit field for a given filter component, providing a default of\r\n * 10 if none is otherwise specified. Cargo-culted from Synapse.\r\n * @return {Number} the limit for this filter component.\r\n */\r\n\r\n\r\nFilterComponent.prototype.limit = function () {\r\n return this.filter_json.limit !== undefined ? this.filter_json.limit : 10;\r\n};","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","import f from \"../functions.js\";\r\nclass User {\r\n constructor(core, p){\r\n if(!p) p = {}\r\n\r\n this.core = core\r\n this.state = 0\r\n this.keysupdatetimeout = null\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n \r\n }\r\n\r\n destroy (){\r\n if(this.keysupdatetimeout){\r\n clearTimeout(this.keysupdatetimeout)\r\n }\r\n\r\n this.keysupdatetimeout = null\r\n this.state = 0\r\n\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n\r\n }\r\n\r\n setCredentials (credentials){\r\n if (credentials)\r\n this.credentials = credentials\r\n }\r\n\r\n setUsersInfo (usersinfo, reload){\r\n _.each(usersinfo || [], v => {\r\n\r\n this.core.store.commit('SET_USERINFO', {\r\n info : v,\r\n reload : reload\r\n })\r\n })\r\n }\r\n\r\n setContacts (usersinfo){\r\n \r\n //this.core.store.commit('SET_CONTACTS', usersinfo)\r\n \r\n }\r\n\r\n myMatrixId(){\r\n return this.matrixId(this.userinfo.id)\r\n }\r\n\r\n matrixId(id, domain){\r\n \r\n id || (id = '')\r\n\r\n if(id.indexOf(\"@\") == 0) return id\r\n\r\n return '@' + id + ':' + (domain || this.core.domain)\r\n }\r\n\r\n fromMatrixId(matrixid){\r\n return f.getmatrixid(matrixid)\r\n }\r\n}\r\n\r\nexport default User","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","var EXIF = require('exif-js');\r\n\r\nimport f from '@/application/functions'\r\n\r\nvar Images = function(){\r\n var self = this;\r\n\r\n self.orientation = function(image, exif){\r\n\r\n return new Promise((resolve, reject) => {\r\n if(!exif.orientation){\r\n return resolve(image)\r\n }\r\n\r\n var img = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d');\r\n \r\n img.src = srcData;\r\n\r\n img.onload = function(){\r\n\r\n var width = img.width,\r\n height = img.height;\r\n \r\n // set proper canvas dimensions before transform & export\r\n if ($.inArray(exif.orientation, [5, 6, 7, 8]) > -1) {\r\n canvas.width = height;\r\n canvas.height = width;\r\n } else {\r\n canvas.width = width;\r\n canvas.height = height;\r\n }\r\n \r\n // transform context before drawing image\r\n switch (exif.orientation) {\r\n case 1:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 2:\r\n // flip horizontal\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 3:\r\n // rotate 180\r\n ctx.translate(width, height);\r\n ctx.rotate(Math.PI);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 4:\r\n // flip vertical\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 5:\r\n // flip vertical, rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 6:\r\n // rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(0, -height);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 7:\r\n // flip horizontal, rotate 90 counter clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(width, -height);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 8:\r\n // rotate 90 counter clockwise\r\n ctx.rotate(-Math.PI / 2);\r\n ctx.translate(-width, 0);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n default:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n return;\r\n }\r\n \r\n // Draw img into canvas\r\n // ctx.drawImage(img, 0, 0, width, height);\r\n\r\n var url = canvas.toDataURL(\"image/jpeg\", 0.95);\r\n\r\n $(canvas).remove();\r\n\r\n resolve(url)\r\n\r\n }\r\n })\r\n }\r\n\r\n self.autorotation = function(file, base64){\r\n return new Promise((resolve, reject) => {\r\n\r\n if (file && !f.isios()) {\r\n EXIF.getData(file, function() {\r\n \r\n var exif = EXIF.getAllTags(this)\r\n \r\n self.orientation(base64, exif).then(res => {\r\n return resolve(res)\r\n })\r\n \r\n })\r\n } else {\r\n return resolve(base64)\r\n }\r\n }) \r\n\r\n }\r\n\r\n self.srcToData = function(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function() {\r\n var reader = new FileReader();\r\n reader.onloadend = function() {\r\n callback(reader.result);\r\n }\r\n reader.readAsDataURL(xhr.response);\r\n };\r\n \r\n xhr.onerror = function(){}\r\n \r\n xhr.open('GET', url);\r\n xhr.responseType = 'blob';\r\n xhr.send();\r\n }\r\n\r\n self.resize = {\r\n fit : function(srcData, width, height, format, quality) {\r\n\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\";\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n\r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n var c = Math.max(((newHeight - height) / newHeight), ((newWidth - width) / newWidth))\r\n \r\n if(c > 0){\r\n newHeight = newHeight * (c + 1)\r\n newWidth = newWidth * (c + 1)\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n\r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n }) \r\n \r\n },\r\n\r\n def : function(srcData, width, height, format, quality) {\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\"\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n \r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n \r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n \r\n })\r\n \r\n \r\n }\r\n }\r\n \r\n \r\n self.grayscaleImage = function (srcData, clbk){\r\n\r\n var image = new Image();\r\n\r\n image.src = srcData;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n image.onload = function(){\r\n\r\n var myCanvas = document.createElement(\"canvas\");\r\n var myCanvasContext = myCanvas.getContext(\"2d\");\r\n\r\n var imgWidth = image.width;\r\n var imgHeight = image.height;\r\n \r\n myCanvas.width = imgWidth;\r\n myCanvas.height = imgHeight;\r\n\r\n myCanvasContext.drawImage(image, 0, 0);\r\n\r\n var imageData = myCanvasContext.getImageData(0,0, imgWidth, imgHeight);\r\n\r\n var j = 0, i = 0;\r\n\r\n for (i = 0; i < imageData.height; i++)\r\n {\r\n for (j = 0; j < imageData.width; j++)\r\n {\r\n var index=(i*4)*imageData.width+(j*4);\r\n var red=imageData.data[index];\r\n var green=imageData.data[index+1];\r\n var blue=imageData.data[index+2];\r\n var alpha=imageData.data[index+3];\r\n var average = (3 * red + green + blue)/3;\r\n\r\n imageData.data[index] = average;\r\n imageData.data[index+1]= average;\r\n imageData.data[index+2]= average;\r\n imageData.data[index+3]= alpha;\r\n }\r\n }\r\n\r\n myCanvasContext.putImageData(imageData, 0, 0, 0, 0, imageData.width, imageData.height);\r\n \r\n resolve(myCanvas.toDataURL());\r\n\r\n }\r\n\r\n })\r\n }\r\n\r\n self.wh = function(base64){\r\n const img = new Image();\r\n var imgInfo = {};\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n img.onload = function () {\r\n imgInfo.w = this.width\r\n imgInfo.h = this.height\r\n resolve(imgInfo)\r\n }\r\n\r\n img.onerror = function (e) {\r\n reject(e)\r\n }\r\n\r\n img.src = base64\r\n //this.info = imgInfo\r\n\r\n })\r\n \r\n }\r\n\r\n return self;\r\n}\r\n\r\nexport default Images","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","module.exports = require('./readable').PassThrough\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=16157ecb&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=16157ecb&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"16157ecb\",\n null\n ,true\n)\n\nexport default component.exports","import Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport f from '@/application/functions.js'\r\n\r\n\r\nVue.use(Vuex);\r\n\r\nvar themes = {\r\n\twhite: \"White\",\r\n\tblack: \"Dark\",\r\n\tclassic: \"Classic\"\r\n}\r\n\r\nvar mex = {\r\n\ttheme: function (state, value) {\r\n\r\n\t\tif (themes[value]) {\r\n\t\t\tstate.theme = value\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar activetimeout = null\r\n\r\nvar store = new Vuex.Store({\r\n\tstate: {\r\n\t\tcontacts: {},\r\n\t\tcontactsFromMatrix: {},\r\n\t\tcontactsMap: {},\r\n\t\tchats: [],\r\n\t\tprechats: [],\r\n\t\tchatsMap: {},\r\n\t\tevents: {},\r\n\t\tusers: {},\r\n\t\ttyping: {},\r\n\t\ticon: null,\r\n\t\tloading: false,\r\n\t\tonline: true,\r\n\t\tunauthorized: false,\r\n\t\ttheme: 'white',\r\n\t\tthemes: themes,\r\n\t\tsignedUpUsers: [],\r\n\t\tpocketnet: '',\r\n\t\tmobile: '',\r\n\t\tvoiceMessagesEnabled: '',\r\n\t\tcurrentPlayingVoiceMessage: null,\r\n\t\tcurrent_user: {},\r\n\t\tminimized: true,\r\n\t\tactive: false,\r\n\t\tactiveBlock: {},\r\n\t\tglobalpreloader: false,\r\n\t\tallnotifications: 0,\r\n\t\tpocketteammessages: [],\r\n\t\treadedteammessages: {},\r\n\t\tchatsready: false,\r\n\t\tautohide: false,\r\n\t\titeraction: false,\r\n\t\troomMembes: [],\r\n\t\tgallery: null,\r\n\t\tshare: null,\r\n\t\tcontact: null,\r\n\t\tconnect: null,\r\n\t\tjoinroom: null,\r\n\t\tchatusers: {},\r\n\t\tforce: {},\r\n\t\twasunhidden: false,\r\n\t\thiddenInParent: false,\r\n\t\thideOptimization: false,\r\n\t\tmodalShowed: null,\r\n\t\tmenu: null,\r\n\t\tpinchat: false,\r\n\t\tlastroom: null,\r\n\t\tdontreadreceipts: false,\r\n\t\tvoicerecording : false,\r\n\t\tdeletedrooms: {},\r\n\t\tpkoindisabled : false\r\n\t\t//share : {url : 'https://yandex.ru/'} //null\r\n\t},\r\n\tgetters: {\r\n\t\tgetUser: state => {\r\n\t\t\treturn state.user\r\n\t\t},\r\n\t\tgetConnection: state => {\r\n\t\t\treturn state.localMatrixStore\r\n\t\t},\r\n\r\n\t\tgetSignedUpUsers: state => {\r\n\t\t\treturn state.signedUpUsers\r\n\t\t},\r\n\t},\r\n\tmutations: {\r\n\t\tSET_CURRENT_PLAYING_VOICE_MESSAGE(state, message) {\r\n\t\t\tstate.currentPlayingVoiceMessage = message\r\n\t\t},\r\n\t\tsetUser(state, userData) {\r\n\t\t\tstate.current_user = userData || {}\r\n\t\t},\r\n\r\n\t\tclearall(state) {\r\n\r\n\t\t\tstate.contacts = {}\r\n\t\t\tstate.contactsFromMatrix = {}\r\n\t\t\tstate.contactsMap = {}\r\n\t\t\tstate.chats = []\r\n\t\t\tstate.prechats = []\r\n\t\t\tstate.chatsMap = {}\r\n\t\t\tstate.events = {}\r\n\t\t\tstate.users = {}\r\n\t\t\tstate.typing = {}\r\n\t\t\tstate.icon = null\r\n\t\t\tstate.loading = false\r\n\t\t\tstate.online = true\r\n\t\t\tstate.unauthorized = false\r\n\t\t\tstate.signedUpUsers = []\r\n\t\t\t/*state.pocketnet = ''*/\r\n\t\t\tstate.current_user = {}\r\n\t\t\tstate.minimized = false\r\n\t\t\tstate.active = false\r\n\t\t\tstate.activeBlock = {}\r\n\t\t\tstate.globalpreloader = false\r\n\t\t\tstate.allnotifications = 0\r\n\t\t\tstate.pocketteammessages = []\r\n\t\t\tstate.readedteammessages = {}\r\n\t\t\tstate.chatsready = false\r\n\t\t\tstate.autohide = false\r\n\t\t\tstate.gallery = null\r\n\t\t\tstate.modalShowed = null\r\n\t\t\tstate.menu = null\r\n\t\t\tstate.pinchat = false\r\n\t\t\tstate.dontreadreceipts = false\r\n\t\t\tstate.lastroom = null\r\n\t\t\tstate.voicerecording = false\r\n\r\n\t\t\t// state.share = null\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t} else state.minimized = true\r\n\r\n\t\t\tif (activetimeout) {\r\n\t\t\t\tclearTimeout(activetimeout)\r\n\t\t\t\tactivetimeout = null\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tblockactive(state, a) {\r\n\t\t\tif (a.value)\r\n\t\t\t\tVue.set(state.activeBlock, a.item, a.value)\r\n\t\t\telse\r\n\t\t\t\tVue.delete(state.activeBlock, a.item, a.value)\r\n\r\n\t\t},\r\n\r\n\t\tglobalpreloader: function (state, value) {\r\n\t\t\tstate.globalpreloader = value\r\n\t\t},\r\n\r\n\t\ticon(state, value) {\r\n\r\n\t\t\tstate.icon = value\r\n\r\n\t\t\tvar mv = f.deep(window, 'window.POCKETNETINSTANCE.mobile.vibration')\r\n\r\n\t\t\tif (mv) {\r\n\t\t\t\tmv.small()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tpkoindisabled(state, value){\r\n\t\t\tstate.pkoindisabled = value && value == 'true' ? true : false\r\n\t\t},\r\n\r\n\t\twasunhidden(state, value) {\r\n\t\t\tstate.wasunhidden = true\r\n\t\t},\r\n\r\n\t\thiddenInParent(state, value) {\r\n\t\t\tstate.hiddenInParent = value\r\n\t\t},\r\n\r\n\t\thideOptimization(state, value) {\r\n\t\t\tstate.hideOptimization = value\r\n\t\t},\r\n\r\n\t\tpinchat(state, value) {\r\n\t\t\tstate.pinchat = value\r\n\t\t\tlocalStorage['pinchat'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tdontreadreceipts(state, value) {\r\n\t\t\tstate.dontreadreceipts = value\r\n\r\n\t\t\tlocalStorage['dontreadreceipts'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tSET_LAST_ROOM(state, value) {\r\n\r\n\t\t\tif (!value) state.lastroom = null\r\n\r\n\t\t\telse\r\n\t\t\t\tstate.lastroom = {\r\n\t\t\t\t\tid: value,\r\n\t\t\t\t\ttime: new Date()\r\n\t\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tactive(state, value) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tvar time = 50;\r\n\r\n\t\t\tif (!value) time = 1000\r\n\r\n\t\t\tactivetimeout = f.slowMade(() => {\r\n\r\n\t\t\t\tif (!value) {\r\n\t\t\t\t\tif (!_.isEmpty(state.activeBlock)) {\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstate.iteraction = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstate.active = value\r\n\r\n\t\t\t\tif (!state.active) {\r\n\t\t\t\t\tstate.share = null\r\n\t\t\t\t\tdelete state.activeBlock.share\r\n\t\t\t\t}\r\n\r\n\t\t\t}, activetimeout, time)\r\n\t\t},\r\n\r\n\t\tsetiteraction(state, value) {\r\n\t\t\tstate.iteraction = value\r\n\t\t},\r\n\r\n\t\tmaximize(state, route) {\r\n\t\t\tstate.minimized = false\r\n\t\t},\r\n\r\n\t\tminimize(state, v) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif (state.minimized) {\r\n\t\t\t\tstate.activeBlock = {}\r\n\t\t\t\tstate.active = false\r\n\t\t\t}\r\n\r\n\t\t\tstate.minimized = true\r\n\t\t},\r\n\r\n\t\tsetmodal(state, v) {\r\n\t\t\tstate.modalShowed = v;\r\n\t\t},\r\n\r\n\t\tsetPocketnet(state, pocketnet) {\r\n\t\t\tstate.pocketnet = pocketnet;\r\n\t\t},\r\n\t\tsetMobile(state, mobile) {\r\n\t\t\tstate.mobile = mobile;\r\n\t\t},\r\n\r\n\t\tsetVoiceMessagesEnabled(state, voiceMessagesEnabled) {\r\n\t\t\tstate.voiceMessagesEnabled = voiceMessagesEnabled;\r\n\t\t},\r\n\r\n\t\tls(state) {\r\n\t\t\tif (typeof localStorage.getItem('pinchat') != 'undefined')\r\n\t\t\t\tstate.pinchat = localStorage.getItem('pinchat') ? true : false\r\n\r\n\t\t\tif (typeof localStorage.getItem('dontreadreceipts') != 'undefined')\r\n\t\t\t\tstate.dontreadreceipts = localStorage.getItem('dontreadreceipts') ? true : false\r\n\t\t},\r\n\r\n\t\tinit(state) {\r\n\t\t\tmex.theme(state, localStorage.getItem('theme') || 'white')\r\n\r\n\r\n\r\n\t\t},\r\n\r\n\t\tALL_NOTIFICATIONS_COUNT(state, rooms) {\r\n\r\n\t\t\tvar n = new Date()\r\n\r\n\t\t\tvar count = _.filter(rooms, room => {\r\n\r\n\t\t\t\tif (room._selfMembership === 'invite') {\r\n\t\t\t\t\tvar users = store._vm.core.mtrx.anotherChatUsers(room)\r\n\r\n\t\t\t\t\tif (users.length == 1 && store._vm.core.mtrx.blockeduser(users[0].userId)) {\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (f.date.addseconds(new Date(room.summary.lastModified), 86400) > n) return true\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tstate.allnotifications = _.reduce(rooms, (s, chat) => {\r\n\r\n\t\t\t\treturn s + (chat.getUnreadNotificationCount() || 0)\r\n\r\n\t\t\t}, 0) + count.length\r\n\r\n\r\n\t\t\tif (state.chats.length <= 3) {\r\n\t\t\t\t// Count notifications from pocketnet team room\r\n\t\t\t\tvar pocketMessages = _.filter(state.pocketteammessages, function (m) {\r\n\t\t\t\t\treturn !state.readedteammessages[m.id];\r\n\t\t\t\t}).length;\r\n\t\t\t\tstate.allnotifications += pocketMessages\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar external = f.deep(store, '_vm.core.external.clbks.ALL_NOTIFICATIONS_COUNT') || {}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(state.allnotifications)\r\n\t\t\t})\r\n\r\n\t\t\treturn state.allnotifications\r\n\t\t},\r\n\r\n\t\tSET_CHATS_READY(state, v) {\r\n\t\t\tstate.chatsready = v\r\n\t\t},\r\n\r\n\t\tSET_PRECHATS_TO_STORE(state, chats) {\r\n\t\t\tstate.prechats = chats;\r\n\t\t},\r\n\r\n\t\tSET_CHAT_TO_FORCE(state, id) {\r\n\r\n\r\n\t\t\tVue.set(state.force, id, true)\r\n\r\n\t\t},\r\n\r\n\t\tSET_CHATS_TO_STORE(state, chats) {\r\n\r\n\t\t\tstate.chats = chats;\r\n\r\n\t\t\tvar chatsMap = {}\r\n\r\n\t\t\t_.each(chats, (chat) => {\r\n\r\n\t\t\t\tvar aid = chat.info.title.replace(\"#\", '')\r\n\r\n\t\t\t\tif (!state.chatsMap[chat.roomId] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, chat.roomId, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!state.chatsMap[aid] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, aid, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchatsMap[chat.roomId] = chat\r\n\t\t\t\tchatsMap[chat.info.title.replace(\"#\", '')] = chat\r\n\r\n\t\t\t\tVue.delete(state.force, chat.roomId)\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.chatsMap, function (c, id) {\r\n\t\t\t\tif (!chatsMap[id]) Vue.delete(state.chatsMap, id)\r\n\t\t\t})\r\n\r\n\t\t\t//state.chatsMap = chatsMap;\r\n\r\n\t\t},\r\n\t\tSET_EVENTS_TO_STORE(state, events) {\r\n\t\t\t//state.events = events\r\n\t\t\t\r\n\t\t\t_.each(events, function(ev, k){\r\n\t\t\t\tvar timeline = []\r\n\r\n\t\t\t\t_.each(ev.timeline, function(__e){\r\n\t\t\t\t\tvar e = __e.event\r\n\r\n\t\t\t\t\tvar _e = {\r\n\r\n\t\t\t\t\t\tevent : {\r\n\t\t\t\t\t\t\tcontent : _.clone(e.content),\r\n\t\t\t\t\t\t\tevent_id: e.event_id,\r\n\t\t\t\t\t\t\torigin_server_ts: e.origin_server_ts,\r\n\t\t\t\t\t\t\troom_id: e.room_id,\r\n\t\t\t\t\t\t\tsender: e.sender,\r\n\t\t\t\t\t\t\tstate_key: e.state_key,\r\n\t\t\t\t\t\t\ttype: e.type\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\tget : () => __e\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttimeline.push(_e)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\tVue.set(state.events, k, {timeline})\r\n\t\t\t});\r\n\r\n\t\t},\r\n\r\n\t\tSET_TYPING_TO_STORE(state, data) {\r\n\t\t\tstate.typing[data.room] || (state.typing[data.room] = {})\r\n\t\t\tstate.typing[data.room][data.name] = data.typing\r\n\r\n\t\t\tfunction allTrue(data) {\r\n\t\t\t\tfor (var o in data)\r\n\t\t\t\t\tif (!data[o]) return false;\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tallTrue(data.typing)\r\n\r\n\t\t},\r\n\t\tDELETE_ROOM(state, roomid) {\r\n\r\n\t\t\tVue.set(state.deletedrooms, roomid, true)\r\n\r\n\r\n\r\n\t\t},\r\n\t\tSET_CONTACTS(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tmp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contacts = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CHATS_USERS(state, v) {\r\n\r\n\t\t\t_.each(v || {}, function (u, i) {\r\n\t\t\t\tif (!state.chatusers[i] || !_.isEqual(state.chatusers[i], u)) {\r\n\t\t\t\t\tVue.set(state.chatusers, i, u)\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\r\n\t\t\t//state.chatusers = v || {}\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_FROM_MATRIX(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tif (f.getmatrixid(c.id) != (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)) mp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsFromMatrix = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_MAP(state) {\r\n\r\n\t\t\tvar contactsMap = {}\r\n\r\n\t\t\t_.each(state.contacts, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.contactsFromMatrix, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsMap = contactsMap;\r\n\t\t},\r\n\r\n\t\tSET_UNAUTHORIZED(state, v) {\r\n\t\t\tstate.unauthorized = v\r\n\t\t},\r\n\r\n\t\tSET_USERINFO(state, v) {\r\n\r\n\t\t\tif (!v.info) return\r\n\r\n\t\t\tif (v.reload || !state.users[v.info.id]) Vue.set(state.users, v.info.id, v.info)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tSET_CURRENT_ROOM(state, v) {\r\n\r\n\t\t\tstate.currentRoom = v\r\n\t\t},\r\n\r\n\t\tCLEAR_USERSINFO(state, v) {\r\n\t\t\tstate.users = {}\r\n\t\t},\r\n\r\n\t\tGALLERY(state, v) {\r\n\r\n\t\t\tstate.gallery = v || null\r\n\r\n\t\t\tvar fu = null\r\n\r\n\t\t\tif(v){\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.gallerybackground')\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.background')\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif (fu) {\r\n\t\t\t\tfu()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tSHARE(state, v) {\r\n\t\t\tstate.share = v || null\r\n\r\n\t\t\tif (!state.mobile) {\r\n\t\t\t\tstate.activeBlock.share = true\r\n\t\t\t\tstate.active = true;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tCONNECT(state, v) {\r\n\t\t\tstate.connect = v\r\n\t\t},\r\n\r\n\t\tJOINROOM(state, v) {\r\n\t\t\tstate.joinroom = v\r\n\t\t},\r\n\r\n\t\tCONTACT(state, v) {\r\n\t\t\tstate.contact = v || null\r\n\t\t},\r\n\r\n\t\ttheme(state, value) {\r\n\t\t\tmex.theme(state, value)\r\n\t\t},\r\n\r\n\t\tSET_POCKETTEAMMESSAGES(state, v) {\r\n\t\t\tstate.pocketteammessages = v;\r\n\t\t\t// Check local storage\r\n\t\t\tvar readedMessagesStr = localStorage.getItem('readedpocketteammessages');\r\n\t\t\tif (readedMessagesStr) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar readedMessages = JSON.parse(readedMessagesStr);\r\n\t\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tlocalStorage.removeItem('readedpocketteammessages');\r\n\t\t\t\t\tstate.readedteammessages = {};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_READEDTEAMMESSAGES(state, v) {\r\n\t\t\tif (v && v.length > 0) {\r\n\t\t\t\tvar readedMessages = {};\r\n\t\t\t\t_.each(v, function (m) {\r\n\t\t\t\t\treadedMessages[m.id] = true;\r\n\t\t\t\t});\r\n\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t// Update local storage\r\n\t\t\t\tlocalStorage.setItem('readedpocketteammessages', JSON.stringify(readedMessages));\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_MENU(state, v) {\r\n\t\t\tstate.menu = v\r\n\r\n\t\t},\r\n\r\n\t\tSET_VOICERECORDING(state, v){\r\n\t\t\tstate.voicerecording = v\r\n\t\t}\r\n\r\n\t},\r\n\tactions: {\r\n\t\tSET_CHAT_MEMBERS({ commit }, chat) {\r\n\r\n\t\t},\r\n\t\tTYPING_EVENT({ commit }, member) {\r\n\t\t\tlet room = member.roomId\r\n\t\t\tlet name = member.name\r\n\t\t\tlet data = { room, name, typing: member.typing }\r\n\t\t\tcommit('SET_TYPING_TO_STORE', data)\r\n\t\t},\r\n\t\tCHAT_MEMBERS({ commit }) {\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY_FROMEVENTS({ commit, dispatch }, { events, event }) {\r\n\r\n\t\t\tvar images = [], index = 0\r\n\r\n\t\t\tvar encrypted = function (event) {\r\n\t\t\t\treturn f.deep(event, 'event.content.info.secrets') ? true : false\r\n\t\t\t}\r\n\r\n\t\t\t_.each(events, event => {\r\n\r\n\t\t\t\tif (event.event.content.msgtype === 'm.image') {\r\n\r\n\t\t\t\t\tvar url = event.event.content.url\r\n\r\n\t\t\t\t\tif (encrypted(event)) {\r\n\t\t\t\t\t\turl = event.event.decryptedImage\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\timages.push({\r\n\t\t\t\t\t\tsrc: url,\r\n\t\t\t\t\t\tw: event.event.content.info.w || 500,\r\n\t\t\t\t\t\th: event.event.content.info.h || 500,\r\n\t\t\t\t\t\teventId: event.event.event_id\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\t\t\timages = _.filter(images, function (i) {\r\n\t\t\t\treturn i.src\r\n\t\t\t})\r\n\r\n\t\t\tindex = images.map(function (e) {\r\n\t\t\t\treturn e.eventId\r\n\t\t\t}).indexOf(event.event.event_id)\r\n\r\n\t\t\tdispatch('SHOW_GALLERY', { images, index })\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY({ commit }, { images, index }) {\r\n\r\n\t\t\tif (!index) index = 0\r\n\r\n\t\t\tif (!images) images = []\r\n\r\n\t\t\tif (images.length) {\r\n\r\n\t\t\t\tcommit('GALLERY', {\r\n\t\t\t\t\timages: images,\r\n\t\t\t\t\tindex: index\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcommit('GALLERY', null)\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tRELOAD_CHAT_USERS({ commit }, m_chats) {\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats, true).then(i => {\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tFETCH_CHATS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar id = store._vm.core.user.myMatrixId()\r\n\r\n\t\t\tvar chats = _.map(m_chats, function (r) {\r\n\t\t\t\tif (r.getLastActiveTimestamp() === -9007199254740991) {\r\n\r\n\t\t\t\t\tif (r.getMember(id)) {\r\n\t\t\t\t\t\tr.summary.lastModified = r.getMember(id).events.member.event.origin_server_ts\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tr.summary.lastModified = r.getLastActiveTimestamp()\r\n\t\t\t\t}\r\n\t\t\t\treturn r.summary\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_PRECHATS_TO_STORE', chats)\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.allchatmembers(m_chats).then(r => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_TO_STORE', chats)\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\r\n\t\t\t\treturn store._vm.core.mtrx.kit.fillContacts(m_chats)\r\n\r\n\t\t\t})\r\n\r\n\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats).then(i => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\tcommit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n\t\t\t\t\treturn m.id !== (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)\r\n\t\t\t\t}))\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\r\n\t\tFETCH_EVENTS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar events = {}\r\n\r\n\t\t\t_.each(m_chats, function (chat) {\r\n\r\n\t\t\t\tevents[chat.roomId] = {}\r\n\r\n\t\t\t\tvar timeline = [].concat(chat.timeline, chat.currentState.getStateEvents('m.room.member'))\r\n\r\n\t\t\t\tevents[chat.roomId].timeline = timeline\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(events, function (e) {\r\n\r\n\t\t\t\te.timeline = _.sortBy(e.timeline, function (event) {\r\n\t\t\t\t\treturn event.getDate()\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_EVENTS_TO_STORE', events)\r\n\r\n\t\t\t//store._vm.core.mtrx.kit.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n\t\t\t//})\r\n\r\n\t\t},\r\n\t}\r\n})\r\n\r\n\r\nexport default store;","/*!\n * vue-router v3.5.3\n * (c) 2021 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (!condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b, onlyPath) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query))\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n (onlyPath || (\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params))\n )\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/+/g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar warnedCustomSlot;\nvar warnedTagProp;\nvar warnedEventProp;\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n custom: Boolean,\n exact: Boolean,\n exactPath: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);\n classes[activeClass] = this.exact || this.exactPath\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (process.env.NODE_ENV !== 'production' && !this.custom) {\n !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\\n\\n');\n warnedCustomSlot = true;\n }\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\" with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ('tag' in this.$options.propsData && !warnedTagProp) {\n warn(\n false,\n \"'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedTagProp = true;\n }\n if ('event' in this.$options.propsData && !warnedEventProp) {\n warn(\n false,\n \"'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedEventProp = true;\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap,\n parentRoute\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n alias: route.alias\n ? typeof route.alias === 'string'\n ? [route.alias]\n : route.alias\n : [],\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function addRoute (parentOrRoute, route) {\n var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;\n // $flow-disable-line\n createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);\n\n // add aliases of parent\n if (parent && parent.alias.length) {\n createRouteMap(\n // $flow-disable-line route is defined if parent is\n parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),\n pathList,\n pathMap,\n nameMap,\n parent\n );\n }\n }\n\n function getRoutes () {\n return pathList.map(function (path) { return pathMap[path]; })\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoute: addRoute,\n getRoutes: getRoutes,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1.ensureURL();\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1.ready) {\n this$1.ready = true;\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1.ready = true;\n this$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1.errorCbs.length) {\n this$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'uncaught error during route navigation:');\n }\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n if (route.hash) {\n handleScroll(this.router, current, route, false);\n }\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1.replace(to);\n } else {\n this$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1.pending = null;\n onComplete(route);\n if (this$1.router.app) {\n this$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1.base);\n if (this$1.current === START && location === this$1._startLocation) {\n return\n }\n\n this$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n var pathLowerCase = path.toLowerCase();\n var baseLowerCase = base.toLowerCase();\n // base=\"/a\" shouldn't turn path=\"/app\" into \"/a/pp\"\n // https://github.com/vuejs/vue-router/issues/3555\n // so we ensure the trailing slash in the base\n if (base && ((pathLowerCase === baseLowerCase) ||\n (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n this$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1.current;\n this$1.index = targetIndex;\n this$1.updateRoute(route);\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n if (process.env.NODE_ENV !== 'production') {\n warn(this instanceof VueRouter, \"Router must be called with the new operator.\");\n }\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1.apps.indexOf(app);\n if (index > -1) { this$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }\n\n if (!this$1.app) { this$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.getRoutes = function getRoutes () {\n return this.matcher.getRoutes()\n};\n\nVueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {\n this.matcher.addRoute(parentOrRoute, route);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');\n }\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.5.3';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\nVueRouter.START_LOCATION = START;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nexport default VueRouter;\n","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\n\r\nVue.use(Router);\r\n\r\n\r\nconst router = new Router({\r\n routes: [\r\n \r\n {\r\n path: '/contacts',\r\n name: 'contacts',\r\n component: () => import ('@/views/contacts')\r\n },\r\n {\r\n path: '/contact',\r\n name: 'contact',\r\n component: () => import ('@/views/contact') \r\n },\r\n {\r\n path: '/chats',\r\n name: 'chats',\r\n component: () => import ('@/views/chats')\r\n },\r\n {\r\n path: '/chat',\r\n name: 'chat',\r\n component: () => import ('@/views/chat')\r\n },\r\n {\r\n path: '/publicPreview',\r\n name: 'publicPreview',\r\n component: () => import ('@/views/publicPreview')\r\n },\r\n {\r\n path: '/chatSettings',\r\n name: 'chatSettings',\r\n component: () => import ('@/views/chatSettings')\r\n },\r\n {\r\n path: '/chatInfo',\r\n name: 'chatInfo',\r\n component: () => import ('@/views/chatinfo')\r\n },\r\n {\r\n path: '/teamRoom',\r\n name: 'teamRoom',\r\n component: () => import ('@/views/teamroom')\r\n },\r\n {\r\n path: '/settings',\r\n name: 'settings',\r\n component: () => import ('@/views/settings')\r\n },\r\n\r\n {\r\n path: '/invite',\r\n name: 'invite',\r\n component: () => import ('@/views/invite')\r\n },\r\n\r\n \r\n ],\r\n \r\n mode: document.getElementById('automomous') ? 'history' : 'abstract',\r\n \r\n})\r\n\r\n\r\nexport default router","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},attrs:{\"id\":\"modal\"}},[_c('div',{staticClass:\"modal-backdrop\",on:{\"click\":_vm.close}}),_c('div',{staticClass:\"modal-wrapper\"},[_c('div',{staticClass:\"modal\",attrs:{\"role\":\"dialog\",\"aria-labelledby\":\"modalTitle\",\"aria-describedby\":\"modalDescription\"}},[_c('div',{staticClass:\"modal-header\"},[_vm._t(\"header\",function(){return [_vm._v(\" \"+_vm._s(_vm.$t(\"caption.header\"))+\" \")]})],2),_c('div',{staticClass:\"modal-body\",attrs:{\"id\":\"modalDescription\"}},[_vm._t(\"body\")],2),(_vm.displayFooter)?_c('div',{staticClass:\"modal-footer\"}):_vm._e(),_c('div',{staticClass:\"modal-close\",on:{\"click\":_vm.close}},[_c('i',{staticClass:\"fas fa-times\"})])])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'modal',\r\n props: {\r\n displayFooter : {\r\n default : true,\r\n type : Boolean\r\n },\r\n cantclose : Boolean\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'modal'})\r\n },\r\n \r\n destroyed() {\r\n this.$store.commit('blockactive', {value : false, item : 'modal'})\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n \r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active: state => state.active,\r\n mobile: state => state.mobile,\r\n }),\r\n\r\n methods : {\r\n close : function(){\r\n this.$emit('close')\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f016832&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pmenu\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile}},[(_vm.menu)?_c('div',{staticClass:\"menubgwrapper\"},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menu.items},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"items\"},[_c('transition-group',{attrs:{\"name\":\"menulis2t\",\"tag\":\"div\"}},_vm._l((_vm.filteredItems),function(item){return _c('div',{key:item.click,staticClass:\"item\"},[_vm._t(\"default\",function(){return [_c('router-link',{attrs:{\"to\":'/' + item.route}},[_c('div',{staticClass:\"iwr\"},[(item.icon)?_c('i',{class:item.icon}):_vm._e(),_c('span',[_vm._v(_vm._s(item.name && typeof item.name === 'string' ? item.name : 'undefined'))])])])]},{\"item\":item})],2)}),0)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./simpleMenu.vue?vue&type=template&id=79bb4e47&scoped=true&\"\nimport script from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nexport * from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"79bb4e47\",\n null\n ,true\n)\n\nexport default component.exports","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'pmenu',\r\n props: {\r\n \r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n return {\r\n last : null\r\n }\r\n },\r\n\r\n watch: {\r\n \r\n },\r\n\r\n computed: {\r\n\r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent,\r\n\r\n menu : state => state.menu\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n if (this.menu){\r\n\r\n this.last = this.menu\r\n\r\n\r\n this.menu.handler(item, this.menu.item, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n })\r\n\r\n // this.$emit('itemClicked', item, this.menu.item, );\r\n }\r\n \r\n },\r\n\r\n showPopup : function(){\r\n if (this.last){\r\n this.$store.commit('SET_MENU', this.last);\r\n this.last = null\r\n }\r\n },\r\n \r\n hidePopup() {\r\n this.$store.commit('SET_MENU', null);\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=6078dda8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=6078dda8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6078dda8\",\n null\n ,true\n)\n\nexport default component.exports","/*!\n * vue-textarea-autosize v1.1.1 \n * (c) 2019 Saymon\n * Released under the MIT License.\n */\n//\n//\n//\n//\n//\n//\n//\nvar script = {\n name: 'TextareaAutosize',\n props: {\n value: {\n type: [String, Number],\n default: ''\n },\n autosize: {\n type: Boolean,\n default: true\n },\n minHeight: {\n type: [Number],\n 'default': null\n },\n maxHeight: {\n type: [Number],\n 'default': null\n },\n\n /*\n * Force !important for style properties\n */\n important: {\n type: [Boolean, Array],\n default: false\n }\n },\n data: function data() {\n return {\n // data property for v-model binding with real textarea tag\n val: null,\n // works when content height becomes more then value of the maxHeight property\n maxHeightScroll: false,\n height: 'auto'\n };\n },\n computed: {\n computedStyles: function computedStyles() {\n if (!this.autosize) return {};\n return {\n resize: !this.isResizeImportant ? 'none' : 'none !important',\n height: this.height,\n overflow: this.maxHeightScroll ? 'auto' : !this.isOverflowImportant ? 'hidden' : 'hidden !important'\n };\n },\n isResizeImportant: function isResizeImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('resize');\n },\n isOverflowImportant: function isOverflowImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('overflow');\n },\n isHeightImportant: function isHeightImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('height');\n }\n },\n watch: {\n value: function value(val) {\n this.val = val;\n },\n val: function val(_val) {\n this.$nextTick(this.resize);\n this.$emit('input', _val);\n },\n minHeight: function minHeight() {\n this.$nextTick(this.resize);\n },\n maxHeight: function maxHeight() {\n this.$nextTick(this.resize);\n },\n autosize: function autosize(val) {\n if (val) this.resize();\n }\n },\n methods: {\n resize: function resize() {\n var _this = this;\n\n var important = this.isHeightImportant ? 'important' : '';\n this.height = \"auto\".concat(important ? ' !important' : '');\n this.$nextTick(function () {\n var contentHeight = _this.$el.scrollHeight + 1;\n\n if (_this.minHeight) {\n contentHeight = contentHeight < _this.minHeight ? _this.minHeight : contentHeight;\n }\n\n if (_this.maxHeight) {\n if (contentHeight > _this.maxHeight) {\n contentHeight = _this.maxHeight;\n _this.maxHeightScroll = true;\n } else {\n _this.maxHeightScroll = false;\n }\n }\n\n var heightVal = contentHeight + 'px';\n _this.height = \"\".concat(heightVal).concat(important ? ' !important' : '');\n });\n return this;\n }\n },\n created: function created() {\n this.val = this.value;\n },\n mounted: function mounted() {\n this.resize();\n }\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\n/* server only */\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n } // Vue.extend constructor export interop.\n\n\n var options = typeof script === 'function' ? script.options : script; // render functions\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true; // functional template\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n } // scopedId\n\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n var hook;\n\n if (moduleIdentifier) {\n // server build\n hook = function hook(context) {\n // 2.3 injection\n context = context || // cached call\n this.$vnode && this.$vnode.ssrContext || // stateful\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\n // 2.2 with runInNewContext: true\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n } // inject component styles\n\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n } // register component module identifier for async chunk inference\n\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n }; // used by ssr in case component is cached and beforeCreate\n // never gets called\n\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function () {\n style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n // register for functional component in vue file\n var originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\nvar normalizeComponent_1 = normalizeComponent;\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.val),expression:\"val\"}],style:(_vm.computedStyles),domProps:{\"value\":(_vm.val)},on:{\"focus\":_vm.resize,\"input\":function($event){if($event.target.composing){ return; }_vm.val=$event.target.value;}}})};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n\n \n var TextareaAutosize = normalizeComponent_1(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n undefined,\n undefined\n );\n\nvar version = '1.1.1';\n\nvar install = function install(Vue) {\n Vue.component('TextareaAutosize', TextareaAutosize);\n};\n\nvar plugin = {\n install: install,\n version: version\n};\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(plugin);\n}\n\nexport default plugin;\n","/*!\n * vue-i18n v8.27.0 \n * (c) 2022 kazuya kawaguchi\n * Released under the MIT License.\n */\n/* */\n\n/**\n * constants\n */\n\nvar numberFormatKeys = [\n 'compactDisplay',\n 'currency',\n 'currencyDisplay',\n 'currencySign',\n 'localeMatcher',\n 'notation',\n 'numberingSystem',\n 'signDisplay',\n 'style',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits'\n];\n\n/**\n * utilities\n */\n\nfunction warn (msg, err) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.warn(err.stack);\n }\n }\n}\n\nfunction error (msg, err) {\n if (typeof console !== 'undefined') {\n console.error('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.error(err.stack);\n }\n }\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isBoolean (val) {\n return typeof val === 'boolean'\n}\n\nfunction isString (val) {\n return typeof val === 'string'\n}\n\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n return toString.call(obj) === OBJECT_STRING\n}\n\nfunction isNull (val) {\n return val === null || val === undefined\n}\n\nfunction isFunction (val) {\n return typeof val === 'function'\n}\n\nfunction parseArgs () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var locale = null;\n var params = null;\n if (args.length === 1) {\n if (isObject(args[0]) || isArray(args[0])) {\n params = args[0];\n } else if (typeof args[0] === 'string') {\n locale = args[0];\n }\n } else if (args.length === 2) {\n if (typeof args[0] === 'string') {\n locale = args[0];\n }\n /* istanbul ignore if */\n if (isObject(args[1]) || isArray(args[1])) {\n params = args[1];\n }\n }\n\n return { locale: locale, params: params }\n}\n\nfunction looseClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction remove (arr, item) {\n if (arr.delete(item)) {\n return arr\n }\n}\n\nfunction arrayFrom (arr) {\n var ret = [];\n arr.forEach(function (a) { return ret.push(a); });\n return ret\n}\n\nfunction includes (arr, item) {\n return !!~arr.indexOf(item)\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\nfunction merge (target) {\n var arguments$1 = arguments;\n\n var output = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments$1[i];\n if (source !== undefined && source !== null) {\n var key = (void 0);\n for (key in source) {\n if (hasOwn(source, key)) {\n if (isObject(source[key])) {\n output[key] = merge(output[key], source[key]);\n } else {\n output[key] = source[key];\n }\n }\n }\n }\n }\n return output\n}\n\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = isArray(a);\n var isArrayB = isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.\n * @param rawText The raw input from the user that should be escaped.\n */\nfunction escapeHtml(rawText) {\n return rawText\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\n/**\n * Escapes html tags and special symbols from all provided params which were returned from parseArgs().params.\n * This method performs an in-place operation on the params object.\n *\n * @param {any} params Parameters as provided from `parseArgs().params`.\n * May be either an array of strings or a string->any map.\n *\n * @returns The manipulated `params` object.\n */\nfunction escapeParams(params) {\n if(params != null) {\n Object.keys(params).forEach(function (key) {\n if(typeof(params[key]) == 'string') {\n params[key] = escapeHtml(params[key]);\n }\n });\n }\n return params\n}\n\n/* */\n\nfunction extend (Vue) {\n if (!Vue.prototype.hasOwnProperty('$i18n')) {\n // $FlowFixMe\n Object.defineProperty(Vue.prototype, '$i18n', {\n get: function get () { return this._i18n }\n });\n }\n\n Vue.prototype.$t = function (key) {\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n\n var i18n = this.$i18n;\n return i18n._t.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this ].concat( values ))\n };\n\n Vue.prototype.$tc = function (key, choice) {\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n\n var i18n = this.$i18n;\n return i18n._tc.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this, choice ].concat( values ))\n };\n\n Vue.prototype.$te = function (key, locale) {\n var i18n = this.$i18n;\n return i18n._te(key, i18n.locale, i18n._getMessages(), locale)\n };\n\n Vue.prototype.$d = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).d.apply(ref, [ value ].concat( args ))\n };\n\n Vue.prototype.$n = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).n.apply(ref, [ value ].concat( args ))\n };\n}\n\n/* */\n\n/**\n * Mixin\n * \n * If `bridge` mode, empty mixin is returned,\n * else regulary mixin implementation is returned.\n */\nfunction defineMixin (bridge) {\n if ( bridge === void 0 ) bridge = false;\n\n function mounted () {\n if (this !== this.$root && this.$options.__INTLIFY_META__ && this.$el) {\n this.$el.setAttribute('data-intlify', this.$options.__INTLIFY_META__);\n }\n }\n\n return bridge\n ? { mounted: mounted } // delegate `vue-i18n-bridge` mixin implementation\n : { // regulary \n beforeCreate: function beforeCreate () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n = options.__i18nBridge || options.__i18n;\n _i18n.forEach(function (resource) {\n localeMessages = merge(localeMessages, JSON.parse(resource));\n });\n Object.keys(localeMessages).forEach(function (locale) {\n options.i18n.mergeLocaleMessage(locale, localeMessages[locale]);\n });\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n this._i18n = options.i18n;\n this._i18nWatcher = this._i18n.watchI18nData();\n } else if (isPlainObject(options.i18n)) {\n var rootI18n = this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n\n ? this.$root.$i18n\n : null;\n // component local i18n\n if (rootI18n) {\n options.i18n.root = this.$root;\n options.i18n.formatter = rootI18n.formatter;\n options.i18n.fallbackLocale = rootI18n.fallbackLocale;\n options.i18n.formatFallbackMessages = rootI18n.formatFallbackMessages;\n options.i18n.silentTranslationWarn = rootI18n.silentTranslationWarn;\n options.i18n.silentFallbackWarn = rootI18n.silentFallbackWarn;\n options.i18n.pluralizationRules = rootI18n.pluralizationRules;\n options.i18n.preserveDirectiveContent = rootI18n.preserveDirectiveContent;\n }\n\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages$1 = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n$1 = options.__i18nBridge || options.__i18n;\n _i18n$1.forEach(function (resource) {\n localeMessages$1 = merge(localeMessages$1, JSON.parse(resource));\n });\n options.i18n.messages = localeMessages$1;\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n\n var ref = options.i18n;\n var sharedMessages = ref.sharedMessages;\n if (sharedMessages && isPlainObject(sharedMessages)) {\n options.i18n.messages = merge(options.i18n.messages, sharedMessages);\n }\n\n this._i18n = new VueI18n(options.i18n);\n this._i18nWatcher = this._i18n.watchI18nData();\n\n if (options.i18n.sync === undefined || !!options.i18n.sync) {\n this._localeWatcher = this.$i18n.watchLocale();\n }\n\n if (rootI18n) {\n rootI18n.onComponentInstanceCreated(this._i18n);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n // root i18n\n this._i18n = this.$root.$i18n;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n // parent i18n\n this._i18n = options.parent.$i18n;\n }\n },\n\n beforeMount: function beforeMount () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (isPlainObject(options.i18n)) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n }\n },\n\n mounted: mounted,\n\n beforeDestroy: function beforeDestroy () {\n if (!this._i18n) { return }\n\n var self = this;\n this.$nextTick(function () {\n if (self._subscribing) {\n self._i18n.unsubscribeDataChanging(self);\n delete self._subscribing;\n }\n\n if (self._i18nWatcher) {\n self._i18nWatcher();\n self._i18n.destroyVM();\n delete self._i18nWatcher;\n }\n\n if (self._localeWatcher) {\n self._localeWatcher();\n delete self._localeWatcher;\n }\n });\n }\n }\n}\n\n/* */\n\nvar interpolationComponent = {\n name: 'i18n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n path: {\n type: String,\n required: true\n },\n locale: {\n type: String\n },\n places: {\n type: [Array, Object]\n }\n },\n render: function render (h, ref) {\n var data = ref.data;\n var parent = ref.parent;\n var props = ref.props;\n var slots = ref.slots;\n\n var $i18n = parent.$i18n;\n if (!$i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return\n }\n\n var path = props.path;\n var locale = props.locale;\n var places = props.places;\n var params = slots();\n var children = $i18n.i(\n path,\n locale,\n onlyHasDefaultPlace(params) || places\n ? useLegacyPlaces(params.default, places)\n : params\n );\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag ? h(tag, data, children) : children\n }\n};\n\nfunction onlyHasDefaultPlace (params) {\n var prop;\n for (prop in params) {\n if (prop !== 'default') { return false }\n }\n return Boolean(prop)\n}\n\nfunction useLegacyPlaces (children, places) {\n var params = places ? createParamsFromPlaces(places) : {};\n\n if (!children) { return params }\n\n // Filter empty text nodes\n children = children.filter(function (child) {\n return child.tag || child.text.trim() !== ''\n });\n\n var everyPlace = children.every(vnodeHasPlaceAttribute);\n if (process.env.NODE_ENV !== 'production' && everyPlace) {\n warn('`place` attribute is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return children.reduce(\n everyPlace ? assignChildPlace : assignChildIndex,\n params\n )\n}\n\nfunction createParamsFromPlaces (places) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`places` prop is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return Array.isArray(places)\n ? places.reduce(assignChildIndex, {})\n : Object.assign({}, places)\n}\n\nfunction assignChildPlace (params, child) {\n if (child.data && child.data.attrs && child.data.attrs.place) {\n params[child.data.attrs.place] = child;\n }\n return params\n}\n\nfunction assignChildIndex (params, child, index) {\n params[index] = child;\n return params\n}\n\nfunction vnodeHasPlaceAttribute (vnode) {\n return Boolean(vnode.data && vnode.data.attrs && vnode.data.attrs.place)\n}\n\n/* */\n\nvar numberComponent = {\n name: 'i18n-n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n value: {\n type: Number,\n required: true\n },\n format: {\n type: [String, Object]\n },\n locale: {\n type: String\n }\n },\n render: function render (h, ref) {\n var props = ref.props;\n var parent = ref.parent;\n var data = ref.data;\n\n var i18n = parent.$i18n;\n\n if (!i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return null\n }\n\n var key = null;\n var options = null;\n\n if (isString(props.format)) {\n key = props.format;\n } else if (isObject(props.format)) {\n if (props.format.key) {\n key = props.format.key;\n }\n\n // Filter out number format options only\n options = Object.keys(props.format).reduce(function (acc, prop) {\n var obj;\n\n if (includes(numberFormatKeys, prop)) {\n return Object.assign({}, acc, ( obj = {}, obj[prop] = props.format[prop], obj ))\n }\n return acc\n }, null);\n }\n\n var locale = props.locale || i18n.locale;\n var parts = i18n._ntp(props.value, locale, key, options);\n\n var values = parts.map(function (part, index) {\n var obj;\n\n var slot = data.scopedSlots && data.scopedSlots[part.type];\n return slot ? slot(( obj = {}, obj[part.type] = part.value, obj.index = index, obj.parts = parts, obj )) : part.value\n });\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag\n ? h(tag, {\n attrs: data.attrs,\n 'class': data['class'],\n staticClass: data.staticClass\n }, values)\n : values\n }\n};\n\n/* */\n\nfunction bind (el, binding, vnode) {\n if (!assert(el, vnode)) { return }\n\n t(el, binding, vnode);\n}\n\nfunction update (el, binding, vnode, oldVNode) {\n if (!assert(el, vnode)) { return }\n\n var i18n = vnode.context.$i18n;\n if (localeEqual(el, vnode) &&\n (looseEqual(binding.value, binding.oldValue) &&\n looseEqual(el._localeMessage, i18n.getLocaleMessage(i18n.locale)))) { return }\n\n t(el, binding, vnode);\n}\n\nfunction unbind (el, binding, vnode, oldVNode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return\n }\n\n var i18n = vnode.context.$i18n || {};\n if (!binding.modifiers.preserve && !i18n.preserveDirectiveContent) {\n el.textContent = '';\n }\n el._vt = undefined;\n delete el['_vt'];\n el._locale = undefined;\n delete el['_locale'];\n el._localeMessage = undefined;\n delete el['_localeMessage'];\n}\n\nfunction assert (el, vnode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return false\n }\n\n if (!vm.$i18n) {\n warn('VueI18n instance does not exists in Vue instance');\n return false\n }\n\n return true\n}\n\nfunction localeEqual (el, vnode) {\n var vm = vnode.context;\n return el._locale === vm.$i18n.locale\n}\n\nfunction t (el, binding, vnode) {\n var ref$1, ref$2;\n\n var value = binding.value;\n\n var ref = parseValue(value);\n var path = ref.path;\n var locale = ref.locale;\n var args = ref.args;\n var choice = ref.choice;\n if (!path && !locale && !args) {\n warn('value type not supported');\n return\n }\n\n if (!path) {\n warn('`path` is required in v-t directive');\n return\n }\n\n var vm = vnode.context;\n if (choice != null) {\n el._vt = el.textContent = (ref$1 = vm.$i18n).tc.apply(ref$1, [ path, choice ].concat( makeParams(locale, args) ));\n } else {\n el._vt = el.textContent = (ref$2 = vm.$i18n).t.apply(ref$2, [ path ].concat( makeParams(locale, args) ));\n }\n el._locale = vm.$i18n.locale;\n el._localeMessage = vm.$i18n.getLocaleMessage(vm.$i18n.locale);\n}\n\nfunction parseValue (value) {\n var path;\n var locale;\n var args;\n var choice;\n\n if (isString(value)) {\n path = value;\n } else if (isPlainObject(value)) {\n path = value.path;\n locale = value.locale;\n args = value.args;\n choice = value.choice;\n }\n\n return { path: path, locale: locale, args: args, choice: choice }\n}\n\nfunction makeParams (locale, args) {\n var params = [];\n\n locale && params.push(locale);\n if (args && (Array.isArray(args) || isPlainObject(args))) {\n params.push(args);\n }\n\n return params\n}\n\nvar Vue;\n\nfunction install (_Vue, options) {\n if ( options === void 0 ) options = { bridge: false };\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && install.installed && _Vue === Vue) {\n warn('already installed.');\n return\n }\n install.installed = true;\n\n Vue = _Vue;\n\n var version = (Vue.version && Number(Vue.version.split('.')[0])) || -1;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && version < 2) {\n warn((\"vue-i18n (\" + (install.version) + \") need to use Vue 2.0 or later (Vue: \" + (Vue.version) + \").\"));\n return\n }\n\n extend(Vue);\n Vue.mixin(defineMixin(options.bridge));\n Vue.directive('t', { bind: bind, update: update, unbind: unbind });\n Vue.component(interpolationComponent.name, interpolationComponent);\n Vue.component(numberComponent.name, numberComponent);\n\n // use simple mergeStrategies to prevent i18n instance lose '__proto__'\n var strats = Vue.config.optionMergeStrategies;\n strats.i18n = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n };\n}\n\n/* */\n\nvar BaseFormatter = function BaseFormatter () {\n this._caches = Object.create(null);\n};\n\nBaseFormatter.prototype.interpolate = function interpolate (message, values) {\n if (!values) {\n return [message]\n }\n var tokens = this._caches[message];\n if (!tokens) {\n tokens = parse(message);\n this._caches[message] = tokens;\n }\n return compile(tokens, values)\n};\n\n\n\nvar RE_TOKEN_LIST_VALUE = /^(?:\\d)+/;\nvar RE_TOKEN_NAMED_VALUE = /^(?:\\w)+/;\n\nfunction parse (format) {\n var tokens = [];\n var position = 0;\n\n var text = '';\n while (position < format.length) {\n var char = format[position++];\n if (char === '{') {\n if (text) {\n tokens.push({ type: 'text', value: text });\n }\n\n text = '';\n var sub = '';\n char = format[position++];\n while (char !== undefined && char !== '}') {\n sub += char;\n char = format[position++];\n }\n var isClosed = char === '}';\n\n var type = RE_TOKEN_LIST_VALUE.test(sub)\n ? 'list'\n : isClosed && RE_TOKEN_NAMED_VALUE.test(sub)\n ? 'named'\n : 'unknown';\n tokens.push({ value: sub, type: type });\n } else if (char === '%') {\n // when found rails i18n syntax, skip text capture\n if (format[(position)] !== '{') {\n text += char;\n }\n } else {\n text += char;\n }\n }\n\n text && tokens.push({ type: 'text', value: text });\n\n return tokens\n}\n\nfunction compile (tokens, values) {\n var compiled = [];\n var index = 0;\n\n var mode = Array.isArray(values)\n ? 'list'\n : isObject(values)\n ? 'named'\n : 'unknown';\n if (mode === 'unknown') { return compiled }\n\n while (index < tokens.length) {\n var token = tokens[index];\n switch (token.type) {\n case 'text':\n compiled.push(token.value);\n break\n case 'list':\n compiled.push(values[parseInt(token.value, 10)]);\n break\n case 'named':\n if (mode === 'named') {\n compiled.push((values)[token.value]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Type of token '\" + (token.type) + \"' and format of value '\" + mode + \"' don't match!\"));\n }\n }\n break\n case 'unknown':\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Detect 'unknown' type of token!\");\n }\n break\n }\n index++;\n }\n\n return compiled\n}\n\n/* */\n\n/**\n * Path parser\n * - Inspired:\n * Vue.js Path parser\n */\n\n// actions\nvar APPEND = 0;\nvar PUSH = 1;\nvar INC_SUB_PATH_DEPTH = 2;\nvar PUSH_SUB_PATH = 3;\n\n// states\nvar BEFORE_PATH = 0;\nvar IN_PATH = 1;\nvar BEFORE_IDENT = 2;\nvar IN_IDENT = 3;\nvar IN_SUB_PATH = 4;\nvar IN_SINGLE_QUOTE = 5;\nvar IN_DOUBLE_QUOTE = 6;\nvar AFTER_PATH = 7;\nvar ERROR = 8;\n\nvar pathStateMachine = [];\n\npathStateMachine[BEFORE_PATH] = {\n 'ws': [BEFORE_PATH],\n 'ident': [IN_IDENT, APPEND],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[IN_PATH] = {\n 'ws': [IN_PATH],\n '.': [BEFORE_IDENT],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[BEFORE_IDENT] = {\n 'ws': [BEFORE_IDENT],\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND]\n};\n\npathStateMachine[IN_IDENT] = {\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND],\n 'ws': [IN_PATH, PUSH],\n '.': [BEFORE_IDENT, PUSH],\n '[': [IN_SUB_PATH, PUSH],\n 'eof': [AFTER_PATH, PUSH]\n};\n\npathStateMachine[IN_SUB_PATH] = {\n \"'\": [IN_SINGLE_QUOTE, APPEND],\n '\"': [IN_DOUBLE_QUOTE, APPEND],\n '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],\n ']': [IN_PATH, PUSH_SUB_PATH],\n 'eof': ERROR,\n 'else': [IN_SUB_PATH, APPEND]\n};\n\npathStateMachine[IN_SINGLE_QUOTE] = {\n \"'\": [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_SINGLE_QUOTE, APPEND]\n};\n\npathStateMachine[IN_DOUBLE_QUOTE] = {\n '\"': [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_DOUBLE_QUOTE, APPEND]\n};\n\n/**\n * Check if an expression is a literal value.\n */\n\nvar literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\nfunction isLiteral (exp) {\n return literalValueRE.test(exp)\n}\n\n/**\n * Strip quotes from a string\n */\n\nfunction stripQuotes (str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27)\n ? str.slice(1, -1)\n : str\n}\n\n/**\n * Determine the type of a character in a keypath.\n */\n\nfunction getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}\n\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n */\n\nfunction formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}\n\n/**\n * Parse a string path into an array of segments\n */\n\nfunction parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\n\n\n\n\nvar I18nPath = function I18nPath () {\n this._cache = Object.create(null);\n};\n\n/**\n * External parse that check for a cache hit first\n */\nI18nPath.prototype.parsePath = function parsePath (path) {\n var hit = this._cache[path];\n if (!hit) {\n hit = parse$1(path);\n if (hit) {\n this._cache[path] = hit;\n }\n }\n return hit || []\n};\n\n/**\n * Get path value from path string\n */\nI18nPath.prototype.getPathValue = function getPathValue (obj, path) {\n if (!isObject(obj)) { return null }\n\n var paths = this.parsePath(path);\n if (paths.length === 0) {\n return null\n } else {\n var length = paths.length;\n var last = obj;\n var i = 0;\n while (i < length) {\n var value = last[paths[i]];\n if (value === undefined || value === null) {\n return null\n }\n last = value;\n i++;\n }\n\n return last\n }\n};\n\n/* */\n\n\n\nvar htmlTagMatcher = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\nvar linkKeyMatcher = /(?:@(?:\\.[a-z]+)?:(?:[\\w\\-_|./]+|\\([\\w\\-_|./]+\\)))/g;\nvar linkKeyPrefixMatcher = /^@(?:\\.([a-z]+))?:/;\nvar bracketsMatcher = /[()]/g;\nvar defaultModifiers = {\n 'upper': function (str) { return str.toLocaleUpperCase(); },\n 'lower': function (str) { return str.toLocaleLowerCase(); },\n 'capitalize': function (str) { return (\"\" + (str.charAt(0).toLocaleUpperCase()) + (str.substr(1))); }\n};\n\nvar defaultFormatter = new BaseFormatter();\n\nvar VueI18n = function VueI18n (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #290\n /* istanbul ignore if */\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n var locale = options.locale || 'en-US';\n var fallbackLocale = options.fallbackLocale === false\n ? false\n : options.fallbackLocale || 'en-US';\n var messages = options.messages || {};\n var dateTimeFormats = options.dateTimeFormats || options.datetimeFormats || {};\n var numberFormats = options.numberFormats || {};\n\n this._vm = null;\n this._formatter = options.formatter || defaultFormatter;\n this._modifiers = options.modifiers || {};\n this._missing = options.missing || null;\n this._root = options.root || null;\n this._sync = options.sync === undefined ? true : !!options.sync;\n this._fallbackRoot = options.fallbackRoot === undefined\n ? true\n : !!options.fallbackRoot;\n this._fallbackRootWithEmptyString = options.fallbackRootWithEmptyString === undefined\n ? true\n : !!options.fallbackRootWithEmptyString;\n this._formatFallbackMessages = options.formatFallbackMessages === undefined\n ? false\n : !!options.formatFallbackMessages;\n this._silentTranslationWarn = options.silentTranslationWarn === undefined\n ? false\n : options.silentTranslationWarn;\n this._silentFallbackWarn = options.silentFallbackWarn === undefined\n ? false\n : !!options.silentFallbackWarn;\n this._dateTimeFormatters = {};\n this._numberFormatters = {};\n this._path = new I18nPath();\n this._dataListeners = new Set();\n this._componentInstanceCreatedListener = options.componentInstanceCreatedListener || null;\n this._preserveDirectiveContent = options.preserveDirectiveContent === undefined\n ? false\n : !!options.preserveDirectiveContent;\n this.pluralizationRules = options.pluralizationRules || {};\n this._warnHtmlInMessage = options.warnHtmlInMessage || 'off';\n this._postTranslation = options.postTranslation || null;\n this._escapeParameterHtml = options.escapeParameterHtml || false;\n\n if ('__VUE_I18N_BRIDGE__' in options) {\n this.__VUE_I18N_BRIDGE__ = options.__VUE_I18N_BRIDGE__;\n }\n\n /**\n * @param choice {number} a choice index given by the input to $tc: `$tc('path.to.rule', choiceIndex)`\n * @param choicesLength {number} an overall amount of available choices\n * @returns a final choice index\n */\n this.getChoiceIndex = function (choice, choicesLength) {\n var thisPrototype = Object.getPrototypeOf(this$1);\n if (thisPrototype && thisPrototype.getChoiceIndex) {\n var prototypeGetChoiceIndex = (thisPrototype.getChoiceIndex);\n return (prototypeGetChoiceIndex).call(this$1, choice, choicesLength)\n }\n\n // Default (old) getChoiceIndex implementation - english-compatible\n var defaultImpl = function (_choice, _choicesLength) {\n _choice = Math.abs(_choice);\n\n if (_choicesLength === 2) {\n return _choice\n ? _choice > 1\n ? 1\n : 0\n : 1\n }\n\n return _choice ? Math.min(_choice, 2) : 0\n };\n\n if (this$1.locale in this$1.pluralizationRules) {\n return this$1.pluralizationRules[this$1.locale].apply(this$1, [choice, choicesLength])\n } else {\n return defaultImpl(choice, choicesLength)\n }\n };\n\n\n this._exist = function (message, key) {\n if (!message || !key) { return false }\n if (!isNull(this$1._path.getPathValue(message, key))) { return true }\n // fallback for flat key\n if (message[key]) { return true }\n return false\n };\n\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n\n this._initVM({\n locale: locale,\n fallbackLocale: fallbackLocale,\n messages: messages,\n dateTimeFormats: dateTimeFormats,\n numberFormats: numberFormats\n });\n};\n\nvar prototypeAccessors = { vm: { configurable: true },messages: { configurable: true },dateTimeFormats: { configurable: true },numberFormats: { configurable: true },availableLocales: { configurable: true },locale: { configurable: true },fallbackLocale: { configurable: true },formatFallbackMessages: { configurable: true },missing: { configurable: true },formatter: { configurable: true },silentTranslationWarn: { configurable: true },silentFallbackWarn: { configurable: true },preserveDirectiveContent: { configurable: true },warnHtmlInMessage: { configurable: true },postTranslation: { configurable: true },sync: { configurable: true } };\n\nVueI18n.prototype._checkLocaleMessage = function _checkLocaleMessage (locale, level, message) {\n var paths = [];\n\n var fn = function (level, locale, message, paths) {\n if (isPlainObject(message)) {\n Object.keys(message).forEach(function (key) {\n var val = message[key];\n if (isPlainObject(val)) {\n paths.push(key);\n paths.push('.');\n fn(level, locale, val, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push(key);\n fn(level, locale, val, paths);\n paths.pop();\n }\n });\n } else if (isArray(message)) {\n message.forEach(function (item, index) {\n if (isPlainObject(item)) {\n paths.push((\"[\" + index + \"]\"));\n paths.push('.');\n fn(level, locale, item, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push((\"[\" + index + \"]\"));\n fn(level, locale, item, paths);\n paths.pop();\n }\n });\n } else if (isString(message)) {\n var ret = htmlTagMatcher.test(message);\n if (ret) {\n var msg = \"Detected HTML in message '\" + message + \"' of keypath '\" + (paths.join('')) + \"' at '\" + locale + \"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp\";\n if (level === 'warn') {\n warn(msg);\n } else if (level === 'error') {\n error(msg);\n }\n }\n }\n };\n\n fn(level, locale, message, paths);\n};\n\nVueI18n.prototype._initVM = function _initVM (data) {\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n this._vm = new Vue({ data: data, __VUE18N__INSTANCE__: true });\n Vue.config.silent = silent;\n};\n\nVueI18n.prototype.destroyVM = function destroyVM () {\n this._vm.$destroy();\n};\n\nVueI18n.prototype.subscribeDataChanging = function subscribeDataChanging (vm) {\n this._dataListeners.add(vm);\n};\n\nVueI18n.prototype.unsubscribeDataChanging = function unsubscribeDataChanging (vm) {\n remove(this._dataListeners, vm);\n};\n\nVueI18n.prototype.watchI18nData = function watchI18nData () {\n var this$1 = this;\n return this._vm.$watch('$data', function () {\n var listeners = arrayFrom(this$1._dataListeners);\n var i = listeners.length;\n while(i--) {\n Vue.nextTick(function () {\n listeners[i] && listeners[i].$forceUpdate();\n });\n }\n }, { deep: true })\n};\n\nVueI18n.prototype.watchLocale = function watchLocale (composer) {\n if (!composer) {\n /* istanbul ignore if */\n if (!this._sync || !this._root) { return null }\n var target = this._vm;\n return this._root.$i18n.vm.$watch('locale', function (val) {\n target.$set(target, 'locale', val);\n target.$forceUpdate();\n }, { immediate: true })\n } else {\n // deal with vue-i18n-bridge\n if (!this.__VUE_I18N_BRIDGE__) { return null }\n var self = this;\n var target$1 = this._vm;\n return this.vm.$watch('locale', function (val) {\n target$1.$set(target$1, 'locale', val);\n if (self.__VUE_I18N_BRIDGE__ && composer) {\n composer.locale.value = val;\n }\n target$1.$forceUpdate();\n }, { immediate: true })\n }\n};\n\nVueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {\n if (this._componentInstanceCreatedListener) {\n this._componentInstanceCreatedListener(newI18n, this);\n }\n};\n\nprototypeAccessors.vm.get = function () { return this._vm };\n\nprototypeAccessors.messages.get = function () { return looseClone(this._getMessages()) };\nprototypeAccessors.dateTimeFormats.get = function () { return looseClone(this._getDateTimeFormats()) };\nprototypeAccessors.numberFormats.get = function () { return looseClone(this._getNumberFormats()) };\nprototypeAccessors.availableLocales.get = function () { return Object.keys(this.messages).sort() };\n\nprototypeAccessors.locale.get = function () { return this._vm.locale };\nprototypeAccessors.locale.set = function (locale) {\n this._vm.$set(this._vm, 'locale', locale);\n};\n\nprototypeAccessors.fallbackLocale.get = function () { return this._vm.fallbackLocale };\nprototypeAccessors.fallbackLocale.set = function (locale) {\n this._localeChainCache = {};\n this._vm.$set(this._vm, 'fallbackLocale', locale);\n};\n\nprototypeAccessors.formatFallbackMessages.get = function () { return this._formatFallbackMessages };\nprototypeAccessors.formatFallbackMessages.set = function (fallback) { this._formatFallbackMessages = fallback; };\n\nprototypeAccessors.missing.get = function () { return this._missing };\nprototypeAccessors.missing.set = function (handler) { this._missing = handler; };\n\nprototypeAccessors.formatter.get = function () { return this._formatter };\nprototypeAccessors.formatter.set = function (formatter) { this._formatter = formatter; };\n\nprototypeAccessors.silentTranslationWarn.get = function () { return this._silentTranslationWarn };\nprototypeAccessors.silentTranslationWarn.set = function (silent) { this._silentTranslationWarn = silent; };\n\nprototypeAccessors.silentFallbackWarn.get = function () { return this._silentFallbackWarn };\nprototypeAccessors.silentFallbackWarn.set = function (silent) { this._silentFallbackWarn = silent; };\n\nprototypeAccessors.preserveDirectiveContent.get = function () { return this._preserveDirectiveContent };\nprototypeAccessors.preserveDirectiveContent.set = function (preserve) { this._preserveDirectiveContent = preserve; };\n\nprototypeAccessors.warnHtmlInMessage.get = function () { return this._warnHtmlInMessage };\nprototypeAccessors.warnHtmlInMessage.set = function (level) {\n var this$1 = this;\n\n var orgLevel = this._warnHtmlInMessage;\n this._warnHtmlInMessage = level;\n if (orgLevel !== level && (level === 'warn' || level === 'error')) {\n var messages = this._getMessages();\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n};\n\nprototypeAccessors.postTranslation.get = function () { return this._postTranslation };\nprototypeAccessors.postTranslation.set = function (handler) { this._postTranslation = handler; };\n\nprototypeAccessors.sync.get = function () { return this._sync };\nprototypeAccessors.sync.set = function (val) { this._sync = val; };\n\nVueI18n.prototype._getMessages = function _getMessages () { return this._vm.messages };\nVueI18n.prototype._getDateTimeFormats = function _getDateTimeFormats () { return this._vm.dateTimeFormats };\nVueI18n.prototype._getNumberFormats = function _getNumberFormats () { return this._vm.numberFormats };\n\nVueI18n.prototype._warnDefault = function _warnDefault (locale, key, result, vm, values, interpolateMode) {\n if (!isNull(result)) { return result }\n if (this._missing) {\n var missingRet = this._missing.apply(null, [locale, key, vm, values]);\n if (isString(missingRet)) {\n return missingRet\n }\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn(\n \"Cannot translate the value of keypath '\" + key + \"'. \" +\n 'Use the value of keypath as default.'\n );\n }\n }\n\n if (this._formatFallbackMessages) {\n var parsedArgs = parseArgs.apply(void 0, values);\n return this._render(key, interpolateMode, parsedArgs.params, key)\n } else {\n return key\n }\n};\n\nVueI18n.prototype._isFallbackRoot = function _isFallbackRoot (val) {\n return (this._fallbackRootWithEmptyString? !val : isNull(val)) && !isNull(this._root) && this._fallbackRoot\n};\n\nVueI18n.prototype._isSilentFallbackWarn = function _isSilentFallbackWarn (key) {\n return this._silentFallbackWarn instanceof RegExp\n ? this._silentFallbackWarn.test(key)\n : this._silentFallbackWarn\n};\n\nVueI18n.prototype._isSilentFallback = function _isSilentFallback (locale, key) {\n return this._isSilentFallbackWarn(key) && (this._isFallbackRoot() || locale !== this.fallbackLocale)\n};\n\nVueI18n.prototype._isSilentTranslationWarn = function _isSilentTranslationWarn (key) {\n return this._silentTranslationWarn instanceof RegExp\n ? this._silentTranslationWarn.test(key)\n : this._silentTranslationWarn\n};\n\nVueI18n.prototype._interpolate = function _interpolate (\n locale,\n message,\n key,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n if (!message) { return null }\n\n var pathRet = this._path.getPathValue(message, key);\n if (isArray(pathRet) || isPlainObject(pathRet)) { return pathRet }\n\n var ret;\n if (isNull(pathRet)) {\n /* istanbul ignore else */\n if (isPlainObject(message)) {\n ret = message[key];\n if (!(isString(ret) || isFunction(ret))) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function !\"));\n }\n return null\n }\n } else {\n return null\n }\n } else {\n /* istanbul ignore else */\n if (isString(pathRet) || isFunction(pathRet)) {\n ret = pathRet;\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function!\"));\n }\n return null\n }\n }\n\n // Check for the existence of links within the translated string\n if (isString(ret) && (ret.indexOf('@:') >= 0 || ret.indexOf('@.') >= 0)) {\n ret = this._link(locale, message, ret, host, 'raw', values, visitedLinkStack);\n }\n\n return this._render(ret, interpolateMode, values, key)\n};\n\nVueI18n.prototype._link = function _link (\n locale,\n message,\n str,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n var ret = str;\n\n // Match all the links within the local\n // We are going to replace each of\n // them with its translation\n var matches = ret.match(linkKeyMatcher);\n\n // eslint-disable-next-line no-autofix/prefer-const\n for (var idx in matches) {\n // ie compatible: filter custom array\n // prototype method\n if (!matches.hasOwnProperty(idx)) {\n continue\n }\n var link = matches[idx];\n var linkKeyPrefixMatches = link.match(linkKeyPrefixMatcher);\n var linkPrefix = linkKeyPrefixMatches[0];\n var formatterName = linkKeyPrefixMatches[1];\n\n // Remove the leading @:, @.case: and the brackets\n var linkPlaceholder = link.replace(linkPrefix, '').replace(bracketsMatcher, '');\n\n if (includes(visitedLinkStack, linkPlaceholder)) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Circular reference found. \\\"\" + link + \"\\\" is already visited in the chain of \" + (visitedLinkStack.reverse().join(' <- '))));\n }\n return ret\n }\n visitedLinkStack.push(linkPlaceholder);\n\n // Translate the link\n var translated = this._interpolate(\n locale, message, linkPlaceholder, host,\n interpolateMode === 'raw' ? 'string' : interpolateMode,\n interpolateMode === 'raw' ? undefined : values,\n visitedLinkStack\n );\n\n if (this._isFallbackRoot(translated)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(linkPlaceholder)) {\n warn((\"Fall back to translate the link placeholder '\" + linkPlaceholder + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n var root = this._root.$i18n;\n translated = root._translate(\n root._getMessages(), root.locale, root.fallbackLocale,\n linkPlaceholder, host, interpolateMode, values\n );\n }\n translated = this._warnDefault(\n locale, linkPlaceholder, translated, host,\n isArray(values) ? values : [values],\n interpolateMode\n );\n\n if (this._modifiers.hasOwnProperty(formatterName)) {\n translated = this._modifiers[formatterName](translated);\n } else if (defaultModifiers.hasOwnProperty(formatterName)) {\n translated = defaultModifiers[formatterName](translated);\n }\n\n visitedLinkStack.pop();\n\n // Replace the link with the translated\n ret = !translated ? ret : ret.replace(link, translated);\n }\n\n return ret\n};\n\nVueI18n.prototype._createMessageContext = function _createMessageContext (values, formatter, path, interpolateMode) {\n var this$1 = this;\n\n var _list = isArray(values) ? values : [];\n var _named = isObject(values) ? values : {};\n var list = function (index) { return _list[index]; };\n var named = function (key) { return _named[key]; };\n var messages = this._getMessages();\n var locale = this.locale;\n\n return {\n list: list,\n named: named,\n values: values,\n formatter: formatter,\n path: path,\n messages: messages,\n locale: locale,\n linked: function (linkedKey) { return this$1._interpolate(locale, messages[locale] || {}, linkedKey, null, interpolateMode, undefined, [linkedKey]); }\n }\n};\n\nVueI18n.prototype._render = function _render (message, interpolateMode, values, path) {\n if (isFunction(message)) {\n return message(\n this._createMessageContext(values, this._formatter || defaultFormatter, path, interpolateMode)\n )\n }\n\n var ret = this._formatter.interpolate(message, values, path);\n\n // If the custom formatter refuses to work - apply the default one\n if (!ret) {\n ret = defaultFormatter.interpolate(message, values, path);\n }\n\n // if interpolateMode is **not** 'string' ('row'),\n // return the compiled data (e.g. ['foo', VNode, 'bar']) with formatter\n return interpolateMode === 'string' && !isString(ret) ? ret.join('') : ret\n};\n\nVueI18n.prototype._appendItemToChain = function _appendItemToChain (chain, item, blocks) {\n var follow = false;\n if (!includes(chain, item)) {\n follow = true;\n if (item) {\n follow = item[item.length - 1] !== '!';\n item = item.replace(/!/g, '');\n chain.push(item);\n if (blocks && blocks[item]) {\n follow = blocks[item];\n }\n }\n }\n return follow\n};\n\nVueI18n.prototype._appendLocaleToChain = function _appendLocaleToChain (chain, locale, blocks) {\n var follow;\n var tokens = locale.split('-');\n do {\n var item = tokens.join('-');\n follow = this._appendItemToChain(chain, item, blocks);\n tokens.splice(-1, 1);\n } while (tokens.length && (follow === true))\n return follow\n};\n\nVueI18n.prototype._appendBlockToChain = function _appendBlockToChain (chain, block, blocks) {\n var follow = true;\n for (var i = 0; (i < block.length) && (isBoolean(follow)); i++) {\n var locale = block[i];\n if (isString(locale)) {\n follow = this._appendLocaleToChain(chain, locale, blocks);\n }\n }\n return follow\n};\n\nVueI18n.prototype._getLocaleChain = function _getLocaleChain (start, fallbackLocale) {\n if (start === '') { return [] }\n\n if (!this._localeChainCache) {\n this._localeChainCache = {};\n }\n\n var chain = this._localeChainCache[start];\n if (!chain) {\n if (!fallbackLocale) {\n fallbackLocale = this.fallbackLocale;\n }\n chain = [];\n\n // first block defined by start\n var block = [start];\n\n // while any intervening block found\n while (isArray(block)) {\n block = this._appendBlockToChain(\n chain,\n block,\n fallbackLocale\n );\n }\n\n // last block defined by default\n var defaults;\n if (isArray(fallbackLocale)) {\n defaults = fallbackLocale;\n } else if (isObject(fallbackLocale)) {\n /* $FlowFixMe */\n if (fallbackLocale['default']) {\n defaults = fallbackLocale['default'];\n } else {\n defaults = null;\n }\n } else {\n defaults = fallbackLocale;\n }\n\n // convert defaults to array\n if (isString(defaults)) {\n block = [defaults];\n } else {\n block = defaults;\n }\n if (block) {\n this._appendBlockToChain(\n chain,\n block,\n null\n );\n }\n this._localeChainCache[start] = chain;\n }\n return chain\n};\n\nVueI18n.prototype._translate = function _translate (\n messages,\n locale,\n fallback,\n key,\n host,\n interpolateMode,\n args\n) {\n var chain = this._getLocaleChain(locale, fallback);\n var res;\n for (var i = 0; i < chain.length; i++) {\n var step = chain[i];\n res =\n this._interpolate(step, messages[step], key, host, interpolateMode, args, [key]);\n if (!isNull(res)) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with '\" + step + \"' locale.\"));\n }\n return res\n }\n }\n return null\n};\n\nVueI18n.prototype._t = function _t (key, _locale, messages, host) {\n var ref;\n\n var values = [], len = arguments.length - 4;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 4 ];\n if (!key) { return '' }\n\n var parsedArgs = parseArgs.apply(void 0, values);\n if(this._escapeParameterHtml) {\n parsedArgs.params = escapeParams(parsedArgs.params);\n }\n\n var locale = parsedArgs.locale || _locale;\n\n var ret = this._translate(\n messages, locale, this.fallbackLocale, key,\n host, 'string', parsedArgs.params\n );\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return (ref = this._root).$t.apply(ref, [ key ].concat( values ))\n } else {\n ret = this._warnDefault(locale, key, ret, host, values, 'string');\n if (this._postTranslation && ret !== null && ret !== undefined) {\n ret = this._postTranslation(ret, key);\n }\n return ret\n }\n};\n\nVueI18n.prototype.t = function t (key) {\n var ref;\n\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n return (ref = this)._t.apply(ref, [ key, this.locale, this._getMessages(), null ].concat( values ))\n};\n\nVueI18n.prototype._i = function _i (key, locale, messages, host, values) {\n var ret =\n this._translate(messages, locale, this.fallbackLocale, key, host, 'raw', values);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to interpolate the keypath '\" + key + \"' with root locale.\"));\n }\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.i(key, locale, values)\n } else {\n return this._warnDefault(locale, key, ret, host, [values], 'raw')\n }\n};\n\nVueI18n.prototype.i = function i (key, locale, values) {\n /* istanbul ignore if */\n if (!key) { return '' }\n\n if (!isString(locale)) {\n locale = this.locale;\n }\n\n return this._i(key, locale, this._getMessages(), null, values)\n};\n\nVueI18n.prototype._tc = function _tc (\n key,\n _locale,\n messages,\n host,\n choice\n) {\n var ref;\n\n var values = [], len = arguments.length - 5;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 5 ];\n if (!key) { return '' }\n if (choice === undefined) {\n choice = 1;\n }\n\n var predefined = { 'count': choice, 'n': choice };\n var parsedArgs = parseArgs.apply(void 0, values);\n parsedArgs.params = Object.assign(predefined, parsedArgs.params);\n values = parsedArgs.locale === null ? [parsedArgs.params] : [parsedArgs.locale, parsedArgs.params];\n return this.fetchChoice((ref = this)._t.apply(ref, [ key, _locale, messages, host ].concat( values )), choice)\n};\n\nVueI18n.prototype.fetchChoice = function fetchChoice (message, choice) {\n /* istanbul ignore if */\n if (!message || !isString(message)) { return null }\n var choices = message.split('|');\n\n choice = this.getChoiceIndex(choice, choices.length);\n if (!choices[choice]) { return message }\n return choices[choice].trim()\n};\n\nVueI18n.prototype.tc = function tc (key, choice) {\n var ref;\n\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n return (ref = this)._tc.apply(ref, [ key, this.locale, this._getMessages(), null, choice ].concat( values ))\n};\n\nVueI18n.prototype._te = function _te (key, locale, messages) {\n var args = [], len = arguments.length - 3;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ];\n\n var _locale = parseArgs.apply(void 0, args).locale || locale;\n return this._exist(messages[_locale], key)\n};\n\nVueI18n.prototype.te = function te (key, locale) {\n return this._te(key, this.locale, this._getMessages(), locale)\n};\n\nVueI18n.prototype.getLocaleMessage = function getLocaleMessage (locale) {\n return looseClone(this._vm.messages[locale] || {})\n};\n\nVueI18n.prototype.setLocaleMessage = function setLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, message);\n};\n\nVueI18n.prototype.mergeLocaleMessage = function mergeLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, merge(\n typeof this._vm.messages[locale] !== 'undefined' && Object.keys(this._vm.messages[locale]).length\n ? Object.assign({}, this._vm.messages[locale])\n : {},\n message\n ));\n};\n\nVueI18n.prototype.getDateTimeFormat = function getDateTimeFormat (locale) {\n return looseClone(this._vm.dateTimeFormats[locale] || {})\n};\n\nVueI18n.prototype.setDateTimeFormat = function setDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, format);\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype.mergeDateTimeFormat = function mergeDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, merge(this._vm.dateTimeFormats[locale] || {}, format));\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype._clearDateTimeFormat = function _clearDateTimeFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._dateTimeFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._dateTimeFormatters[id];\n }\n};\n\nVueI18n.prototype._localizeDateTime = function _localizeDateTime (\n value,\n locale,\n fallback,\n dateTimeFormats,\n key\n) {\n var _locale = locale;\n var formats = dateTimeFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = dateTimeFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' datetime formats from '\" + current + \"' datetime formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n var id = _locale + \"__\" + key;\n var formatter = this._dateTimeFormatters[id];\n if (!formatter) {\n formatter = this._dateTimeFormatters[id] = new Intl.DateTimeFormat(_locale, format);\n }\n return formatter.format(value)\n }\n};\n\nVueI18n.prototype._d = function _d (value, locale, key) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && !VueI18n.availabilities.dateTimeFormat) {\n warn('Cannot format a Date value due to not supported Intl.DateTimeFormat.');\n return ''\n }\n\n if (!key) {\n return new Intl.DateTimeFormat(locale).format(value)\n }\n\n var ret =\n this._localizeDateTime(value, locale, this.fallbackLocale, this._getDateTimeFormats(), key);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to datetime localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.d(value, key, locale)\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.d = function d (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._d(value, locale, key)\n};\n\nVueI18n.prototype.getNumberFormat = function getNumberFormat (locale) {\n return looseClone(this._vm.numberFormats[locale] || {})\n};\n\nVueI18n.prototype.setNumberFormat = function setNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, format);\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype.mergeNumberFormat = function mergeNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, merge(this._vm.numberFormats[locale] || {}, format));\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype._clearNumberFormat = function _clearNumberFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._numberFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._numberFormatters[id];\n }\n};\n\nVueI18n.prototype._getNumberFormatter = function _getNumberFormatter (\n value,\n locale,\n fallback,\n numberFormats,\n key,\n options\n) {\n var _locale = locale;\n var formats = numberFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = numberFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' number formats from '\" + current + \"' number formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n\n var formatter;\n if (options) {\n // If options specified - create one time number formatter\n formatter = new Intl.NumberFormat(_locale, Object.assign({}, format, options));\n } else {\n var id = _locale + \"__\" + key;\n formatter = this._numberFormatters[id];\n if (!formatter) {\n formatter = this._numberFormatters[id] = new Intl.NumberFormat(_locale, format);\n }\n }\n return formatter\n }\n};\n\nVueI18n.prototype._n = function _n (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format a Number value due to not supported Intl.NumberFormat.');\n }\n return ''\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.format(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.format(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to number localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.n(value, Object.assign({}, { key: key, locale: locale }, options))\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.n = function n (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n var options = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n\n // Filter out number format options only\n options = Object.keys(args[0]).reduce(function (acc, key) {\n var obj;\n\n if (includes(numberFormatKeys, key)) {\n return Object.assign({}, acc, ( obj = {}, obj[key] = args[0][key], obj ))\n }\n return acc\n }, null);\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._n(value, locale, key, options)\n};\n\nVueI18n.prototype._ntp = function _ntp (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format to parts a Number value due to not supported Intl.NumberFormat.');\n }\n return []\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.formatToParts(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.formatToParts(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to format number to parts of root: key '\" + key + \"' .\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n._ntp(value, locale, key, options)\n } else {\n return ret || []\n }\n};\n\nObject.defineProperties( VueI18n.prototype, prototypeAccessors );\n\nvar availabilities;\n// $FlowFixMe\nObject.defineProperty(VueI18n, 'availabilities', {\n get: function get () {\n if (!availabilities) {\n var intlDefined = typeof Intl !== 'undefined';\n availabilities = {\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\n };\n }\n\n return availabilities\n }\n});\n\nVueI18n.install = install;\nVueI18n.version = '8.27.0';\n\nexport default VueI18n;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"m-message-fade\",\"mode\":\"in-out\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.show),expression:\"show\"}],staticClass:\"m-message-wrapper\",class:_vm.wrapperClassName,style:({\r\n width: _vm.width\r\n })},[_c('mmessage',{class:[_vm.type && 'm-message--' + _vm.type, _vm.className],attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"closable\":_vm.showClose,\"is-collapsed\":_vm.isCollapsed,\"close-handler\":_vm.close,\"click-handler\":_vm.click,\"title\":_vm.title,\"supportHTML\":_vm.supportHTML},nativeOn:{\"mouseenter\":function($event){return _vm.clearTimer.apply(null, arguments)},\"mouseleave\":function($event){return _vm.startTimer.apply(null, arguments)}}},[_c('template',{slot:\"icon\"},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg}}):(_vm.type)?_c('icon',{staticClass:\"m-message--icon\",attrs:{\"name\":_vm.type}}):_vm._e()],1)],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.visible),expression:\"visible\"}],staticClass:\"m-message\"},[(_vm.iconImg || _vm.$slots.icon)?_c('div',{staticClass:\"m-message-icons\",on:{\"click\":_vm.handleClick}},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg,\"alt\":\"Img\"}}):_vm._t(\"icon\")],2):_vm._e(),_c('div',{staticClass:\"m-message-content\",on:{\"click\":_vm.handleClick}},[(_vm.title || _vm.$slots.title)?_c('div',{staticClass:\"m-message--title\"},[_vm._t(\"title\",function(){return [_vm._v(\" \"+_vm._s(_vm.title)+\" \")]})],2):_vm._e(),(_vm.event && _vm.chat)?_c('event',{attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"preview\":true}}):_c('div',{staticClass:\"m-message--body\"},[_vm._t(\"message\")],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./mmessage.vue?vue&type=template&id=03371e2c&\"\nimport script from \"./mmessage.vue?vue&type=script&lang=js&\"\nexport * from \"./mmessage.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","'use strict'\r\nconst icons = {}\r\n\r\nexport const addIcon = function (name, options) {\r\n icons[name] = options\r\n}\r\n\r\nconst Icon = {\r\n name: 'Icon',\r\n props: {\r\n name: String,\r\n color: String\r\n },\r\n computed: {\r\n svg () {\r\n return icons[this.name]\r\n }\r\n },\r\n // eslint-disable-next-line\r\n render (h) {\r\n const svg = this.svg\r\n\r\n if (!svg) {\r\n // eslint-disable-next-line\r\n console.warn(`The name of '${this.name}' could not be found.`)\r\n return ``\r\n }\r\n\r\n const style = {\r\n color: this.color ? this.color : (svg.fill ? svg.fill : null)\r\n }\r\n\r\n return (\r\n `\r\n \r\n { svg.defs && }\r\n { svg.path && }\r\n { svg.html && }\r\n {this.$slots.default}\r\n \r\n `\r\n )\r\n }\r\n}\r\n\r\nIcon.add = addIcon\r\n\r\nexport default Icon\r\n","export default {\r\n name: 'info',\r\n fill: '#1CADF2',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z'\r\n}\r\n","export default {\r\n name: 'success',\r\n fill: '#17B77E',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z'\r\n}\r\n","export default {\r\n name: 'error',\r\n fill: '#F56C6C',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z'\r\n}\r\n","export default {\r\n name: 'warning',\r\n fill: '#FFC603',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z'\r\n}\r\n","export default {\r\n name: 'loading',\r\n viewBox: '0 0 50 50',\r\n class: 'm-loading-icon m-loading-wipe',\r\n defs: ``,\r\n html: ''\r\n}\r\n","import Icon from './icon'\r\nimport InfoIcon from './svgs/info'\r\nimport SuccessIcon from './svgs/success'\r\nimport ErrorIcon from './svgs/error'\r\nimport WarningIcon from './svgs/warning'\r\nimport LoadingIcon from './svgs/loading'\r\n\r\nIcon.add(InfoIcon.name, InfoIcon)\r\nIcon.add(SuccessIcon.name, SuccessIcon)\r\nIcon.add(ErrorIcon.name, ErrorIcon)\r\nIcon.add(WarningIcon.name, WarningIcon)\r\nIcon.add(LoadingIcon.name, LoadingIcon)\r\n\r\nexport default Icon\r\n","\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./message-template.vue?vue&type=template&id=7da7e992&\"\nimport script from \"./message-template.vue?vue&type=script&lang=js&\"\nexport * from \"./message-template.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","import MessageTemplate from './message-template'\r\nimport Vue from 'vue'\r\nconst MessageConstructor = Vue.extend(MessageTemplate)\r\n\r\nconst instances = []\r\nlet count = 1\r\nconst containers = {}\r\n\r\nconst Message = function (options) {\r\n let userOnClose = options.onClose\r\n let userOnClick = options.onClick\r\n const position = options.position || 'top-center'\r\n const hasMask = options.hasMask || false\r\n const containerKey = position + (hasMask ? '-mask' : '')\r\n let containerEl = containers[containerKey]\r\n\r\n if (!containerEl) {\r\n containerEl = containers[containerKey] = document.createElement('div')\r\n containerEl.className = [\r\n 'm-message-container',\r\n 'is-' + position,\r\n hasMask ? 'has-mask' : ''\r\n ].filter(function (e) { return !!e }).join(' ')\r\n document.body.appendChild(containerEl)\r\n }\r\n\r\n if (options.zIndex) {\r\n containerEl.style.zIndex = options.zIndex\r\n }\r\n\r\n const id = count++\r\n options.onClose = function () {\r\n Message.close(id, userOnClose)\r\n }\r\n\r\n options.onClick = function () {\r\n Message.click(id, userOnClick, userOnClose)\r\n }\r\n\r\n const instance = new MessageConstructor({\r\n el: document.createElement('div'),\r\n data: options\r\n })\r\n\r\n instance.id = id\r\n instance.containerKey = containerKey\r\n\r\n // for position of bottom-*\r\n if (position.indexOf('bottom') === 0 && containerEl.firstChild) {\r\n containerEl.insertBefore(instance.$el, containerEl.firstChild)\r\n } else {\r\n containerEl.appendChild(instance.$el)\r\n }\r\n // 挂载后再设置显示才有过渡效果\r\n instance.show = true\r\n\r\n instances.push(instance)\r\n\r\n return instance\r\n}\r\n\r\nMessage.click = function (id, userOnClick, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClick === 'function') {\r\n userOnClick(instances[i])\r\n }\r\n \r\n }\r\n }\r\n\r\n Message.close(id, userOnClose)\r\n}\r\n\r\nMessage.close = function (id, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClose === 'function') {\r\n userOnClose(instances[i])\r\n }\r\n instances[i] = null\r\n instances.splice(i, 1)\r\n\r\n const index = instances.findIndex(function (e) {\r\n return e.containerKey === containerKey\r\n })\r\n // 如果开启遮罩,300ms 后移除容器(不移除白屏时间太长)\r\n if (hasMask && index === -1) {\r\n setTimeout(function () {\r\n containers[containerKey].remove()\r\n containers[containerKey] = null\r\n }, 300)\r\n }\r\n break\r\n }\r\n }\r\n\r\n setTimeout(function () {\r\n // 当前没有消息后,移除容器\r\n if (instances.length === 0) {\r\n for (let type in containers) {\r\n if (containers[type]) {\r\n containers[type].remove()\r\n containers[type] = null\r\n }\r\n }\r\n }\r\n }, 300)\r\n}\r\n\r\nMessage.closeAll = function () {\r\n for (let i = instances.length - 1; i >= 0; i--) {\r\n instances[i].close()\r\n }\r\n}\r\n\r\nconst types = [ 'info', 'success', 'error', 'warning', 'loading' ]\r\n\r\ntypes.forEach(type => {\r\n Message[type] = function (options) {\r\n options = typeof options === 'string' ? { message: options } : options\r\n return Message({ ...options, type })\r\n }\r\n})\r\n\r\nexport default Message\r\n","import Message from './message.js'\r\nimport MessageComponent from './mmessage.vue'\r\nimport './asd.css'\r\n\r\nMessage.install = function (Vue, options) {\r\n if (options && options.name) {\r\n Vue.prototype[`$${options.name}`] = Message\r\n } else {\r\n Vue.prototype.$message = Message\r\n }\r\n}\r\n\r\nexport const MMessage = MessageComponent\r\nexport default Message\r\n","import f from \"@/application/functions\";\r\n\r\nvar cachestorage = {}\r\n\r\nclass MTRXKIT {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n }\r\n\r\n tetatetchat(m_chat){\r\n if(!m_chat) return false\r\n \r\n if(typeof m_chat.tetatet != 'undefined') return m_chat.tetatet\r\n\r\n var users = this.core.mtrx.chatUsersInfo(m_chat.roomId)\r\n var tt = false\r\n\r\n if(users.length == 2){\r\n tt = m_chat.name == '#' + this.tetatetid(users[0], users[1])\r\n }\r\n if(users.length > 1) m_chat.tetatet = tt\r\n\r\n return tt\r\n }\r\n\r\n tetatetid(user1, user2) {\r\n\r\n var seed = 2;\r\n\r\n if(user1.id == user2.id) return null\r\n\r\n var id = parseInt(user1.id, 16) * parseInt(user2.id, 16) * seed\r\n\r\n if(cachestorage[id]) return cachestorage[id]\r\n\r\n var hash = f.sha224(id.toString()).toString('hex')\r\n\r\n cachestorage[id] = hash\r\n\r\n return hash\r\n }\r\n\r\n unknowngroupusers(m_chat){\r\n return m_chat && m_chat._selfMembership === 'invite' && !m_chat.summary.members && !this.tetatetchat(this.m_chat)\r\n }\r\n\r\n usersFromChats(m_chats){\r\n var users = {}\r\n \r\n _.each(m_chats, (chat) => {\r\n\r\n users[chat.roomId] = _.map(_.uniq([].concat(_.toArray(chat.currentState.members), chat.summary.members || []), (r) => {\r\n return r.userId\r\n\r\n }), function(r){\r\n\r\n return {\r\n userId : f.getmatrixid(r.userId),\r\n membership : r.membership,\r\n powerLevel : r.powerLevel\r\n }\r\n\r\n }) \r\n })\r\n\r\n\r\n\r\n return users\r\n }\r\n\r\n prepareChat(m_chat){\r\n\t\treturn this.usersInfoForChatsStore([m_chat]).then(() => {\r\n return this.core.pcrypto.addroom(m_chat)\r\n })\r\n\t}\r\n\r\n fillContacts(m_chats){\r\n\r\n m_chats = _.filter(m_chats, (ch) => {\r\n return ch._selfMembership == 'join' && ch.name.length == 57\r\n })\r\n\r\n return this.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n this.core.store.commit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n return !this.core.user.userinfo || m.id !== this.core.user.userinfo.id\r\n }))\r\n\r\n })\r\n }\r\n\r\n usersInfoForChatsStore(m_chats, reload){\r\n\r\n return this.usersInfoForChats(m_chats, reload).then(i => {\r\n\r\n this.core.store.commit('SET_CHATS_USERS', this.usersFromChats(m_chats))\r\n\r\n return Promise.resolve(i)\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n allchatmembers(m_chats, reload, withinvite){\r\n var members = []\r\n var promises = []\r\n\r\n\r\n if(withinvite){\r\n var promises = _.map(m_chats, (chat) => {\r\n\r\n\r\n if(chat._selfMembership === 'invite' && (!chat.summary.members || reload) && !chat.summary.membersloading){\r\n \r\n chat.summary.membersloading = true\r\n \r\n return chat._loadMembersFromServer().then(r => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n chat.summary.members = _.map(r, (user) => {\r\n \r\n return {\r\n name: f.getmatrixid(user.state_key),\r\n membership: user.content.membership,\r\n user: user,\r\n userId : user.state_key,\r\n powerLevel : user.content.powerLevel || 0\r\n }\r\n \r\n })\r\n \r\n if(chat._selfMembership === 'invite' && this.core.user.userinfo){\r\n \r\n if(!_.find(chat.summary.members, (m) => {\r\n return m.userId == this.core.user.matrixId(this.core.user.userinfo.id)\r\n } )){\r\n \r\n chat.summary.members.push({\r\n name: this.core.user.userinfo.id,\r\n membership: 'invite',\r\n user: this.core.user.userinfo,\r\n userId : this.core.user.matrixId(this.core.user.userinfo.id),\r\n powerLevel : 0\r\n })\r\n \r\n }\r\n \r\n }\r\n \r\n return Promise.resolve()\r\n \r\n }).catch(e => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n return Promise.resolve()\r\n })\r\n }\r\n \r\n return Promise.resolve()\r\n \r\n })\r\n }\r\n\r\n return Promise.all(promises).then(r => {\r\n\r\n _.each(m_chats, (chat) => {\r\n members = members.concat(_.toArray(chat.currentState.members), chat.summary.members || [])\r\n })\r\n\r\n members = _.uniq(members, function(m){\r\n return m.userId\r\n })\r\n\r\n return Promise.resolve(members)\r\n })\r\n }\r\n\r\n usersInfoForChats(m_chats, reload) {\r\n\r\n /// TODO FILTER CONTACTS\r\n\r\n return this.allchatmembers(m_chats, reload).then(members => {\r\n\r\n return this.usersInfo(members, reload)\r\n })\r\n \r\n }\r\n\r\n usersInfoById(id) {\r\n\r\n var ids = [f.getmatrixid(id)]\r\n\r\n return this.core.user.usersInfo(ids, false).then( r => {\r\n return Promise.resolve(r[0])\r\n })\r\n }\r\n\r\n usersInfo(members, reload) {\r\n\r\n var ids = _.map(members, function (m) {\r\n return f.getmatrixid(m.userId)\r\n })\r\n\r\n ids = _.uniq(ids)\r\n\r\n return this.core.user.usersInfo(ids, false, reload)\r\n }\r\n\r\n groupId(users) {\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n users.forEach( (user) => {\r\n idForInviting.push( this.core.user.matrixId(user.id) )\r\n })\r\n\r\n users.forEach(function (user) {\r\n let idsForHash = parseInt(user.id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n\r\n return {hash: hash, idForInviting: idForInviting}\r\n\r\n }\r\n\r\n groupIdLight(ids) {\r\n\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n var domains = [null]\r\n\r\n if (window.chatinvitedomains) domains = [].concat(domains, window.chatinvitedomains)\r\n\r\n _.each(domains, (domain) => {\r\n\r\n _.each(ids, (id) => {\r\n idForInviting.push( this.core.user.matrixId(id, domain) )\r\n })\r\n\r\n })\r\n\r\n \r\n _.each(ids, (_id) => {\r\n let idsForHash = parseInt(_id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n return {hash: hash, idForInviting: idForInviting}\r\n }\r\n\r\n chatIsPublic(chat){\r\n var join_rules = chat.currentState.getStateEvents(\"m.room.join_rules\")\r\n\r\n console.log('join_rules', join_rules)\r\n\r\n return _.find(join_rules, (v) => {\r\n return f.deep(v, 'event.content.join_rule') == 'public'\r\n }) ? true : false\r\n }\r\n\r\n \r\n}\r\n\r\nexport default MTRXKIT","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * FingerprintJS v3.3.2 - Copyright (c) FingerprintJS, Inc, 2021 (https://fingerprintjs.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArrays } from 'tslib';\n\nvar version = \"3.3.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction forEachWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\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\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\" + selector + \"'\";\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var isFinalResultLoaded = function (loadResult) {\n return typeof loadResult !== 'function';\n };\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n var sourceGetters = Array(includedSources.length);\n // Using `forEachWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n forEachWithBreaks(includedSources, function (sourceKey, index) {\n sourceGetters[index] = loadSource(sources[sourceKey], sourceOptions);\n });\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var components, _i, includedSources_1, sourceKey, componentPromises, _loop_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n components = {};\n for (_i = 0, includedSources_1 = includedSources; _i < includedSources_1.length; _i++) {\n sourceKey = includedSources_1[_i];\n components[sourceKey] = undefined;\n }\n componentPromises = Array(includedSources.length);\n _loop_1 = function () {\n var hasAllComponentPromises;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n hasAllComponentPromises = true;\n return [4 /*yield*/, forEachWithBreaks(includedSources, function (sourceKey, index) {\n if (!componentPromises[index]) {\n // `sourceGetters` may be incomplete at this point of execution because `forEachWithBreaks` is asynchronous\n if (sourceGetters[index]) {\n componentPromises[index] = sourceGetters[index]().then(function (component) { return (components[sourceKey] = component); });\n }\n else {\n hasAllComponentPromises = false;\n }\n }\n })];\n case 1:\n _a.sent();\n if (hasAllComponentPromises) {\n return [2 /*return*/, \"break\"];\n }\n return [4 /*yield*/, wait(1)]; // Lets the source load loop continue\n case 2:\n _a.sent(); // Lets the source load loop continue\n return [2 /*return*/];\n }\n });\n };\n _a.label = 1;\n case 1: return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (state_1 === \"break\")\n return [3 /*break*/, 4];\n _a.label = 3;\n case 3: return [3 /*break*/, 1];\n case 4: return [4 /*yield*/, Promise.all(componentPromises)];\n case 5:\n _a.sent();\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprintjs.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* Timeout */ || error.name === \"suspended\" /* Suspended */) {\n return -3 /* Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n fingerprintPromise.catch(function () { return undefined; });\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n context.startRendering();\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n element.setAttribute(name_1, attributes[name_1].join(' '));\n }\n return element;\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\" + fontToDetect + \"',\" + baseFont);\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n return { winding: false, geometry: '', text: '' };\n }\n return {\n winding: doesSupportWinding(context),\n geometry: makeGeometryImage(canvas, context),\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n text: makeTextImage(canvas, context),\n };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction makeTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \" + String.fromCharCode(55357, 56835) /* 😃 */;\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n return save(canvas);\n}\nfunction makeGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n return save(canvas);\n}\nfunction save(canvas) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArrays(screenFrameBackup)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\" + (offset >= 0 ? '+' : '') + Math.abs(offset);\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * See docs/content_blockers.md to learn how to make the list\n */\nvar filters = {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n 'a[title=\"7naga poker\" i]',\n '[title=\"ALIENBOLA\" i]',\n ],\n abpvn: [\n '#quangcaomb',\n '.iosAdsiosAds-layout',\n '.quangcao',\n '[href^=\"https://r88.vn/\"]',\n '[href^=\"https://zbet.vn/\"]',\n ],\n adBlockFinland: [\n '.mainostila',\n '.sponsorit',\n '.ylamainos',\n 'a[href*=\"/clickthrgh.asp?\"]',\n 'a[href^=\"https://app.readpeak.com/ads\"]',\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n 'a[href^=\"http://g1.v.fwmrm.net/ad/\"]',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n ],\n adBlockWarningRemoval: ['#adblock-honeypot', '.adblocker-root', '.wp_adblock_detect'],\n adGuardAnnoyances: ['amp-embed[type=\"zen\"]', '.hs-sosyal', '#cookieconsentdiv', 'div[class^=\"app_gdpr\"]', '.as-oil'],\n adGuardBase: ['#ad-after', '#ad-p3', '.BetterJsPopOverlay', '#ad_300X250', '#bannerfloat22'],\n adGuardChinese: [\n '#piao_div_0[style*=\"width:140px;\"]',\n 'a[href*=\".ttz5.cn\"]',\n 'a[href*=\".yabovip2027.com/\"]',\n '.tm3all2h4b',\n '.cc5278_banner_ad',\n ],\n adGuardFrench: [\n '.zonepub',\n '[class*=\"_adLeaderboard\"]',\n '[id^=\"block-xiti_oas-\"]',\n 'a[href^=\"http://ptapjmp.com/\"]',\n 'a[href^=\"https://go.alvexo.com/\"]',\n ],\n adGuardGerman: [\n '.banneritemwerbung_head_1',\n '.boxstartwerbung',\n '.werbung3',\n 'a[href^=\"http://www.eis.de/index.phtml?refid=\"]',\n 'a[href^=\"https://www.tipico.com/?affiliateId=\"]',\n ],\n adGuardJapanese: [\n '#kauli_yad_1',\n '#ad-giftext',\n '#adsSPRBlock',\n 'a[href^=\"http://ad2.trafficgate.net/\"]',\n 'a[href^=\"http://www.rssad.jp/\"]',\n ],\n adGuardMobile: ['amp-auto-ads', '#mgid_iframe', '.amp_ad', 'amp-embed[type=\"24smi\"]', '#mgid_iframe1'],\n adGuardRussian: [\n 'a[href^=\"https://ya-distrib.ru/r/\"]',\n 'a[href^=\"https://ad.letmeads.com/\"]',\n '.reclama',\n 'div[id^=\"smi2adblock\"]',\n 'div[id^=\"AdFox_banner_\"]',\n ],\n adGuardSocial: [\n 'a[href^=\"//www.stumbleupon.com/submit?url=\"]',\n 'a[href^=\"//telegram.me/share/url?\"]',\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: [\n '#barraPublicidade',\n '#Publicidade',\n '#publiEspecial',\n '#queTooltip',\n '[href^=\"http://ads.glispa.com/\"]',\n ],\n adGuardTrackingProtection: [\n 'amp-embed[type=\"taboola\"]',\n '#qoo-counter',\n 'a[href^=\"http://click.hotlog.ru/\"]',\n 'a[href^=\"http://hitcounter.ru/top/stat.php\"]',\n 'a[href^=\"http://top.mail.ru/jump\"]',\n ],\n adGuardTurkish: [\n '#backkapat',\n '#reklami',\n 'a[href^=\"http://adserv.ontek.com.tr/\"]',\n 'a[href^=\"http://izlenzi.com/campaign/\"]',\n 'a[href^=\"http://www.installads.net/\"]',\n ],\n bulgarian: ['td#freenet_table_ads', '#adbody', '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: ['#AD_banner_bottom', '#Ads_google_02', '#N-ad-article-rightRail-1', '#ad-fullbanner2', '#ad-zone-2'],\n easyListChina: [\n 'a[href*=\".wensixuetang.com/\"]',\n 'A[href*=\"/hth107.com/\"]',\n '.appguide-wrap[onclick*=\"bcebos.com\"]',\n '.frontpageAdvM',\n '#taotaole',\n ],\n easyListCookie: ['#adtoniq-msg-bar', '#CoockiesPage', '#CookieModal_cookiemodal', '#DO_CC_PANEL', '#ShowCookie'],\n easyListCzechSlovak: ['#onlajny-stickers', '#reklamni-box', '.reklama-megaboard', '.sklik', '[id^=\"sklikReklama\"]'],\n easyListDutch: [\n '#advertentie',\n '#vipAdmarktBannerBlock',\n '.adstekst',\n 'a[href^=\"https://xltube.nl/click/\"]',\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n 'a[href^=\"http://www.hw-area.com/?dp=\"]',\n 'a[href^=\"https://ads.sunmaker.com/tracking.php?\"]',\n '.werbung-skyscraper2',\n '.bannergroup_werbung',\n '.ads_rechts',\n ],\n easyListItaly: [\n '.box_adv_annunci',\n '.sb-box-pubbliredazionale',\n 'a[href^=\"http://affiliazioniads.snai.it/\"]',\n 'a[href^=\"https://adserver.html.it/\"]',\n 'a[href^=\"https://affiliazioniads.snai.it/\"]',\n ],\n easyListLithuania: [\n '.reklamos_tarpas',\n '.reklamos_nuorodos',\n 'img[alt=\"Reklaminis skydelis\"]',\n 'img[alt=\"Dedikuoti.lt serveriai\"]',\n 'img[alt=\"Hostingas Serveriai.lt\"]',\n ],\n estonian: ['A[href*=\"http://pay4results24.eu\"]'],\n fanboyAnnoyances: [\n '#feedback-tab',\n '#taboola-below-article',\n '.feedburnerFeedBlock',\n '.widget-feedburner-counter',\n '[title=\"Subscribe to our blog\"]',\n ],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: [\n '.td-tags-and-social-wrapper-box',\n '.twitterContainer',\n '.youtube-social',\n 'a[title^=\"Like us on Facebook\"]',\n 'img[alt^=\"Share on Digg\"]',\n ],\n frellwitSwedish: [\n 'a[href*=\"casinopro.se\"][target=\"_blank\"]',\n 'a[href*=\"doktor-se.onelink.me\"]',\n 'article.category-samarbete',\n 'div.holidAds',\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n 'A[href*=\"adman.otenet.gr/click?\"]',\n 'A[href*=\"http://axiabanners.exodus.gr/\"]',\n 'A[href*=\"http://interactive.forthnet.gr/click?\"]',\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n 'A[href*=\"ad.eval.hu\"]',\n 'A[href*=\"ad.netmedia.hu\"]',\n 'A[href*=\"daserver.ultraweb.hu\"]',\n '#cemp_doboz',\n '.optimonk-iframe-container',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '.cookie-msg-info-container',\n '#cookies-policy-sticky',\n ],\n icelandicAbp: ['A[href^=\"/framework/resources/forms/ads.aspx\"]'],\n latvian: [\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 120px; height: 40px; overflow: hidden; position: relative;\"]',\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 88px; height: 31px; overflow: hidden; position: relative;\"]',\n ],\n listKr: [\n 'a[href*=\"//kingtoon.slnk.kr\"]',\n 'a[href*=\"//playdsb.com/kr\"]',\n 'div.logly-lift-adz',\n 'div[data-widget_id=\"ml6EJ074\"]',\n 'ins.daum_ddn_area',\n ],\n listeAr: [\n '.geminiLB1Ad',\n '.right-and-left-sponsers',\n 'a[href*=\".aflam.info\"]',\n 'a[href*=\"booraq.org\"]',\n 'a[href*=\"dubizzle.com/ar/?utm_source=\"]',\n ],\n listeFr: [\n 'a[href^=\"http://promo.vador.com/\"]',\n '#adcontainer_recherche',\n 'a[href*=\"weborama.fr/fcgi-bin/\"]',\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n '[href^=\"https://aff.sendhub.pl/\"]',\n 'a[href^=\"http://advmanager.techfun.pl/redirect/\"]',\n 'a[href^=\"http://www.trizer.pl/?utm_source\"]',\n 'div#skapiec_ad',\n ],\n ro: [\n 'a[href^=\"//afftrk.altex.ro/Counter/Click\"]',\n 'a[href^=\"/magazin/\"]',\n 'a[href^=\"https://blackfridaysales.ro/trk/shop/\"]',\n 'a[href^=\"https://event.2performant.com/events/click\"]',\n 'a[href^=\"https://l.profitshare.ro/\"]',\n ],\n ruAd: [\n 'a[href*=\"//febrare.ru/\"]',\n 'a[href*=\"//utimg.ru/\"]',\n 'a[href*=\"://chikidiki.ru\"]',\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: ['a[href*=macau-uta-popup]', '#ads-google-middle_rectangle-group', '.ads300s', '.bumq', '.img-kosana'],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n '.ctpl-fullbanner',\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n};\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var debug = (_a === void 0 ? {} : _a).debug;\n return __awaiter(this, void 0, void 0, function () {\n var filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filterNames = Object.keys(filters);\n allSelectors = (_b = []).concat.apply(_b, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _c.sent();\n if (debug) {\n printDebug(blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\" + filterName + \":\";\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \" + selector + \" \" + (blockedSelectors[selector] ? '🚫' : '➡️');\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(message + \"\\n```\");\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \" + gamut + \")\").matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch('inverted')) {\n return true;\n }\n if (doesMatch('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(inverted-colors: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$1('active')) {\n return true;\n }\n if (doesMatch$1('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(forced-colors: \" + value + \")\").matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \" + i + \")\").matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$3('reduce')) {\n return true;\n }\n if (doesMatch$3('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(prefers-reduced-motion: \" + value + \")\").matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch$4('high')) {\n return true;\n }\n if (doesMatch$4('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(dynamic-range: \" + value + \")\").matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = containerWidthPx + \"px\";\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\" + 1 / iframeWindow.devicePixelRatio;\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArrays(Array((containerWidthPx / 20) << 0)).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\" + proConfidenceScore) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\" + (result ? '|' : '') + componentKey.replace(/([:|\\\\])/g, '\\\\$1') + \":\" + value;\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \" + result.version + \"\\nuserAgent: \" + navigator.userAgent + \"\\ntimeBetweenLoadAndGet: \" + (startTime - creationTime) + \"\\nvisitorId: \" + result.visitorId + \"\\ncomponents: \" + componentsToDebugString(components) + \"\\n```\");\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.01) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://openfpcdn.io/fingerprintjs/v\" + version + \"/npm-monitoring\", true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport default index;\nexport { componentsToDebugString, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources };\n","const sdk = require('@/matrix-js-sdk');\r\n\r\nimport MTRXKIT from \"./mtrxkit\";\r\nimport f from \"./functions\";\r\nimport images from \"./utils/images\";\r\nimport FingerprintJS from '@fingerprintjs/fingerprintjs';\r\n\r\nimport qs from 'qs';\r\nimport fileSaver from 'file-saver';\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar axios = require('axios');\r\n\r\nconsole.log(\"sdk\", sdk)\r\n\r\n\r\nclass MTRX {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n this.baseUrl = p.baseUrl\r\n this.ready = false\r\n this.error = false\r\n this.kit = new MTRXKIT(this.core, p)\r\n this.sdk = sdk\r\n this.sync = ''\r\n this.nd = false\r\n this.version = 4\r\n this.dversion = '2'\r\n this.backup = {}\r\n this.db = null\r\n\r\n this.customrequest = true\r\n\r\n this.devicekey = 'm8_device'\r\n }\r\n\r\n\r\n async setCredentials() {\r\n return this.core.user.matrixCredentials().then(credentials => {\r\n this.credentials = credentials\r\n return Promise.resolve(credentials)\r\n })\r\n\r\n }\r\n\r\n getDevices() {\r\n var devices = localStorage[this.devicekey] || ''\r\n\r\n if (devices) {\r\n try {\r\n var d = JSON.parse(devices)\r\n\r\n return d\r\n } catch (e) {\r\n }\r\n }\r\n\r\n return {}\r\n }\r\n\r\n setDevice(device, userkey) {\r\n\r\n var devices = this.getDevices()\r\n\r\n devices[userkey] = device\r\n\r\n localStorage[this.devicekey] = JSON.stringify(devices)\r\n localStorage.device_ = JSON.stringify(device)\r\n\r\n }\r\n\r\n getDevice(userkey) {\r\n // return localStorage.m8_device;\r\n // var devices = this.getDevices()\r\n // return devices[userkey] || null\r\n }\r\n\r\n request(opts, clbk) {\r\n\r\n var response = null;\r\n\r\n var error = null\r\n\r\n const cancelTokenSource = axios.CancelToken.source();\r\n\r\n var aopts = {\r\n url: opts.uri,\r\n params: opts.qs,\r\n data: JSON.parse(opts.body || \"{}\"),\r\n timeout: opts.timeout,\r\n headers: opts.headers,\r\n json: opts.json,\r\n method: opts.method,\r\n withCredentials: opts.withCredentials,\r\n _matrix_opts: opts,\r\n cancelToken: cancelTokenSource.token,\r\n\r\n paramsSerializer: function (params) {\r\n return qs.stringify(params, opts.qsStringifyOptions)\r\n },\r\n }\r\n\r\n var req = axios(aopts).then(response => {\r\n\r\n\r\n return Promise.resolve(response)\r\n }).catch(e => {\r\n\r\n error = e\r\n response = e.response\r\n\r\n return Promise.resolve(response)\r\n\r\n }).then(response => {\r\n\r\n var parsederror = error\r\n\r\n if (error) {\r\n\r\n try {\r\n parsederror = JSON.parse(f.deep(response, 'request.responseText'))\r\n\r\n error = new sdk.MatrixError(parsederror)\r\n\r\n } catch (e) {\r\n }\r\n\r\n //error.error = parsederror\r\n\r\n }\r\n\r\n clbk(error, response, f.deep(response, 'request.responseText') || '')\r\n\r\n /*if (error)\r\n return Promise.reject(parsederror)*/\r\n })\r\n\r\n req.abort = function () {\r\n cancelTokenSource.cancel();\r\n }\r\n\r\n return req\r\n\r\n /*\r\n uri\tstring\tThe complete URI.\r\n method\tstring\tThe HTTP method.\r\n qs\tObject\tThe query parameters to append to the URI.\r\n body\tObject\tThe JSON-serializable object.\r\n json\tboolean\tTrue if this is a JSON request.\r\n _matrix_opts\r\n */\r\n\r\n\r\n }\r\n\r\n async getFingerprint() {\r\n var fp = await FingerprintJS.load()\r\n var result = await fp.get()\r\n return result.visitorId + this.dversion\r\n }\r\n\r\n createMtrxClient(opts) {\r\n\r\n var client = sdk.createClient(opts);\r\n\r\n client.getProfileInfo = function () {\r\n return Promise.resolve({\r\n avatar_url: '',\r\n displayname: 'test'\r\n })\r\n }\r\n\r\n return client\r\n }\r\n\r\n async getClient() {\r\n\r\n await this.setCredentials();\r\n\r\n var userClientData = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n var opts = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n if (this.customrequest)\r\n opts.request = this.request\r\n\r\n var client = this.createMtrxClient(opts);\r\n\r\n\r\n try {\r\n var userData = await client.login('m.login.password', {\r\n user: this.credentials.username,\r\n password: this.credentials.password,\r\n })\r\n\r\n } catch (e) {\r\n\r\n if(e && e.indexOf && e.indexOf('M_USER_DEACTIVATED') > -1){\r\n this.error = 'M_USER_DEACTIVATED'\r\n return null\r\n }\r\n\r\n if (await client.isUsernameAvailable(this.credentials.username)) {\r\n\r\n userData = await client.register(\r\n this.credentials.username,\r\n this.credentials.password,\r\n null,\r\n {\r\n type: 'm.login.dummy',\r\n //signature : this.core.user.signature('matrix')\r\n }\r\n )\r\n\r\n } else {\r\n throw 'Signup error, username is not available: ' + e\r\n }\r\n }\r\n\r\n localStorage.accessToken = userData.access_token\r\n var store = new sdk.IndexedDBStore({\r\n indexedDB: window.indexedDB,\r\n dbName: 'matrix-js-sdk:' + this.credentials.username\r\n })\r\n await store.startup()\r\n\r\n Object.assign(userClientData, {\r\n userId: userData.user_id,\r\n accessToken: userData.access_token,\r\n unstableClientRelationAggregation: true,\r\n timelineSupport: true,\r\n store: store,\r\n\r\n // deviceId: userData.device_id,\r\n })\r\n\r\n if (this.customrequest)\r\n userClientData.request = this.request\r\n\r\n\r\n var userClient = this.createMtrxClient(userClientData)\r\n window.client = userClient\r\n window.core = this.core\r\n\r\n await userClient.startClient({\r\n pollTimeout: 60000,\r\n resolveInvitesToProfiles: true\r\n });\r\n\r\n\r\n this.access = userClientData\r\n\r\n this.client = userClient\r\n\r\n return userClient;\r\n }\r\n\r\n clearstorage(key) {\r\n var keys = Object.keys(localStorage), i = keys.length;\r\n\r\n while (i--) {\r\n if (keys[i] && keys[i].indexOf(key) == 0) {\r\n localStorage.removeItem(keys[i]);\r\n }\r\n }\r\n }\r\n\r\n clearstore() {\r\n\r\n var version = Number(localStorage.matrixversion || '0')\r\n\r\n if (version < this.version) {\r\n\r\n this.clearstorage('crypto.')\r\n this.clearstorage('session.')\r\n\r\n var keys = ['', '2', '3', '4', '5', '6', '8']\r\n\r\n _.each(keys, function (key) {\r\n delete localStorage['m' + key + '_device']\r\n })\r\n\r\n }\r\n\r\n localStorage.matrixversion = this.version\r\n }\r\n\r\n async createClient() {\r\n try {\r\n this.client = await this.getClient()\r\n this.store = this.client.store\r\n this.ready = true\r\n\r\n } catch (e) {\r\n this.error = e\r\n }\r\n\r\n\r\n return true\r\n }\r\n\r\n wait() {\r\n return f.pretry(() => {\r\n return this.ready\r\n }).then(() => {\r\n\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n waitchats() {\r\n\r\n return f.pretry(() => {\r\n\r\n return this.chatsready\r\n\r\n }).then(() => {\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n me(id) {\r\n return f.getmatrixid(id) == this.core.user.userinfo?.id\r\n }\r\n\r\n reciepts(event) {\r\n var room = null;\r\n\r\n return f.pretry(() => {\r\n\r\n var rooms = this.core.mtrx.store.rooms\r\n\r\n room = rooms[event.getRoomId()]\r\n\r\n return room\r\n\r\n }).then(() => {\r\n\r\n return room.getReceiptsForEvent(event)\r\n\r\n })\r\n }\r\n\r\n storeFileLocal(url, file){\r\n\r\n return file.arrayBuffer().then((arrayBuffer) => {\r\n const blob = new Blob([new Uint8Array(arrayBuffer)], {type: file.type });\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n return window.POCKETNETINSTANCE.storage.saveFile(url, blob);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n return this.db.set(url, blob)\r\n }\r\n }\r\n \r\n });\r\n \r\n \r\n }\r\n\r\n download(url) {\r\n\r\n // Function to download the file\r\n var dlFile = () => {\r\n return f.fetchLocal(url).then(response => {\r\n // Update the storage before returning\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n window.POCKETNETINSTANCE.storage.saveFile(url, response.data);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n this.db.set(url, response.data)\r\n }\r\n }\r\n\r\n return Promise.resolve(response.data);\r\n })\r\n }\r\n\r\n\r\n // Check if file is saved in the storage\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova) {\r\n return window.POCKETNETINSTANCE.storage.loadFile(url).then((file) => {\r\n return Promise.resolve(file);\r\n }, (e) => {\r\n\r\n // Nothing in storage, download file\r\n return dlFile();\r\n });\r\n } else {\r\n\r\n if(this.db){\r\n\r\n return this.db.get(url).then((file) => {\r\n\r\n return Promise.resolve(file);\r\n\r\n }).catch(() => {\r\n return dlFile();\r\n })\r\n \r\n }\r\n\r\n return dlFile();\r\n\r\n }\r\n \r\n \r\n }\r\n\r\n customRoomType(roomId) {\r\n var room = this.core.mtrx.client.getRoom(roomId)\r\n\r\n if (!room) return null\r\n\r\n var ev = room.currentState.getStateEvents(\"m.room.custom\", \"\") || {};\r\n\r\n return ev.event?.content.type\r\n\r\n }\r\n\r\n isReaded(event, me) {\r\n\r\n return this.reciepts(event).then(reciepts => {\r\n return Promise.resolve(\r\n _.find(reciepts, reciept => {\r\n var m = this.me(reciept.userId)\r\n\r\n\r\n return reciept.type == 'm.read' && ((me && m) || (!m && !me))\r\n })\r\n )\r\n })\r\n\r\n\r\n }\r\n\r\n initEvents() {\r\n\r\n let self = this\r\n\r\n let userId = this.core.mtrx.client.credentials.userId\r\n\r\n this.client.on(\"RoomMember.membership\", (event, member) => {\r\n\r\n\r\n if (!this.chatsready) return\r\n\r\n\r\n if ((member.membership === \"invite\" || member.membership === \"join\") && event.getSender() !== userId) {\r\n this.core.notifier.event(event)\r\n }\r\n\r\n });\r\n\r\n this.client.on(\"Room.timeline\", (message, member) => {\r\n\r\n if (!this.chatsready) return\r\n\r\n if (!message.event.content) return\r\n\r\n if (message.event.content.msgtype === 'm.file') {\r\n message.event.content.pbody = JSON.parse(message.event.content.body)\r\n }\r\n\r\n\r\n if (message.getSender() !== userId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(message.event.room_id)\r\n\r\n if (message.event.content['m.relates_to'] && message.event.content['m.relates_to'][\"rel_type\"] == 'm.replace') return false\r\n\r\n if (m_chat && this.core.pcrypto.rooms[message.event.room_id]) this.core.notifier.event(message, m_chat)\r\n\r\n }\r\n\r\n\r\n });\r\n\r\n this.client.on(\"RoomMember.typing\", (event, member) => {\r\n this.core.store.dispatch('TYPING_EVENT', member)\r\n });\r\n\r\n\r\n this.client.on('sync', (state, prevState, res) => {\r\n\r\n if (state === 'PREPARED') {\r\n this.setready()\r\n }\r\n\r\n this.core.store.dispatch('FETCH_CHATS').then(r => {\r\n this.core.store.dispatch('FETCH_EVENTS')\r\n this.core.store.commit('ALL_NOTIFICATIONS_COUNT', this.client.getRooms())\r\n })\r\n\r\n\r\n });\r\n\r\n }\r\n\r\n setready() {\r\n\r\n if (!this.chatsready) {\r\n this.chatsready = true\r\n this.core.store.commit('SET_CHATS_READY', true)\r\n }\r\n\r\n }\r\n\r\n initdb(){\r\n return ChatStorage('files', 1).then((db) => {\r\n this.db = db\r\n return Promise.resolve()\r\n }).catch(() => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n init() {\r\n return this.createClient().then(() => {\r\n\r\n if(this.error){\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return this.initdb()\r\n \r\n }).then(() => {\r\n\r\n this.initEvents()\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n deactivateAccount(){\r\n\r\n if (this.client) {\r\n return this.client.deactivateAccount(this.credentials, true)\r\n }\r\n\r\n return Promise.reject('noclient')\r\n }\r\n\r\n destroy() {\r\n if (this.client) {\r\n // Before client is stopped, delete the pusher if needed\r\n if (window.cordova) {\r\n this.deletePusher();\r\n }\r\n\r\n this.client.stopClient()\r\n }\r\n\r\n this.chatsready = false\r\n this.ready = false\r\n this.error = false\r\n }\r\n\r\n // Try to delete the current pusher if needed\r\n deletePusher() {\r\n // Try to get a saved token\r\n\r\n if (!window.cordova) return\r\n\r\n var savedToken;\r\n if (localStorage)\r\n savedToken = localStorage.getItem('fcmtoken5');\r\n if (savedToken && this.client.setPusher) {\r\n var appName = 'pocketnet';\r\n var pusherData = {\r\n app_display_name: appName,\r\n app_id: appName + window.cordova.platformId,\r\n\r\n data: {\r\n url: this.core.mtrx.baseUrl + '/_matrix/push/v1/notify',\r\n default_payload: {\r\n aps: {\r\n \"sound\": \"default\",\r\n \"content-available\": 1\r\n }\r\n }\r\n },\r\n\r\n device_display_name: window.device.manufacturer + \" \" + window.device.model,\r\n kind: null,\t// Set to null to delete the pusher\r\n lang: localStorage.getItem('loc') || 'en',\r\n pushkey: savedToken\r\n\r\n };\r\n\r\n this.core.mtrx.client.setPusher(pusherData).then(() => {\r\n localStorage.removeItem('fcmtoken5');\r\n }, (err) => {\r\n console.log(err);\r\n });\r\n }\r\n }\r\n\r\n uploadContent(file, save) {\r\n return this.client.uploadContent(file).then(src => {\r\n return Promise.resolve(this.core.mtrx.client.mxcUrlToHttp(src))\r\n }).then(url => {\r\n\r\n if(save){\r\n return this.storeFileLocal(url, file).then(() => {\r\n return Promise.resolve(url)\r\n }).catch(e => {\r\n return Promise.resolve(url)\r\n })\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n /*transaction(roomId, txId){\r\n this.client.sendEvent(roomId, \"m.room.message\", {\r\n\r\n txId: roomId,\r\n msgtype: \"m.notice\"\r\n\r\n }, \"\");\r\n }*/\r\n\r\n\r\n originalEvent(id, timeline) {\r\n var rtr = timeline._timelineSet.getRelationsForEvent(e.event.event_id, 'm.reference', 'm.room.message')\r\n\r\n if (rtr) {\r\n var events = rtr.getRelations()\r\n return events[0]\r\n }\r\n }\r\n\r\n clearEventId(event) {\r\n var previd = null\r\n\r\n if (\r\n event.event.content['m.relates_to'] &&\r\n event.event.content['m.relates_to']['rel_type'] == 'm.replace') previd = event.event.content['m.relates_to']['event_id']\r\n\r\n\r\n return previd || event.getId()\r\n\r\n }\r\n\r\n textEvent(chat, text) {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return chat.pcrypto.encryptEvent(text)\r\n }\r\n\r\n return Promise.resolve(this.sdk.ContentHelpers.makeTextMessage(text))\r\n }\r\n\r\n sendtext(chat, text, {relation, from}) {\r\n\r\n return this.textEvent(chat, text).then(r => {\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return this.client.sendEvent(chat.roomId, 'm.room.message', r)\r\n } else\r\n return this.client.sendMessage(chat.roomId, r)\r\n })\r\n\r\n\r\n }\r\n\r\n sendFile(chat, file, meta, {relation, from}, notenc) {\r\n\r\n if (!meta) meta = {}\r\n\r\n var fileInfo = {}\r\n fileInfo.name = file.name\r\n fileInfo.size = file.size\r\n\r\n var encpromise = (() => Promise.resolve(file))()\r\n var promise = null\r\n\r\n if (chat.pcrypto.canBeEncrypt() && !notenc) {\r\n\r\n encpromise = chat.pcrypto.encryptFile(file).then(r => {\r\n\r\n fileInfo.secrets = r.secrets\r\n\r\n return Promise.resolve(r.file)\r\n\r\n })\r\n\r\n }\r\n\r\n return encpromise.then(file => {\r\n\r\n promise = this.client.uploadContent(file)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n\r\n }).then(src => {\r\n\r\n if (meta.aborted)\r\n return Promise.reject('aborted')\r\n\r\n return Promise.resolve(this.client.mxcUrlToHttp(src))\r\n\r\n }).then((url) => {\r\n\r\n fileInfo.url = url\r\n\r\n let body = JSON.stringify(fileInfo)\r\n\r\n var r = {\r\n body: body,\r\n msgtype: 'm.file'\r\n }\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n return this.client.sendMessage(chat.roomId, r)\r\n\r\n })\r\n\r\n }\r\n\r\n sendImageBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendImage(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendAudioBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendAudio(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendImage(chat, base64, file, meta, {relation, from} = {}) {\r\n if (!file) return this.sendImageBase64(chat, base64, meta)\r\n\r\n var i = new images()\r\n var info = {}\r\n\r\n if (!meta) meta = {}\r\n\r\n return i.wh(base64).then(_info => {\r\n info = _info\r\n\r\n if (from)\r\n info.from = from\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return Promise.resolve(r.file)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve(file)\r\n\r\n\r\n }).then(file => {\r\n var promise = this.core.mtrx.uploadContent(file, true)\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((image) => {\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendImageMessage(chat.roomId, image, info, 'Image')\r\n })\r\n }\r\n\r\n sendAudio(chat, base64, file, meta, {relation, from} = {}) {\r\n\r\n\r\n if (!file) return this.sendAudioBase64(chat, base64, meta)\r\n\r\n \r\n let info = {}\r\n\r\n info.from = from\r\n\r\n return new Promise(resolve => {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n console.log(\"??????????\")\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return resolve(r.file)\r\n })\r\n }\r\n\r\n resolve(file) \r\n\r\n }).then(file => {\r\n\r\n let promise = this.core.mtrx.uploadContent(file, true)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((audio) => {\r\n\r\n console.log(audio, info)\r\n\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendAudioMessage(chat.roomId, audio, info, 'Audio')\r\n })\r\n\r\n }\r\n\r\n async getFile(chat, event) {\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n\r\n return this.download(event.event.content.pbody.url).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return Promise.resolve({\r\n file: r,\r\n name: event.event.content.pbody.name\r\n });\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n async downloadFile(chat, event) {\r\n\r\n return this.getFile(chat, event).then(r => {\r\n\r\n if (window.cordova && f.saveFileCordova) {\r\n return new Promise((resolve, reject) => {\r\n\r\n f.saveFileCordova(r.file, r.name, function (i, e) {\r\n\r\n if (e) {\r\n console.error(e)\r\n }\r\n\r\n if (!e) resolve()\r\n\r\n else reject('unable')\r\n })\r\n })\r\n }\r\n\r\n return fileSaver.saveAs(r.file, r.name);\r\n\r\n }).catch(e => {\r\n console.error(e)\r\n return Promise.reject(e)\r\n })\r\n\r\n\r\n }\r\n\r\n async getAudioUnencrypt(chat, event){\r\n\r\n console.log('getAudioUnencrypt')\r\n\r\n if(event.event.content.audioData){\r\n return Promise.resolve(event.event.content.audioData)\r\n }\r\n\r\n return this.download(event.event.content.url, true).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.content.audioData = arraybuffer\r\n\r\n return Promise.resolve(arraybuffer)\r\n })\r\n\r\n }\r\n\r\n async getAudio(chat, event) {\r\n\r\n if (event.event.decryptedAudio) {\r\n return Promise.resolve(event.event.decryptedAudio)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.decryptedAudio = arraybuffer\r\n\r\n return Promise.resolve(event.event.decryptedAudio)\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n }\r\n }\r\n\r\n async getImage(chat, event) {\r\n\r\n if (event.event.decryptedImage) {\r\n return Promise.resolve(event.event.decryptedImage)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n return f.Base64.fromFile(r)\r\n }).then(url => {\r\n\r\n event.event.decryptedImage = url.replace('data:file;', 'data:image/jpeg;')\r\n return Promise.resolve(event.event.decryptedImage)\r\n\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n }\r\n\r\n\r\n shareInChat(id, share) {\r\n var m_chat = this.client.getRoom(id)\r\n\r\n\r\n //// share.openwithItems []\r\n\r\n //// https://github.com/j3k0/cordova-plugin-openwith (item.type ---> resize)\r\n\r\n return this.core.mtrx.kit.prepareChat(m_chat).then(r => {\r\n\r\n var promises = []\r\n\r\n //// todo resize images.resize.fit\r\n _.each(share.images, (base64) => {\r\n\r\n var promise = this.sendImageBase64(m_chat, base64, {}, {from: share.from})\r\n\r\n promises.push(promise)\r\n\r\n })\r\n\r\n _.each(share.files, (file) => {\r\n\r\n promises.push(this.sendFile(m_chat, file, {}, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.urls, (url) => {\r\n\r\n promises.push(this.sendtext(m_chat, url, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.messages, (text) => {\r\n\r\n promises.push(this.sendtext(m_chat, text, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.audio, (arraybuffer) => {\r\n\r\n var base64 = 'data:audio/mpeg;base64,' + f._arrayBufferToBase64(arraybuffer)\r\n\r\n promises.push(this.sendAudioBase64(m_chat, base64,{}, {from: share.from}))\r\n\r\n })\r\n\r\n return Promise.all(promises)\r\n\r\n })\r\n }\r\n\r\n opencontact(contact) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: contact.name,\r\n type: 'contact',\r\n data: {\r\n contact: contact\r\n }\r\n })\r\n }\r\n\r\n complain(caption, p) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: caption,\r\n type: 'complain',\r\n data: p\r\n })\r\n }\r\n\r\n blockeduser(id) {\r\n\r\n if (!this.core.mtrx.client) return\r\n\r\n return this.core.mtrx.client.isUserIgnored(this.core.user.matrixId(id))\r\n }\r\n\r\n blockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList.push(userId)\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n fastsync = function () {\r\n\r\n var state = this.client.getSyncState()\r\n\r\n if (state === \"PREPARED\" || state === \"SYNCING\") {\r\n\r\n } else {\r\n return this.client.retryImmediately().catch(e => {\r\n console.log('fastsyncerror', e)\r\n })\r\n }\r\n\r\n\r\n }\r\n\r\n unblockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (!this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList = _.filter(blackList, function (_id) {\r\n return userId != _id\r\n })\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n chatUsersInfo(roomId, m) {\r\n\r\n if (!m) m = 'chatUsers'\r\n\r\n var _users = this.core.store.state.users\r\n\r\n return _.filter(_.map(this[m](roomId), (user) => {\r\n return _users[user.userId]\r\n }), function (u) {\r\n return u\r\n })\r\n\r\n }\r\n\r\n chatUsers(roomId) {\r\n return this.core.store.state.chatusers[roomId] || []\r\n }\r\n\r\n\r\n anotherChatUsers(roomId) {\r\n return _.filter(this.chatUsers(roomId), (user) => {\r\n return user.userId != this.core.user.userinfo.id\r\n })\r\n }\r\n}\r\n\r\nexport default MTRX\r\n","//require('ion-sound')\r\nimport f from \"./functions\";\r\n//const { Howl, Howler } = require('howler');\r\n\r\nclass Notifier {\r\n\r\n\tconstructor(core, p) {\r\n\t\tif (!p) p = {}\r\n\r\n\t\tthis.core = core\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\r\n\t\tthis.ion = null\r\n\r\n\t\tif (typeof ion != 'undefined') this.ion = ion\r\n\r\n\t\t/*ion.sound({\r\n\t\t sounds: [\r\n\t\t\t{\r\n\t\t\t name: \"glass\"\r\n\t\t\t}\r\n\t\t ],\r\n\t\t path: \"sounds/\",\r\n\t\t preload: true\r\n\t\t});*/\r\n\t}\r\n\r\n\tkey = 'showednotifications'\r\n\tshowed = {}\r\n\r\n\taddshowed(id) {\r\n\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\t\tthis.showed[id] = true\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\r\n\t}\r\n\r\n\tclearshowed() {\r\n\t\tthis.showed = {}\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\t}\r\n\r\n\tplaysound() {\r\n\t\t// If cordova is available, use the media plugin to play a sound\r\n\t\tif (window.Media && window.cordova && window.cordova.file && window.cordova.file.applicationDirectory) {\r\n\r\n\t\t\tvar soundSrc = window.cordova.file.applicationDirectory + 'www/sounds/glass.mp3';\r\n\t\t\tif (soundSrc.startsWith('file://'))\r\n\t\t\t\tsoundSrc = soundSrc.substring(7);\r\n\t\t\tvar notificationSound = new Media(soundSrc);\r\n\t\t\t// Play audio\r\n\t\t\tnotificationSound.play();\r\n\t\t}\r\n\r\n\t\t// Else, try to use the Howler sound plugin\r\n\t\telse if (window.ion) {\r\n\r\n\t\t\tion.sound.play('glass')\r\n\r\n\t\t\t/*var notificationSound = new Howl({\r\n\t\t\t\tsrc: ['sounds/glass.mp3'],\r\n\t\t\t\thtml5: true\r\n\t\t\t});\r\n\t\t\tnotificationSound.play();*/\r\n\t\t}\r\n\t}\r\n\r\n\tnotifySoundOrAction() {\r\n\r\n\t\tvar lastsounddate = localStorage['lastsounddate'] || null\r\n\r\n\t\tif (lastsounddate) {\r\n\t\t\tlastsounddate = new Date(lastsounddate)\r\n\r\n\t\t\tif (f.date.addseconds(lastsounddate, 10) > (new Date())) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlocalStorage['lastsounddate'] = (new Date())\r\n\r\n\t\tif (window.cordova && window.POCKETNETINSTANCE) {\r\n\t\t\twindow.POCKETNETINSTANCE.mobile.vibration.small()\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.playsound()\r\n\t\t}\r\n\t}\r\n\r\n\tdecrypt(event, chat) {\r\n\r\n\t\treturn this.core.mtrx.kit.prepareChat(chat).then(r => {\r\n\r\n\t\t\t\r\n\t\t\tif (event.event.decrypted) {\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}\r\n\r\n\t\t\treturn chat.pcrypto.decryptEvent(event.event)\r\n\t\t\t \r\n\t\t}).catch(e => {\r\n\t\t\treturn Promise.resolve()\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tmessage(event, user, chat) {\r\n\r\n\t\tvar state = this.core.vm.$store.state\r\n\r\n\r\n\t\tif (this.showed[event.event.event_id]) return\r\n\r\n\t\tthis.addshowed(event.event.event_id)\r\n\r\n\t\tvar external = f.deep(this, 'core.external.clbks.NOTIFICATION') || {}\r\n\t\tvar ctype = ''\r\n\r\n\t\tvar t = f.deep(event, 'event.type')\r\n\r\n\t\tif (['m.room.member'].indexOf(t) > -1) ctype = 'invite'\r\n\t\tif (['m.room.message'].indexOf(t) > -1) ctype = 'message'\r\n\t\tif (['m.room.name'].indexOf(t) > -1) ctype = ''\r\n\t\tif (['m.room.power_levels'].indexOf(t) > -1) ctype = 'moder'\r\n\t\tif (['m.room.redaction'].indexOf(t) > -1) ctype = 'redaction'\r\n\t\tif (f.deep(event, 'event.content.msgtype') == 'm.encrypted') ctype = 'encrypted'\r\n\r\n\t\tvar c = () => {\r\n\r\n\t\t\t\r\n\t\t\tvar msg = {\r\n\t\t\t\ttitle: user.name,\r\n\t\t\t\tevent: event,\r\n\t\t\t\tmessage: event.event.content.type == 'm.encrypted' ? \"***\" : event.event.content.body, // event.content.body,\r\n\t\t\t\troomId: event.event.room_id,\r\n\t\t\t\ticon: user.image,\r\n\t\t\t\tchat: chat,\r\n\t\t\t\tctype: ctype\r\n\t\t\t}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(msg)\r\n\t\t\t})\r\n\r\n\t\t\tif (state.currentRoom === event.event.room_id && !this.core.hiddenInParent) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.notifySoundOrAction()\r\n\t\t\tthis.show(msg, '/chat?id=' + event.event.room_id)\r\n\t\t}\r\n\r\n\t\tif (ctype == 'encrypted') {\r\n\t\t\tthis.decrypt(event, chat).then(c)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tc()\r\n\t\t}\r\n\r\n\r\n\t}\r\n\r\n\tevent(event, chat) {\r\n\t\tlet pushAction = this.core.mtrx.client.getPushActionsForEvent(event)\r\n\r\n\r\n\t\tif (!pushAction.notify) return\r\n\r\n\t\t//let timeFromNow = moment(moment.utc(event.event.origin_server_ts).toDate()).local().fromNow()\r\n\r\n\t\tvar date = moment(moment.utc(event.event.origin_server_ts).toDate()).local().toDate()\r\n\t\tvar iftime = f.date.addseconds(date, 10) > moment().toDate()\r\n\r\n\r\n\t\tif (!iftime) return\r\n\r\n\t\tthis.core.mtrx.isReaded(event, true).then(r => {\r\n\r\n\t\t\tif (r) return\r\n\r\n\t\t\tif (!this.core.mtrx.me(event.getSender()) && event.getSender() && event.getSender() !== this.core.mtrx.client.credentials.userId) {\r\n\r\n\r\n\t\t\t\tthis.core.user.usersInfo([f.getmatrixid(event.getSender())]).then(info => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tinfo && info[0]\r\n\t\t\t\t\t) {\r\n\r\n\r\n\t\t\t\t\t\tthis.message(event, info[0], chat)\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tshow = function (info, click) {\r\n\t\tif (typeof click != 'function') {\r\n\t\t\tvar route = click\r\n\t\t\tclick = () => {\r\n\t\t\t\tthis.core.vm.$router.push(route).catch(e => {})\r\n\r\n\t\t\t\tif (this.core.apptochat) this.core.apptochat()\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar position = \"bottom-right\";\r\n\r\n\t\tif (this.core.vm.$store.state.mobile) {\r\n\t\t\tposition = 'top-left'\r\n\t\t}\r\n\r\n\t\tthis.core.vm.$message({\r\n\t\t\tevent: info.event,\r\n\t\t\ttitle: info.title,\r\n\t\t\tmessage: info.message,\r\n\t\t\troomId: info.roomId,\r\n\t\t\ticonImg: info.icon || null,\r\n\t\t\tonClick: click,\r\n\t\t\tzIndex: 999,\r\n\t\t\tsupportHTML: true,\r\n\t\t\twrapperClassName: \"notificationWrapper\",\r\n\t\t\tposition: position,\r\n\t\t\ttype: 'info',\r\n\t\t\tchat: info.chat,\r\n\t\t\tduration: 5000\r\n\t\t})\r\n\t}\r\n}\r\n\r\nexport default Notifier","var Axios = require('axios');\r\nimport axiosRequest from '@nelsonomuto/axios-request-timeout';\r\nvar { error, byError } = require('./error')\r\n\r\nimport f from '@/application/functions'\r\nimport qs from 'qs';\r\n\r\nvar Axios = function(){\r\n\r\n var datakeys = [\r\n 'data.result'\r\n ]\r\n\r\n var errorkeys = [\r\n 'data.error'\r\n ]\r\n\r\n async function axios ({\r\n to : to,\r\n data : data\r\n }){\r\n\r\n data || (data = {})\r\n\r\n _.each(data, (v, i) => {\r\n if(_.isArray(v) || _.isObject(v)){\r\n data[i] = JSON.stringify(v)\r\n }\r\n }) \r\n\r\n var response = null;\r\n\r\n try{\r\n response = await axiosRequest({\r\n method: 'post',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n url: to,\r\n data: qs.stringify(data),\r\n timeout: 35000\r\n })\r\n\r\n }\r\n catch(e){\r\n response = e.response\r\n }\r\n \r\n\r\n if(!response){\r\n return Promise.reject('noresponse')\r\n }\r\n\r\n ////errors\r\n \r\n var ke = _.find(errorkeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (ke){\r\n return Promise.reject(byError(f.deep(response.data, ke)))\r\n }\r\n\r\n ////result\r\n\r\n var k = _.find(datakeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (k){\r\n return Promise.resolve(f.deep(response.data, k))\r\n }\r\n\r\n ////result\r\n \r\n return Promise.reject('error')\r\n \r\n\r\n }\r\n\r\n return {\r\n axios\r\n }\r\n\r\n}\r\n\r\nexport default Axios","import f from './functions'\r\nimport Axios from './axios'\r\nvar { error } = require('./error')\r\n\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar ApiWrapper = function (core) {\r\n\r\n\tvar self = this;\r\n\tvar a = new Axios();\r\n\r\n\tvar cache = {}\r\n\tvar loading = {}\r\n\tvar storages = {}\r\n\r\n\tvar apis = {\r\n\t\tpocketnet : null\r\n\t}\r\n\r\n\tvar ep = function(){\r\n\t\treturn Promise.resolve()\r\n\t}\r\n\r\n\tvar getstorage = function(p){\r\n\r\n\t\tif(!storages[p.storage]){\r\n\t\t\treturn ChatStorage(p.storage, p.version || 1, p.time).then(storage => {\r\n\r\n\t\t\t\tstorages[p.storage] = storage\r\n\r\n\t\t\t\treturn Promise.resolve(storage)\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve(storages[p.storage])\r\n\t}\r\n\r\n\t\r\n\tvar scasheAct = function (ids, key, resultsKey, reload, storageparameters) {\r\n\r\n\t\tif (!_.isArray(ids)) ids = [ids]\r\n\r\n\t\tvar waitLoading = {}\r\n\r\n\t\tif(!resultsKey) \r\n\t\t\tresultsKey = key\r\n\r\n\t\tif(!cache[key]) {\r\n\t\t\tcache[key] = {}\r\n\t\t}\r\n\r\n\t\tif(!loading[key]) {\r\n\t\t\tloading[key] = {}\r\n\t\t}\r\n\r\n\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\r\n\t\t\tif (storage){\r\n\r\n\t\t\t\treturn Promise.all(_.map(ids, (id) => {\r\n\r\n\t\t\t\t\tif (cache[key][id]){\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn storage.get(id).then((stored) => {\r\n\t\t\t\t\t\tcache[key][stored[resultsKey]] = stored\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}))\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\r\n\t\t}).then(r => {\r\n\r\n\t\t\tvar idtoloadPrev = _.uniq(_.filter(ids, function (id) {\r\n\t\t\t\treturn reload || !cache[key][id] || cache[key][id].nocache\r\n\t\t\t}))\r\n\t\r\n\t\t\tvar idtoload = _.filter(idtoloadPrev, function (id) {\r\n\t\r\n\t\t\t\tif(!loading[key][id]) {\r\n\t\t\t\t\tloading[key][id] = true\r\n\t\t\t\t\treturn true\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\twaitLoading[id] = true\r\n\t\t\t})\r\n\t\r\n\t\t\tvar handleResults = function (result, _ids) {\r\n\r\n\t\t\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(storage){\r\n\t\t\t\t\t\treturn Promise.all(_.map(result, (row) => {\r\n\r\n\t\t\t\t\t\t\tif(!row[resultsKey]){\r\n\t\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn storage.set(row[resultsKey], row)\r\n\r\n\t\t\t\t\t\t}))\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(() => {\r\n\r\n\t\t\t\t\t_.each(result, function (row) {\r\n\r\n\t\t\t\t\t\tif (row[resultsKey]) {\r\n\t\t\t\t\t\t\tcache[key][row[resultsKey]] = row\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t_.each(_ids, function(id){\r\n\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\r\n\t\t\t\t\t\tif(!cache[key][id])\r\n\t\t\t\t\t\t\tcache[key][id] = 'error'\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\tvar nresult = {};\r\n\t\t\r\n\t\t\t\t\treturn f.pretry(() => {\r\n\t\t\r\n\t\t\t\t\t\t_.each(ids, function (id) {\r\n\t\t\r\n\t\t\t\t\t\t\tif (cache[key][id]) {\r\n\t\t\r\n\t\t\t\t\t\t\t\tif (cache[key][id] != 'error')\r\n\t\t\r\n\t\t\t\t\t\t\t\t\tnresult[id] = (cache[key][id])\r\n\t\t\r\n\t\t\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t\treturn _.toArray(waitLoading).length == 0\r\n\t\t\r\n\t\t\t\t\t}).then(() => {\r\n\t\t\t\t\t\treturn Promise.resolve(nresult)\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t})\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.resolve({\r\n\t\t\t\tid: idtoload,\r\n\t\t\t\thandle: handleResults\r\n\t\t\t})\r\n\t\t})\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t}\r\n\r\n\tvar waitonline = function () {\r\n\r\n\t\tif (!core || !core.waitonline) {\r\n\t\t\treturn Promise.resolve()\r\n\t\t}\r\n\r\n\t\treturn core.waitonline()\r\n\r\n\t}\r\n\r\n\tvar crequest = function (ids, key, rkey, reload, storageparameters) {\r\n\r\n\t\treturn scasheAct(ids, key, rkey, reload, storageparameters).then(sh => {\r\n\r\n\t\t\tif (!sh.id.length) {\r\n\t\t\t\treturn sh.handle([])\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.reject(sh)\r\n\r\n\t\t})\r\n\r\n\t\t\r\n\t}\r\n\r\n\tvar request = function (data, to) {\r\n\r\n\t\treturn waitonline().then(() => {\r\n\r\n\t\t\tdata || (data = {})\r\n\r\n\t\t\treturn a.axios({\r\n\t\t\t\tto,\r\n\t\t\t\tdata,\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\t\t\t\t.catch(e => {\r\n\r\n\t\t\t\t\tif (e == 'noresponse') {\r\n\r\n\t\t\t\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\trequest(data, to).then(r => {\r\n\r\n\r\n\t\t\t\t\t\t\t\t\treturn resolve(r)\r\n\r\n\t\t\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\t\t\treturn reject(e)\r\n\r\n\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t\t}, 3000)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\r\n\t\t})\r\n\r\n\r\n\t}\r\n\r\n\tself.clearCache = function (key) {\r\n\r\n\t\tif (!key) {\r\n\t\t\tcache = {}\r\n\t\t} else {\r\n\t\t\tdelete cache[key]\r\n\t\t}\r\n\t}\r\n\r\n\tself.pocketnet = {\r\n\r\n\t\tcommon: (data, method) => {\r\n\r\n\t\t\tif(!data) data = {}\r\n\r\n\t\t\tif(!apis.pocketnet)\r\n\t\t\t\tapis.pocketnet = f.deep(window, 'POCKETNETINSTANCE.api')\r\n\t\t\t\t\r\n\t\t\tif(!apis.pocketnet && typeof Api != 'undefined'){\r\n\t\t\t\tapis.pocketnet = new Api(core)\r\n\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\tif (apis.pocketnet) {\r\n\r\n\t\t\t\treturn apis.pocketnet.initIf().then(() => {\r\n\t\t\t\t\treturn apis.pocketnet.wait.ready('use', 3000)\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\treturn apis.pocketnet.rpc(method, data.parameters)\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\terror : e\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t})\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tdata.method = method\r\n\t\t\tdata.node = '185.148.147.15'\r\n\t\t\tdata.parameters = f.hexEncode(JSON.stringify(data.parameters || \"\"))\r\n\r\n\t\t\treturn request(data, servers.pocketnet + '/rpc-' + (method || \"common\"))\r\n\r\n\t\t},\r\n\t\t\r\n\t\tuserState: (addresses) => {\r\n\r\n\t\t\tif (!_.isArray(addresses)) addresses = [addresses]\r\n\r\n\t\t\tvar parameters = [addresses.join(',')];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserstate')\r\n\t\t},\r\n\r\n\t\tuserStateMe: (address) => {\r\n\r\n\t\t\tvar cacheresult = f.deep(window, 'POCKETNETINSTANCE.platform.sdk.ustate.storage.' + address)\r\n\r\n\t\t\tif(cacheresult){\r\n\t\t\t\treturn Promise.resolve(cacheresult)\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userState(address)\r\n\t\t},\r\n\r\n\t\tuserInfoCached: (addresses, reload) => {\r\n\r\n\t\t\tvar rescached = []\r\n\r\n\t\t\tif(!reload){\r\n\r\n\t\t\t\trescached = _.filter(_.map(addresses, (address) => {\r\n\t\t\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.sdk.userscl.storage.' + address) || null\r\n\t\t\t\t}), (u) => {return u})\r\n\r\n\t\t\t\taddresses = _.filter(addresses, (a) => {\r\n\t\t\t\t\treturn !_.find(rescached, (r) => {\r\n\t\t\t\t\t\treturn r.address == a\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userInfo(addresses, reload).then(rs => {\r\n\r\n\t\t\t\t\r\n\t\t\t\trs = _.toArray(rs)\r\n\r\n\t\t\t\t_.each(rescached, (c) => {\r\n\t\t\t\t\trs.push(c)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\treturn Promise.resolve(rs)\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tsearch: (text) => {\r\n\r\n\t\t\tvar parameters = [text, 'users'];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'searchusers').then(data => {\r\n\t\t\t\treturn Promise.resolve(data || [])\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tuserInfo: (addresses, reload) => {\r\n\r\n\t\t\tif(!addresses.length){\r\n\t\t\t\treturn Promise.resolve([])\r\n\t\t\t}\r\n\r\n\t\t\treturn crequest(addresses, 'pocketnet_userInfo', 'address', reload, {\r\n\t\t\t\tstorage : 'userInfo',\r\n\t\t\t\ttime : 60 * 60 * 24 \r\n\t\t\t}).catch(sh => {\r\n\r\n\t\t\t\tif(!sh || !sh.id) {\r\n\t\t\t\t\treturn Promise.reject(sh)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar parameters = [sh.id, '1'];\r\n\r\n\t\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\t\treturn sh.handle(results, sh.id)\r\n\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpostInfo: (params) => {\r\n\r\n\t\t\tvar parameters = [[params.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getrawtransactionwithmessagebyid').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileAddress: (profile_name) => {\r\n\r\n\t\t\tvar parameters = [[profile_name.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuseraddress').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileInfo: (profile_address) => {\r\n\r\n\t\t\tvar parameters = [[profile_address.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\r\n\t}\r\n\r\n\treturn self;\r\n}\r\n\r\nexport default ApiWrapper\r\n\r\n","import f from './functions';\r\n\r\nvar Media = function () {\r\n var self = this\r\n\r\n self.gettingmedia = false\r\n\r\n var permissions = {\r\n\r\n ios : {\r\n audio : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n window.audioinput.checkMicrophonePermission(function(hasPermission) {\r\n if (hasPermission) {\r\n \r\n resolve();\r\n } \r\n else {\t \r\n // Ask the user for permission to access the microphone\r\n window.audioinput.getMicrophonePermission(function(hasPermission, message) {\r\n if (hasPermission) {\r\n resolve()\r\n } else {\r\n reject('permissions')\r\n }\r\n });\r\n }\r\n });\r\n\r\n })\r\n \r\n },\r\n\r\n video : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n \r\n var needMic = true;\r\n var needCamera = true;\r\n\r\n cordova.plugins.iosrtc.requestPermission(needMic, needCamera, function (permissionApproved) {\r\n // permissionApproved will be true if user accepted permission otherwise will be false.\r\n if(permissionApproved) resolve()\r\n else reject('permissions')\r\n\r\n })\r\n\r\n })\r\n \r\n } \r\n },\r\n\r\n audio : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n var request = function(){\r\n permissions.requestPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n reject('permissions')\r\n\r\n });\r\n }\r\n\r\n permissions.checkPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else {\r\n request()\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n request()\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n },\r\n\r\n video : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n permissions.hasPermission(permissions.CAMERA, (status) => {\r\n\r\n if (status.hasPermission) {\r\n\r\n resolve()\r\n\r\n }\r\n else {\r\n\r\n permissions.requestPermission(permissions.CAMERA, () => {\r\n\r\n resolve()\r\n\r\n }, () => {\r\n\r\n reject('permissions')\r\n\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n }\r\n \r\n }\r\n\r\n var initPermissions = function(mediasettings){\r\n\r\n var callperm = function(f, setting){\r\n if (setting){\r\n return f()\r\n }\r\n else{\r\n return Promise.resolve()\r\n }\r\n }\r\n\r\n if(window.cordova && window.device){\r\n\r\n var ios = f.isios()\r\n\r\n return callperm(ios ? permissions.ios.audio : permissions.audio, mediasettings.audio).then(() => {\r\n return callperm(ios ? permissions.ios.video : permissions.video, mediasettings.video)\r\n }).catch(e => {\r\n console.error(\"E\", e)\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }\r\n\r\n var initMedia = function(mediasettings){\r\n\r\n return new Promise((resolve, reject)=> {\r\n\r\n\r\n initPermissions(mediasettings).then(() => {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n navigator.mediaDevices.getUserMedia(mediasettings).then(resolve).catch(reject);\r\n } else {\r\n (\r\n navigator.getUserMedia ||\r\n navigator.webkitGetUserMedia ||\r\n navigator.mozGetUserMedia ||\r\n navigator.msGetUserMedia\r\n )\r\n (mediasettings, resolve, reject);\r\n }\r\n\r\n }).catch(reject)\r\n\r\n })\r\n \r\n }\r\n \r\n self.get = function(mediasettings){\r\n\r\n return initMedia(mediasettings)\r\n\r\n }\r\n\r\n self.permissions = initPermissions\r\n\r\n}\r\n\r\n\r\nexport default Media","// Copied from https://github.com/chris-rudmin/Recorderjs\n\nexport default () => {\n let BYTES_PER_SAMPLE = 2\n\n let recorded = []\n\n function encode (buffer) {\n let length = buffer.length\n let data = new Uint8Array(length * BYTES_PER_SAMPLE)\n for (let i = 0; i < length; i++) {\n let index = i * BYTES_PER_SAMPLE\n let sample = buffer[i]\n if (sample > 1) {\n sample = 1\n } else if (sample < -1) {\n sample = -1\n }\n sample = sample * 32768\n data[index] = sample\n data[index + 1] = sample >> 8\n }\n recorded.push(data)\n }\n\n function dump (sampleRate) {\n let bufferLength = recorded.length ? recorded[0].length : 0\n let length = recorded.length * bufferLength\n let wav = new Uint8Array(44 + length)\n let view = new DataView(wav.buffer)\n\n // RIFF identifier 'RIFF'\n view.setUint32(0, 1380533830, false)\n // file length minus RIFF identifier length and file description length\n view.setUint32(4, 36 + length, true)\n // RIFF type 'WAVE'\n view.setUint32(8, 1463899717, false)\n // format chunk identifier 'fmt '\n view.setUint32(12, 1718449184, false)\n // format chunk length\n view.setUint32(16, 16, true)\n // sample format (raw)\n view.setUint16(20, 1, true)\n // channel count\n view.setUint16(22, 1, true)\n // sample rate\n view.setUint32(24, sampleRate, true)\n // byte rate (sample rate * block align)\n view.setUint32(28, sampleRate * BYTES_PER_SAMPLE, true)\n // block align (channel count * bytes per sample)\n view.setUint16(32, BYTES_PER_SAMPLE, true)\n // bits per sample\n view.setUint16(34, 8 * BYTES_PER_SAMPLE, true)\n // data chunk identifier 'data'\n view.setUint32(36, 1684108385, false)\n // data chunk length\n view.setUint32(40, length, true)\n\n // eslint-disable-next-line unicorn/no-for-loop\n for (let i = 0; i < recorded.length; i++) {\n wav.set(recorded[i], i * bufferLength + 44)\n }\n\n recorded = []\n postMessage(wav.buffer, [wav.buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else if (e.data[0] === 'dump') {\n dump(e.data[1])\n }\n }\n}\n","import waveEncoder from './wave-encoder/index.js'\n\nlet AudioContext = window.AudioContext || window.webkitAudioContext\n\nlet createWorker = fn => {\n let js = fn\n .toString()\n .replace(/^(\\(\\)\\s*=>|function\\s*\\(\\))\\s*{/, '')\n .replace(/}$/, '')\n let blob = new Blob([js])\n return new Worker(URL.createObjectURL(blob))\n}\n\nlet error = method => {\n let event = new Event('error')\n event.data = new Error('Wrong state for ' + method)\n return event\n}\n\nlet context\n\n/**\n * Audio Recorder with MediaRecorder API.\n *\n * @example\n * navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {\n * let recorder = new MediaRecorder(stream)\n * })\n */\nclass MediaRecorder {\n /**\n * @param {MediaStream} stream The audio stream to record.\n */\n constructor (stream, config = null) {\n /**\n * The `MediaStream` passed into the constructor.\n * @type {MediaStream}\n */\n this.stream = stream\n this.config = config\n /**\n * The current state of recording process.\n * @type {\"inactive\"|\"recording\"|\"paused\"}\n */\n this.state = 'inactive'\n\n this.em = document.createDocumentFragment()\n this.encoder = createWorker(MediaRecorder.encoder)\n\n let recorder = this\n this.encoder.addEventListener('message', e => {\n let event = new Event('dataavailable')\n event.data = new Blob([e.data], { type: recorder.mimeType })\n recorder.em.dispatchEvent(event)\n if (recorder.state === 'inactive') {\n recorder.em.dispatchEvent(new Event('stop'))\n }\n })\n }\n\n /**\n * Begins recording media.\n *\n * @param {number} [timeslice] The milliseconds to record into each `Blob`.\n * If this parameter isn’t included, single `Blob`\n * will be recorded.\n *\n * @return {undefined}\n *\n * @example\n * recordButton.addEventListener('click', () => {\n * recorder.start()\n * })\n */\n start (timeslice) {\n if (this.state !== 'inactive') {\n return this.em.dispatchEvent(error('start'))\n }\n\n this.state = 'recording'\n\n if (!context) {\n context = new AudioContext(this.config)\n }\n this.clone = this.stream.clone()\n this.input = context.createMediaStreamSource(this.clone)\n this.processor = context.createScriptProcessor(2048, 1, 1)\n\n this.encoder.postMessage(['init', context.sampleRate])\n\n this.processor.onaudioprocess = e => {\n if (this.state === 'recording') {\n this.encoder.postMessage(['encode', e.inputBuffer.getChannelData(0)])\n }\n }\n\n this.input.connect(this.processor)\n this.processor.connect(context.destination)\n\n this.em.dispatchEvent(new Event('start'))\n\n if (timeslice) {\n this.slicing = setInterval(() => {\n if (this.state === 'recording') this.requestData()\n }, timeslice)\n }\n\n return undefined\n }\n\n /**\n * Stop media capture and raise `dataavailable` event with recorded data.\n *\n * @return {undefined}\n *\n * @example\n * finishButton.addEventListener('click', () => {\n * recorder.stop()\n * })\n */\n stop () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('stop'))\n }\n\n this.requestData()\n this.state = 'inactive'\n this.clone.getTracks().forEach(track => {\n track.stop()\n })\n this.processor.disconnect()\n this.input.disconnect()\n return clearInterval(this.slicing)\n }\n\n /**\n * Pauses recording of media streams.\n *\n * @return {undefined}\n *\n * @example\n * pauseButton.addEventListener('click', () => {\n * recorder.pause()\n * })\n */\n pause () {\n if (this.state !== 'recording') {\n return this.em.dispatchEvent(error('pause'))\n }\n\n this.state = 'paused'\n return this.em.dispatchEvent(new Event('pause'))\n }\n\n /**\n * Resumes media recording when it has been previously paused.\n *\n * @return {undefined}\n *\n * @example\n * resumeButton.addEventListener('click', () => {\n * recorder.resume()\n * })\n */\n resume () {\n if (this.state !== 'paused') {\n return this.em.dispatchEvent(error('resume'))\n }\n\n this.state = 'recording'\n return this.em.dispatchEvent(new Event('resume'))\n }\n\n /**\n * Raise a `dataavailable` event containing the captured media.\n *\n * @return {undefined}\n *\n * @example\n * this.on('nextData', () => {\n * recorder.requestData()\n * })\n */\n requestData () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('requestData'))\n }\n\n return this.encoder.postMessage(['dump', context.sampleRate])\n }\n\n /**\n * Add listener for specified event type.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The listener function.\n *\n * @return {undefined}\n *\n * @example\n * recorder.addEventListener('dataavailable', e => {\n * audio.src = URL.createObjectURL(e.data)\n * })\n */\n addEventListener (...args) {\n this.em.addEventListener(...args)\n }\n\n /**\n * Remove event listener.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The same function used in `addEventListener`.\n *\n * @return {undefined}\n */\n removeEventListener (...args) {\n this.em.removeEventListener(...args)\n }\n\n /**\n * Calls each of the listeners registered for a given event.\n *\n * @param {Event} event The event object.\n *\n * @return {boolean} Is event was no canceled by any listener.\n */\n dispatchEvent (...args) {\n this.em.dispatchEvent(...args)\n }\n}\n\n/**\n * The MIME type that is being used for recording.\n * @type {string}\n */\nMediaRecorder.prototype.mimeType = 'audio/wav'\n\n/**\n * Returns `true` if the MIME type specified is one the polyfill can record.\n *\n * This polyfill supports `audio/wav` and `audio/mpeg`.\n *\n * @param {string} mimeType The mimeType to check.\n *\n * @return {boolean} `true` on `audio/wav` and `audio/mpeg` MIME type.\n */\nMediaRecorder.isTypeSupported = mimeType => {\n return MediaRecorder.prototype.mimeType === mimeType\n}\n\n/**\n * `true` if MediaRecorder can not be polyfilled in the current browser.\n * @type {boolean}\n *\n * @example\n * if (MediaRecorder.notSupported) {\n * showWarning('Audio recording is not supported in this browser')\n * }\n */\nMediaRecorder.notSupported = !navigator.mediaDevices || !AudioContext\n\n/**\n * Converts RAW audio buffer to compressed audio files.\n * It will be loaded to Web Worker.\n * By default, WAVE encoder will be used.\n * @type {function}\n *\n * @example\n * MediaRecorder.prototype.mimeType = 'audio/ogg'\n * MediaRecorder.encoder = oggEncoder\n */\nMediaRecorder.encoder = waveEncoder\n\nexport default MediaRecorder\n","\n\n\nexport default () => {\n importScripts(\n 'https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js'\n )\n\n let CHANNELS = 1\n let KBPS = 128\n let DEFAULT_SAMPLE_RATE = 44100\n\n let encoder\n let recorded = new Int8Array()\n\n function concat (a, b) {\n if (b.length === 0) {\n return a\n }\n let c = new Int8Array(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n\n function init (sampleRate) {\n encoder = new lamejs.Mp3Encoder(\n CHANNELS,\n sampleRate || DEFAULT_SAMPLE_RATE,\n KBPS\n )\n }\n\n function encode (buffer) {\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = buffer[i] * 32767.5\n }\n\n let buf = encoder.encodeBuffer(buffer)\n recorded = concat(recorded, buf)\n }\n\n function dump () {\n let buf = encoder.flush()\n recorded = concat(recorded, buf)\n let buffer = recorded.buffer\n recorded = new Int8Array()\n postMessage(buffer, [buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'init') {\n init(e.data[1])\n } else if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else {\n dump(e.data[1])\n }\n }\n}\n","\r\n\r\nimport MTRX from \"./mtrx.js\";\r\nimport Notifier from \"./notifier.js\";\r\nimport PNUser from \"./user/pnuser.js\";\r\nimport ApiWrapper from \"./api.js\";\r\nimport Pcrypto from \"./pcrypto.js\";\r\nimport listeners from './listeners'\r\nimport f from './functions'\r\nimport Media from './media'\r\n/*\r\nimport pcm from '@/application/utils/pcm.js'\r\nlet Mp3 = require('js-mp3');\r\n*/\r\n/*\r\nvar {register} = require('extendable-media-recorder')\r\nvar {connect} = require('extendable-media-recorder-wav-encoder')*/\r\n\r\n\r\nimport AudioRecorder from 'audio-recorder-polyfill'\r\nimport mpegEncoder from 'audio-recorder-polyfill/mpeg-encoder'\r\n\r\nAudioRecorder.encoder = mpegEncoder\r\nAudioRecorder.prototype.mimeType = 'audio/mpeg'\r\n\r\n\r\n\r\n\r\nclass Core {\r\n constructor(vm, p){\r\n if(!p) p = {}\r\n\r\n this.options = {\r\n listofproxies : p.listofproxies\r\n }\r\n\r\n if(!p.mtrx) p.mtrx = {}\r\n p.mtrx.baseUrl = 'https://' + p.domain\r\n\r\n if (p.mtrx.baseUrl == 'https://test.matrix.pocketnet.app'){\r\n \r\n this.options.burn = {\r\n v : 'minutes',\r\n w : 120,\r\n m : 30,\r\n b : 15\r\n }\r\n }\r\n else{\r\n this.options.burn = {\r\n v : 'days',\r\n w : 7,\r\n m : 2,\r\n b : 1\r\n }\r\n }\r\n\r\n \r\n\r\n this.apiHandlers = {\r\n error : function(){},\r\n success : function(){}\r\n }\r\n\r\n this.domain = p.domain\r\n\r\n this.vm = vm\r\n this.mtrx = new MTRX(this, p.mtrx)\r\n this.user = new PNUser(this, p.user || {})\r\n this.notifier = new Notifier(this, p.notifier || {})\r\n this.pcrypto = new Pcrypto(this, p.pcrypto || {})\r\n this.api = new ApiWrapper(this, p.servers)\r\n\r\n this.onlineListener = new listeners.online(this)\r\n this.focusListener = new listeners.focus(this)\r\n this.online = true\r\n this.focus = true\r\n this.store = vm.$store\r\n this.loading = true\r\n\r\n this.external = {}\r\n this.hiddenInParent = false\r\n\r\n this.customRecorderConnected = false\r\n\r\n this.pcrypto.init(this.user)\r\n\r\n this.media = new Media()\r\n this.audioContext = null\r\n\r\n }\r\n\r\n hideOptimization = function(v){\r\n\r\n //this.hideOptimization = v\r\n this.store.commit('hideOptimization', v)\r\n\r\n }\r\n\r\n hideInParent = function(v){\r\n this.hiddenInParent = v\r\n this.store.commit('hiddenInParent', v)\r\n\r\n\r\n /*if(!v)\r\n this.store.commit('wasunhidden', true)*/\r\n }\r\n\r\n canback = function(){\r\n return this.store.state.gallery ? false : true\r\n }\r\n\r\n update = function({block}){\r\n\r\n this.pcrypto.set.block(block)\r\n }\r\n\r\n logerror = function(type, data){\r\n\r\n\r\n if (window.POCKETNETINSTANCE){\r\n\r\n window.POCKETNETINSTANCE.Logger.error({\r\n err: type,\r\n payload: data,\r\n code: 402,\r\n });\r\n\r\n }\r\n }\r\n\r\n destroy = function(){\r\n this.store.commit('clearall')\r\n this.removeEvents()\r\n\r\n if(!this.vm.$route.name != 'chats')\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n this.user.destroy()\r\n this.mtrx.destroy()\r\n this.pcrypto.destroy()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.unlink(this)\r\n }\r\n\r\n this.vm.$destroy();\r\n\r\n }\r\n\r\n init = function(){\r\n \r\n this.focusListener.init()\r\n this.onlineListener.init()\r\n\r\n this.initEvents()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.link(this)\r\n }\r\n }\r\n \r\n\r\n setUnauthorized = function(v){\r\n this.unauthorized = v\r\n this.store.commit('SET_UNAUTHORIZED', v)\r\n }\r\n\r\n initWithUserBase = function(){\r\n\r\n this.loading = true\r\n\r\n return this.user.checkCredentials().then(state => {\r\n\r\n return this.user.userInfo()\r\n\r\n }).then(r => {\r\n\r\n if(!r){\r\n return Promise.reject('unknown')\r\n }\r\n\r\n if(r.deleted){\r\n return Promise.reject('deleted')\r\n }\r\n\r\n return this.pcrypto.prepare()\r\n\r\n }).then(r => {\r\n\r\n return this.mtrx.init()\r\n\r\n }).then(r => {\r\n\r\n this.loading = false\r\n this.setUnauthorized(null)\r\n\r\n this.pcrypto.helpers.checkuser()\r\n\r\n if (f.deep(this.user,'userinfo.name'))\r\n this.mtrx.client.setDisplayName(f.deep(this.user,'userinfo.name'))\r\n\r\n return Promise.resolve()\r\n\r\n }).catch(e => {\r\n\r\n console.log(\"E\", e)\r\n \r\n this.loading = false\r\n\r\n if(e == 'unauthorized' || e == 'unknown' || e == 'deleted'){\r\n this.setUnauthorized(e)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n initWithUser = function(credentials){\r\n\r\n\r\n this.user.setCredentials(credentials)\r\n\r\n return this.initWithUserBase().then(() => {\r\n return this.user.initKeysProcess()\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n }\r\n\r\n waitonline = function(){\r\n\r\n if(this.online) return Promise.resolve()\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n f.retry(() => {\r\n return this.online;\r\n }, function () {\r\n\r\n resolve()\r\n\r\n }, 5)\r\n\r\n })\r\n\r\n\r\n }\r\n\r\n removeEvents = function(){\r\n delete this.focusListener.clbks.resume.core\r\n delete this.focusListener.clbks.pause.core\r\n delete this.onlineListener.clbks.online.core\r\n delete this.onlineListener.clbks.offline.core\r\n }\r\n\r\n initEvents = function(){\r\n this.focusListener.clbks.resume.core = (time) => {\r\n\r\n this.focus = this.focusListener.focus\r\n\r\n if(time > 60){\r\n }\r\n }\r\n\r\n this.focusListener.clbks.pause.core = () => {\r\n this.focus = this.focusListener.focus\r\n }\r\n\r\n this.onlineListener.clbks.online.core = (time) => {\r\n this.online = this.onlineListener.online\r\n }\r\n\r\n this.onlineListener.clbks.offline.core = () => {\r\n this.online = this.onlineListener.online\r\n }\r\n }\r\n\r\n externalLink = function(pobj){\r\n this.external = pobj\r\n\r\n }\r\n\r\n destroyExternalLink = function(){\r\n this.external = {}\r\n }\r\n\r\n currentTime = function () {\r\n var created = Math.floor((new Date().getTime()) / 1000)\r\n\r\n if (this.timeDifference) {\r\n created += this.timeDifference\r\n }\r\n\r\n return created;\r\n }\r\n\r\n wait = function(){\r\n return f.pretry(() => {\r\n\t\t\treturn !this.loading\r\n\t\t}).then(() => {\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t})\r\n }\r\n\r\n joinRoom(roomid){\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('JOINROOM', roomid)\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }).then(info => {\r\n\r\n if (this.store.state.chatsMap[roomid]){\r\n /// old chat\r\n this.vm.$router.push('/chat?id=' + roomid).catch(e => {})\r\n }\r\n else\r\n {\r\n this.store.commit('JOINROOM', roomid)\r\n this.vm.$router.push('/publicPreview?id=' + roomid).catch(e => {})\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n connect(address){\r\n\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('CONNECT', f.hexEncode(address))\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n else{\r\n return this.user.usersInfo([address], true)\r\n }\r\n\r\n }).then(info => {\r\n\r\n var roomId = this.mtrx.kit.tetatetid(info[0], this.user.userinfo)\r\n\r\n\r\n if(!roomId) return Promise.reject('roomId')\r\n\r\n if (this.store.state.chatsMap[roomId]){\r\n /// old chat\r\n\r\n this.gotoRoute('/chat?id=' + roomId)\r\n /*this.vm.$router.push('/chat?id=' + roomId).catch(e => {\r\n console.error('e', e)\r\n })*/\r\n }\r\n else\r\n {\r\n\r\n this.gotoRoute('/contact?id=' + f.hexEncode(address))\r\n //this.store.commit('CONTACT', roomId)\r\n //this.gotoRoute('/chat?id=' + roomId + '&u=' + f.hexEncode(address))\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n cancelshare(){\r\n this.store.commit('SHARE', null)\r\n\r\n return Promise.resolve()\r\n }\r\n\r\n share(share){\r\n\t\tthis.store.commit('SHARE', share)\r\n\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n return Promise.resolve()\r\n\t}\r\n\r\n goto(roomId){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push('/chat?id=' + roomId).catch(e => {});\r\n });\r\n }\r\n\r\n gotoRoute(route){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push(route).catch(e => {});\r\n });\r\n }\r\n\r\n updateUser(){\r\n \r\n return this.user.userInfo(true).then(r => {\r\n\r\n /*if (this.unauthorized){\r\n return this.initWithUserBase()\r\n }*/\r\n \r\n })\r\n }\r\n\r\n isactive(){\r\n return this.vm.$store.state.minimized && this.vm.$store.state.active && this.vm.$store.state.pocketnet\r\n } \r\n\r\n sitemessage(title){\r\n\r\n var position = \"bottom-right\";\r\n\r\n if (this.vm.$store.state.mobile){\r\n position = 'top-left'\r\n }\r\n \r\n this.vm.$message({\r\n title: title,\r\n zIndex: 999,\r\n supportHTML: true,\r\n wrapperClassName: \"notificationWrapper\",\r\n position: position,\r\n type: 'info',\r\n duration : 2000\r\n })\r\n }\r\n\r\n menu(v){\r\n\r\n this.store.commit('SET_MENU', v ? {\r\n\t\t\titems : v.items,\r\n\t\t\titem : v.item,\r\n handler : v.handler\r\n\t\t} : null)\r\n }\r\n\r\n invitepnt(){\r\n\r\n var ui = f.deep(this, 'user.userinfo.source')\r\n\r\n if(ui){\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.platform){\r\n \r\n if(this.backtoapp) this.backtoapp()\r\n\r\n window.POCKETNETINSTANCE.platform.ui.socialshare('welcome?connect=' + ui.address, {\r\n sharing : {\r\n image : '',\r\n images : [ui.i],\r\n title : this.vm.$i18n.t(\"caption.joinApp\"),\r\n html : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n },\r\n \r\n text : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n }\r\n \r\n },\r\n embedding : {\r\n type : 'connect',\r\n id : ui.address\r\n }\r\n })\r\n\r\n }\r\n else{\r\n var l = 'https://bastyon.com/welcome?connect=' + ui.address\r\n\r\n f.copytext(l)\r\n\r\n this.sitemessage('The link was copied successfully')\r\n }\r\n\r\n }\r\n\r\n else{\r\n this.sitemessage('The error was occuried')\r\n }\r\n\r\n \r\n }\r\n\r\n async convertAudioToBase64(blob) {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(blob)\r\n return new Promise(resolve => {\r\n reader.onloadend = () => {\r\n resolve(reader.result)\r\n }\r\n })\r\n }\r\n\r\n /*async connectCustomRecorder() {\r\n\r\n if (this.customRecorderConnected) return\r\n this.customRecorderConnected = true\r\n \r\n await register(await connect());\r\n \r\n }*/\r\n\r\n /*mp3ToWav(base64Audio){\r\n\r\n var mp3ArrayBuffer = f._base64ToArrayBuffer(base64Audio.split(',')[1])\r\n\r\n var decoder = Mp3.newDecoder(mp3ArrayBuffer);\r\n var pcmArrayBuffer = decoder.decode();\r\n\r\n var dataURI = new pcm({channels: 1, rate: 8000, depth: 8}).toWav(pcmArrayBuffer).encode();\r\n\r\n return dataURI\r\n\r\n }*/\r\n\r\n initMediaRecorder() {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n\r\n\r\n return this.media.get({ audio: true }).then(stream => {\r\n\r\n let mediaRecorder = new AudioRecorder(stream, { audioBitsPerSecond : 32000 })\r\n \r\n return mediaRecorder\r\n \r\n }).catch(function (err) {\r\n return Promise.reject(err)\r\n });\r\n\r\n } else {\r\n return Promise.reject()\r\n }\r\n }\r\n\r\n getAudioContext(){\r\n\r\n if(this.audioContext && this.audioContext.state != 'closed') {\r\n\r\n\r\n if(this.audioContext.state === \"suspended\") this.audioContext.resume()\r\n\r\n\r\n\r\n return this.audioContext\r\n }\r\n else{\r\n }\r\n\r\n this.audioContext = new (window.AudioContext || window.webkitAudioContext)() || null;\r\n\r\n if(f.isios() && window.unmute){\r\n unmute(this.audioContext, false, false);\r\n }\r\n\r\n return this.audioContext\r\n }\r\n}\r\n\r\nexport default Core\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"preloader\",\"platform\":_vm.platform}},[_vm._m(0)])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"variant \"},[_c('div',{staticClass:\"iospreloadercenter\"},[_c('div',{staticClass:\"spinner-eff spinner-eff-3\"},[_c('div',{staticClass:\"circle circle-1\"}),_c('div',{staticClass:\"circle circle-2\"}),_c('div',{staticClass:\"circle circle-3\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\nimport f from '@/application/functions'\r\nexport default {\r\n name: 'preloader',\r\n props: {\r\n },\r\n\r\n computed : mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active : state => state.active,\r\n platform : function(){\r\n return f.deep(window, 'device.platform') || 'browser'\r\n },\r\n })\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3e6353d6&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index_ex.sass?vue&type=style&index=0&id=3e6353d6&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3e6353d6\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"wai-fixedmessageicon\"}},[_c('div',{staticClass:\"wrapper\"},[_c('div',{staticClass:\"table\"},[_c('div',{staticClass:\"cell\"},[(_vm.icon)?_c('div',{staticClass:\"iconWrapper\"},[_c('sweetalert',{attrs:{\"icon\":_vm.icon}})],1):_vm._e(),(_vm.message)?_c('div',{staticClass:\"message\"},[_c('div',[_vm._v(_vm._s(_vm.message))])]):_vm._e()])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa\",style:(_vm.cssVars)},[(_vm.isIcon('error'))?_c('div',{staticClass:\"sa-error\"},[_vm._m(0),_c('div',{staticClass:\"sa-error-placeholder\"}),_c('div',{staticClass:\"sa-error-fix\"})]):(_vm.isIcon('warning'))?_c('div',{staticClass:\"sa-warning\"},[_c('div',{staticClass:\"sa-warning-body\"}),_c('div',{staticClass:\"sa-warning-dot\"})]):(_vm.isIcon('info'))?_c('div',{staticClass:\"sa-info\"},[_c('div',{staticClass:\"sa-info-body\"}),_c('div',{staticClass:\"sa-info-dot\"})]):(_vm.isIcon('loading'))?_c('div',{staticClass:\"sa-loading\"},[_c('div',{staticClass:\"sa-loading-body\"})]):_c('div',{staticClass:\"sa-success\"},[_c('div',{staticClass:\"sa-success-tip\"}),_c('div',{staticClass:\"sa-success-long\"}),_c('div',{staticClass:\"sa-success-placeholder\"}),_c('div',{staticClass:\"sa-success-fix\"})])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa-error-x\"},[_c('div',{staticClass:\"sa-error-left\"}),_c('div',{staticClass:\"sa-error-right\"})])}]\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=0635047f&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=0635047f&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0635047f\",\n null\n ,true\n)\n\nexport default component.exports","import { mapState } from 'vuex';\r\nimport sweetalert from '@/editedplugins/vue-sweetalert-icons/src/components/icon.vue'\r\nexport default {\r\n name: 'fixedmessageicon',\r\n props: {\r\n \r\n },\r\n\r\n components : {\r\n sweetalert\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n icon : {\r\n immediate: true,\r\n handler(){\r\n this.init()\r\n }\r\n }\r\n },\r\n\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n icon : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.icon : null\r\n },\r\n\r\n message : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.message : null\r\n },\r\n\r\n \r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n init : function(){\r\n var t = this\r\n\r\n const timeout = this.$store.state.icon?.timeout;\r\n\r\n if(this.$store.state.icon.manual) return\r\n\r\n setTimeout(function(){\r\n\r\n t.$store.commit('icon', null)\r\n\r\n }, timeout || 2000)\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1cf419f0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1cf419f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1cf419f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{attrs:{\"id\":\"wai-date\"}},[_vm._v(_vm._s(_vm.label))])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'date',\r\n props: ['date'],\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n label : function(){\r\n\r\n moment.locale(this.$i18n.locale)\r\n\r\n return moment(moment.utc(this.date).toDate()).local().fromNow();\r\n\r\n }\r\n }),\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=eb4df516&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=eb4df516&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"eb4df516\",\n null\n ,true\n)\n\nexport default component.exports","var render = function (_h,_vm) {var _c=_vm._c;return _c('div',{staticClass:\"userpic\"},[_c('div',{staticClass:\"userpicSquareWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\",class:_vm.props.status},[(_vm.props.userinfo.image)?_c('bgimage',{attrs:{\"src\":_vm.props.userinfo.image}}):_vm._e(),(!_vm.props.userinfo.image && _vm.props.userinfo.name && (_vm.props.status != 'blocked' && _vm.props.status != 'invite' && _vm.props.status != 'ban'))?_c('div',{staticClass:\"charAvatar\"},[_c('span',[_vm._v(_vm._s(_vm.props.userinfo.name.charAt(0)))])]):_vm._e(),_c('div',{staticClass:\"statusIcon\"},[(_vm.props.status == 'blocked' || _vm.props.status == 'ban')?_c('i',{staticClass:\"fas fa-ban\"}):_vm._e(),(_vm.props.status == 'invite')?_c('i',{staticClass:\"fas fa-user-plus\"}):_vm._e()])],1)])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nexport default {\r\n name: 'userpic',\r\n props: {\r\n userinfo: {\r\n type : Object,\r\n default : {}\r\n },\r\n status : ''\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=5034d1e2&scoped=true&functional=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=5034d1e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n true,\n injectStyles,\n \"5034d1e2\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.users)?_c('div',{staticClass:\"userspic\",class:{oneuser : _vm.users && _vm.users.length === 1}},[(_vm.users.length === 0)?_c('userpic',{attrs:{\"userinfo\":_vm.single,\"status\":_vm.single.status}}):_vm._e(),(_vm.users.length === 1)?_c('userpic',{attrs:{\"status\":_vm.status[_vm.users[0].id],\"userinfo\":_vm.users[0],\"unseen\":_vm.unseen}}):_vm._e(),(_vm.users.length > 1)?_c('many',{attrs:{\"slidesPerView\":_vm.slidesPerView,\"status\":_vm.status,\"userinfo\":_vm.users,\"unseen\":_vm.unseen}}):_vm._e(),(_vm.unseen)?_c('div',{staticClass:\"unseen\"},[_vm._v(\" \"+_vm._s(_vm.unseen > 99 ? '99' : _vm.unseen)+\" \")]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import many from '@/components/assets/userspic/many.vue'\r\n\r\nexport default {\r\n name: 'userspic',\r\n props: {\r\n users: Array,\r\n single: {},\r\n unseen: Number,\r\n slidesPerView: Number,\r\n status : {\r\n type : Object,\r\n default : {}\r\n }\r\n \r\n },\r\n\r\n data : function(){\r\n return {}\r\n },\r\n components: {\r\n many\r\n },\r\n\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=792279b0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=792279b0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"792279b0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"bgimage\",class:{loaded: _vm.loaded, hasimage : _vm.src},style:('background-image:url('+_vm.imageSrc+'); background-size: cover; background-position: center center; background-repeat: no-repeat')},[_vm._t(\"cnt\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./bgimage.vue?vue&type=template&id=5d20f73c&scoped=true&\"\nimport script from \"./bgimage.vue?vue&type=script&lang=js&\"\nexport * from \"./bgimage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"5d20f73c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"wai-logotype\"}},[_c('div',{staticClass:\"items\"},[_c('div',{staticClass:\"item\"},[_c('div',{staticClass:\"logo\"},[_c('img',{attrs:{\"src\":'img/ldpiwide-' + _vm.themeL + '.png'}})])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nvar bwl = {\r\n black : 'black',\r\n white : 'white',\r\n classic : 'white'\r\n\r\n}\r\n\r\nexport default {\r\n name: 'wai-logotype',\r\n props: {\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n themeL : function(state){\r\n return bwl[state.theme] || 'white'\r\n }\r\n }),\r\n\r\n methods : {\r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e33cd7cc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e33cd7cc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e33cd7cc\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"outer-div\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},on:{\"click\":function($event){$event.stopPropagation();}}},[(_vm.menuIsVisible && !_vm.hiddenInParent)?_c('div',{staticClass:\"dropdown\",class:{visible: _vm.menuIsVisible}},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.hidePopup),expression:\"hidePopup\"}],staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menuItems},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e(),_c('div',{staticClass:\"dropDownIcon\",on:{\"click\":_vm.onClickHandler}},[_c('i',{class:'icon ' + (_vm.icon || 'fas fa-ellipsis-h')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'dropdownMenu',\r\n props: {\r\n menuItems: {\r\n type: Array,\r\n required: true\r\n },\r\n\r\n rowObject: {\r\n type: Object,\r\n },\r\n\r\n icon : String\r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false,\r\n menuIsVisible: false,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n menuIsVisible: function(newValue) {\r\n this.$emit('menuIsVisible', newValue);\r\n }\r\n },\r\n\r\n computed: {\r\n\r\n dropdownWidthInner(){\r\n return this.dropdownWidth;\r\n },\r\n \r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n this.$emit('itemClicked', item, this.rowObject, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n });\r\n },\r\n onClickHandler() {\r\n this.menuIsVisible = !this.menuIsVisible;\r\n\r\n\r\n },\r\n hidePopup() {\r\n this.menuIsVisible = false;\r\n\r\n },\r\n showPopup() {\r\n \r\n this.menuIsVisible = true;\r\n\r\n\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e4f39dca&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e4f39dca&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e4f39dca\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"back\",on:{\"click\":_vm.click}},[_c('div',{staticClass:\"iconbutton\"},[_c('i',{class:(_vm.icon || 'fas fa-angle-left')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7e97eec1&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7e97eec1&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7e97eec1\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active, unauthorized: _vm.unauthorized, modalShowed : _vm.modalShowed ? true : false, mobile: _vm.mobile},attrs:{\"id\":\"maincontent\"},on:{\"mouseenter\":_vm.mouseenter,\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"headerSpacerWrapper\"},[_c('div',{staticClass:\"headerSpacerWrapperOvf\"},[_c('div',{ref:\"scrollable\",staticClass:\"headerSpacer\"},[_vm._t(\"content\",function(){return [_vm._v(\"   \")]})],2)]),_c('pmenu'),(_vm.modalShowed && _vm.modalShowed.data && !_vm.hiddenInParent)?_c('modal',{on:{\"close\":_vm.closeModal},scopedSlots:_vm._u([{key:\"header\",fn:function(){return [_vm._v(_vm._s(_vm.modalShowed.caption))]},proxy:true},{key:\"body\",fn:function(){return [_c('div',{staticClass:\"modalcommoncontent\"},[(_vm.modalShowed.type == 'complain')?_c('complain',{attrs:{\"p\":_vm.modalShowed.data}}):_vm._e(),(_vm.modalShowed.type == 'contact')?_c('contact',{attrs:{\"contact\":_vm.modalShowed.data.contact}}):_vm._e(),(_vm.modalShowed.type == 'showuserselect')?_c('contacts',{attrs:{\"users\":_vm.modalShowed.data.users,\"mode\":\"Select\"},on:{\"close\":_vm.closeModal,\"select\":function (contact) {_vm.modalShowed.data.userselected(contact); _vm.closeModal()}}}):_vm._e()],1)]},proxy:true},{key:\"footer\",fn:function(){return undefined},proxy:true}],null,false,3972288297)}):_vm._e(),(!_vm.unauthorized && _vm.rbackexp)?_c('div',{staticClass:\"expandp\",on:{\"click\":_vm.setactive,\"mousemove\":_vm.effect}},[_vm._m(0)]):_vm._e()],1),(_vm.iconshow)?_c('transition',{attrs:{\"name\":\"fade\"}},[_c('fixedmessageicon')],1):_vm._e()],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"etablew\"},[_c('div',{staticClass:\"etable table\"},[_c('div',[_c('i',{staticClass:\"fas fa-expand-arrows-alt\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'maincontent',\r\n props: {\r\n rbackexp : Boolean\r\n },\r\n\r\n components : {\r\n\r\n 'contact': () => import('@/components/contact/index.vue'),\r\n 'contacts': () => import('@/components/contacts/list/index.vue'),\r\n 'complain': () => import('@/components/complain/index.vue')\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n iconshow: function() {\r\n\t\t\treturn this.$store.state.icon ? true : false\r\n\t\t},\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n modalShowed : state => state.modalShowed,\r\n hiddenInParent : state => state.hiddenInParent,\r\n mobile : state => state.mobile,\r\n unauthorized : state => state.unauthorized\r\n }),\r\n\r\n methods : {\r\n setactive : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})\r\n this.$store.commit('setiteraction', true)\r\n },\r\n mouseenter : function(){\r\n /*this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})*/\r\n },\r\n\r\n mouseleave : function(){\r\n\r\n if (this.$store.state.autohide){\r\n this.$store.commit('active', false)\r\n }\r\n this.$store.commit('blockactive', {value : false, item : 'main'})\r\n },\r\n\r\n effect : function(e){\r\n /*const x = e.pageX - e.target.offsetLeft\r\n const y = e.pageY - e.target.offsetTop\r\n\r\n e.target.style.setProperty('--x', `${ x }px`)\r\n e.target.style.setProperty('--y', `${ y }px`)*/\r\n },\r\n\r\n closeModal : function(){\r\n this.$store.commit('setmodal', null)\r\n },\r\n\r\n scroll : function(v){\r\n this.$refs['scrollable'].scrollTop = v || 0\r\n },\r\n \r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a8a70f9c&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=a8a70f9c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a8a70f9c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"search\"}},[_c('div',{staticClass:\"searchWrapper\"},[_c('div',{staticClass:\"inputWrapper\"},[_c('input',{ref:\"input\",attrs:{\"placeholder\":_vm.placeholder || this.$i18n.t('caption.search'),\"type\":\"text\"},domProps:{\"value\":_vm.searchTxt},on:{\"keyup\":_vm.change,\"input\":_vm.change,\"focus\":_vm.focused,\"blur\":_vm.blured}})]),(!_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\"},[_c('i',{staticClass:\"fas fa-search\"})]):_vm._e(),(_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-times\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import {mapState} from 'vuex';\r\n// TODO IGOR' SEARCH ALL COMPONENTS\r\nexport default {\r\n name: 'search',\r\n props: {\r\n placeholder: String,\r\n minimize: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n isTyping: false,\r\n searchTxt: ''\r\n }\r\n\r\n },\r\n\r\n created: () => {\r\n\r\n },\r\n\r\n watch: {\r\n searchTxt : {\r\n handler : _.debounce(function() {\r\n\r\n var text = this.searchTxt.toLowerCase()\r\n this.$emit('search', text)\r\n \r\n }, 500)\r\n }\r\n },\r\n computed: mapState({\r\n auth: state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active: function (state) {\r\n return state.active || !this.minimize\r\n },\r\n }),\r\n\r\n methods: {\r\n change : function(event){\r\n this.searchTxt = event.target.value\r\n },\r\n\r\n clear : function(event){\r\n this.searchTxt = ''\r\n }, \r\n \r\n clickicon: function () {\r\n this.$refs['input'].focus()\r\n },\r\n\r\n blured: function () {\r\n this.$store.commit('blockactive', {value: false, item: 'input'})\r\n },\r\n\r\n focused: function () {\r\n this.$store.commit('blockactive', {value: true, item: 'input'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1774f2a8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1774f2a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1774f2a8\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"linepreloader\"}},[_c('span'),_c('span'),_c('span')])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'linepreloader',\r\n props: {\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=bcf20e38&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=bcf20e38&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"bcf20e38\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=01d24e5e&shadow\"\nimport script from \"./App.vue?vue&type=script&lang=js&shadow\"\nexport * from \"./App.vue?vue&type=script&lang=js&shadow\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./editedplugins/vue-m-message/dist/index.css?vue&type=style&index=0&lang=css&shadow\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&lang=sass&shadow\")\nif (style1.__inject__) style1.__inject__(context)\nvar style2 = require(\"./App.vue?vue&type=style&index=2&lang=css&shadow\")\nif (style2.__inject__) style2.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","import './setPublicPath'\nimport Vue from 'vue'\nimport wrap from '@vue/web-component-wrapper'\n\n// runtime shared by every component chunk\nimport 'css-loader/dist/runtime/api.js'\nimport 'vue-style-loader/lib/addStylesShadow'\nimport 'vue-loader/lib/runtime/componentNormalizer'\n\nimport matrixElement from '~root/src/App.vue?shadow'\nwindow.customElements.define('matrix-element', wrap(Vue, matrixElement))","var MD5 = require('md5.js')\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n","module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var a=r[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var a in e)n.d(t,a,function(r){return e[r]}.bind(null,a));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,\"a\",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p=\"\",n(n.s=0)}([function(e,r,n){\"use strict\";n.r(r),n.d(r,\"validateHTMLColorName\",(function(){return l})),n.d(r,\"validateHTMLColorSpecialName\",(function(){return i})),n.d(r,\"validateHTMLColorHex\",(function(){return u})),n.d(r,\"validateHTMLColorRgb\",(function(){return d})),n.d(r,\"validateHTMLColorHsl\",(function(){return f})),n.d(r,\"validateHTMLColorHwb\",(function(){return h})),n.d(r,\"validateHTMLColorLab\",(function(){return g})),n.d(r,\"validateHTMLColor\",(function(){return m}));const t=e=>e&&\"string\"==typeof e,a=[\"AliceBlue\",\"AntiqueWhite\",\"Aqua\",\"Aquamarine\",\"Azure\",\"Beige\",\"Bisque\",\"Black\",\"BlanchedAlmond\",\"Blue\",\"BlueViolet\",\"Brown\",\"BurlyWood\",\"CadetBlue\",\"Chartreuse\",\"Chocolate\",\"Coral\",\"CornflowerBlue\",\"Cornsilk\",\"Crimson\",\"Cyan\",\"DarkBlue\",\"DarkCyan\",\"DarkGoldenrod\",\"DarkGray\",\"DarkGreen\",\"DarkKhaki\",\"DarkMagenta\",\"DarkOliveGreen\",\"DarkOrange\",\"DarkOrchid\",\"DarkRed\",\"DarkSalmon\",\"DarkSeaGreen\",\"DarkSlateBlue\",\"DarkSlateGray\",\"DarkTurquoise\",\"DarkViolet\",\"DeepPink\",\"DeepSkyBlue\",\"DimGray\",\"DodgerBlue\",\"FireBrick\",\"FloralWhite\",\"ForestGreen\",\"Fuchsia\",\"Gainsboro\",\"GhostWhite\",\"Gold\",\"Goldenrod\",\"Gray\",\"Green\",\"GreenYellow\",\"HoneyDew\",\"HotPink\",\"IndianRed\",\"Indigo\",\"Ivory\",\"Khaki\",\"Lavender\",\"LavenderBlush\",\"LawnGreen\",\"LemonChiffon\",\"LightBlue\",\"LightCoral\",\"LightCyan\",\"LightGoldenrodYellow\",\"LightGray\",\"LightGreen\",\"LightPink\",\"LightSalmon\",\"LightSalmon\",\"LightSeaGreen\",\"LightSkyBlue\",\"LightSlateGray\",\"LightSteelBlue\",\"LightYellow\",\"Lime\",\"LimeGreen\",\"Linen\",\"Magenta\",\"Maroon\",\"MediumAquamarine\",\"MediumBlue\",\"MediumOrchid\",\"MediumPurple\",\"MediumSeaGreen\",\"MediumSlateBlue\",\"MediumSlateBlue\",\"MediumSpringGreen\",\"MediumTurquoise\",\"MediumVioletRed\",\"MidnightBlue\",\"MintCream\",\"MistyRose\",\"Moccasin\",\"NavajoWhite\",\"Navy\",\"OldLace\",\"Olive\",\"OliveDrab\",\"Orange\",\"OrangeRed\",\"Orchid\",\"PaleGoldenrod\",\"PaleGreen\",\"PaleTurquoise\",\"PaleVioletRed\",\"PapayaWhip\",\"PeachPuff\",\"Peru\",\"Pink\",\"Plum\",\"PowderBlue\",\"Purple\",\"RebeccaPurple\",\"Red\",\"RosyBrown\",\"RoyalBlue\",\"SaddleBrown\",\"Salmon\",\"SandyBrown\",\"SeaGreen\",\"SeaShell\",\"Sienna\",\"Silver\",\"SkyBlue\",\"SlateBlue\",\"SlateGray\",\"Snow\",\"SpringGreen\",\"SteelBlue\",\"Tan\",\"Teal\",\"Thistle\",\"Tomato\",\"Turquoise\",\"Violet\",\"Wheat\",\"White\",\"WhiteSmoke\",\"Yellow\",\"YellowGreen\"],o=[\"currentColor\",\"inherit\",\"transparent\"],l=e=>{let r=!1;return t(e)&&a.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},i=e=>{let r=!1;return t(e)&&o.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},u=e=>{if(t(e)){const r=/^#([\\da-f]{3}){1,2}$|^#([\\da-f]{4}){1,2}$/i;return e&&r.test(e)}},d=e=>{if(t(e)){const r=/(rgb)a?\\((\\s*\\d+%?\\s*?,?\\s*){2}(\\s*\\d+%?\\s*?,?\\s*\\)?)(\\s*,?\\s*\\/?\\s*(0?\\.?\\d+%?\\s*)?|1|0)?\\)$/i;return e&&r.test(e)}},s=\"(([0-9]|[1-9][0-9]|100)%)\",c=`\\\\s*?\\\\)?)(\\\\s*?(\\\\/?)\\\\s+${`(((${s}))|(0?(\\\\.\\\\d+)?)|1))?`}\\\\s*?\\\\)$`,f=e=>{if(t(e)){const r=new RegExp(`(hsl)a?\\\\((\\\\s*?(${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}|${\"(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)gra)\"}|${\"((([0-5])?\\\\.\\\\d+|6\\\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)\"}|${\"((0?(\\\\.\\\\d+)?|1)turn)\"})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})\\\\s*?\\\\)?)(\\\\s*?(\\\\/?|,?)\\\\s*?(((${s}))|(0?(\\\\.\\\\d+)?)|1))?\\\\)$`);return e&&r.test(e)}},h=e=>{if(t(e)){const r=new RegExp(`(hwb\\\\(\\\\s*?${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}\\\\s+)((0|${s})\\\\s+)((0|${s})${c}`);return e&&r.test(e)}},g=e=>{if(t(e)){const r=\"(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])(\\\\.\\\\d+)??|160))\",n=new RegExp(`(lab\\\\(\\\\s*?((\\\\d*(\\\\.\\\\d+)?)%)\\\\s+${r}\\\\s+${r}${c}`);return e&&n.test(e)}},m=e=>!!(e&&u(e)||d(e)||f(e)||h(e)||g(e));r.default=e=>!!(e&&u(e)||l(e)||i(e)||d(e)||f(e)||h(e)||g(e))}]);","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#teamroom.mobile[data-v-9b340a7a]{margin-bottom:10px}#teamroom[data-v-9b340a7a]:hover{cursor:pointer}#teamroom .teamChatWrapper[data-v-9b340a7a]{padding:.5em .25em;display:flex;align-items:center;transition:.3s}#teamroom .teamChatWrapper .iconWrapper[data-v-9b340a7a]{width:44px;display:flex;align-items:center;min-width:44px;height:44px;position:relative}#teamroom .teamChatWrapper .iconWrapper .logo[data-v-9b340a7a]{background-size:cover;background-position:50%;background-repeat:no-repeat;height:44px;width:44px;margin-left:0;margin-top:0;position:absolute;background:rgb(var(--text-on-bg-ac-color));border-radius:50%;padding-top:8px;text-align:center}#teamroom .teamChatWrapper .iconWrapper .logo img[data-v-9b340a7a]{width:28px;height:28px;margin:0 auto}#teamroom .teamChatWrapper .iconWrapper .unseen[data-v-9b340a7a]{background:rgba(var(--color-bg-ac),.9);color:rgb(var(--text-on-bg-ac-color));position:absolute;width:22px;height:22px;right:-10%;top:-10%;line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em}#teamroom .teamChatWrapper .infoWrapper[data-v-9b340a7a]{padding-left:.5em}#teamroom .teamChatWrapper .infoWrapper>div[data-v-9b340a7a]{display:flex;align-content:center}#teamroom .teamChatWrapper .infoWrapper .infoName span[data-v-9b340a7a]{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;display:inline-block;max-width:190px;color:rgb(var(--text-color))}#teamroom .teamChatWrapper .infoWrapper .previewMessage[data-v-9b340a7a]{display:flex;justify-content:flex-start;align-items:center;width:100%}#teamroom .teamChatWrapper .infoWrapper .previewMessage span[data-v-9b340a7a]{display:block;color:rgb(var(--color-txt-gray));font-size:.9em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:210px}#teamroom.minimized:not(.active) .teamChatWrapper[data-v-9b340a7a]{padding:.5em 0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n'use strict';\n\nvar eos;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\n\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\n\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true; // request.destroy just do .end - .abort is what we want\n\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\n\nfunction call(fn) {\n fn();\n}\n\nfunction pipe(from, to) {\n return from.pipe(to);\n}\n\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\n\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\n\nmodule.exports = pipeline;","// style-loader: Adds some css to the DOM by adding a \n","import mod from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ClipLoader.vue?vue&type=template&id=7edc50d8&\"\nimport script from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nexport * from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ClipLoader.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3d50eb11&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"listPreview\"},[(_vm.urlpreview && _vm.metaPreviewLink)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"linkTitle txt\"},[_vm._v(\"sent link: \"+_vm._s(_vm.meta['og:title'])+\" \")]),(_vm.meta['og:site_name'] === 'Pocketnet')?_c('span',{staticClass:\"pocketnetLink\"},[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")]):_c('span',[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.file')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" sent file: \"+_vm._s(JSON.parse(_vm.content.body).name)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.bad.encrypted')?_c('div',{staticClass:\"previewMessage\"},[_c('span',[_vm._v(\" \"+_vm._s(_vm.$t(\"caption.unabletoDecrypt\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.redaction')?_c('div',{staticClass:\"previewMessage\"},[_c('span',{staticClass:\"txt\"},[_c('i',{staticClass:\"fas fa-eraser\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.messageDeleted\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.power_levels')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" \"+_vm._s(_vm.powerLevels)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.image')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentImage\")))])]):_vm._e(),(_vm.content.msgtype === 'm.audio')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentVoiceMessage\")))])]):_vm._e(),((_vm.content.msgtype === 'm.text') && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.content.body}})],1)]):_vm._e(),(_vm.content.msgtype === 'm.encrypted' && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.decryptEvent.body}})],1)]):_vm._e(),(_vm.content.membership === 'invite')?_c('div',{staticClass:\"invitedEvent\"},[(_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToChat\")))]):_vm._e(),(!_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToRoom\")))]):_vm._e()]):_vm._e(),(_vm.content.membership === 'leave')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt sname\"},[_vm._v(\" \"+_vm._s(_vm.name)+\" \")]),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.leftChat\")))])]):_vm._e(),(_vm.content.membership === 'ban')?_c('div',[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"txt\"},[_vm._v(\"banned \"+_vm._s(_vm.content.displayname))])]):_vm._e(),(_vm.content.membership === 'join' && _vm.event.getSender() !== _vm.userId)?_c('div',{staticClass:\"invitedEvent\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.joined\")))])]):_vm._e(),(_vm.content.name)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatRenamed\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.name))])])]):_vm._e(),(_vm.content.topic)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatTopic\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.topic.replace(/_/g, ' ')))])])]):_vm._e(),(_vm.readed)?_c('div',{staticClass:\"statusWrapper\"},[(_vm.my)?_c('div',{staticClass:\"my\"},[_c('i',{staticClass:\"fas fa-check-double\"})]):_vm._e()]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',_vm._l((_vm.chunks),function(chunk,index){return _c('label',{key:index,attrs:{\"chunks\":_vm.chunks}},[(chunk.id)?_c('label',{staticClass:\"likelink\",on:{\"click\":function($event){return _vm.show(chunk)}}},[_vm._v(\"@\"+_vm._s(chunk.name))]):_c('label',[_vm._v(_vm._s(chunk))])])}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./incomingMessage.vue?vue&type=template&id=6b3704ba&scoped=true&\"\nimport script from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nexport * from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./incomingMessage.vue?vue&type=style&index=0&id=6b3704ba&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6b3704ba\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=ba5ac396&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=ba5ac396&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"ba5ac396\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"urlMessage\",attrs:{\"id\":\"url\"}},[(_vm.urltype!= 'impty' && !_vm.error)?_c('div',{staticClass:\"urlwrapper\"},[(!_vm.loading)?_c('metaMessage',{ref:\"metamessage\",attrs:{\"type\":_vm.urltype,\"name\":_vm.meta['og:site_name'],\"title\":_vm.meta['og:title'],\"description\":_vm.meta['og:description'],\"image\":_vm.previewImageUrl,\"url\":_vm.url,\"h\":_vm.meta['og:image:height'],\"w\":_vm.meta['og:image:width']},on:{\"updatedSize\":_vm.updatedSize}}):_c('div',[_c('div',{staticClass:\"preloaderWrapperLocal\"},[_c('linepreloader')],1)])],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=791cf1f7&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=791cf1f7&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"791cf1f7\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"voiceMessage\",class:{playing:_vm.isPlaying}},[_c('div',{staticClass:\"voiceMessage_wrapper\"},[_c('button',{staticClass:\"voiceMessage_toggle\",class:{encrypted: _vm.encrypted},on:{\"touchend\":_vm.audioToggle,\"click\":_vm.audioToggleClick}},[_c('i',{class:_vm.isPlaying ? 'fas fa-pause': 'fas fa-play'})]),_c('div',{staticClass:\"voiceMessage_graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"width\":\"100\",\"height\":\"50\"},on:{\"mousedown\":_vm.goTo}})]),_c('div',{staticClass:\"voiceMessage_options\"},[(!_vm.error)?_c('span',[_vm._v(_vm._s(_vm.getDurationString))]):_vm._e(),(_vm.error)?_c('i',{staticClass:\"fas fa-exclamation-circle\"}):_vm._e()]),(_vm.encrypted && !_vm.error)?_c('div',{staticClass:\"encsign\"},[_c('i',{staticClass:\"fas fa-lock\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0438bc11&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0438bc11&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0438bc11\",\n null\n ,true\n)\n\nexport default component.exports","import actions from \"@/components/events/event/actions/index.vue\";\r\nimport filePreview from \"@/components/events/previews/filePreview/index.vue\";\r\nimport fileMessage from \"@/components/events/event/fileMessage/index.vue\";\r\nimport listPreview from \"@/components/events/event/message/listPreview/index.vue\";\r\nimport f from '@/application/functions'\r\nimport url from '@/components/events/event/url/index.vue'\r\nimport imagesLoaded from 'vue-images-loaded'\r\nimport dummypreviews from \"@/components/chats/dummypreviews\";\r\nimport IncomingMessage from \"./incomingMessage/incomingMessage.vue\"\r\nimport VoiceMessage from '@/components/events/event/VoiceMessage';\r\n\r\nexport default {\r\n name: 'eventsMessage',\r\n props: {\r\n decryptEvent: {},\r\n origin: Object,\r\n prevevent : Object,\r\n event: Object,\r\n preview: Boolean,\r\n userinfo: Object,\r\n readed: Object,\r\n downloaded: Boolean,\r\n baseImg: {\r\n type: String,\r\n default: 'empty'\r\n },\r\n filePreview: Object,\r\n imgEvent: {},\r\n add_image: Function,\r\n goToGallery: Function,\r\n chat: Object,\r\n encrypted: false,\r\n encryptedData: Boolean,\r\n decryptedInfo: null,\r\n error: String,\r\n withImage: Boolean,\r\n reference: Object,\r\n last : Boolean,\r\n showmyicontrue : false,\r\n fromreference : Boolean,\r\n multiSelect: {\r\n default: false,\r\n type: Boolean,\r\n },\r\n selectedMessages: {\r\n default: [],\r\n type: Array,\r\n },\r\n isRemoveSelectedMessages: false,\r\n audioBuffer : null\r\n },\r\n directives: {\r\n imagesLoaded\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n referenceshowed : false,\r\n }\r\n\r\n },\r\n components: {\r\n actions,\r\n filePreview,\r\n fileMessage,\r\n listPreview,\r\n url,\r\n dummypreviews,\r\n IncomingMessage,\r\n VoiceMessage,\r\n },\r\n watch : {\r\n isRemoveSelectedMessages: {\r\n immediate: true,\r\n handler: function () {\r\n if (this.isRemoveSelectedMessages) {\r\n for (let i = 0; i < this.selectedMessages.length; i++) {\r\n if (\r\n this.selectedMessages[i].message_id === this.origin.event.event_id\r\n ) {\r\n this.$emit('remove');\r\n\r\n return this.core.mtrx.client.redactEvent(\r\n this.chat.roomId,\r\n this.origin.event.event_id,\r\n null,\r\n {\r\n reason: 'messagedeleting',\r\n }\r\n );\r\n }\r\n }\r\n this.$emit('messagesIsDeleted', true);\r\n }\r\n },\r\n },\r\n readyToRender : {\r\n immediate : true,\r\n handler : function(){\r\n if(this.readyToRender) this.$emit('readyToRender')\r\n }\r\n }\r\n },\r\n computed: {\r\n showburn : function(){ \r\n\r\n if(new Date() < new Date(2021,11,28)) {\r\n return ''\r\n }\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.b) return 'big'\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.m) return 'medium'\r\n\r\n return ''\r\n },\r\n willburn : function(){\r\n\r\n var d = moment(this.origin._localTimestamp).add(this.core.options.burn.w, this.core.options.burn.v)\r\n\r\n return d\r\n\r\n },\r\n\r\n readyToRender : function(){\r\n\r\n var r = ( this.content.msgtype === 'm.encrypted' && !this.textWithoutLinks && this.badenctypted ) || \r\n\r\n (this.content.membership) ||\r\n\r\n ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && this.textWithoutLinks) ||\r\n (this.file) || (this.error) || \r\n (this.content.msgtype === 'm.image' && this.imageUrl) ||\r\n (this.content.msgtype === 'm.audio' && this.audioUrl) ||\r\n (this.urlpreview) || \r\n (this.preview)\r\n\r\n return r \r\n\r\n },\r\n my: function () {\r\n return this.userinfo.id === this.core.user.userinfo?.id\r\n },\r\n stateChat: function () {\r\n var id = this.$route.query.id\r\n\r\n return this.$store.state.chatsMap[id]\r\n },\r\n\r\n\r\n sending: function () {\r\n return this.origin.status == 'sending'\r\n },\r\n\r\n showmeta : function(){\r\n if(!this.prevevent) return true\r\n\r\n var prevuser = this.$f.getmatrixid(this.prevevent.getSender())\r\n\r\n var t = 10 * 60000\r\n\r\n if((moment().diff(this.origin._localTimestamp, 'days')) != 0){\r\n t = 60 * 1000 * 60 * 24\r\n }\r\n\r\n if (prevuser != this.userinfo.id || this.prevevent._localTimestamp + t < this.origin._localTimestamp){\r\n return true\r\n }\r\n \r\n },\r\n\r\n imageFrom: function () {\r\n if (this.content && this.content.info) return this.content.info.from\r\n },\r\n\r\n showmyicon: function () {\r\n \r\n return this.showmyicontrue || \r\n this.content.msgtype === 'm.image' ||\r\n /*this.content.msgtype === 'm.audio' ||*/\r\n this.content.msgtype === 'm.file' || \r\n this.urlpreview || (!this.$store.state.active && this.$store.state.minimized)\r\n\r\n\r\n },\r\n\r\n file: function () {\r\n if (this.content.msgtype === 'm.file') {\r\n return this.body\r\n }\r\n },\r\n\r\n replacedmintionsbody:function(){\r\n return this.body.replace(/@\\w{68}:(\\w{1,50})/g, function(str, l){\r\n return '@' + l\r\n })\r\n\r\n },\r\n\r\n body: function () {\r\n\r\n var bc = this.origin.event.content\r\n\r\n if (this.origin.event.content.msgtype == 'm.encrypted') {\r\n bc = this.decryptEvent\r\n }\r\n\r\n return bc.pbody || bc.body || ''\r\n },\r\n\r\n content: function () {\r\n return this.origin.event.content\r\n },\r\n\r\n badenctypted: function () {\r\n return this.decryptEvent.msgtype == 'm.bad.encrypted'\r\n },\r\n\r\n \r\n\r\n textWithoutLinks: function () {\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (!this.urlpreview || this.urlpreview.length < 10 ||\r\n (trimmed.indexOf(this.urlpreview) > 0 && trimmed.indexOf(this.urlpreview) + this.urlpreview.length < trimmed.length)\r\n ) {\r\n return trimmed\r\n }\r\n\r\n return this.$f.trim(trimmed.replace(this.urlpreview, ''))\r\n\r\n },\r\n\r\n imageUrl: function () {\r\n if (this.content.msgtype === 'm.image') {\r\n\r\n if (this.encryptedData) {\r\n return this.decryptedInfo\r\n } else {\r\n\r\n \r\n\r\n return this.content && this.content.url;\r\n }\r\n\r\n }\r\n },\r\n\r\n audioUrl: function () {\r\n if (this.content.msgtype === 'm.audio') {\r\n\r\n if(this.encryptedData && this.decryptedInfo) return this.decryptedInfo\r\n\r\n return this.audioBuffer\r\n\r\n //return this.content && this.content.audioData\r\n }\r\n },\r\n\r\n\r\n canediting: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n cancopy: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n menuItems: function () {\r\n var menu = [\r\n {\r\n click: \"reply\",\r\n title: this.$i18n.t(\"button.reply\"),\r\n icon: \"fas fa-reply\"\r\n },\r\n {\r\n click: \"showMultiSelect\",\r\n title: this.$i18n.t(\"button.select\"),\r\n icon: \"fas fa-check-circle\",\r\n },\r\n ]\r\n\r\n if(!this.file){\r\n menu.push({\r\n click: \"share\",\r\n title: this.$i18n.t(\"button.share\"),\r\n icon: \"fas fa-share-alt\"\r\n })\r\n }\r\n\r\n\r\n if (this.my) {\r\n menu.push({\r\n click: \"delete\",\r\n title: this.$i18n.t(\"button.delete\"),\r\n icon: \"far fa-trash-alt\"\r\n })\r\n }\r\n\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n menu.unshift({\r\n click: \"copy\",\r\n title: this.$i18n.t(\"button.copy\"),\r\n icon: \"far fa-copy\"\r\n })\r\n\r\n if (this.my && this.canediting)\r\n menu.unshift({\r\n click: \"edit\",\r\n title: this.$i18n.t(\"button.edit\"),\r\n icon: \"far fa-edit\"\r\n })\r\n }\r\n\r\n return menu\r\n },\r\n\r\n\r\n urlpreview: function () {\r\n if (!this.preview && this.content.msgtype !== 'm.file') {\r\n\r\n\r\n var url = f.getUrl(this.body)\r\n\r\n if (url){\r\n var _u = new URL(url)\r\n\r\n if(_u.pathname == '/'){\r\n if(f.knsite(url)) return ''\r\n }\r\n\r\n return url\r\n }\r\n\r\n return url || ''\r\n }\r\n },\r\n\r\n edited: function () {\r\n if (this.content.edited) return true\r\n\r\n if (\r\n this.origin.event.content['m.relates_to'] &&\r\n this.origin.event.content['m.relates_to']['rel_type'] == 'm.replace') return true\r\n },\r\n\r\n selectedMessage: function () {\r\n const elem = this.selectedMessages.filter(\r\n (item) => item.message_id === this.origin.event.event_id\r\n );\r\n return elem[0]?.message_id === this.origin.event.event_id ? true : false;\r\n },\r\n },\r\n\r\n mounted() {\r\n\r\n },\r\n\r\n methods: {\r\n gotoreference: function () {\r\n var id = this.reference.getId()\r\n\r\n this.$emit('gotoreference', id)\r\n },\r\n\r\n showwhenburn : function(){\r\n\r\n var text = ''\r\n\r\n //console.log(this.willburn.toDate(), new Date(), this.willburn.toDate() > new Date())\r\n\r\n if(this.willburn.toDate() < new Date()){\r\n text = this.$i18n.t(\"messagewasburn\")\r\n }\r\n else{\r\n text = this.$i18n.t(\"messagewillburn\")\r\n\r\n //this.willburn.locale(this.$i18n.locale).format('DD MMMM YYYY')\r\n }\r\n\r\n this.$store.commit('icon', {\r\n\t\t\t\ticon: 'info',\r\n\t\t\t\tmessage: text\r\n \r\n \r\n\t\t\t})\r\n\r\n },\r\n\r\n imagesLoaded: function () {\r\n this.updatedSize()\r\n },\r\n updatedSize: function (before) {\r\n this.$emit('updatedSize', before)\r\n },\r\n\r\n dropDownMenuShow: function () {\r\n\r\n if(this.urlpreview) return\r\n\r\n setTimeout(() => {\r\n this.setmenu()\r\n }, 200)\r\n\r\n },\r\n\r\n setmenu : function(){\r\n this.core.menu({\r\n items : this.menuItems,\r\n handler : this.menuItemClickHandler,\r\n item : {}\r\n })\r\n },\r\n\r\n menushare: function () {\r\n\r\n var sharing = {}\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (this.content.msgtype === 'm.image' && this.imageUrl) sharing.images = [this.imageUrl]\r\n\r\n if (this.content.msgtype === 'm.audio' && this.audioUrl) sharing.audio = [this.audioUrl]\r\n\r\n if ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && trimmed) sharing.messages = [trimmed]\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id\r\n\r\n this.$emit('share', sharing)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menuedit: function () {\r\n this.$emit('editing', this.body)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menushowMultiSelect: function () {\r\n this.$emit('showMultiSelect');\r\n this.selectMessage();\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menureply: function () {\r\n\r\n this.$emit('reply')\r\n\r\n return Promise.resolve()\r\n },\r\n menucopy: function () {\r\n\r\n \r\n\r\n this.$f.copytext(this.replacedmintionsbody)\r\n\r\n return Promise.resolve()\r\n },\r\n menudelete: function () {\r\n\r\n return this.$dialog.confirm(\r\n 'Do you really want to delete message?', {\r\n okText: this.$i18n.t(\"yes\"),\r\n cancelText: this.$i18n.t(\"cancel\")\r\n })\r\n\r\n .then((dialog) => {\r\n\r\n this.$emit('remove')\r\n\r\n\r\n return this.core.mtrx.client.redactEvent(this.chat.roomId, this.origin.event.event_id, null, {\r\n reason: \"messagedeleting\",\r\n })\r\n\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n\r\n },\r\n menuItemClickHandler: function (item, d, p) {\r\n\r\n p.hidePopup()\r\n\r\n this['menu' + item.click]().then(r => {\r\n\r\n }).catch(e => {\r\n p.showPopup()\r\n })\r\n\r\n },\r\n\r\n imagePaddingStyle : function(c){\r\n\r\n if(c.info && c.info.h && c.info.w){\r\n\r\n var cc = c.info.h / c.info.w\r\n\r\n if (cc > 1.7) cc = 1.7\r\n\r\n var h = 'padding-bottom:' + ((cc) * 100) + '%'\r\n\r\n return h\r\n }\r\n\r\n return ''\r\n },\r\n parser(event) {\r\n return JSON.parse(event)['og:title']\r\n },\r\n openImage(img) {\r\n this.$emit('openImg', img)\r\n },\r\n\r\n format_date(value) {\r\n if (value) {\r\n if ((moment().diff(value, 'days')) === 0) {\r\n return new Date(value).toLocaleTimeString([], {hour: '2-digit', minute: \"2-digit\", hour12: false})\r\n } else {\r\n if (moment().year() === moment(value).year()) {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM')\r\n } else {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM YYYY')\r\n }\r\n }\r\n }\r\n },\r\n\r\n download: function () {\r\n this.$emit('download')\r\n },\r\n\r\n decryptagain : function(){\r\n this.$emit('decryptagain')\r\n },\r\n \r\n openImageGallery(msgEvent) {\r\n this.$emit('openGalleryImg', msgEvent)\r\n },\r\n reshareKeys() {\r\n let roomId = this.chat.roomId\r\n },\r\n textDonation: function (withTx = false) {\r\n var from = this.$i18n.t(\"caption.somebody\"), msg = '';\r\n try {\r\n from = this.$f.deep(this, '$store.state.users.' + this.content.from).name;\r\n } catch (err) {\r\n }\r\n var to = this.$i18n.t(\"caption.somebody\");\r\n try {\r\n to = this.$f.deep(this, '$store.state.users.' + this.content.to).name;\r\n } catch (err) {\r\n }\r\n msg += from + this.$i18n.t(\"caption.sent\") + this.content.amount + this.$i18n.t(\"caption.sent\") + to;\r\n return msg;\r\n },\r\n\r\n menuIsVisibleHandler(isVisible) {\r\n this.$emit('menuIsVisible', isVisible);\r\n },\r\n\r\n showreference : function(){\r\n this.referenceshowed = !this.referenceshowed\r\n },\r\n\r\n selectMessage: function () {\r\n var sharing = {};\r\n\r\n var trimmed = this.$f.trim(this.body);\r\n\r\n if (this.content.msgtype === 'm.image' && this.imageUrl)\r\n sharing.images = [this.imageUrl];\r\n\r\n if (this.content.msgtype === 'm.audio' && this.decryptedInfo)\r\n sharing.audio = [this.decryptedInfo];\r\n\r\n if (\r\n (this.content.msgtype === 'm.text' ||\r\n this.content.msgtype === 'm.encrypted') &&\r\n trimmed\r\n )\r\n sharing.messages = [trimmed];\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true;\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id;\r\n this.$emit('selectMessage', {\r\n message_id: this.origin.event.event_id,\r\n ...sharing,\r\n });\r\n },\r\n removeMessage: function () {\r\n this.$emit('removeMessage', {\r\n message_id: this.origin.event.event_id,\r\n });\r\n },\r\n\r\n eventMessage: function (state) {\r\n state ? this.removeMessage() : this.selectMessage()\r\n }\r\n }\r\n}","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=c8f458dc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=c8f458dc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"c8f458dc\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=659136c0&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=659136c0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"659136c0\",\n null\n ,true\n)\n\nexport default component.exports","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\"","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.EventTimelineSet = EventTimelineSet;\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _eventTimeline = require(\"./event-timeline\");\r\n\r\nvar _event = require(\"./event\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _relations = require(\"./relations\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module models/event-timeline-set\r\n */\r\n// var DEBUG = false;\r\nconst DEBUG = true;\r\nlet debuglog;\r\n\r\nif (DEBUG) {\r\n // using bind means that we get to keep useful line numbers in the console\r\n debuglog = _logger.logger.log.bind(_logger.logger);\r\n} else {\r\n debuglog = function () {};\r\n}\r\n/**\r\n * Construct a set of EventTimeline objects, typically on behalf of a given\r\n * room. A room may have multiple EventTimelineSets for different levels\r\n * of filtering. The global notification list is also an EventTimelineSet, but\r\n * lacks a room.\r\n *\r\n *

This is an ordered sequence of timelines, which may or may not\r\n * be continuous. Each timeline lists a series of events, as well as tracking\r\n * the room state at the start and the end of the timeline (if appropriate).\r\n * It also tracks forward and backward pagination tokens, as well as containing\r\n * links to the next timeline in the sequence.\r\n *\r\n *

There is one special timeline - the 'live' timeline, which represents the\r\n * timeline to which events are being added in real-time as they are received\r\n * from the /sync API. Note that you should not retain references to this\r\n * timeline - even if it is the current timeline right now, it may not remain\r\n * so if the server gives us a timeline gap in /sync.\r\n *\r\n *

In order that we can find events from their ids later, we also maintain a\r\n * map from event_id to timeline and index.\r\n *\r\n * @constructor\r\n * @param {?Room} room\r\n * Room for this timelineSet. May be null for non-room cases, such as the\r\n * notification timeline.\r\n * @param {Object} opts Options inherited from Room.\r\n *\r\n * @param {boolean} [opts.timelineSupport = false]\r\n * Set to true to enable improved timeline support.\r\n * @param {Object} [opts.filter = null]\r\n * The filter object, if any, for this timelineSet.\r\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\r\n * Optional. Set to true to enable client-side aggregation of event relations\r\n * via `getRelationsForEvent`.\r\n * This feature is currently unstable and the API may change without notice.\r\n */\r\n\r\n\r\nfunction EventTimelineSet(room, opts) {\r\n this.room = room;\r\n this._timelineSupport = Boolean(opts.timelineSupport);\r\n this._liveTimeline = new _eventTimeline.EventTimeline(this);\r\n this._unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation; // just a list - *not* ordered.\r\n\r\n this._timelines = [this._liveTimeline];\r\n this._eventIdToTimeline = {};\r\n this._filter = opts.filter || null;\r\n\r\n if (this._unstableClientRelationAggregation) {\r\n // A tree of objects to access a set of relations for an event, as in:\r\n // this._relations[relatesToEventId][relationType][relationEventType]\r\n this._relations = {};\r\n }\r\n}\r\n\r\nutils.inherits(EventTimelineSet, _events.EventEmitter);\r\n/**\r\n * Get all the timelines in this set\r\n * @return {module:models/event-timeline~EventTimeline[]} the timelines in this set\r\n */\r\n\r\nEventTimelineSet.prototype.getTimelines = function () {\r\n return this._timelines;\r\n};\r\n/**\r\n * Get the filter object this timeline set is filtered on, if any\r\n * @return {?Filter} the optional filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getFilter = function () {\r\n return this._filter;\r\n};\r\n/**\r\n * Set the filter object this timeline set is filtered on\r\n * (passed to the server when paginating via /messages).\r\n * @param {Filter} filter the filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setFilter = function (filter) {\r\n this._filter = filter;\r\n};\r\n/**\r\n * Get the list of pending sent events for this timelineSet's room, filtered\r\n * by the timelineSet's filter if appropriate.\r\n *\r\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\r\n * waiting for remote echo.\r\n *\r\n * @throws If opts.pendingEventOrdering was not 'detached'\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getPendingEvents = function () {\r\n if (!this.room) {\r\n return [];\r\n }\r\n\r\n if (this._filter) {\r\n return this._filter.filterRoomTimeline(this.room.getPendingEvents());\r\n } else {\r\n return this.room.getPendingEvents();\r\n }\r\n};\r\n/**\r\n * Get the live timeline for this room.\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} live timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getLiveTimeline = function () {\r\n return this._liveTimeline;\r\n};\r\n/**\r\n * Return the timeline (if any) this event is in.\r\n * @param {String} eventId the eventId being sought\r\n * @return {module:models/event-timeline~EventTimeline} timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.eventIdToTimeline = function (eventId) {\r\n return this._eventIdToTimeline[eventId];\r\n};\r\n/**\r\n * Track a new event as if it were in the same timeline as an old event,\r\n * replacing it.\r\n * @param {String} oldEventId event ID of the original event\r\n * @param {String} newEventId event ID of the replacement event\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.replaceEventId = function (oldEventId, newEventId) {\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n }\r\n};\r\n/**\r\n * Reset the live timeline, and start a new one.\r\n *\r\n *

This is used when /sync returns a 'limited' timeline.\r\n *\r\n * @param {string=} backPaginationToken token for back-paginating the new timeline\r\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\r\n * if absent or null, all timelines are reset.\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timelineReset\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.resetLiveTimeline = function (backPaginationToken, forwardPaginationToken) {\r\n // Each EventTimeline has RoomState objects tracking the state at the start\r\n // and end of that timeline. The copies at the end of the live timeline are\r\n // special because they will have listeners attached to monitor changes to\r\n // the current room state, so we move this RoomState from the end of the\r\n // current live timeline to the end of the new one and, if necessary,\r\n // replace it with a newly created one. We also make a copy for the start\r\n // of the new timeline.\r\n // if timeline support is disabled, forget about the old timelines\r\n const resetAllTimelines = !this._timelineSupport || !forwardPaginationToken;\r\n const oldTimeline = this._liveTimeline;\r\n const newTimeline = resetAllTimelines ? oldTimeline.forkLive(_eventTimeline.EventTimeline.FORWARDS) : oldTimeline.fork(_eventTimeline.EventTimeline.FORWARDS);\r\n\r\n if (resetAllTimelines) {\r\n this._timelines = [newTimeline];\r\n this._eventIdToTimeline = {};\r\n } else {\r\n this._timelines.push(newTimeline);\r\n }\r\n\r\n if (forwardPaginationToken) {\r\n // Now set the forward pagination token on the old live timeline\r\n // so it can be forward-paginated.\r\n oldTimeline.setPaginationToken(forwardPaginationToken, _eventTimeline.EventTimeline.FORWARDS);\r\n } // make sure we set the pagination token before firing timelineReset,\r\n // otherwise clients which start back-paginating will fail, and then get\r\n // stuck without realising that they *can* back-paginate.\r\n\r\n\r\n newTimeline.setPaginationToken(backPaginationToken, _eventTimeline.EventTimeline.BACKWARDS); // Now we can swap the live timeline to the new one.\r\n\r\n this._liveTimeline = newTimeline;\r\n this.emit(\"Room.timelineReset\", this.room, this, resetAllTimelines);\r\n};\r\n/**\r\n * Get the timeline which contains the given event, if any\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\r\n * the given event, or null if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getTimelineForEvent = function (eventId) {\r\n const res = this._eventIdToTimeline[eventId];\r\n return res === undefined ? null : res;\r\n};\r\n/**\r\n * Get an event which is stored in our timelines\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event~MatrixEvent} the given event, or undefined if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.findEventById = function (eventId) {\r\n const tl = this.getTimelineForEvent(eventId);\r\n\r\n if (!tl) {\r\n return undefined;\r\n }\r\n\r\n return utils.findElement(tl.getEvents(), function (ev) {\r\n return ev.getId() == eventId;\r\n });\r\n};\r\n/**\r\n * Add a new timeline to this timeline list\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addTimeline = function () {\r\n if (!this._timelineSupport) {\r\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" + \" parameter to true when creating MatrixClient to enable\" + \" it.\");\r\n }\r\n\r\n const timeline = new _eventTimeline.EventTimeline(this);\r\n\r\n this._timelines.push(timeline);\r\n\r\n return timeline;\r\n};\r\n/**\r\n * Add events to a timeline\r\n *\r\n *

Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent[]} events A list of events to add.\r\n *\r\n * @param {boolean} toStartOfTimeline True to add these events to the start\r\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\r\n * event will be the last element of 'events'.\r\n *\r\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\r\n * add events to.\r\n *\r\n * @param {string=} paginationToken token for the next batch of events\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n *\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventsToTimeline = function (events, toStartOfTimeline, timeline, paginationToken) {\r\n if (!timeline) {\r\n throw new Error(\"'timeline' not specified for EventTimelineSet.addEventsToTimeline\");\r\n }\r\n\r\n if (!toStartOfTimeline && timeline == this._liveTimeline) {\r\n throw new Error(\"EventTimelineSet.addEventsToTimeline cannot be used for adding events to \" + \"the live timeline - use Room.addLiveEvents instead\");\r\n }\r\n\r\n if (this._filter) {\r\n events = this._filter.filterRoomTimeline(events);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const direction = toStartOfTimeline ? _eventTimeline.EventTimeline.BACKWARDS : _eventTimeline.EventTimeline.FORWARDS;\r\n const inverseDirection = toStartOfTimeline ? _eventTimeline.EventTimeline.FORWARDS : _eventTimeline.EventTimeline.BACKWARDS; // Adding events to timelines can be quite complicated. The following\r\n // illustrates some of the corner-cases.\r\n //\r\n // Let's say we start by knowing about four timelines. timeline3 and\r\n // timeline4 are neighbours:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M] [P] [S] <------> [T]\r\n //\r\n // Now we paginate timeline1, and get the following events from the server:\r\n // [M, N, P, R, S, T, U].\r\n //\r\n // 1. First, we ignore event M, since we already know about it.\r\n //\r\n // 2. Next, we append N to timeline 1.\r\n //\r\n // 3. Next, we don't add event P, since we already know about it,\r\n // but we do link together the timelines. We now have:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P] [S] <------> [T]\r\n //\r\n // 4. Now we add event R to timeline2:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] [S] <------> [T]\r\n //\r\n // Note that we have switched the timeline we are working on from\r\n // timeline1 to timeline2.\r\n //\r\n // 5. We ignore event S, but again join the timelines:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T]\r\n //\r\n // 6. We ignore event T, and the timelines are already joined, so there\r\n // is nothing to do.\r\n //\r\n // 7. Finally, we add event U to timeline4:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T, U]\r\n //\r\n // The important thing to note in the above is what happened when we\r\n // already knew about a given event:\r\n //\r\n // - if it was appropriate, we joined up the timelines (steps 3, 5).\r\n // - in any case, we started adding further events to the timeline which\r\n // contained the event we knew about (steps 3, 5, 6).\r\n //\r\n //\r\n // So much for adding events to the timeline. But what do we want to do\r\n // with the pagination token?\r\n //\r\n // In the case above, we will be given a pagination token which tells us how to\r\n // get events beyond 'U' - in this case, it makes sense to store this\r\n // against timeline4. But what if timeline4 already had 'U' and beyond? in\r\n // that case, our best bet is to throw away the pagination token we were\r\n // given and stick with whatever token timeline4 had previously. In short,\r\n // we want to only store the pagination token if the last event we receive\r\n // is one we didn't previously know about.\r\n //\r\n // We make an exception for this if it turns out that we already knew about\r\n // *all* of the events, and we weren't able to join up any timelines. When\r\n // that happens, it means our existing pagination token is faulty, since it\r\n // is only telling us what we already know. Rather than repeatedly\r\n // paginating with the same token, we might as well use the new pagination\r\n // token in the hope that we eventually work our way out of the mess.\r\n\r\n let didUpdate = false;\r\n let lastEventWasNew = false;\r\n\r\n for (let i = 0; i < events.length; i++) {\r\n const event = events[i];\r\n const eventId = event.getId();\r\n const existingTimeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!existingTimeline) {\r\n // we don't know about this event yet. Just add it to the timeline.\r\n this.addEventToTimeline(event, timeline, toStartOfTimeline);\r\n lastEventWasNew = true;\r\n didUpdate = true;\r\n continue;\r\n }\r\n\r\n lastEventWasNew = false;\r\n\r\n if (existingTimeline == timeline) {\r\n debuglog(\"Event \" + eventId + \" already in timeline \" + timeline);\r\n continue;\r\n }\r\n\r\n const neighbour = timeline.getNeighbouringTimeline(direction);\r\n\r\n if (neighbour) {\r\n // this timeline already has a neighbour in the relevant direction;\r\n // let's assume the timelines are already correctly linked up, and\r\n // skip over to it.\r\n //\r\n // there's probably some edge-case here where we end up with an\r\n // event which is in a timeline a way down the chain, and there is\r\n // a break in the chain somewhere. But I can't really imagine how\r\n // that would happen, so I'm going to ignore it for now.\r\n //\r\n if (existingTimeline == neighbour) {\r\n debuglog(\"Event \" + eventId + \" in neighbouring timeline - \" + \"switching to \" + existingTimeline);\r\n } else {\r\n debuglog(\"Event \" + eventId + \" already in a different \" + \"timeline \" + existingTimeline);\r\n }\r\n\r\n timeline = existingTimeline;\r\n continue;\r\n } // time to join the timelines.\r\n\r\n\r\n _logger.logger.info(\"Already have timeline for \" + eventId + \" - joining timeline \" + timeline + \" to \" + existingTimeline); // Variables to keep the line length limited below.\r\n\r\n\r\n const existingIsLive = existingTimeline === this._liveTimeline;\r\n const timelineIsLive = timeline === this._liveTimeline;\r\n const backwardsIsLive = direction === _eventTimeline.EventTimeline.BACKWARDS && existingIsLive;\r\n const forwardsIsLive = direction === _eventTimeline.EventTimeline.FORWARDS && timelineIsLive;\r\n\r\n if (backwardsIsLive || forwardsIsLive) {\r\n // The live timeline should never be spliced into a non-live position.\r\n // We use independent logging to better discover the problem at a glance.\r\n if (backwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set a preceding existingTimeLine on our \" + \"timeline as the existingTimeLine is live (\" + existingTimeline + \")\");\r\n }\r\n\r\n if (forwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set our preceding timeline on a existingTimeLine \" + \"as our timeline is live (\" + timeline + \")\");\r\n }\r\n\r\n continue; // abort splicing - try next event\r\n }\r\n\r\n timeline.setNeighbouringTimeline(existingTimeline, direction);\r\n existingTimeline.setNeighbouringTimeline(timeline, inverseDirection);\r\n timeline = existingTimeline;\r\n didUpdate = true;\r\n } // see above - if the last event was new to us, or if we didn't find any\r\n // new information, we update the pagination token for whatever\r\n // timeline we ended up on.\r\n\r\n\r\n if (lastEventWasNew || !didUpdate) {\r\n if (direction === _eventTimeline.EventTimeline.FORWARDS && timeline === this._liveTimeline) {\r\n _logger.logger.warn({\r\n lastEventWasNew,\r\n didUpdate\r\n }); // for debugging\r\n\r\n\r\n _logger.logger.warn(`Refusing to set forwards pagination token of live timeline ` + `${timeline} to ${paginationToken}`);\r\n\r\n return;\r\n }\r\n\r\n timeline.setPaginationToken(paginationToken, direction);\r\n }\r\n};\r\n/**\r\n * Add an event to the end of this live timeline.\r\n *\r\n * @param {MatrixEvent} event Event to be added\r\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addLiveEvent = function (event, duplicateStrategy, fromCache) {\r\n if (this._filter) {\r\n const events = this._filter.filterRoomTimeline([event]);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const timeline = this._eventIdToTimeline[event.getId()];\r\n\r\n if (timeline) {\r\n if (duplicateStrategy === \"replace\") {\r\n debuglog(\"EventTimelineSet.addLiveEvent: replacing duplicate event \" + event.getId());\r\n const tlEvents = timeline.getEvents();\r\n\r\n for (let j = 0; j < tlEvents.length; j++) {\r\n if (tlEvents[j].getId() === event.getId()) {\r\n // still need to set the right metadata on this event\r\n _eventTimeline.EventTimeline.setEventMetadata(event, timeline.getState(_eventTimeline.EventTimeline.FORWARDS), false);\r\n\r\n if (!tlEvents[j].encryptedType) {\r\n tlEvents[j] = event;\r\n } // XXX: we need to fire an event when this happens.\r\n\r\n\r\n break;\r\n }\r\n }\r\n } else {\r\n debuglog(\"EventTimelineSet.addLiveEvent: ignoring duplicate event \" + event.getId());\r\n }\r\n\r\n return;\r\n }\r\n\r\n this.addEventToTimeline(event, this._liveTimeline, false, fromCache);\r\n};\r\n/**\r\n * Add event to the given timeline, and emit Room.timeline. Assumes\r\n * we have already checked we don't know about this event.\r\n *\r\n * Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent} event\r\n * @param {EventTimeline} timeline\r\n * @param {boolean} toStartOfTimeline\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventToTimeline = function (event, timeline, toStartOfTimeline, fromCache) {\r\n const eventId = event.getId();\r\n timeline.addEvent(event, toStartOfTimeline);\r\n this._eventIdToTimeline[eventId] = timeline;\r\n this.setRelationsTarget(event);\r\n this.aggregateRelations(event);\r\n const data = {\r\n timeline: timeline,\r\n liveEvent: !toStartOfTimeline && timeline == this._liveTimeline && !fromCache\r\n };\r\n this.emit(\"Room.timeline\", event, this.room, Boolean(toStartOfTimeline), false, data);\r\n};\r\n/**\r\n * Replaces event with ID oldEventId with one with newEventId, if oldEventId is\r\n * recognised. Otherwise, add to the live timeline. Used to handle remote echos.\r\n *\r\n * @param {MatrixEvent} localEvent the new event to be added to the timeline\r\n * @param {String} oldEventId the ID of the original event\r\n * @param {boolean} newEventId the ID of the replacement event\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.handleRemoteEcho = function (localEvent, oldEventId, newEventId) {\r\n // XXX: why don't we infer newEventId from localEvent?\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n } else {\r\n if (this._filter) {\r\n if (this._filter.filterRoomTimeline([localEvent]).length) {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n } else {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n }\r\n};\r\n/**\r\n * Removes a single event from this room.\r\n *\r\n * @param {String} eventId The id of the event to remove\r\n *\r\n * @return {?MatrixEvent} the removed event, or null if the event was not found\r\n * in this room.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.removeEvent = function (eventId) {\r\n const timeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!timeline) {\r\n return null;\r\n }\r\n\r\n const removed = timeline.removeEvent(eventId);\r\n\r\n if (removed) {\r\n delete this._eventIdToTimeline[eventId];\r\n const data = {\r\n timeline: timeline\r\n };\r\n this.emit(\"Room.timeline\", removed, this.room, undefined, true, data);\r\n }\r\n\r\n return removed;\r\n};\r\n/**\r\n * Determine where two events appear in the timeline relative to one another\r\n *\r\n * @param {string} eventId1 The id of the first event\r\n * @param {string} eventId2 The id of the second event\r\n\r\n * @return {?number} a number less than zero if eventId1 precedes eventId2, and\r\n * greater than zero if eventId1 succeeds eventId2. zero if they are the\r\n * same event; null if we can't tell (either because we don't know about one\r\n * of the events, or because they are in separate timelines which don't join\r\n * up).\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.compareEventOrdering = function (eventId1, eventId2) {\r\n if (eventId1 == eventId2) {\r\n // optimise this case\r\n return 0;\r\n }\r\n\r\n const timeline1 = this._eventIdToTimeline[eventId1];\r\n const timeline2 = this._eventIdToTimeline[eventId2];\r\n\r\n if (timeline1 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline2 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline1 === timeline2) {\r\n // both events are in the same timeline - figure out their\r\n // relative indices\r\n let idx1;\r\n let idx2;\r\n const events = timeline1.getEvents();\r\n\r\n for (let idx = 0; idx < events.length && (idx1 === undefined || idx2 === undefined); idx++) {\r\n const evId = events[idx].getId();\r\n\r\n if (evId == eventId1) {\r\n idx1 = idx;\r\n }\r\n\r\n if (evId == eventId2) {\r\n idx2 = idx;\r\n }\r\n }\r\n\r\n return idx1 - idx2;\r\n } // the events are in different timelines. Iterate through the\r\n // linkedlist to see which comes first.\r\n // first work forwards from timeline1\r\n\r\n\r\n let tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline1 is before timeline2\r\n return -1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.FORWARDS);\r\n } // now try backwards from timeline1\r\n\r\n\r\n tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline2 is before timeline1\r\n return 1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.BACKWARDS);\r\n } // the timelines are not contiguous.\r\n\r\n\r\n return null;\r\n};\r\n/**\r\n * Get a collection of relations to a given event in this timeline set.\r\n *\r\n * @param {String} eventId\r\n * The ID of the event that you'd like to access relation events for.\r\n * For example, with annotations, this would be the ID of the event being annotated.\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\", \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @throws If eventId, relationType or eventType\r\n * are not valid.\r\n *\r\n * @returns {?Relations}\r\n * A container for relation events or undefined if there are no relation events for\r\n * the relationType.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getRelationsForEvent = function (eventId, relationType, eventType) {\r\n if (!this._unstableClientRelationAggregation) {\r\n throw new Error(\"Client-side relation aggregation is disabled\");\r\n }\r\n\r\n if (!eventId || !relationType || !eventType) {\r\n throw new Error(\"Invalid arguments for `getRelationsForEvent`\");\r\n } // debuglog(\"Getting relations for: \", eventId, relationType, eventType);\r\n\r\n\r\n const relationsForEvent = this._relations[eventId] || {};\r\n const relationsWithRelType = relationsForEvent[relationType] || {};\r\n return relationsWithRelType[eventType];\r\n};\r\n/**\r\n * Set an event as the target event if any Relations exist for it already\r\n *\r\n * @param {MatrixEvent} event\r\n * The event to check as relation target.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setRelationsTarget = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n const relationsForEvent = this._relations[event.getId()];\r\n\r\n if (!relationsForEvent) {\r\n return;\r\n } // don't need it for non m.replace relations for now\r\n\r\n\r\n const relationsWithRelType = relationsForEvent[\"m.replace\"];\r\n\r\n if (!relationsWithRelType) {\r\n return;\r\n } // only doing replacements for messages for now (e.g. edits)\r\n\r\n\r\n const relationsWithEventType = relationsWithRelType[\"m.room.message\"];\r\n\r\n if (relationsWithEventType) {\r\n relationsWithEventType.setTargetEvent(event);\r\n }\r\n};\r\n/**\r\n * Add relation events to the relevant relation collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be aggregated.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.aggregateRelations = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n if (event.isRedacted() || event.status === _event.EventStatus.CANCELLED) {\r\n return;\r\n } // If the event is currently encrypted, wait until it has been decrypted.\r\n\r\n\r\n if (event.isBeingDecrypted()) {\r\n event.once(\"Event.decrypted\", () => {\r\n this.aggregateRelations(event);\r\n });\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n return;\r\n }\r\n\r\n const relatesToEventId = relation.event_id;\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType(); // debuglog(\"Aggregating relation: \", event.getId(), eventType, relation);\r\n\r\n let relationsForEvent = this._relations[relatesToEventId];\r\n\r\n if (!relationsForEvent) {\r\n relationsForEvent = this._relations[relatesToEventId] = {};\r\n }\r\n\r\n let relationsWithRelType = relationsForEvent[relationType];\r\n\r\n if (!relationsWithRelType) {\r\n relationsWithRelType = relationsForEvent[relationType] = {};\r\n }\r\n\r\n let relationsWithEventType = relationsWithRelType[eventType];\r\n let isNewRelations = false;\r\n let relatesToEvent;\r\n\r\n if (!relationsWithEventType) {\r\n relationsWithEventType = relationsWithRelType[eventType] = new _relations.Relations(relationType, eventType, this.room);\r\n isNewRelations = true;\r\n relatesToEvent = this.findEventById(relatesToEventId) || this.room.getPendingEvent(relatesToEventId);\r\n\r\n if (relatesToEvent) {\r\n relationsWithEventType.setTargetEvent(relatesToEvent);\r\n }\r\n }\r\n\r\n relationsWithEventType.addEvent(event); // only emit once event has been added to relations\r\n\r\n if (isNewRelations && relatesToEvent) {\r\n relatesToEvent.emit(\"Event.relationsCreated\", relationType, eventType);\r\n }\r\n};\r\n/**\r\n * Fires whenever the timeline in a room is updated.\r\n * @event module:client~MatrixClient#\"Room.timeline\"\r\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\r\n * @param {?Room} room The room, if any, whose timeline was updated.\r\n * @param {boolean} toStartOfTimeline True if this event was added to the start\r\n * @param {boolean} removed True if this event has just been removed from the timeline\r\n * (beginning; oldest) of the timeline e.g. due to pagination.\r\n *\r\n * @param {object} data more data about the event\r\n *\r\n * @param {module:models/event-timeline.EventTimeline} data.timeline the timeline the\r\n * event was added to/removed from\r\n *\r\n * @param {boolean} data.liveEvent true if the event was a real-time event\r\n * added to the end of the live timeline\r\n *\r\n * @example\r\n * matrixClient.on(\"Room.timeline\",\r\n * function(event, room, toStartOfTimeline, removed, data) {\r\n * if (!toStartOfTimeline && data.liveEvent) {\r\n * var messageToAppend = room.timeline.[room.timeline.length - 1];\r\n * }\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever the live timeline in a room is reset.\r\n *\r\n * When we get a 'limited' sync (for example, after a network outage), we reset\r\n * the live timeline to be empty before adding the recent events to the new\r\n * timeline. This event is fired after the timeline is reset, and before the\r\n * new events are added.\r\n *\r\n * @event module:client~MatrixClient#\"Room.timelineReset\"\r\n * @param {Room} room The room whose live timeline was reset, if any\r\n * @param {EventTimelineSet} timelineSet timelineSet room whose live timeline was reset\r\n * @param {boolean} resetAllTimelines True if all timelines were reset.\r\n */","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.logger = void 0;\r\n\r\nvar _loglevel = _interopRequireDefault(require(\"loglevel\"));\r\n\r\n/*\r\nCopyright 2018 André Jaenisch\r\nCopyright 2019, 2021 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module logger\r\n */\r\n// This is to demonstrate, that you can use any namespace you want.\r\n// Namespaces allow you to turn on/off the logging for specific parts of the\r\n// application.\r\n// An idea would be to control this via an environment variable (on Node.js).\r\n// See https://www.npmjs.com/package/debug to see how this could be implemented\r\n// Part of #332 is introducing a logging library in the first place.\r\nconst DEFAULT_NAMESPACE = \"matrix\"; // because rageshakes in react-sdk hijack the console log, also at module load time,\r\n// initializing the logger here races with the initialization of rageshakes.\r\n// to avoid the issue, we override the methodFactory of loglevel that binds to the\r\n// console methods at initialization time by a factory that looks up the console methods\r\n// when logging so we always get the current value of console methods.\r\n\r\n_loglevel.default.methodFactory = function (methodName, logLevel, loggerName) {\r\n return function (...args) {\r\n /* eslint-disable @babel/no-invalid-this */\r\n if (this.prefix) {\r\n args.unshift(this.prefix);\r\n }\r\n /* eslint-enable @babel/no-invalid-this */\r\n\r\n\r\n const supportedByConsole = methodName === \"error\" || methodName === \"warn\" || methodName === \"trace\" || methodName === \"info\";\r\n /* eslint-disable no-console */\r\n\r\n return\r\n\r\n if (supportedByConsole) {\r\n return console[methodName](...args);\r\n } else {\r\n return console.log(...args);\r\n }\r\n /* eslint-enable no-console */\r\n\r\n };\r\n};\r\n/**\r\n * Drop-in replacement for console using {@link https://www.npmjs.com/package/loglevel|loglevel}.\r\n * Can be tailored down to specific use cases if needed.\r\n */\r\n\r\n\r\nconst logger = _loglevel.default.getLogger(DEFAULT_NAMESPACE);\r\n\r\nexports.logger = logger;\r\nlogger.setLevel(_loglevel.default.levels.DEBUG);\r\n\r\nfunction extendLogger(logger) {\r\n logger.withPrefix = function (prefix) {\r\n const existingPrefix = this.prefix || \"\";\r\n return getPrefixedLogger(existingPrefix + prefix);\r\n };\r\n}\r\n\r\nextendLogger(logger);\r\n\r\nfunction getPrefixedLogger(prefix) {\r\n const prefixLogger = _loglevel.default.getLogger(`${DEFAULT_NAMESPACE}-${prefix}`);\r\n\r\n if (prefixLogger.prefix !== prefix) {\r\n // Only do this setup work the first time through, as loggers are saved by name.\r\n extendLogger(prefixLogger);\r\n prefixLogger.prefix = prefix;\r\n prefixLogger.setLevel(_loglevel.default.levels.DEBUG);\r\n }\r\n\r\n return prefixLogger;\r\n}","var Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar StringDecoder = require('string_decoder').StringDecoder\nvar inherits = require('inherits')\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.SyncApi = SyncApi;\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"./utils\"));\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nvar _pushprocessor = require(\"./pushprocessor\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/*\r\n * TODO:\r\n * This class mainly serves to take all the syncing logic out of client.js and\r\n * into a separate file. It's all very fluid, and this class gut wrenches a lot\r\n * of MatrixClient props (e.g. _http). Given we want to support WebSockets as\r\n * an alternative syncing API, we may want to have a proper syncing interface\r\n * for HTTP and WS at some point.\r\n */\r\nconst DEBUG = true; // /sync requests allow you to set a timeout= but the request may continue\r\n// beyond that and wedge forever, so we need to track how long we are willing\r\n// to keep open the connection. This constant is *ADDED* to the timeout= value\r\n// to determine the max time we're willing to wait.\r\n\r\nconst BUFFER_PERIOD_MS = 80 * 1000; // Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\r\n// to RECONNECTING. This is needed to inform the client of server issues when the\r\n// keepAlive is successful but the server /sync fails.\r\n\r\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\r\n\r\nfunction getFilterName(userId, suffix) {\r\n // scope this on the user ID because people may login on many accounts\r\n // and they all need to be stored!\r\n return \"FILTER_SYNC_\" + userId + (suffix ? \"_\" + suffix : \"\");\r\n}\r\n\r\nfunction debuglog(...params) {\r\n if (!DEBUG) {\r\n return;\r\n }\r\n\r\n _logger.logger.log(...params);\r\n}\r\n/**\r\n * Internal class - unstable.\r\n * Construct an entity which is able to sync with a homeserver.\r\n * @constructor\r\n * @param {MatrixClient} client The matrix client instance to use.\r\n * @param {Object} opts Config options\r\n * @param {module:crypto=} opts.crypto Crypto manager\r\n * @param {Function=} opts.canResetEntireTimeline A function which is called\r\n * with a room ID and returns a boolean. It should return 'true' if the SDK can\r\n * SAFELY remove events from this room. It may not be safe to remove events if\r\n * there are other references to the timelines for this room.\r\n * Default: returns false.\r\n * @param {Boolean=} opts.disablePresence True to perform syncing without automatically\r\n * updating presence.\r\n */\r\n\r\n\r\nfunction SyncApi(client, opts) {\r\n this.client = client;\r\n opts = opts || {};\r\n opts.initialSyncLimit = opts.initialSyncLimit === undefined ? 8 : opts.initialSyncLimit;\r\n opts.resolveInvitesToProfiles = opts.resolveInvitesToProfiles || false;\r\n opts.pollTimeout = opts.pollTimeout || 30 * 1000;\r\n opts.pendingEventOrdering = opts.pendingEventOrdering || \"chronological\";\r\n\r\n if (!opts.canResetEntireTimeline) {\r\n opts.canResetEntireTimeline = function (roomId) {\r\n return false;\r\n };\r\n }\r\n\r\n this.opts = opts;\r\n this._peekRoom = null;\r\n this._currentSyncRequest = null;\r\n this._syncState = null;\r\n this._syncStateData = null; // additional data (eg. error object for failed sync)\r\n\r\n this._catchingUp = false;\r\n this._running = false;\r\n this._keepAliveTimer = null;\r\n this._connectionReturnedDefer = null;\r\n this._notifEvents = []; // accumulator of sync events in the current sync response\r\n\r\n this._failedSyncCount = 0; // Number of consecutive failed /sync requests\r\n\r\n this._storeIsInvalid = false; // flag set if the store needs to be cleared before we can start\r\n\r\n if (client.getNotifTimelineSet()) {\r\n client.reEmitter.reEmit(client.getNotifTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\r\n }\r\n}\r\n/**\r\n * @param {string} roomId\r\n * @return {Room}\r\n */\r\n\r\n\r\nSyncApi.prototype.createRoom = function (roomId) {\r\n const client = this.client;\r\n const {\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n } = client;\r\n const room = new _room.Room(roomId, client, client.getUserId(), {\r\n lazyLoadMembers: this.opts.lazyLoadMembers,\r\n pendingEventOrdering: this.opts.pendingEventOrdering,\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n });\r\n client.reEmitter.reEmit(room, [\"Room.name\", \"Room.avatar\", \"Room.timeline\", \"Room.redaction\", \"Room.redactionCancelled\", \"Room.receipt\", \"Room.tags\", \"Room.timelineReset\", \"Room.localEchoUpdated\", \"Room.accountData\", \"Room.myMembership\", \"Room.replaceEvent\"]);\r\n\r\n this._registerStateListeners(room);\r\n\r\n return room;\r\n};\r\n/**\r\n * @param {string} groupId\r\n * @return {Group}\r\n */\r\n\r\n\r\nSyncApi.prototype.createGroup = function (groupId) {\r\n const client = this.client;\r\n const group = new _group.Group(groupId);\r\n client.reEmitter.reEmit(group, [\"Group.profile\", \"Group.myMembership\"]);\r\n client.store.storeGroup(group);\r\n return group;\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._registerStateListeners = function (room) {\r\n const client = this.client; // we need to also re-emit room state and room member events, so hook it up\r\n // to the client now. We need to add a listener for RoomState.members in\r\n // order to hook them correctly. (TODO: find a better way?)\r\n\r\n client.reEmitter.reEmit(room.currentState, [\"RoomState.events\", \"RoomState.members\", \"RoomState.newMember\"]);\r\n room.currentState.on(\"RoomState.newMember\", function (event, state, member) {\r\n member.user = client.getUser(member.userId);\r\n client.reEmitter.reEmit(member, [\"RoomMember.name\", \"RoomMember.typing\", \"RoomMember.powerLevel\", \"RoomMember.membership\"]);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._deregisterStateListeners = function (room) {\r\n // could do with a better way of achieving this.\r\n room.currentState.removeAllListeners(\"RoomState.events\");\r\n room.currentState.removeAllListeners(\"RoomState.members\");\r\n room.currentState.removeAllListeners(\"RoomState.newMember\");\r\n};\r\n/**\r\n * Sync rooms the user has left.\r\n * @return {Promise} Resolved when they've been added to the store.\r\n */\r\n\r\n\r\nSyncApi.prototype.syncLeftRooms = function () {\r\n const client = this.client;\r\n const self = this; // grab a filter with limit=1 and include_leave=true\r\n\r\n const filter = new _filter.Filter(this.client.credentials.userId);\r\n filter.setTimelineLimit(1);\r\n filter.setIncludeLeaveRooms(true);\r\n const localTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;\r\n const qps = {\r\n timeout: 0 // don't want to block since this is a single isolated req\r\n\r\n };\r\n return client.getOrCreateFilter(getFilterName(client.credentials.userId, \"LEFT_ROOMS\"), filter).then(function (filterId) {\r\n qps.filter = filterId;\r\n return client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, localTimeoutMs);\r\n }).then(function (data) {\r\n let leaveRooms = [];\r\n\r\n if (data.rooms && data.rooms.leave) {\r\n leaveRooms = self._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n\r\n const rooms = [];\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n rooms.push(room);\r\n\r\n if (!leaveObj.isBrandNewRoom) {\r\n // the intention behind syncLeftRooms is to add in rooms which were\r\n // *omitted* from the initial /sync. Rooms the user were joined to\r\n // but then left whilst the app is running will appear in this list\r\n // and we do not want to bother with them since they will have the\r\n // current state already (and may get dupe messages if we add\r\n // yet more timeline events!), so skip them.\r\n // NB: When we persist rooms to localStorage this will be more\r\n // complicated...\r\n return;\r\n }\r\n\r\n leaveObj.timeline = leaveObj.timeline || {};\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room); // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n\r\n\r\n room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n });\r\n return rooms;\r\n });\r\n};\r\n/**\r\n * Peek into a room. This will result in the room in question being synced so it\r\n * is accessible via getRooms(). Live updates for the room will be provided.\r\n * @param {string} roomId The room ID to peek into.\r\n * @return {Promise} A promise which resolves once the room has been added to the\r\n * store.\r\n */\r\n\r\n\r\nSyncApi.prototype.peek = function (roomId) {\r\n if (this._peekRoom && this._peekRoom.roomId === roomId) {\r\n return Promise.resolve(this._peekRoom);\r\n }\r\n\r\n const client = this.client;\r\n this._peekRoom = this.createRoom(roomId);\r\n return this.client.roomInitialSync(roomId, 20).then(response => {\r\n // make sure things are init'd\r\n response.messages = response.messages || {};\r\n response.messages.chunk = response.messages.chunk || [];\r\n response.state = response.state || []; // FIXME: Mostly duplicated from _processRoomEvents but not entirely\r\n // because \"state\" in this API is at the BEGINNING of the chunk\r\n\r\n const oldStateEvents = utils.map(utils.deepCopy(response.state), client.getEventMapper());\r\n const stateEvents = utils.map(response.state, client.getEventMapper());\r\n const messages = utils.map(response.messages.chunk, client.getEventMapper()); // XXX: copypasted from /sync until we kill off this\r\n // minging v1 API stuff)\r\n // handle presence events (User objects)\r\n\r\n if (response.presence && utils.isArray(response.presence)) {\r\n response.presence.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // set the pagination token before adding the events in case people\r\n // fire off pagination requests in response to the Room.timeline\r\n // events.\r\n\r\n\r\n if (response.messages.start) {\r\n this._peekRoom.oldState.paginationToken = response.messages.start;\r\n } // set the state of the room to as it was after the timeline executes\r\n\r\n\r\n this._peekRoom.oldState.setStateEvents(oldStateEvents);\r\n\r\n this._peekRoom.currentState.setStateEvents(stateEvents);\r\n\r\n this._resolveInvites(this._peekRoom);\r\n\r\n this._peekRoom.recalculate(); // roll backwards to diverge old state. addEventsToTimeline\r\n // will overwrite the pagination token, so make sure it overwrites\r\n // it with the right thing.\r\n\r\n\r\n this._peekRoom.addEventsToTimeline(messages.reverse(), true, this._peekRoom.getLiveTimeline(), response.messages.start);\r\n\r\n client.store.storeRoom(this._peekRoom);\r\n client.emit(\"Room\", this._peekRoom);\r\n\r\n this._peekPoll(this._peekRoom);\r\n\r\n return this._peekRoom;\r\n });\r\n};\r\n/**\r\n * Stop polling for updates in the peeked room. NOPs if there is no room being\r\n * peeked.\r\n */\r\n\r\n\r\nSyncApi.prototype.stopPeeking = function () {\r\n this._peekRoom = null;\r\n};\r\n/**\r\n * Do a peek room poll.\r\n * @param {Room} peekRoom\r\n * @param {string?} token from= token\r\n */\r\n\r\n\r\nSyncApi.prototype._peekPoll = function (peekRoom, token) {\r\n if (this._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n }\r\n\r\n const self = this; // FIXME: gut wrenching; hard-coded timeout values\r\n\r\n this.client._http.authedRequest(undefined, \"GET\", \"/events\", {\r\n room_id: peekRoom.roomId,\r\n timeout: 30 * 1000,\r\n from: token\r\n }, undefined, 50 * 1000).then(function (res) {\r\n if (self._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n } // We have a problem that we get presence both from /events and /sync\r\n // however, /sync only returns presence for users in rooms\r\n // you're actually joined to.\r\n // in order to be sure to get presence for all of the users in the\r\n // peeked room, we handle presence explicitly here. This may result\r\n // in duplicate presence events firing for some users, which is a\r\n // performance drain, but such is life.\r\n // XXX: copypasted from /sync until we can kill this minging v1 stuff.\r\n\r\n\r\n res.chunk.filter(function (e) {\r\n return e.type === \"m.presence\";\r\n }).map(self.client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = self.client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(self.client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n self.client.store.storeUser(user);\r\n }\r\n\r\n self.client.emit(\"event\", presenceEvent);\r\n }); // strip out events which aren't for the given room_id (e.g presence)\r\n // and also ephemeral events (which we're assuming is anything without\r\n // and event ID because the /events API doesn't separate them).\r\n\r\n const events = res.chunk.filter(function (e) {\r\n return e.room_id === peekRoom.roomId && e.event_id;\r\n }).map(self.client.getEventMapper());\r\n peekRoom.addLiveEvents(events);\r\n\r\n self._peekPoll(peekRoom, res.end);\r\n }, function (err) {\r\n _logger.logger.error(\"[%s] Peek poll failed: %s\", peekRoom.roomId, err);\r\n\r\n setTimeout(function () {\r\n self._peekPoll(peekRoom, token);\r\n }, 30 * 1000);\r\n });\r\n};\r\n/**\r\n * Returns the current state of this sync object\r\n * @see module:client~MatrixClient#event:\"sync\"\r\n * @return {?String}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncState = function () {\r\n return this._syncState;\r\n};\r\n/**\r\n * Returns the additional data object associated with\r\n * the current sync state, or null if there is no\r\n * such data.\r\n * Sync errors, if available, are put in the 'error' key of\r\n * this object.\r\n * @return {?Object}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncStateData = function () {\r\n return this._syncStateData;\r\n};\r\n\r\nSyncApi.prototype.recoverFromSyncStartupError = async function (savedSyncPromise, err) {\r\n // Wait for the saved sync to complete - we send the pushrules and filter requests\r\n // before the saved sync has finished so they can run in parallel, but only process\r\n // the results after the saved sync is done. Equivalently, we wait for it to finish\r\n // before reporting failures from these functions.\r\n await savedSyncPromise;\r\n\r\n const keepaliveProm = this._startKeepAlives();\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n\r\n await keepaliveProm;\r\n};\r\n/**\r\n * Is the lazy loading option different than in previous session?\r\n * @param {bool} lazyLoadMembers current options for lazy loading\r\n * @return {bool} whether or not the option has changed compared to the previous session */\r\n\r\n\r\nSyncApi.prototype._wasLazyLoadingToggled = async function (lazyLoadMembers) {\r\n lazyLoadMembers = !!lazyLoadMembers; // assume it was turned off before\r\n // if we don't know any better\r\n\r\n let lazyLoadMembersBefore = false;\r\n const isStoreNewlyCreated = await this.client.store.isNewlyCreated();\r\n\r\n if (!isStoreNewlyCreated) {\r\n const prevClientOptions = await this.client.store.getClientOptions();\r\n\r\n if (prevClientOptions) {\r\n lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers;\r\n }\r\n\r\n return lazyLoadMembersBefore !== lazyLoadMembers;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nSyncApi.prototype._shouldAbortSync = function (error) {\r\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\r\n // The logout already happened, we just need to stop.\r\n _logger.logger.warn(\"Token no longer valid - assuming logout\");\r\n\r\n this.stop();\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n/**\r\n * Main entry point\r\n */\r\n\r\n\r\nSyncApi.prototype.sync = function () {\r\n const client = this.client;\r\n const self = this;\r\n this._running = true;\r\n\r\n if (global.window && global.window.addEventListener) {\r\n this._onOnlineBound = this._onOnline.bind(this);\r\n global.window.addEventListener(\"online\", this._onOnlineBound, false);\r\n }\r\n\r\n let savedSyncPromise = Promise.resolve();\r\n let savedSyncToken = null; // We need to do one-off checks before we can begin the /sync loop.\r\n // These are:\r\n // 1) We need to get push rules so we can check if events should bing as we get\r\n // them from /sync.\r\n // 2) We need to get/create a filter which we can use for /sync.\r\n // 3) We need to check the lazy loading option matches what was used in the\r\n // stored sync. If it doesn't, we can't use the stored sync.\r\n\r\n async function getPushRules() {\r\n try {\r\n debuglog(\"Getting push rules...\");\r\n const result = await client.getPushRules();\r\n debuglog(\"Got push rules\");\r\n client.pushRules = result;\r\n } catch (err) {\r\n _logger.logger.error(\"Getting push rules failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying push rules...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getPushRules();\r\n return;\r\n }\r\n\r\n checkLazyLoadStatus(); // advance to the next stage\r\n }\r\n\r\n function buildDefaultFilter() {\r\n const filter = new _filter.Filter(client.credentials.userId);\r\n filter.setTimelineLimit(self.opts.initialSyncLimit);\r\n return filter;\r\n }\r\n\r\n const checkLazyLoadStatus = async () => {\r\n debuglog(\"Checking lazy load status...\");\r\n\r\n if (this.opts.lazyLoadMembers && client.isGuest()) {\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers) {\r\n debuglog(\"Checking server lazy load support...\");\r\n const supported = await client.doesServerSupportLazyLoading();\r\n\r\n if (supported) {\r\n debuglog(\"Enabling lazy load on sync filter...\");\r\n\r\n if (!this.opts.filter) {\r\n this.opts.filter = buildDefaultFilter();\r\n }\r\n\r\n this.opts.filter.setLazyLoadMembers(true);\r\n } else {\r\n debuglog(\"LL: lazy loading requested but not supported \" + \"by server, so disabling\");\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n } // need to vape the store when enabling LL and wasn't enabled before\r\n\r\n\r\n debuglog(\"Checking whether lazy loading has changed in store...\");\r\n const shouldClear = await this._wasLazyLoadingToggled(this.opts.lazyLoadMembers);\r\n\r\n if (shouldClear) {\r\n this._storeIsInvalid = true;\r\n const reason = _errors.InvalidStoreError.TOGGLED_LAZY_LOADING;\r\n const error = new _errors.InvalidStoreError(reason, !!this.opts.lazyLoadMembers);\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error\r\n }); // bail out of the sync loop now: the app needs to respond to this error.\r\n // we leave the state as 'ERROR' which isn't great since this normally means\r\n // we're retrying. The client must be stopped before clearing the stores anyway\r\n // so the app should stop the client, clear the store and start it again.\r\n\r\n\r\n _logger.logger.warn(\"InvalidStoreError: store is not usable: stopping sync.\");\r\n\r\n return;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers && this.opts.crypto) {\r\n this.opts.crypto.enableLazyLoading();\r\n }\r\n\r\n try {\r\n debuglog(\"Storing client options...\");\r\n await this.client._storeClientOptions();\r\n debuglog(\"Stored client options\");\r\n } catch (err) {\r\n _logger.logger.error(\"Storing client options failed\", err);\r\n\r\n throw err;\r\n }\r\n\r\n getFilter(); // Now get the filter and start syncing\r\n };\r\n\r\n async function getFilter() {\r\n debuglog(\"Getting filter...\");\r\n let filter;\r\n\r\n if (self.opts.filter) {\r\n filter = self.opts.filter;\r\n } else {\r\n filter = buildDefaultFilter();\r\n }\r\n\r\n let filterId;\r\n\r\n try {\r\n filterId = await client.getOrCreateFilter(getFilterName(client.credentials.userId), filter);\r\n } catch (err) {\r\n _logger.logger.error(\"Getting filter failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying filter...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getFilter();\r\n return;\r\n } // reset the notifications timeline to prepare it to paginate from\r\n // the current point in time.\r\n // The right solution would be to tie /sync pagination tokens into\r\n // /notifications API somehow.\r\n\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n if (self._currentSyncRequest === null) {\r\n // Send this first sync request here so we can then wait for the saved\r\n // sync data to finish processing before we process the results of this one.\r\n debuglog(\"Sending first sync request...\");\r\n self._currentSyncRequest = self._doSyncRequest({\r\n filterId\r\n }, savedSyncToken);\r\n } // Now wait for the saved sync to finish...\r\n\r\n\r\n debuglog(\"Waiting for saved sync before starting sync processing...\");\r\n await savedSyncPromise;\r\n\r\n self._sync({\r\n filterId\r\n });\r\n }\r\n\r\n if (client.isGuest()) {\r\n // no push rules for guests, no access to POST filter for guests.\r\n self._sync({});\r\n } else {\r\n // Pull the saved sync token out first, before the worker starts sending\r\n // all the sync data which could take a while. This will let us send our\r\n // first incremental sync request before we've processed our saved data.\r\n debuglog(\"Getting saved sync token...\");\r\n savedSyncPromise = client.store.getSavedSyncToken().then(tok => {\r\n debuglog(\"Got saved sync token\");\r\n savedSyncToken = tok;\r\n debuglog(\"Getting saved sync...\");\r\n return client.store.getSavedSync();\r\n }).then(savedSync => {\r\n debuglog(`Got reply from saved sync, exists? ${!!savedSync}`);\r\n\r\n if (savedSync) {\r\n return self._syncFromCache(savedSync);\r\n }\r\n }).catch(err => {\r\n _logger.logger.error(\"Getting saved sync failed\", err);\r\n }); // Now start the first incremental sync request: this can also\r\n // take a while so if we set it going now, we can wait for it\r\n // to finish while we process our saved sync data.\r\n\r\n getPushRules();\r\n }\r\n};\r\n/**\r\n * Stops the sync object from syncing.\r\n */\r\n\r\n\r\nSyncApi.prototype.stop = function () {\r\n debuglog(\"SyncApi.stop\");\r\n\r\n if (global.window) {\r\n global.window.removeEventListener(\"online\", this._onOnlineBound, false);\r\n this._onOnlineBound = undefined;\r\n }\r\n\r\n this._running = false;\r\n\r\n if (this._currentSyncRequest) {\r\n this._currentSyncRequest.abort();\r\n }\r\n\r\n if (this._keepAliveTimer) {\r\n clearTimeout(this._keepAliveTimer);\r\n this._keepAliveTimer = null;\r\n }\r\n};\r\n/**\r\n * Retry a backed off syncing request immediately. This should only be used when\r\n * the user explicitly attempts to retry their lost connection.\r\n * @return {boolean} True if this resulted in a request being retried.\r\n */\r\n\r\n\r\nSyncApi.prototype.retryImmediately = function () {\r\n if (!this._connectionReturnedDefer) {\r\n return false;\r\n }\r\n\r\n this._startKeepAlives(0);\r\n\r\n return true;\r\n};\r\n/**\r\n * Process a single set of cached sync data.\r\n * @param {Object} savedSync a saved sync that was persisted by a store. This\r\n * should have been acquired via client.store.getSavedSync().\r\n */\r\n\r\n\r\nSyncApi.prototype._syncFromCache = async function (savedSync) {\r\n debuglog(\"sync(): not doing HTTP hit, instead returning stored /sync data\");\r\n const nextSyncToken = savedSync.nextBatch; // Set sync token for future incremental syncing\r\n\r\n this.client.store.setSyncToken(nextSyncToken); // No previous sync, set old token to null\r\n\r\n const syncEventData = {\r\n oldSyncToken: null,\r\n nextSyncToken,\r\n catchingUp: false,\r\n fromCache: true\r\n };\r\n const data = {\r\n next_batch: nextSyncToken,\r\n rooms: savedSync.roomsData,\r\n groups: savedSync.groupsData,\r\n account_data: {\r\n events: savedSync.accountData\r\n }\r\n };\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n _logger.logger.error(\"Error processing cached sync\", e.stack || e);\r\n } // Don't emit a prepared if we've bailed because the store is invalid:\r\n // in this case the client will not be usable until stopped & restarted\r\n // so this would be useless and misleading.\r\n\r\n\r\n if (!this._storeIsInvalid) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n }\r\n};\r\n/**\r\n * Invoke me to do /sync calls\r\n * @param {Object} syncOptions\r\n * @param {string} syncOptions.filterId\r\n * @param {boolean} syncOptions.hasSyncedBefore\r\n */\r\n\r\n\r\nSyncApi.prototype._sync = async function (syncOptions) {\r\n const client = this.client;\r\n\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting.\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n const syncToken = client.store.getSyncToken();\r\n let data;\r\n\r\n try {\r\n //debuglog('Starting sync since=' + syncToken);\r\n if (this._currentSyncRequest === null) {\r\n this._currentSyncRequest = this._doSyncRequest(syncOptions, syncToken);\r\n }\r\n\r\n data = await this._currentSyncRequest;\r\n } catch (e) {\r\n this._onSyncError(e, syncOptions);\r\n\r\n return;\r\n } finally {\r\n this._currentSyncRequest = null;\r\n } //debuglog('Completed sync, next_batch=' + data.next_batch);\r\n // set the sync token NOW *before* processing the events. We do this so\r\n // if something barfs on an event we can skip it rather than constantly\r\n // polling with the same token.\r\n\r\n\r\n client.store.setSyncToken(data.next_batch); // Reset after a successful sync\r\n\r\n this._failedSyncCount = 0;\r\n await client.store.setSyncData(data);\r\n const syncEventData = {\r\n oldSyncToken: syncToken,\r\n nextSyncToken: data.next_batch,\r\n catchingUp: this._catchingUp\r\n };\r\n\r\n if (this.opts.crypto) {\r\n // tell the crypto module we're about to process a sync\r\n // response\r\n await this.opts.crypto.onSyncWillProcess(syncEventData);\r\n }\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n // log the exception with stack if we have it, else fall back\r\n // to the plain description\r\n _logger.logger.error(\"Caught /sync error\", e.stack || e); // Emit the exception for client handling\r\n\r\n\r\n this.client.emit(\"sync.unexpectedError\", e);\r\n } // update this as it may have changed\r\n\r\n\r\n syncEventData.catchingUp = this._catchingUp; // emit synced events\r\n\r\n if (!syncOptions.hasSyncedBefore) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n\r\n syncOptions.hasSyncedBefore = true;\r\n } // tell the crypto module to do its processing. It may block (to do a\r\n // /keys/changes request).\r\n\r\n\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.onSyncCompleted(syncEventData);\r\n } // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates\r\n\r\n\r\n this._updateSyncState(\"SYNCING\", syncEventData);\r\n\r\n if (client.store.wantsSave()) {\r\n // We always save the device list (if it's dirty) before saving the sync data:\r\n // this means we know the saved device list data is at least as fresh as the\r\n // stored sync data which means we don't have to worry that we may have missed\r\n // device changes. We can also skip the delay since we're not calling this very\r\n // frequently (and we don't really want to delay the sync for it).\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.saveDeviceList(0);\r\n } // tell databases that everything is now in a consistent state and can be saved.\r\n\r\n\r\n client.store.save();\r\n } // Begin next sync\r\n\r\n\r\n this._sync(syncOptions);\r\n};\r\n\r\nSyncApi.prototype._doSyncRequest = function (syncOptions, syncToken) {\r\n const qps = this._getSyncParams(syncOptions, syncToken);\r\n\r\n return this.client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, qps.timeout + BUFFER_PERIOD_MS);\r\n};\r\n\r\nSyncApi.prototype._getSyncParams = function (syncOptions, syncToken) {\r\n let pollTimeout = this.opts.pollTimeout;\r\n\r\n if (this.getSyncState() !== 'SYNCING' || this._catchingUp) {\r\n // unless we are happily syncing already, we want the server to return\r\n // as quickly as possible, even if there are no events queued. This\r\n // serves two purposes:\r\n //\r\n // * When the connection dies, we want to know asap when it comes back,\r\n // so that we can hide the error from the user. (We don't want to\r\n // have to wait for an event or a timeout).\r\n //\r\n // * We want to know if the server has any to_device messages queued up\r\n // for us. We do that by calling it with a zero timeout until it\r\n // doesn't give us any more to_device messages.\r\n this._catchingUp = true;\r\n pollTimeout = 0;\r\n }\r\n\r\n let filterId = syncOptions.filterId;\r\n\r\n if (this.client.isGuest() && !filterId) {\r\n filterId = this._getGuestFilter();\r\n }\r\n\r\n const qps = {\r\n filter: filterId,\r\n timeout: pollTimeout\r\n };\r\n\r\n if (this.opts.disablePresence) {\r\n qps.set_presence = \"offline\";\r\n }\r\n\r\n if (syncToken) {\r\n qps.since = syncToken;\r\n } else {\r\n // use a cachebuster for initialsyncs, to make sure that\r\n // we don't get a stale sync\r\n // (https://github.com/vector-im/vector-web/issues/1354)\r\n qps._cacheBuster = Date.now();\r\n }\r\n\r\n if (this.getSyncState() == 'ERROR' || this.getSyncState() == 'RECONNECTING') {\r\n // we think the connection is dead. If it comes back up, we won't know\r\n // about it till /sync returns. If the timeout= is high, this could\r\n // be a long time. Set it to 0 when doing retries so we don't have to wait\r\n // for an event or a timeout before emiting the SYNCING event.\r\n qps.timeout = 0;\r\n }\r\n\r\n return qps;\r\n};\r\n\r\nSyncApi.prototype._onSyncError = function (err, syncOptions) {\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n _logger.logger.error(\"/sync error %s\", err);\r\n\r\n _logger.logger.error(err);\r\n\r\n if (this._shouldAbortSync(err)) {\r\n return;\r\n }\r\n\r\n this._failedSyncCount++;\r\n\r\n _logger.logger.log('Number of consecutive failed sync requests:', this._failedSyncCount);\r\n\r\n debuglog(\"Starting keep-alive\"); // Note that we do *not* mark the sync connection as\r\n // lost yet: we only do this if a keepalive poke\r\n // fails, since long lived HTTP connections will\r\n // go away sometimes and we shouldn't treat this as\r\n // erroneous. We set the state to 'reconnecting'\r\n // instead, so that clients can observe this state\r\n // if they wish.\r\n\r\n this._startKeepAlives().then(connDidFail => {\r\n // Only emit CATCHUP if we detected a connectivity error: if we didn't,\r\n // it's quite likely the sync will fail again for the same reason and we\r\n // want to stay in ERROR rather than keep flip-flopping between ERROR\r\n // and CATCHUP.\r\n if (connDidFail && this.getSyncState() === 'ERROR') {\r\n this._updateSyncState(\"CATCHUP\", {\r\n oldSyncToken: null,\r\n nextSyncToken: null,\r\n catchingUp: true\r\n });\r\n }\r\n\r\n this._sync(syncOptions);\r\n });\r\n\r\n this._currentSyncRequest = null; // Transition from RECONNECTING to ERROR after a given number of failed syncs\r\n\r\n this._updateSyncState(this._failedSyncCount >= FAILED_SYNC_ERROR_THRESHOLD ? \"ERROR\" : \"RECONNECTING\", {\r\n error: err\r\n });\r\n};\r\n/**\r\n * Process data returned from a sync response and propagate it\r\n * into the model objects\r\n *\r\n * @param {Object} syncEventData Object containing sync tokens associated with this sync\r\n * @param {Object} data The response from /sync\r\n */\r\n\r\n\r\nSyncApi.prototype._processSyncResponse = async function (syncEventData, data) {\r\n const client = this.client;\r\n const self = this; // data looks like:\r\n // {\r\n // next_batch: $token,\r\n // presence: { events: [] },\r\n // account_data: { events: [] },\r\n // device_lists: { changed: [\"@user:server\", ... ]},\r\n // to_device: { events: [] },\r\n // device_one_time_keys_count: { signed_curve25519: 42 },\r\n // rooms: {\r\n // invite: {\r\n // $roomid: {\r\n // invite_state: { events: [] }\r\n // }\r\n // },\r\n // join: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token, limited: true },\r\n // ephemeral: { events: [] },\r\n // summary: {\r\n // m.heroes: [ $user_id ],\r\n // m.joined_member_count: $count,\r\n // m.invited_member_count: $count\r\n // },\r\n // account_data: { events: [] },\r\n // unread_notifications: {\r\n // highlight_count: 0,\r\n // notification_count: 0,\r\n // }\r\n // }\r\n // },\r\n // leave: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token }\r\n // }\r\n // }\r\n // },\r\n // groups: {\r\n // invite: {\r\n // $groupId: {\r\n // inviter: $inviter,\r\n // profile: {\r\n // avatar_url: $avatarUrl,\r\n // name: $groupName,\r\n // },\r\n // },\r\n // },\r\n // join: {},\r\n // leave: {},\r\n // },\r\n // }\r\n // TODO-arch:\r\n // - Each event we pass through needs to be emitted via 'event', can we\r\n // do this in one place?\r\n // - The isBrandNewRoom boilerplate is boilerplatey.\r\n // handle presence events (User objects)\r\n\r\n if (data.presence && utils.isArray(data.presence.events)) {\r\n data.presence.events.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getSender());\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getSender());\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // handle non-room account_data\r\n\r\n\r\n if (data.account_data && utils.isArray(data.account_data.events)) {\r\n const events = data.account_data.events.map(client.getEventMapper());\r\n const prevEventsMap = events.reduce((m, c) => {\r\n m[c.getId()] = client.store.getAccountData(c.getType());\r\n return m;\r\n }, {});\r\n client.store.storeAccountDataEvents(events);\r\n events.forEach(function (accountDataEvent) {\r\n // Honour push rules that come down the sync stream but also\r\n // honour push rules that were previously cached. Base rules\r\n // will be updated when we receive push rules via getPushRules\r\n // (see SyncApi.prototype.sync) before syncing over the network.\r\n if (accountDataEvent.getType() === 'm.push_rules') {\r\n const rules = accountDataEvent.getContent();\r\n client.pushRules = _pushprocessor.PushProcessor.rewriteDefaultRules(rules);\r\n }\r\n\r\n const prevEvent = prevEventsMap[accountDataEvent.getId()];\r\n client.emit(\"accountData\", accountDataEvent, prevEvent);\r\n return accountDataEvent;\r\n });\r\n } // handle to-device events\r\n\r\n\r\n if (data.to_device && utils.isArray(data.to_device.events) && data.to_device.events.length > 0) {\r\n const cancelledKeyVerificationTxns = [];\r\n data.to_device.events.map(client.getEventMapper()).map(toDeviceEvent => {\r\n // map is a cheap inline forEach\r\n // We want to flag m.key.verification.start events as cancelled\r\n // if there's an accompanying m.key.verification.cancel event, so\r\n // we pull out the transaction IDs from the cancellation events\r\n // so we can flag the verification events as cancelled in the loop\r\n // below.\r\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\r\n const txnId = toDeviceEvent.getContent()['transaction_id'];\r\n\r\n if (txnId) {\r\n cancelledKeyVerificationTxns.push(txnId);\r\n }\r\n } // as mentioned above, .map is a cheap inline forEach, so return\r\n // the unmodified event.\r\n\r\n\r\n return toDeviceEvent;\r\n }).forEach(function (toDeviceEvent) {\r\n const content = toDeviceEvent.getContent();\r\n\r\n if (toDeviceEvent.getType() == \"m.room.message\" && content.msgtype == \"m.bad.encrypted\") {\r\n // the mapper already logged a warning.\r\n _logger.logger.log('Ignoring undecryptable to-device event from ' + toDeviceEvent.getSender());\r\n\r\n return;\r\n }\r\n\r\n if (toDeviceEvent.getType() === \"m.key.verification.start\" || toDeviceEvent.getType() === \"m.key.verification.request\") {\r\n const txnId = content['transaction_id'];\r\n\r\n if (cancelledKeyVerificationTxns.includes(txnId)) {\r\n toDeviceEvent.flagCancelled();\r\n }\r\n }\r\n\r\n client.emit(\"toDeviceEvent\", toDeviceEvent);\r\n });\r\n } else {\r\n // no more to-device events: we can stop polling with a short timeout.\r\n this._catchingUp = false;\r\n }\r\n\r\n if (data.groups) {\r\n if (data.groups.invite) {\r\n this._processGroupSyncEntry(data.groups.invite, 'invite');\r\n }\r\n\r\n if (data.groups.join) {\r\n this._processGroupSyncEntry(data.groups.join, 'join');\r\n }\r\n\r\n if (data.groups.leave) {\r\n this._processGroupSyncEntry(data.groups.leave, 'leave');\r\n }\r\n } // the returned json structure is a bit crap, so make it into a\r\n // nicer form (array) after applying sanity to make sure we don't fail\r\n // on missing keys (on the off chance)\r\n\r\n\r\n let inviteRooms = [];\r\n let joinRooms = [];\r\n let leaveRooms = [];\r\n\r\n if (data.rooms) {\r\n if (data.rooms.invite) {\r\n inviteRooms = this._mapSyncResponseToRoomArray(data.rooms.invite);\r\n }\r\n\r\n if (data.rooms.join) {\r\n joinRooms = this._mapSyncResponseToRoomArray(data.rooms.join);\r\n }\r\n\r\n if (data.rooms.leave) {\r\n leaveRooms = this._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n }\r\n\r\n this._notifEvents = []; // Handle invites\r\n\r\n inviteRooms.forEach(function (inviteObj) {\r\n const room = inviteObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(inviteObj.invite_state, room);\r\n\r\n self._processRoomEvents(room, stateEvents);\r\n\r\n if (inviteObj.isBrandNewRoom) {\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"invite\");\r\n }); // Handle joins\r\n\r\n await utils.promiseMapSeries(joinRooms, async function (joinObj) {\r\n const room = joinObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(joinObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(joinObj.timeline, room);\r\n\r\n const ephemeralEvents = self._mapSyncEventsFormat(joinObj.ephemeral);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(joinObj.account_data); // we do this first so it's correct when any of the events fire\r\n\r\n\r\n if (joinObj.unread_notifications) {\r\n room.setUnreadNotificationCount('total', joinObj.unread_notifications.notification_count); // We track unread notifications ourselves in encrypted rooms, so don't\r\n // bother setting it here. We trust our calculations better than the\r\n // server's for this case, and therefore will assume that our non-zero\r\n // count is accurate.\r\n\r\n const encrypted = client.isRoomEncrypted(room.roomId);\r\n\r\n if (!encrypted || encrypted && room.getUnreadNotificationCount('highlight') <= 0) {\r\n room.setUnreadNotificationCount('highlight', joinObj.unread_notifications.highlight_count);\r\n }\r\n }\r\n\r\n joinObj.timeline = joinObj.timeline || {};\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n room.getLiveTimeline().setPaginationToken(joinObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n } else if (joinObj.timeline.limited) {\r\n let limited = true; // we've got a limited sync, so we *probably* have a gap in the\r\n // timeline, so should reset. But we might have been peeking or\r\n // paginating and already have some of the events, in which\r\n // case we just want to append any subsequent events to the end\r\n // of the existing timeline.\r\n //\r\n // This is particularly important in the case that we already have\r\n // *all* of the events in the timeline - in that case, if we reset\r\n // the timeline, we'll end up with an entirely empty timeline,\r\n // which we'll try to paginate but not get any new events (which\r\n // will stop us linking the empty timeline into the chain).\r\n //\r\n\r\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\r\n const eventId = timelineEvents[i].getId();\r\n\r\n if (room.getTimelineForEvent(eventId)) {\r\n debuglog(\"Already have event \" + eventId + \" in limited \" + \"sync - not resetting\");\r\n limited = false; // we might still be missing some of the events before i;\r\n // we don't want to be adding them to the end of the\r\n // timeline because that would put them out of order.\r\n\r\n timelineEvents.splice(0, i); // XXX: there's a problem here if the skipped part of the\r\n // timeline modifies the state set in stateEvents, because\r\n // we'll end up using the state from stateEvents rather\r\n // than the later state from timelineEvents. We probably\r\n // need to wind stateEvents forward over the events we're\r\n // skipping.\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (limited) {\r\n self._deregisterStateListeners(room);\r\n\r\n room.resetLiveTimeline(joinObj.timeline.prev_batch, self.opts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken); // We have to assume any gap in any timeline is\r\n // reason to stop incrementally tracking notifications and\r\n // reset the timeline.\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n self._registerStateListeners(room);\r\n }\r\n }\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache); // set summary after processing events,\r\n // because it will trigger a name calculation\r\n // which needs the room state to be up to date\r\n\r\n\r\n if (joinObj.summary) {\r\n room.setSummary(joinObj.summary);\r\n } // we deliberately don't add ephemeral events to the timeline\r\n\r\n\r\n room.addEphemeralEvents(ephemeralEvents); // we deliberately don't add accountData to the timeline\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n async function processRoomEvent(e) {\r\n client.emit(\"event\", e);\r\n\r\n if (e.isState() && e.getType() == \"m.room.encryption\" && self.opts.crypto) {\r\n await self.opts.crypto.onCryptoEvent(e);\r\n }\r\n\r\n if (e.isState() && e.getType() === \"im.vector.user_status\") {\r\n let user = client.store.getUser(e.getStateKey());\r\n\r\n if (user) {\r\n user._unstable_updateStatusMessage(e);\r\n } else {\r\n user = createNewUser(client, e.getStateKey());\r\n\r\n user._unstable_updateStatusMessage(e);\r\n\r\n client.store.storeUser(user);\r\n }\r\n }\r\n }\r\n\r\n await utils.promiseMapSeries(stateEvents, processRoomEvent);\r\n await utils.promiseMapSeries(timelineEvents, processRoomEvent);\r\n ephemeralEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"join\");\r\n }); // Handle leaves (e.g. kicked rooms)\r\n\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(leaveObj.account_data);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (leaveObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n timelineEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"leave\");\r\n }); // update the notification timeline, if appropriate.\r\n // we only do this for live events, as otherwise we can't order them sanely\r\n // in the timeline relative to ones paginated in by /notifications.\r\n // XXX: we could fix this by making EventTimeline support chronological\r\n // ordering... but it doesn't, right now.\r\n\r\n if (syncEventData.oldSyncToken && this._notifEvents.length) {\r\n this._notifEvents.sort(function (a, b) {\r\n return a.getTs() - b.getTs();\r\n });\r\n\r\n this._notifEvents.forEach(function (event) {\r\n client.getNotifTimelineSet().addLiveEvent(event);\r\n });\r\n } // Handle device list updates\r\n\r\n\r\n if (data.device_lists) {\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists);\r\n } else {// FIXME if we *don't* have a crypto module, we still need to\r\n // invalidate the device lists. But that would require a\r\n // substantial bit of rework :/.\r\n }\r\n } // Handle one_time_keys_count\r\n\r\n\r\n if (this.opts.crypto && data.device_one_time_keys_count) {\r\n const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0;\r\n this.opts.crypto.updateOneTimeKeyCount(currentCount);\r\n }\r\n\r\n if (this.opts.crypto && data[\"org.matrix.msc2732.device_unused_fallback_key_types\"]) {\r\n // The presence of device_unused_fallback_key_types indicates that the\r\n // server supports fallback keys. If there's no unused\r\n // signed_curve25519 fallback key we need a new one.\r\n const unusedFallbackKeys = data[\"org.matrix.msc2732.device_unused_fallback_key_types\"];\r\n this.opts.crypto.setNeedsNewFallback(unusedFallbackKeys instanceof Array && !unusedFallbackKeys.includes(\"signed_curve25519\"));\r\n }\r\n};\r\n/**\r\n * Starts polling the connectivity check endpoint\r\n * @param {number} delay How long to delay until the first poll.\r\n * defaults to a short, randomised interval (to prevent\r\n * tightlooping if /versions succeeds but /sync etc. fail).\r\n * @return {promise} which resolves once the connection returns\r\n */\r\n\r\n\r\nSyncApi.prototype._startKeepAlives = function (delay) {\r\n if (delay === undefined) {\r\n delay = 2000 + Math.floor(Math.random() * 5000);\r\n }\r\n\r\n if (this._keepAliveTimer !== null) {\r\n clearTimeout(this._keepAliveTimer);\r\n }\r\n\r\n const self = this;\r\n\r\n if (delay > 0) {\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self), delay);\r\n } else {\r\n self._pokeKeepAlive();\r\n }\r\n\r\n if (!this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer = utils.defer();\r\n }\r\n\r\n return this._connectionReturnedDefer.promise;\r\n};\r\n/**\r\n * Make a dummy call to /_matrix/client/versions, to see if the HS is\r\n * reachable.\r\n *\r\n * On failure, schedules a call back to itself. On success, resolves\r\n * this._connectionReturnedDefer.\r\n *\r\n * @param {bool} connDidFail True if a connectivity failure has been detected. Optional.\r\n */\r\n\r\n\r\nSyncApi.prototype._pokeKeepAlive = function (connDidFail) {\r\n if (connDidFail === undefined) connDidFail = false;\r\n const self = this;\r\n\r\n function success() {\r\n clearTimeout(self._keepAliveTimer);\r\n\r\n if (self._connectionReturnedDefer) {\r\n self._connectionReturnedDefer.resolve(connDidFail);\r\n\r\n self._connectionReturnedDefer = null;\r\n }\r\n }\r\n\r\n this.client._http.request(undefined, // callback\r\n \"GET\", \"/_matrix/client/versions\", undefined, // queryParams\r\n undefined, // data\r\n {\r\n prefix: '',\r\n localTimeoutMs: 15 * 1000\r\n }).then(function () {\r\n success();\r\n }, function (err) {\r\n if (err.httpStatus == 400 || err.httpStatus == 404) {\r\n // treat this as a success because the server probably just doesn't\r\n // support /versions: point is, we're getting a response.\r\n // We wait a short time though, just in case somehow the server\r\n // is in a mode where it 400s /versions responses and sync etc.\r\n // responses fail, this will mean we don't hammer in a loop.\r\n self._keepAliveTimer = setTimeout(success, 2000);\r\n } else {\r\n connDidFail = true;\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self, connDidFail), 5000 + Math.floor(Math.random() * 5000)); // A keepalive has failed, so we emit the\r\n // error state (whether or not this is the\r\n // first failure).\r\n // Note we do this after setting the timer:\r\n // this lets the unit tests advance the mock\r\n // clock when they get the error.\r\n\r\n self._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n }\r\n });\r\n};\r\n/**\r\n * @param {Object} groupsSection Groups section object, eg. response.groups.invite\r\n * @param {string} sectionName Which section this is ('invite', 'join' or 'leave')\r\n */\r\n\r\n\r\nSyncApi.prototype._processGroupSyncEntry = function (groupsSection, sectionName) {\r\n // Processes entries from 'groups' section of the sync stream\r\n for (const groupId of Object.keys(groupsSection)) {\r\n const groupInfo = groupsSection[groupId];\r\n let group = this.client.store.getGroup(groupId);\r\n const isBrandNew = group === null;\r\n\r\n if (group === null) {\r\n group = this.createGroup(groupId);\r\n }\r\n\r\n if (groupInfo.profile) {\r\n group.setProfile(groupInfo.profile.name, groupInfo.profile.avatar_url);\r\n }\r\n\r\n if (groupInfo.inviter) {\r\n group.setInviter({\r\n userId: groupInfo.inviter\r\n });\r\n }\r\n\r\n group.setMyMembership(sectionName);\r\n\r\n if (isBrandNew) {\r\n // Now we've filled in all the fields, emit the Group event\r\n this.client.emit(\"Group\", group);\r\n }\r\n }\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @return {Object[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncResponseToRoomArray = function (obj) {\r\n // Maps { roomid: {stuff}, roomid: {stuff} }\r\n // to\r\n // [{stuff+Room+isBrandNewRoom}, {stuff+Room+isBrandNewRoom}]\r\n const client = this.client;\r\n const self = this;\r\n return utils.keys(obj).map(function (roomId) {\r\n const arrObj = obj[roomId];\r\n let room = client.store.getRoom(roomId);\r\n let isBrandNewRoom = false;\r\n\r\n if (!room) {\r\n room = self.createRoom(roomId);\r\n isBrandNewRoom = true;\r\n }\r\n\r\n arrObj.room = room;\r\n arrObj.isBrandNewRoom = isBrandNewRoom;\r\n return arrObj;\r\n });\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @param {Room} room\r\n * @return {MatrixEvent[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncEventsFormat = function (obj, room) {\r\n if (!obj || !utils.isArray(obj.events)) {\r\n return [];\r\n }\r\n\r\n const mapper = this.client.getEventMapper();\r\n return obj.events.map(function (e) {\r\n if (room) {\r\n e.room_id = room.roomId;\r\n }\r\n\r\n return mapper(e);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n */\r\n\r\n\r\nSyncApi.prototype._resolveInvites = function (room) {\r\n if (!room || !this.opts.resolveInvitesToProfiles) {\r\n return;\r\n }\r\n\r\n const client = this.client; // For each invited room member we want to give them a displayname/avatar url\r\n // if they have one (the m.room.member invites don't contain this).\r\n\r\n room.getMembersWithMembership(\"invite\").forEach(function (member) {\r\n if (member._requestedProfileInfo) {\r\n return;\r\n }\r\n\r\n member._requestedProfileInfo = true; // try to get a cached copy first.\r\n\r\n const user = client.getUser(member.userId);\r\n let promise;\r\n\r\n if (user) {\r\n promise = Promise.resolve({\r\n avatar_url: user.avatarUrl,\r\n displayname: user.displayName\r\n });\r\n } else {\r\n promise = client.getProfileInfo(member.userId);\r\n }\r\n\r\n promise.then(function (info) {\r\n // slightly naughty by doctoring the invite event but this means all\r\n // the code paths remain the same between invite/join display name stuff\r\n // which is a worthy trade-off for some minor pollution.\r\n const inviteEvent = member.events.member;\r\n\r\n if (inviteEvent.getContent().membership !== \"invite\") {\r\n // between resolving and now they have since joined, so don't clobber\r\n return;\r\n }\r\n\r\n inviteEvent.getContent().avatar_url = info.avatar_url;\r\n inviteEvent.getContent().displayname = info.displayname; // fire listeners\r\n\r\n member.setMembershipEvent(inviteEvent, room.currentState);\r\n }, function (err) {// OH WELL.\r\n });\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} stateEventList A list of state events. This is the state\r\n * at the *START* of the timeline list if it is supplied.\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processRoomEvents = function (room, stateEventList, timelineEventList, fromCache) {\r\n // If there are no events in the timeline yet, initialise it with\r\n // the given state events\r\n const liveTimeline = room.getLiveTimeline();\r\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\r\n\r\n if (timelineWasEmpty) {\r\n // Passing these events into initialiseState will freeze them, so we need\r\n // to compute and cache the push actions for them now, otherwise sync dies\r\n // with an attempt to assign to read only property.\r\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\r\n // these functions that it shouldn't be. We should probably either store the\r\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\r\n // find some solution where MatrixEvents are immutable but allow for a cache\r\n // field.\r\n for (const ev of stateEventList) {\r\n this.client.getPushActionsForEvent(ev);\r\n }\r\n\r\n liveTimeline.initialiseState(stateEventList);\r\n }\r\n\r\n this._resolveInvites(room); // recalculate the room name at this point as adding events to the timeline\r\n // may make notifications appear which should have the right name.\r\n // XXX: This looks suspect: we'll end up recalculating the room once here\r\n // and then again after adding events (_processSyncResponse calls it after\r\n // calling us) even if no state events were added. It also means that if\r\n // one of the room events in timelineEventList is something that needs\r\n // a recalculation (like m.room.name) we won't recalculate until we've\r\n // finished adding all the events, which will cause the notification to have\r\n // the old room name rather than the new one.\r\n\r\n\r\n room.recalculate(); // If the timeline wasn't empty, we process the state events here: they're\r\n // defined as updates to the state before the start of the timeline, so this\r\n // starts to roll the state forward.\r\n // XXX: That's what we *should* do, but this can happen if we were previously\r\n // peeking in a room, in which case we obviously do *not* want to add the\r\n // state events here onto the end of the timeline. Historically, the js-sdk\r\n // has just set these new state events on the old and new state. This seems\r\n // very wrong because there could be events in the timeline that diverge the\r\n // state, in which case this is going to leave things out of sync. However,\r\n // for now I think it;s best to behave the same as the code has done previously.\r\n\r\n if (!timelineWasEmpty) {\r\n // XXX: As above, don't do this...\r\n //room.addLiveEvents(stateEventList || []);\r\n // Do this instead...\r\n room.oldState.setStateEvents(stateEventList || []);\r\n room.currentState.setStateEvents(stateEventList || []);\r\n } // execute the timeline events. This will continue to diverge the current state\r\n // if the timeline has any state events in it.\r\n // This also needs to be done before running push rules on the events as they need\r\n // to be decorated with sender etc.\r\n\r\n\r\n room.addLiveEvents(timelineEventList || [], null, fromCache);\r\n};\r\n/**\r\n * Takes a list of timelineEvents and adds and adds to _notifEvents\r\n * as appropriate.\r\n * This must be called after the room the events belong to has been stored.\r\n *\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processEventsForNotifs = function (room, timelineEventList) {\r\n // gather our notifications into this._notifEvents\r\n if (this.client.getNotifTimelineSet()) {\r\n for (let i = 0; i < timelineEventList.length; i++) {\r\n const pushActions = this.client.getPushActionsForEvent(timelineEventList[i]);\r\n\r\n if (pushActions && pushActions.notify && pushActions.tweaks && pushActions.tweaks.highlight) {\r\n this._notifEvents.push(timelineEventList[i]);\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * @return {string}\r\n */\r\n\r\n\r\nSyncApi.prototype._getGuestFilter = function () {\r\n const guestRooms = this.client._guestRooms; // FIXME: horrible gut-wrenching\r\n\r\n if (!guestRooms) {\r\n return \"{}\";\r\n } // we just need to specify the filter inline if we're a guest because guests\r\n // can't create filters.\r\n\r\n\r\n return JSON.stringify({\r\n room: {\r\n timeline: {\r\n limit: 20\r\n }\r\n }\r\n });\r\n};\r\n/**\r\n * Sets the sync state and emits an event to say so\r\n * @param {String} newState The new state string\r\n * @param {Object} data Object of additional data to emit in the event\r\n */\r\n\r\n\r\nSyncApi.prototype._updateSyncState = function (newState, data) {\r\n const old = this._syncState;\r\n this._syncState = newState;\r\n this._syncStateData = data;\r\n this.client.emit(\"sync\", this._syncState, old, data);\r\n};\r\n/**\r\n * Event handler for the 'online' event\r\n * This event is generally unreliable and precise behaviour\r\n * varies between browsers, so we poll for connectivity too,\r\n * but this might help us reconnect a little faster.\r\n */\r\n\r\n\r\nSyncApi.prototype._onOnline = function () {\r\n debuglog(\"Browser thinks we are back online\");\r\n\r\n this._startKeepAlives(0);\r\n};\r\n\r\nfunction createNewUser(client, userId) {\r\n const user = new _user.User(userId);\r\n client.reEmitter.reEmit(user, [\"User.avatarUrl\", \"User.displayName\", \"User.presence\", \"User.currentlyActive\", \"User.lastPresenceTs\"]);\r\n return user;\r\n}","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\"","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".topheader[data-v-62a1ab6a]{top:0;z-index:999}.newChat[data-v-62a1ab6a] #maincontent .headerSpacer,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapper,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapperOvf{overflow:visible!important}.newChat.minimized.active[data-v-62a1ab6a] #maincontent .desktopList{display:none}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"br[data-v-ba5ac396]{content:\\\"\\\"}.sname[data-v-ba5ac396]{font-weight:700}.listPreview[data-v-ba5ac396]{display:flex;align-items:center}.statusWrapper[data-v-ba5ac396]{padding-left:.5em}.statusWrapper .my[data-v-ba5ac396]{font-size:.6em;opacity:.5}.previewMessage[data-v-ba5ac396]{min-height:25px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar colorString = require('color-string');\nvar convert = require('color-convert');\n\nvar _slice = [].slice;\n\nvar skippedModels = [\n\t// to be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// shouldn't really be in color-convert either...\n\t'hex'\n];\n\nvar hashedModelKeys = {};\nObject.keys(convert).forEach(function (model) {\n\thashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;\n});\n\nvar limiters = {};\n\nfunction Color(obj, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tvar i;\n\tvar channels;\n\n\tif (obj == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (obj instanceof Color) {\n\t\tthis.model = obj.model;\n\t\tthis.color = obj.color.slice();\n\t\tthis.valpha = obj.valpha;\n\t} else if (typeof obj === 'string') {\n\t\tvar result = colorString.get(obj);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + obj);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (obj.length) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tvar newArr = _slice.call(obj, 0, channels);\n\t\tthis.color = zeroArray(newArr, channels);\n\t\tthis.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;\n\t} else if (typeof obj === 'number') {\n\t\t// this is always RGB - can be converted later on.\n\t\tobj &= 0xFFFFFF;\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(obj >> 16) & 0xFF,\n\t\t\t(obj >> 8) & 0xFF,\n\t\t\tobj & 0xFF\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tvar keys = Object.keys(obj);\n\t\tif ('alpha' in obj) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;\n\t\t}\n\n\t\tvar hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(obj));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tvar labels = convert[this.model].labels;\n\t\tvar color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(obj[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tvar limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString: function () {\n\t\treturn this.string();\n\t},\n\n\ttoJSON: function () {\n\t\treturn this[this.model]();\n\t},\n\n\tstring: function (places) {\n\t\tvar self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to[self.model](args);\n\t},\n\n\tpercentString: function (places) {\n\t\tvar self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to.rgb.percent(args);\n\t},\n\n\tarray: function () {\n\t\treturn this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);\n\t},\n\n\tobject: function () {\n\t\tvar result = {};\n\t\tvar channels = convert[this.model].channels;\n\t\tvar labels = convert[this.model].labels;\n\n\t\tfor (var i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray: function () {\n\t\tvar rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject: function () {\n\t\tvar rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround: function (places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);\n\t},\n\n\talpha: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(100)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(100)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn colorString.to.hex(this.rgb().round().color);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.rgb().color;\n\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.rgb().color;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight: function () {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = this.rgb();\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\t\treturn rgb;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale: function () {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar rgb = this.rgb().color;\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(val, val, val);\n\t},\n\n\tfade: function (ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer: function (ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.hsl();\n\t\tvar hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix: function (mixinColor, weight) {\n\t\t// ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\t\tvar color1 = mixinColor.rgb();\n\t\tvar color2 = this.rgb();\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t}\n};\n\n// model conversion methods and static constructors\nObject.keys(convert).forEach(function (model) {\n\tif (skippedModels.indexOf(model) !== -1) {\n\t\treturn;\n\t}\n\n\tvar channels = convert[model].channels;\n\n\t// conversion methods\n\tColor.prototype[model] = function () {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments.length) {\n\t\t\treturn new Color(arguments, model);\n\t\t}\n\n\t\tvar newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;\n\t\treturn new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (color) {\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(_slice.call(arguments), channels);\n\t\t}\n\t\treturn new Color(color, model);\n\t};\n});\n\nfunction roundTo(num, places) {\n\treturn Number(num.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (num) {\n\t\treturn roundTo(num, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tmodel.forEach(function (m) {\n\t\t(limiters[m] || (limiters[m] = []))[channel] = modifier;\n\t});\n\n\tmodel = model[0];\n\n\treturn function (val) {\n\t\tvar result;\n\n\t\tif (arguments.length) {\n\t\t\tif (modifier) {\n\t\t\t\tval = modifier(val);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = val;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(val) {\n\treturn Array.isArray(val) ? val : [val];\n}\n\nfunction zeroArray(arr, length) {\n\tfor (var i = 0; i < length; i++) {\n\t\tif (typeof arr[i] !== 'number') {\n\t\t\tarr[i] = 0;\n\t\t}\n\t}\n\n\treturn arr;\n}\n\nmodule.exports = Color;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__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 (_) 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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar axios_1 = __importDefault(require(\"axios\"));\nvar CancelToken = axios_1.default.CancelToken;\n/**\n * Axios request with timeout throw\n */\nfunction axiosRequest(config) {\n return __awaiter(this, void 0, void 0, function () {\n var timeout, cancel;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n timeout = config.timeout;\n if (timeout) {\n config.cancelToken = new CancelToken(function (c) { return cancel = c; });\n setTimeout(function () {\n cancel('timeout cancel', { timeout: timeout });\n }, timeout);\n }\n return [4 /*yield*/, axios_1.default(config)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexports.default = axiosRequest;\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryStore = MemoryStore;\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link MemoryStore} for the public class.\r\n * @module store/memory\r\n */\r\nfunction isValidFilterId(filterId) {\r\n const isValidStr = typeof filterId === \"string\" && !!filterId && filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\r\n filterId !== \"null\";\r\n return isValidStr || typeof filterId === \"number\";\r\n}\r\n/**\r\n * Construct a new in-memory data store for the Matrix Client.\r\n * @constructor\r\n * @param {Object=} opts Config options\r\n * @param {LocalStorage} opts.localStorage The local storage instance to persist\r\n * some forms of data such as tokens. Rooms will NOT be stored.\r\n */\r\n\r\n\r\nfunction MemoryStore(opts) {\r\n opts = opts || {};\r\n this.rooms = {// roomId: Room\r\n };\r\n this.groups = {// groupId: Group\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n this.localStorage = opts.localStorage;\r\n this._oobMembers = {// roomId: [member events]\r\n };\r\n this._clientOptions = {};\r\n}\r\n\r\nMemoryStore.prototype = {\r\n /**\r\n * Retrieve the token to stream from.\r\n * @return {string} The token or null.\r\n */\r\n getSyncToken: function () {\r\n return this.syncToken;\r\n },\r\n\r\n /** @return {Promise} whether or not the database was newly created in this session. */\r\n isNewlyCreated: function () {\r\n return Promise.resolve(true);\r\n },\r\n\r\n /**\r\n * Set the token to stream from.\r\n * @param {string} token The token to stream from.\r\n */\r\n setSyncToken: function (token) {\r\n this.syncToken = token;\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Group} group The group to be stored\r\n */\r\n storeGroup: function (group) {\r\n this.groups[group.groupId] = group;\r\n },\r\n\r\n /**\r\n * Retrieve a group by its group ID.\r\n * @param {string} groupId The group ID.\r\n * @return {Group} The group or null.\r\n */\r\n getGroup: function (groupId) {\r\n return this.groups[groupId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known groups.\r\n * @return {Group[]} A list of groups, which may be empty.\r\n */\r\n getGroups: function () {\r\n return utils.values(this.groups);\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Room} room The room to be stored. All properties must be stored.\r\n */\r\n storeRoom: function (room) {\r\n this.rooms[room.roomId] = room; // add listeners for room member changes so we can keep the room member\r\n // map up-to-date.\r\n\r\n room.currentState.on(\"RoomState.members\", this._onRoomMember.bind(this)); // add existing members\r\n\r\n const self = this;\r\n room.currentState.getMembers().forEach(function (m) {\r\n self._onRoomMember(null, room.currentState, m);\r\n });\r\n },\r\n\r\n /**\r\n * Called when a room member in a room being tracked by this store has been\r\n * updated.\r\n * @param {MatrixEvent} event\r\n * @param {RoomState} state\r\n * @param {RoomMember} member\r\n */\r\n _onRoomMember: function (event, state, member) {\r\n if (member.membership === \"invite\") {\r\n // We do NOT add invited members because people love to typo user IDs\r\n // which would then show up in these lists (!)\r\n return;\r\n }\r\n\r\n const user = this.users[member.userId] || new _user.User(member.userId);\r\n\r\n if (member.name) {\r\n user.setDisplayName(member.name);\r\n\r\n if (member.events.member) {\r\n user.setRawDisplayName(member.events.member.getDirectionalContent().displayname);\r\n }\r\n }\r\n\r\n if (member.events.member && member.events.member.getContent().avatar_url) {\r\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\r\n }\r\n\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a room by its' room ID.\r\n * @param {string} roomId The room ID.\r\n * @return {Room} The room or null.\r\n */\r\n getRoom: function (roomId) {\r\n return this.rooms[roomId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known rooms.\r\n * @return {Room[]} A list of rooms, which may be empty.\r\n */\r\n getRooms: function () {\r\n return utils.values(this.rooms);\r\n },\r\n\r\n /**\r\n * Permanently delete a room.\r\n * @param {string} roomId\r\n */\r\n removeRoom: function (roomId) {\r\n if (this.rooms[roomId]) {\r\n this.rooms[roomId].removeListener(\"RoomState.members\", this._onRoomMember);\r\n }\r\n\r\n delete this.rooms[roomId];\r\n },\r\n\r\n /**\r\n * Retrieve a summary of all the rooms.\r\n * @return {RoomSummary[]} A summary of each room.\r\n */\r\n getRoomSummaries: function () {\r\n return utils.map(utils.values(this.rooms), function (room) {\r\n return room.summary;\r\n });\r\n },\r\n\r\n /**\r\n * Store a User.\r\n * @param {User} user The user to store.\r\n */\r\n storeUser: function (user) {\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a User by its' user ID.\r\n * @param {string} userId The user ID.\r\n * @return {User} The user or null.\r\n */\r\n getUser: function (userId) {\r\n return this.users[userId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known users.\r\n * @return {User[]} A list of users, which may be empty.\r\n */\r\n getUsers: function () {\r\n return utils.values(this.users);\r\n },\r\n\r\n /**\r\n * Retrieve scrollback for this room.\r\n * @param {Room} room The matrix room\r\n * @param {integer} limit The max number of old events to retrieve.\r\n * @return {Array} An array of objects which will be at most 'limit'\r\n * length and at least 0. The objects are the raw event JSON.\r\n */\r\n scrollback: function (room, limit) {\r\n return [];\r\n },\r\n\r\n /**\r\n * Store events for a room. The events have already been added to the timeline\r\n * @param {Room} room The room to store events for.\r\n * @param {Array} events The events to store.\r\n * @param {string} token The token associated with these events.\r\n * @param {boolean} toStart True if these are paginated results.\r\n */\r\n storeEvents: function (room, events, token, toStart) {// no-op because they've already been added to the room instance.\r\n },\r\n\r\n /**\r\n * Store a filter.\r\n * @param {Filter} filter\r\n */\r\n storeFilter: function (filter) {\r\n if (!filter) {\r\n return;\r\n }\r\n\r\n if (!this.filters[filter.userId]) {\r\n this.filters[filter.userId] = {};\r\n }\r\n\r\n this.filters[filter.userId][filter.filterId] = filter;\r\n },\r\n\r\n /**\r\n * Retrieve a filter.\r\n * @param {string} userId\r\n * @param {string} filterId\r\n * @return {?Filter} A filter or null.\r\n */\r\n getFilter: function (userId, filterId) {\r\n if (!this.filters[userId] || !this.filters[userId][filterId]) {\r\n return null;\r\n }\r\n\r\n return this.filters[userId][filterId];\r\n },\r\n\r\n /**\r\n * Retrieve a filter ID with the given name.\r\n * @param {string} filterName The filter name.\r\n * @return {?string} The filter ID or null.\r\n */\r\n getFilterIdByName: function (filterName) {\r\n if (!this.localStorage) {\r\n return null;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName; // XXX Storage.getItem doesn't throw ...\r\n // or are we using something different\r\n // than window.localStorage in some cases\r\n // that does throw?\r\n // that would be very naughty\r\n\r\n try {\r\n const value = this.localStorage.getItem(key);\r\n\r\n if (isValidFilterId(value)) {\r\n return value;\r\n }\r\n } catch (e) {}\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Set a filter name to ID mapping.\r\n * @param {string} filterName\r\n * @param {string} filterId\r\n */\r\n setFilterIdByName: function (filterName, filterId) {\r\n if (!this.localStorage) {\r\n return;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName;\r\n\r\n try {\r\n if (isValidFilterId(filterId)) {\r\n this.localStorage.setItem(key, filterId);\r\n } else {\r\n this.localStorage.removeItem(key);\r\n }\r\n } catch (e) {}\r\n },\r\n\r\n /**\r\n * Store user-scoped account data events.\r\n * N.B. that account data only allows a single event per type, so multiple\r\n * events with the same type will replace each other.\r\n * @param {Array} events The events to store.\r\n */\r\n storeAccountDataEvents: function (events) {\r\n const self = this;\r\n events.forEach(function (event) {\r\n self.accountData[event.getType()] = event;\r\n });\r\n },\r\n\r\n /**\r\n * Get account data event by event type\r\n * @param {string} eventType The event type being queried\r\n * @return {?MatrixEvent} the user account_data event of given type, if any\r\n */\r\n getAccountData: function (eventType) {\r\n return this.accountData[eventType];\r\n },\r\n\r\n /**\r\n * setSyncData does nothing as there is no backing data store.\r\n *\r\n * @param {Object} syncData The sync data\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n setSyncData: function (syncData) {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * We never want to save becase we have nothing to save to.\r\n *\r\n * @return {boolean} If the store wants to save\r\n */\r\n wantsSave: function () {\r\n return false;\r\n },\r\n\r\n /**\r\n * Save does nothing as there is no backing data store.\r\n * @param {bool} force True to force a save (but the memory\r\n * store still can't save anything)\r\n */\r\n save: function (force) {},\r\n\r\n /**\r\n * Startup does nothing as this store doesn't require starting up.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n startup: function () {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n getSavedSync: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n getSavedSyncToken: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * Delete all data from this store.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n deleteAllData: function () {\r\n this.rooms = {// roomId: Room\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n getOutOfBandMembers: function (roomId) {\r\n return Promise.resolve(this._oobMembers[roomId] || null);\r\n },\r\n\r\n /**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n setOutOfBandMembers: function (roomId, membershipEvents) {\r\n this._oobMembers[roomId] = membershipEvents;\r\n return Promise.resolve();\r\n },\r\n clearOutOfBandMembers: function () {\r\n this._oobMembers = {};\r\n return Promise.resolve();\r\n },\r\n getClientOptions: function () {\r\n return Promise.resolve(this._clientOptions);\r\n },\r\n storeClientOptions: function (options) {\r\n this._clientOptions = Object.assign({}, options);\r\n return Promise.resolve();\r\n }\r\n};","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"wrapper table\"},[_c('div',{staticClass:\"filecontent\"},[_c('div',{staticClass:\"name\"},[_c('span',[_vm._v(_vm._s(_vm.file.name))])]),_c('div',{staticClass:\"size\"},[_c('span',[_vm._v(_vm._s(_vm.humanReadableSize(_vm.file.size)))])]),(!_vm.encryptedData)?_c('div',{staticClass:\"download\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('button',{staticClass:\"button small rounded\"},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]):_c('div',{staticClass:\"download\"},[_c('button',{staticClass:\"button small rounded\",on:{\"click\":_vm.download}},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]),_c('div',{staticClass:\"icon\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('i',{staticClass:\"fas fa-file-download\"})])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f8b05de&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0f8b05de&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0f8b05de\",\n null\n ,true\n)\n\nexport default component.exports","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".m-message-container{position:fixed;z-index:1010;pointer-events:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;padding:15px}.m-message-container.is-top-center,.m-message-container.is-top-left,.m-message-container.is-top-right{width:100%;top:0;left:0}.m-message-container.is-top-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-top-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-top-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.is-center{width:100%;height:100%;left:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-message-container.is-bottom-center,.m-message-container.is-bottom-left,.m-message-container.is-bottom-right{bottom:0;left:0;width:100%;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.m-message-container.is-bottom-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-bottom-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-bottom-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.has-mask{background-color:hsla(0,0%,100%,.5);width:100%;height:100%;pointer-events:all}.m-message-wrapper{display:inline-block;max-width:500px}.m-message-wrapper+.m-message-wrapper{margin-top:15px}.m-message-wrapper:after,.m-message-wrapper:before{content:\\\"\\\";clear:both;display:table}.m-message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 16px;font-size:14px;overflow:hidden;border-radius:4px;-webkit-box-shadow:0 1px 8px rgba(0,0,0,.15);box-shadow:0 1px 8px rgba(0,0,0,.15);color:rgba(0,0,0,.65);background:hsla(0,0%,100%,.95);pointer-events:all;position:relative}.m-message,.m-message-icons{-webkit-box-sizing:border-box;box-sizing:border-box}.m-message-icons{float:left;margin-right:10px}.m-message--title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-message-content{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto;width:100%}.m-message--description{line-height:1.6;color:#777}.m-message--title+.m-message--description{margin-top:5px}.m-message--icon{width:25px;height:25px;vertical-align:middle;display:inline-block;border-radius:50%}.m-message--control{position:relative;height:100%;-ms-flex-item-align:start;align-self:flex-start;white-space:nowrap;margin-right:-5px;margin-left:10px}.m-message--button{border:none;outline:none;background:none;cursor:pointer;font-size:15px;color:#646464;font-weight:600;padding:0;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle}.m-message--button:hover{color:#f56c6c}.m-message--arrow-down.is-collapsed{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.m-message-fade-enter-active{-webkit-animation:m-message-fade-in-down .3s;animation:m-message-fade-in-down .3s}.m-message-fade-leave-active{-webkit-animation:m-message-fade-out .3s;animation:m-message-fade-out .3s}@-webkit-keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}@keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","\"use strict\";\n// Copyright (C) 2017 Tony Arcieri\n// MIT License. See LICENSE file for details.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst block_1 = require(\"../../internals/block\");\n/**\n * WebCrypto-based implementation of the AES block cipher.\n *\n * This implementation (ab)uses AES-CBC mode to implement AES-ECB. This is\n * likely to be rather slow, as it requires an async call per block, and\n * discards half the buffer.\n *\n * In theory it should be constant time due to the use of WebCrypto (provided\n * the browser's implementation is constant time), but it could probably benefit\n * from some clever optimization work, or improvements to the WebCrypto API.\n *\n * Some WebCrypto implementations (e.g. node-webcrypto-ossl) support ECB mode\n * natively, so we could take advantage of that to potentially encrypt multiple\n * blocks in a single invocation.\n *\n * Key size: 16 or 32 bytes, block size: 16 bytes.\n */\nclass WebCryptoAes {\n constructor(_crypto, _key) {\n this._crypto = _crypto;\n this._key = _key;\n // An initialization vector of all zeros, exposing the raw AES function\n this._iv = new block_1.default();\n this._emptyPromise = Promise.resolve(this);\n }\n /**\n * Create a new WebCryptoAes instance\n *\n * @param {Crypto} crypto - the Web Cryptography provider\n * @param {Uint8Array} keyData - the AES secret key\n * @returns {Promise}\n */\n encryptBlock(block) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = { name: \"AES-CBC\", iv: this._iv.data };\n const ctBlock = yield this._crypto.subtle.encrypt(params, this._key, block.data);\n // TODO: a more efficient way to do in-place encryption?\n block.data.set(new Uint8Array(ctBlock, 0, block_1.default.SIZE));\n return this._emptyPromise;\n });\n }\n}\nexports.default = WebCryptoAes;\n","\"use strict\";\n/** Type which represents AES blocks */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst constant_time_1 = require(\"./constant-time\");\nconst wipe_1 = require(\"./wipe\");\n/** An AES block (128-bits) */\nclass Block {\n constructor() {\n this.data = new Uint8Array(Block.SIZE);\n }\n /**\n * Clear the given array by setting its values to zero.\n *\n * WARNING: The fact that it sets bytes to zero can be relied on.\n *\n * There is no guarantee that this function makes data disappear from memory,\n * as runtime implementation can, for example, have copying garbage collector\n * that will make copies of sensitive data before we wipe it. Or that an\n * operating system will write our data to swap or sleep image. Another thing\n * is that an optimizing compiler can remove calls to this function or make it\n * no-op. There's nothing we can do with it, so we just do our best and hope\n * that everything will be okay and good will triumph over evil.\n */\n clear() {\n wipe_1.wipe(this.data);\n }\n /**\n * Make a copy of this block, returning a new block\n */\n clone() {\n const ret = new Block();\n ret.copy(this);\n return ret;\n }\n /** Copy the contents of another block into this one */\n copy(other) {\n this.data.set(other.data);\n }\n /**\n * Double a value over GF(2^128):\n *\n * a<<1 if firstbit(a)=0\n * (a<<1) ⊕ 0¹²⁰10000111 if firstbit(a)=1\n */\n dbl() {\n let carry = 0;\n for (let i = Block.SIZE - 1; i >= 0; i--) {\n const b = (this.data[i] >>> 7) & 0xff;\n this.data[i] = (this.data[i] << 1) | carry;\n carry = b;\n }\n this.data[Block.SIZE - 1] ^= constant_time_1.select(carry, Block.R, 0);\n carry = 0;\n }\n}\n/** Size of a block as used by the AES cipher */\nBlock.SIZE = 16;\n/** Minimal irreducible polynomial for a 128-bit block size */\nBlock.R = 0x87;\nexports.default = Block;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chats.vue?vue&type=template&id=62a1ab6a&scoped=true&\"\nimport script from \"./chats.vue?vue&type=script&lang=js&\"\nexport * from \"./chats.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"62a1ab6a\",\n null\n ,true\n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7ed73c7c&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7ed73c7c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7ed73c7c\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./name.vue?vue&type=template&id=72a9c575&scoped=true&\"\nimport script from \"./name.vue?vue&type=script&lang=js&\"\nexport * from \"./name.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"72a9c575\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".previewWrapper[data-v-691bf714]{height:60px;position:absolute;top:0;width:100%;display:flex;align-items:center;justify-content:flex-start;padding:0;border-bottom:1px solid rgb(var(--background-main))}.previewWrapper .previewContact[data-v-691bf714],.previewWrapper .previewContactSelect[data-v-691bf714]{width:100%}.previewWrapper .previewBox[data-v-691bf714]{width:100%;display:flex;justify-content:space-between;align-items:center}.previewWrapper .previewBox .previewWrapper[data-v-691bf714]{flex-grow:1;width:100%}.previewWrapper .checkBox[data-v-691bf714]{text-align:center;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList[data-v-691bf714]{margin-bottom:8px}.contactList .title[data-v-691bf714]{padding:0 .5em}.contactList.minimized .title[data-v-691bf714]{display:none}.contactList.minimized .previewWrapper[data-v-691bf714]{padding:.5em 0;border-bottom:0;cursor:pointer}.contactList.minimized .previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList.minimized .previewWrapper[data-v-691bf714] .previewWrapper{padding:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".matrin[data-v-9d2b1700]{margin:0 auto 0 0!important}.msgAction[data-v-9d2b1700]{position:absolute}.msgAction[data-v-9d2b1700]:before{content:\\\"\\\";display:block;width:100%;height:100%;position:fixed;z-index:10;opacity:.9;left:0;right:0;top:0;bottom:0}.msgAction .contentAction[data-v-9d2b1700],.msgAction[data-v-9d2b1700]:before{background-color:rgb(var(--background-main))}.msgAction .contentAction[data-v-9d2b1700]{width:180px;position:relative;z-index:300;border:.1em solid rgb(var(--neutral-grad-0));border-radius:.8em;margin:.6em 0 0 auto}.msgAction .contentAction ul[data-v-9d2b1700]{padding:0;list-style:none;margin:0;display:block;width:100%;height:100%}.msgAction .contentAction ul li[data-v-9d2b1700]{display:flex;justify-content:space-between;padding:.2em .8em;align-items:center;border-top:.1em solid rgb(var(--neutral-grad-1));font-size:1em}.msgAction .contentAction ul li[data-v-9d2b1700]:first-child{border:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".outer-div[data-v-e4f39dca]{line-height:inherit;border-radius:50%}.dropDownIcon[data-v-e4f39dca]{width:35px;height:35px;line-height:35px}.dropDownIcon i[data-v-e4f39dca]{line-height:35px!important}.menuwrapper[data-v-e4f39dca]{padding-left:1em;padding-right:1em;padding-bottom:1em;position:absolute;z-index:100;bottom:0;left:0;right:0}.menuwrapper[data-v-e4f39dca] .items{max-height:500px;overflow-y:auto;border-radius:3px;padding-left:.5em;padding-right:.5em;padding-bottom:.5em}.dropdown[data-v-e4f39dca]{z-index:10000;position:absolute;width:100%;right:0;height:auto;color:rgb(var(--text-color));transition:.3s;bottom:-100em;top:100em}.dropdown .backgr[data-v-e4f39dca]{background:rgba(var(--background-total-theme),.15);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);position:fixed;z-index:100;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}.dropdown.visible[data-v-e4f39dca]{bottom:0;top:0}.dropdown.visible .backgr[data-v-e4f39dca]{opacity:1}.dropdown[data-v-e4f39dca] .contentWrapper{margin-top:.25em;border-radius:10px;overflow:hidden}.dropdown .contentWrapper[data-v-e4f39dca],.dropdown[data-v-e4f39dca] .contentWrapper{border-top:1px solid rgba(var(--neutral-grad-1),.5);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .cancelWrapper .menu-item[data-v-e4f39dca]{margin-top:0;box-shadow:none;color:rgb(var(--neutral-grad-3));box-shadow:0 5px 5px -3px rgba(var(--color-shadow-base),.4)}.dropdown .menu-item[data-v-e4f39dca]{padding:.5em;background:rgb(var(--background-total-theme));color:rgb(var(--neutral-grad-3));line-height:44px;margin-top:.25em;display:flex;border-radius:10px;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .menu-item .title[data-v-e4f39dca]{flex-grow:2;padding-right:44px;text-align:center}.dropdown .menu-item .iconWrapper[data-v-e4f39dca]{width:44px;text-align:center}.dropdown .blocker[data-v-e4f39dca]{position:fixed;top:0;left:0;bottom:0;right:0;content:\\\" \\\"}.cancelWrapper[data-v-e4f39dca]{border-radius:3px;padding-left:.5em;padding-right:.5em;color:rgb(var(--neutral-grad-3))}.small[data-v-e4f39dca]{font-size:.85em}.outer-div.mobile .menuwrapper[data-v-e4f39dca]{position:fixed}.outer-div.minimized[data-v-e4f39dca]{position:static}.outer-div.minimized .backgr[data-v-e4f39dca]{border-radius:4px;height:1000px;bottom:0;top:auto;background:transparent;position:absolute}.outer-div.minimized .dropdown[data-v-e4f39dca]{z-index:10000;right:0}.outer-div.minimized .menuwrapper[data-v-e4f39dca]{border-radius:4px;padding-top:.5em}.outer-div.minimized .menuwrapper[data-v-e4f39dca] .menu-item{margin-top:.25em;border-radius:5px;background:rgba(var(--background-total-theme),.95)}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nmodule.exports = Readable;\n/**/\n\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n/**/\n\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\n\n\nvar Stream = require('./internal/streams/stream');\n/**/\n\n\nvar Buffer = require('buffer').Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n\nvar debugUtil = require('util');\n\nvar debug;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\n\nvar BufferList = require('./internal/streams/buffer_list');\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.\n\n\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\n\nrequire('inherits')(Readable, Stream);\n\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')\n\n this.autoDestroy = !!options.autoDestroy; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n } // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n\n\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n\n return er;\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8\n\n this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:\n\n var p = this._readableState.buffer.head;\n var content = '';\n\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n\n this._readableState.buffer.clear();\n\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n}; // Don't raise the hwm > 1GB\n\n\nvar MAX_HWM = 0x40000000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true;\n\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\n\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n } // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n\n\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused\n\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true; // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume'); // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n\n state.paused = false;\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n\n if (!state.reading) {\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n this._readableState.paused = true;\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {\n ;\n }\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n\n return createReadableStreamAsyncIterator(this);\n };\n}\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n}); // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.\n\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\n\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n\n return from(Readable, iterable, opts);\n };\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","module.exports = require('./lib/_stream_writable.js');\n","export * from \"-!../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst aes_1 = require(\"./polyfill/aes\");\nconst aes_ctr_1 = require(\"./polyfill/aes_ctr\");\n/**\n * Pure JavaScript cryptography implementations\n *\n * WARNING: Not constant time! May leak keys or have other security issues.\n */\nclass PolyfillCryptoProvider {\n constructor() {\n // This class doesn't do anything, it just signals that polyfill impls should be used\n }\n importBlockCipherKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_1.default(keyData);\n });\n }\n importCTRKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_ctr_1.default(new aes_1.default(keyData));\n });\n }\n}\nexports.PolyfillCryptoProvider = PolyfillCryptoProvider;\n","// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./many.vue?vue&type=template&id=71d5e826&scoped=true&\"\nimport script from \"./many.vue?vue&type=script&lang=js&\"\nexport * from \"./many.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./many.vue?vue&type=style&index=0&id=71d5e826&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"71d5e826\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.IndexedDBStore = IndexedDBStore;\r\n\r\nvar _memory = require(\"./memory\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _indexeddbLocalBackend = require(\"./indexeddb-local-backend.js\");\r\n\r\nvar _indexeddbRemoteBackend = require(\"./indexeddb-remote-backend.js\");\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* eslint-disable @babel/no-invalid-this */\r\n\r\n/**\r\n * This is an internal module. See {@link IndexedDBStore} for the public class.\r\n * @module store/indexeddb\r\n */\r\n// If this value is too small we'll be writing very often which will cause\r\n// noticable stop-the-world pauses. If this value is too big we'll be writing\r\n// so infrequently that the /sync size gets bigger on reload. Writing more\r\n// often does not affect the length of the pause since the entire /sync\r\n// response is persisted each time.\r\nconst WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes\r\n\r\n/**\r\n * Construct a new Indexed Database store, which extends MemoryStore.\r\n *\r\n * This store functions like a MemoryStore except it periodically persists\r\n * the contents of the store to an IndexedDB backend.\r\n *\r\n * All data is still kept in-memory but can be loaded from disk by calling\r\n * startup(). This can make startup times quicker as a complete\r\n * sync from the server is not required. This does not reduce memory usage as all\r\n * the data is eagerly fetched when startup() is called.\r\n *
\r\n * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };\r\n * let store = new IndexedDBStore(opts);\r\n * await store.startup(); // load from indexed db\r\n * let client = sdk.createClient({\r\n *     store: store,\r\n * });\r\n * client.startClient();\r\n * client.on(\"sync\", function(state, prevState, data) {\r\n *     if (state === \"PREPARED\") {\r\n *         console.log(\"Started up, now with go faster stripes!\");\r\n *     }\r\n * });\r\n * 
\r\n *\r\n * @constructor\r\n * @extends MemoryStore\r\n * @param {Object} opts Options object.\r\n * @param {Object} opts.indexedDB The Indexed DB interface e.g.\r\n * window.indexedDB\r\n * @param {string=} opts.dbName Optional database name. The same name must be used\r\n * to open the same database.\r\n * @param {string=} opts.workerScript Optional URL to a script to invoke a web\r\n * worker with to run IndexedDB queries on the web worker. The IndexedDbStoreWorker\r\n * class is provided for this purpose and requires the application to provide a\r\n * trivial wrapper script around it.\r\n * @param {Object=} opts.workerApi The webWorker API object. If omitted, the global Worker\r\n * object will be used if it exists.\r\n * @prop {IndexedDBStoreBackend} backend The backend instance. Call through to\r\n * this API if you need to perform specific indexeddb actions like deleting the\r\n * database.\r\n */\r\n\r\nfunction IndexedDBStore(opts) {\r\n _memory.MemoryStore.call(this, opts);\r\n\r\n if (!opts.indexedDB) {\r\n throw new Error('Missing required option: indexedDB');\r\n }\r\n\r\n if (opts.workerScript) {\r\n // try & find a webworker-compatible API\r\n let workerApi = opts.workerApi;\r\n\r\n if (!workerApi) {\r\n // default to the global Worker object (which is where it in a browser)\r\n workerApi = global.Worker;\r\n }\r\n\r\n this.backend = new _indexeddbRemoteBackend.RemoteIndexedDBStoreBackend(opts.workerScript, opts.dbName, workerApi);\r\n } else {\r\n this.backend = new _indexeddbLocalBackend.LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);\r\n }\r\n\r\n this.startedUp = false;\r\n this._syncTs = 0; // Records the last-modified-time of each user at the last point we saved\r\n // the database, such that we can derive the set if users that have been\r\n // modified since we last saved.\r\n\r\n this._userModifiedMap = {// user_id : timestamp\r\n };\r\n}\r\n\r\nutils.inherits(IndexedDBStore, _memory.MemoryStore);\r\nutils.extend(IndexedDBStore.prototype, _events.EventEmitter.prototype);\r\n\r\nIndexedDBStore.exists = function (indexedDB, dbName) {\r\n return _indexeddbLocalBackend.LocalIndexedDBStoreBackend.exists(indexedDB, dbName);\r\n};\r\n/**\r\n * @return {Promise} Resolved when loaded from indexed db.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.startup = function () {\r\n if (this.startedUp) {\r\n _logger.logger.log(`IndexedDBStore.startup: already started`);\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n _logger.logger.log(`IndexedDBStore.startup: connecting to backend`);\r\n\r\n return this.backend.connect().then(() => {\r\n _logger.logger.log(`IndexedDBStore.startup: loading presence events`);\r\n\r\n return this.backend.getUserPresenceEvents();\r\n }).then(userPresenceEvents => {\r\n _logger.logger.log(`IndexedDBStore.startup: processing presence events`);\r\n\r\n userPresenceEvents.forEach(([userId, rawEvent]) => {\r\n const u = new _user.User(userId);\r\n\r\n if (rawEvent) {\r\n u.setPresenceEvent(new _event.MatrixEvent(rawEvent));\r\n }\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n this.storeUser(u);\r\n });\r\n });\r\n};\r\n/**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.getSavedSync = degradable(function () {\r\n return this.backend.getSavedSync();\r\n}, \"getSavedSync\");\r\n/** @return {Promise} whether or not the database was newly created in this session. */\r\n\r\nIndexedDBStore.prototype.isNewlyCreated = degradable(function () {\r\n return this.backend.isNewlyCreated();\r\n}, \"isNewlyCreated\");\r\n/**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n\r\nIndexedDBStore.prototype.getSavedSyncToken = degradable(function () {\r\n return this.backend.getNextBatchToken();\r\n}, \"getSavedSyncToken\"),\r\n/**\r\n * Delete all data from this store.\r\n * @return {Promise} Resolves if the data was deleted from the database.\r\n */\r\nIndexedDBStore.prototype.deleteAllData = degradable(function () {\r\n _memory.MemoryStore.prototype.deleteAllData.call(this);\r\n\r\n return this.backend.clearDatabase().then(() => {\r\n _logger.logger.log(\"Deleted indexeddb data.\");\r\n }, err => {\r\n _logger.logger.error(`Failed to delete indexeddb data: ${err}`);\r\n\r\n throw err;\r\n });\r\n});\r\n/**\r\n * Whether this store would like to save its data\r\n * Note that obviously whether the store wants to save or\r\n * not could change between calling this function and calling\r\n * save().\r\n *\r\n * @return {boolean} True if calling save() will actually save\r\n * (at the time this function is called).\r\n */\r\n\r\nIndexedDBStore.prototype.wantsSave = function () {\r\n const now = Date.now();\r\n return now - this._syncTs > WRITE_DELAY_MS;\r\n};\r\n/**\r\n * Possibly write data to the database.\r\n *\r\n * @param {bool} force True to force a save to happen\r\n * @return {Promise} Promise resolves after the write completes\r\n * (or immediately if no write is performed)\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.save = function (force) {\r\n if (force || this.wantsSave()) {\r\n return this._reallySave();\r\n }\r\n\r\n return Promise.resolve();\r\n};\r\n\r\nIndexedDBStore.prototype._reallySave = degradable(function () {\r\n this._syncTs = Date.now(); // set now to guard against multi-writes\r\n // work out changed users (this doesn't handle deletions but you\r\n // can't 'delete' users as they are just presence events).\r\n\r\n const userTuples = [];\r\n\r\n for (const u of this.getUsers()) {\r\n if (this._userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;\r\n if (!u.events.presence) continue;\r\n userTuples.push([u.userId, u.events.presence.event]); // note that we've saved this version of the user\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n }\r\n\r\n return this.backend.syncToDatabase(userTuples);\r\n});\r\nIndexedDBStore.prototype.setSyncData = degradable(function (syncData) {\r\n return this.backend.setSyncData(syncData);\r\n}, \"setSyncData\");\r\n/**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n\r\nIndexedDBStore.prototype.getOutOfBandMembers = degradable(function (roomId) {\r\n return this.backend.getOutOfBandMembers(roomId);\r\n}, \"getOutOfBandMembers\");\r\n/**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n\r\nIndexedDBStore.prototype.setOutOfBandMembers = degradable(function (roomId, membershipEvents) {\r\n _memory.MemoryStore.prototype.setOutOfBandMembers.call(this, roomId, membershipEvents);\r\n\r\n return this.backend.setOutOfBandMembers(roomId, membershipEvents);\r\n}, \"setOutOfBandMembers\");\r\nIndexedDBStore.prototype.clearOutOfBandMembers = degradable(function (roomId) {\r\n _memory.MemoryStore.prototype.clearOutOfBandMembers.call(this);\r\n\r\n return this.backend.clearOutOfBandMembers(roomId);\r\n}, \"clearOutOfBandMembers\");\r\nIndexedDBStore.prototype.getClientOptions = degradable(function () {\r\n return this.backend.getClientOptions();\r\n}, \"getClientOptions\");\r\nIndexedDBStore.prototype.storeClientOptions = degradable(function (options) {\r\n _memory.MemoryStore.prototype.storeClientOptions.call(this, options);\r\n\r\n return this.backend.storeClientOptions(options);\r\n}, \"storeClientOptions\");\r\n/**\r\n * All member functions of `IndexedDBStore` that access the backend use this wrapper to\r\n * watch for failures after initial store startup, including `QuotaExceededError` as\r\n * free disk space changes, etc.\r\n *\r\n * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`\r\n * in place so that the current operation and all future ones are in-memory only.\r\n *\r\n * @param {Function} func The degradable work to do.\r\n * @param {String} fallback The method name for fallback.\r\n * @returns {Function} A wrapped member function.\r\n */\r\n\r\nfunction degradable(func, fallback) {\r\n return async function (...args) {\r\n try {\r\n return await func.call(this, ...args);\r\n } catch (e) {\r\n _logger.logger.error(\"IndexedDBStore failure, degrading to MemoryStore\", e);\r\n\r\n this.emit(\"degraded\", e);\r\n\r\n try {\r\n // We try to delete IndexedDB after degrading since this store is only a\r\n // cache (the app will still function correctly without the data).\r\n // It's possible that deleting repair IndexedDB for the next app load,\r\n // potenially by making a little more space available.\r\n _logger.logger.log(\"IndexedDBStore trying to delete degraded data\");\r\n\r\n await this.backend.clearDatabase();\r\n\r\n _logger.logger.log(\"IndexedDBStore delete after degrading succeeeded\");\r\n } catch (e) {\r\n _logger.logger.warn(\"IndexedDBStore delete after degrading failed\", e);\r\n } // Degrade the store from being an instance of `IndexedDBStore` to instead be\r\n // an instance of `MemoryStore` so that future API calls use the memory path\r\n // directly and skip IndexedDB entirely. This should be safe as\r\n // `IndexedDBStore` already extends from `MemoryStore`, so we are making the\r\n // store become its parent type in a way. The mutator methods of\r\n // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are\r\n // not overridden at all).\r\n\r\n\r\n Object.setPrototypeOf(this, _memory.MemoryStore.prototype);\r\n\r\n if (fallback) {\r\n return await _memory.MemoryStore.prototype[fallback].call(this, ...args);\r\n }\r\n }\r\n };\r\n}","(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Scrollparent = factory();\n }\n}(this, function () {\n var regex = /(auto|scroll)/;\n\n var parents = function (node, ps) {\n if (node.parentNode === null) { return ps; }\n\n return parents(node.parentNode, ps.concat([node]));\n };\n\n var style = function (node, prop) {\n return getComputedStyle(node, null).getPropertyValue(prop);\n };\n\n var overflow = function (node) {\n return style(node, \"overflow\") + style(node, \"overflow-y\") + style(node, \"overflow-x\");\n };\n\n var scroll = function (node) {\n return regex.test(overflow(node));\n };\n\n var scrollParent = function (node) {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return ;\n }\n\n var ps = parents(node.parentNode, []);\n\n for (var i = 0; i < ps.length; i += 1) {\n if (scroll(ps[i])) {\n return ps[i];\n }\n }\n\n return document.scrollingElement || document.documentElement;\n };\n\n return scrollParent;\n}));\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".bgimage[data-v-5d20f73c]{width:100%;height:100%;opacity:0;transition:.3s}.bgimage.loaded[data-v-5d20f73c]{opacity:1}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.PushProcessor = PushProcessor;\r\n\r\nvar _utils = require(\"./utils\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module pushprocessor\r\n */\r\nconst RULEKINDS_IN_ORDER = ['override', 'content', 'room', 'sender', 'underride']; // The default override rules to apply to the push rules that arrive from the server.\r\n// We do this for two reasons:\r\n// 1. Synapse is unlikely to send us the push rule in an incremental sync - see\r\n// https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for\r\n// more details.\r\n// 2. We often want to start using push rules ahead of the server supporting them,\r\n// and so we can put them here.\r\n\r\nconst DEFAULT_OVERRIDE_RULES = [{\r\n // For homeservers which don't support MSC1930 yet\r\n rule_id: \".m.rule.tombstone\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.room.tombstone\"\r\n }, {\r\n kind: \"event_match\",\r\n key: \"state_key\",\r\n pattern: \"\"\r\n }],\r\n actions: [\"notify\", {\r\n set_tweak: \"highlight\",\r\n value: true\r\n }]\r\n}, {\r\n // For homeservers which don't support MSC2153 yet\r\n rule_id: \".m.rule.reaction\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.reaction\"\r\n }],\r\n actions: [\"dont_notify\"]\r\n}];\r\n/**\r\n * Construct a Push Processor.\r\n * @constructor\r\n * @param {Object} client The Matrix client object to use\r\n */\r\n\r\nfunction PushProcessor(client) {\r\n const cachedGlobToRegex = {// $glob: RegExp,\r\n };\r\n\r\n const matchingRuleFromKindSet = (ev, kindset) => {\r\n for (let ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) {\r\n const kind = RULEKINDS_IN_ORDER[ruleKindIndex];\r\n const ruleset = kindset[kind];\r\n\r\n if (!ruleset) {\r\n continue;\r\n }\r\n\r\n for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) {\r\n const rule = ruleset[ruleIndex];\r\n\r\n if (!rule.enabled) {\r\n continue;\r\n }\r\n\r\n const rawrule = templateRuleToRaw(kind, rule);\r\n\r\n if (!rawrule) {\r\n continue;\r\n }\r\n\r\n if (this.ruleMatchesEvent(rawrule, ev)) {\r\n rule.kind = kind;\r\n return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const templateRuleToRaw = function (kind, tprule) {\r\n const rawrule = {\r\n 'rule_id': tprule.rule_id,\r\n 'actions': tprule.actions,\r\n 'conditions': []\r\n };\r\n\r\n switch (kind) {\r\n case 'underride':\r\n case 'override':\r\n rawrule.conditions = tprule.conditions;\r\n break;\r\n\r\n case 'room':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'room_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'sender':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'user_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'content':\r\n if (!tprule.pattern) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'content.body',\r\n 'pattern': tprule.pattern\r\n });\r\n break;\r\n }\r\n\r\n return rawrule;\r\n };\r\n\r\n const eventFulfillsCondition = function (cond, ev) {\r\n const condition_functions = {\r\n \"event_match\": eventFulfillsEventMatchCondition,\r\n \"contains_display_name\": eventFulfillsDisplayNameCondition,\r\n \"room_member_count\": eventFulfillsRoomMemberCountCondition,\r\n \"sender_notification_permission\": eventFulfillsSenderNotifPermCondition\r\n };\r\n\r\n if (condition_functions[cond.kind]) {\r\n return condition_functions[cond.kind](cond, ev);\r\n } // unknown conditions: we previously matched all unknown conditions,\r\n // but given that rules can be added to the base rules on a server,\r\n // it's probably better to not match unknown conditions.\r\n\r\n\r\n return false;\r\n };\r\n\r\n const eventFulfillsSenderNotifPermCondition = function (cond, ev) {\r\n const notifLevelKey = cond['key'];\r\n\r\n if (!notifLevelKey) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState) {\r\n return false;\r\n } // Note that this should not be the current state of the room but the state at\r\n // the point the event is in the DAG. Unfortunately the js-sdk does not store\r\n // this.\r\n\r\n\r\n return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender());\r\n };\r\n\r\n const eventFulfillsRoomMemberCountCondition = function (cond, ev) {\r\n if (!cond.is) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members) {\r\n return false;\r\n }\r\n\r\n const memberCount = room.currentState.getJoinedMemberCount();\r\n const m = cond.is.match(/^([=<>]*)([0-9]*)$/);\r\n\r\n if (!m) {\r\n return false;\r\n }\r\n\r\n const ineq = m[1];\r\n const rhs = parseInt(m[2]);\r\n\r\n if (isNaN(rhs)) {\r\n return false;\r\n }\r\n\r\n switch (ineq) {\r\n case '':\r\n case '==':\r\n return memberCount == rhs;\r\n\r\n case '<':\r\n return memberCount < rhs;\r\n\r\n case '>':\r\n return memberCount > rhs;\r\n\r\n case '<=':\r\n return memberCount <= rhs;\r\n\r\n case '>=':\r\n return memberCount >= rhs;\r\n\r\n default:\r\n return false;\r\n }\r\n };\r\n\r\n const eventFulfillsDisplayNameCondition = function (cond, ev) {\r\n let content = ev.getContent();\r\n\r\n if (ev.isEncrypted() && ev.getClearContent()) {\r\n content = ev.getClearContent();\r\n }\r\n\r\n if (!content || !content.body || typeof content.body != 'string') {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members || !room.currentState.getMember(client.credentials.userId)) {\r\n return false;\r\n }\r\n\r\n const displayName = room.currentState.getMember(client.credentials.userId).name; // N.B. we can't use \\b as it chokes on unicode. however \\W seems to be okay\r\n // as shorthand for [^0-9A-Za-z_].\r\n\r\n const pat = new RegExp(\"(^|\\\\W)\" + (0, _utils.escapeRegExp)(displayName) + \"(\\\\W|$)\", 'i');\r\n return content.body.search(pat) > -1;\r\n };\r\n\r\n const eventFulfillsEventMatchCondition = function (cond, ev) {\r\n if (!cond.key) {\r\n return false;\r\n }\r\n\r\n const val = valueForDottedKey(cond.key, ev);\r\n\r\n if (typeof val !== 'string') {\r\n return false;\r\n }\r\n\r\n if (cond.value) {\r\n return cond.value === val;\r\n }\r\n\r\n if (typeof cond.pattern !== 'string') {\r\n return false;\r\n }\r\n\r\n let regex;\r\n\r\n if (cond.key == 'content.body') {\r\n regex = createCachedRegex('(^|\\\\W)', cond.pattern, '(\\\\W|$)');\r\n } else {\r\n regex = createCachedRegex('^', cond.pattern, '$');\r\n }\r\n\r\n return !!val.match(regex);\r\n };\r\n\r\n const createCachedRegex = function (prefix, glob, suffix) {\r\n if (cachedGlobToRegex[glob]) {\r\n return cachedGlobToRegex[glob];\r\n }\r\n\r\n cachedGlobToRegex[glob] = new RegExp(prefix + (0, _utils.globToRegexp)(glob) + suffix, 'i');\r\n return cachedGlobToRegex[glob];\r\n };\r\n\r\n const valueForDottedKey = function (key, ev) {\r\n const parts = key.split('.');\r\n let val; // special-case the first component to deal with encrypted messages\r\n\r\n const firstPart = parts[0];\r\n\r\n if (firstPart === 'content') {\r\n val = ev.getContent();\r\n parts.shift();\r\n } else if (firstPart === 'type') {\r\n val = ev.getType();\r\n parts.shift();\r\n } else {\r\n // use the raw event for any other fields\r\n val = ev.event;\r\n }\r\n\r\n while (parts.length > 0) {\r\n const thisPart = parts.shift();\r\n\r\n if ((0, _utils.isNullOrUndefined)(val[thisPart])) {\r\n return null;\r\n }\r\n\r\n val = val[thisPart];\r\n }\r\n\r\n return val;\r\n };\r\n\r\n const matchingRuleForEventWithRulesets = function (ev, rulesets) {\r\n if (!rulesets) {\r\n return null;\r\n }\r\n\r\n if (ev.getSender() === client.credentials.userId) {\r\n return null;\r\n }\r\n\r\n return matchingRuleFromKindSet(ev, rulesets.global);\r\n };\r\n\r\n const pushActionsForEventAndRulesets = function (ev, rulesets) {\r\n const rule = matchingRuleForEventWithRulesets(ev, rulesets);\r\n\r\n if (!rule) {\r\n return {};\r\n }\r\n\r\n const actionObj = PushProcessor.actionListToActionsObject(rule.actions); // Some actions are implicit in some situations: we add those here\r\n\r\n if (actionObj.tweaks.highlight === undefined) {\r\n // if it isn't specified, highlight if it's a content\r\n // rule but otherwise not\r\n actionObj.tweaks.highlight = rule.kind == 'content';\r\n }\r\n\r\n return actionObj;\r\n };\r\n\r\n this.ruleMatchesEvent = function (rule, ev) {\r\n let ret = true;\r\n\r\n for (let i = 0; i < rule.conditions.length; ++i) {\r\n const cond = rule.conditions[i];\r\n ret &= eventFulfillsCondition(cond, ev);\r\n } //console.log(\"Rule \"+rule.rule_id+(ret ? \" matches\" : \" doesn't match\"));\r\n\r\n\r\n return ret;\r\n };\r\n /**\r\n * Get the user's push actions for the given event\r\n *\r\n * @param {module:models/event.MatrixEvent} ev\r\n *\r\n * @return {PushAction}\r\n */\r\n\r\n\r\n this.actionsForEvent = function (ev) {\r\n return pushActionsForEventAndRulesets(ev, client.pushRules);\r\n };\r\n /**\r\n * Get one of the users push rules by its ID\r\n *\r\n * @param {string} ruleId The ID of the rule to search for\r\n * @return {object} The push rule, or null if no such rule was found\r\n */\r\n\r\n\r\n this.getPushRuleById = function (ruleId) {\r\n for (const scope of ['global']) {\r\n if (client.pushRules[scope] === undefined) continue;\r\n\r\n for (const kind of RULEKINDS_IN_ORDER) {\r\n if (client.pushRules[scope][kind] === undefined) continue;\r\n\r\n for (const rule of client.pushRules[scope][kind]) {\r\n if (rule.rule_id === ruleId) return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n}\r\n/**\r\n * Convert a list of actions into a object with the actions as keys and their values\r\n * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ]\r\n * becomes { notify: true, tweaks: { sound: 'default' } }\r\n * @param {array} actionlist The actions list\r\n *\r\n * @return {object} A object with key 'notify' (true or false) and an object of actions\r\n */\r\n\r\n\r\nPushProcessor.actionListToActionsObject = function (actionlist) {\r\n const actionobj = {\r\n 'notify': false,\r\n 'tweaks': {}\r\n };\r\n\r\n for (let i = 0; i < actionlist.length; ++i) {\r\n const action = actionlist[i];\r\n\r\n if (action === 'notify') {\r\n actionobj.notify = true;\r\n } else if (typeof action === 'object') {\r\n if (action.value === undefined) {\r\n action.value = true;\r\n }\r\n\r\n actionobj.tweaks[action.set_tweak] = action.value;\r\n }\r\n }\r\n\r\n return actionobj;\r\n};\r\n/**\r\n * Rewrites conditions on a client's push rules to match the defaults\r\n * where applicable. Useful for upgrading push rules to more strict\r\n * conditions when the server is falling behind on defaults.\r\n * @param {object} incomingRules The client's existing push rules\r\n * @returns {object} The rewritten rules\r\n */\r\n\r\n\r\nPushProcessor.rewriteDefaultRules = function (incomingRules) {\r\n let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone\r\n // These lines are mostly to make the tests happy. We shouldn't run into these\r\n // properties missing in practice.\r\n\r\n if (!newRules) newRules = {};\r\n if (!newRules.global) newRules.global = {};\r\n if (!newRules.global.override) newRules.global.override = []; // Merge the client-level defaults with the ones from the server\r\n\r\n const globalOverrides = newRules.global.override;\r\n\r\n for (const override of DEFAULT_OVERRIDE_RULES) {\r\n const existingRule = globalOverrides.find(r => r.rule_id === override.rule_id);\r\n\r\n if (existingRule) {\r\n // Copy over the actions, default, and conditions. Don't touch the user's\r\n // preference.\r\n existingRule.default = override.default;\r\n existingRule.conditions = override.conditions;\r\n existingRule.actions = override.actions;\r\n } else {\r\n // Add the rule\r\n const ruleId = override.rule_id;\r\n\r\n _logger.logger.warn(`Adding default global override for ${ruleId}`);\r\n\r\n globalOverrides.push(override);\r\n }\r\n }\r\n\r\n return newRules;\r\n};\r\n/**\r\n * @typedef {Object} PushAction\r\n * @type {Object}\r\n * @property {boolean} notify Whether this event should notify the user or not.\r\n * @property {Object} tweaks How this event should be notified.\r\n * @property {boolean} tweaks.highlight Whether this event should be highlighted\r\n * on the UI.\r\n * @property {boolean} tweaks.sound Whether this notification should produce a\r\n * noise.\r\n */","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\"","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\"","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vue-js-toggle-button\"] = factory();\n\telse\n\t\troot[\"vue-js-toggle-button\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(8)\n\nvar Component = __webpack_require__(6)(\n /* script */\n __webpack_require__(1),\n /* template */\n __webpack_require__(7),\n /* scopeId */\n \"data-v-25adc6c0\",\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(3);\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\nvar DEFAULT_COLOR_CHECKED = '#75c791';\nvar DEFAULT_COLOR_UNCHECKED = '#bfcbd9';\nvar DEFAULT_LABEL_CHECKED = 'on';\nvar DEFAULT_LABEL_UNCHECKED = 'off';\nvar DEFAULT_SWITCH_COLOR = '#fff';\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'ToggleButton',\n props: {\n value: {\n type: Boolean,\n default: false\n },\n name: {\n type: String\n },\n disabled: {\n type: Boolean,\n default: false\n },\n tag: {\n type: String\n },\n sync: {\n type: Boolean,\n default: false\n },\n speed: {\n type: Number,\n default: 300\n },\n color: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'disabled');\n }\n },\n switchColor: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked');\n }\n },\n cssColors: {\n type: Boolean,\n default: false\n },\n labels: {\n type: [Boolean, Object],\n default: false,\n validator: function validator(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' ? value.checked || value.unchecked : typeof value === 'boolean';\n }\n },\n height: {\n type: Number,\n default: 22\n },\n width: {\n type: Number,\n default: 50\n },\n margin: {\n type: Number,\n default: 3\n },\n fontSize: {\n type: Number\n }\n },\n computed: {\n className: function className() {\n var toggled = this.toggled,\n disabled = this.disabled;\n\n\n return ['vue-js-switch', {\n toggled: toggled,\n disabled: disabled\n }];\n },\n coreStyle: function coreStyle() {\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n backgroundColor: this.cssColors ? null : this.disabled ? this.colorDisabled : this.colorCurrent,\n borderRadius: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(Math.round(this.height / 2))\n };\n },\n buttonRadius: function buttonRadius() {\n return this.height - this.margin * 2;\n },\n distance: function distance() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width - this.height + this.margin);\n },\n buttonStyle: function buttonStyle() {\n var transition = 'transform ' + this.speed + 'ms';\n var margin = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.margin);\n\n var transform = this.toggled ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(this.distance, margin) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(margin, margin);\n\n var background = this.switchColor ? this.switchColorCurrent : null;\n\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n transition: transition,\n transform: transform,\n background: background\n };\n },\n labelStyle: function labelStyle() {\n return {\n lineHeight: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n fontSize: this.fontSize ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.fontSize) : null\n };\n },\n colorChecked: function colorChecked() {\n var color = this.color;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(color)) {\n return color || DEFAULT_COLOR_CHECKED;\n }\n\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(color, 'checked', DEFAULT_COLOR_CHECKED);\n },\n colorUnchecked: function colorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'unchecked', DEFAULT_COLOR_UNCHECKED);\n },\n colorDisabled: function colorDisabled() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'disabled', this.colorCurrent);\n },\n colorCurrent: function colorCurrent() {\n return this.toggled ? this.colorChecked : this.colorUnchecked;\n },\n labelChecked: function labelChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'checked', DEFAULT_LABEL_CHECKED);\n },\n labelUnchecked: function labelUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'unchecked', DEFAULT_LABEL_UNCHECKED);\n },\n switchColorChecked: function switchColorChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'checked', DEFAULT_SWITCH_COLOR);\n },\n switchColorUnchecked: function switchColorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'unchecked', DEFAULT_SWITCH_COLOR);\n },\n switchColorCurrent: function switchColorCurrent() {\n var switchColor = this.switchColor;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(this.switchColor)) {\n return this.switchColor || DEFAULT_SWITCH_COLOR;\n }\n\n return this.toggled ? this.switchColorChecked : this.switchColorUnchecked;\n }\n },\n watch: {\n value: function value(_value) {\n if (this.sync) {\n this.toggled = !!_value;\n }\n }\n },\n data: function data() {\n return {\n toggled: !!this.value\n };\n },\n\n methods: {\n toggle: function toggle(event) {\n var toggled = !this.toggled;\n\n if (!this.sync) {\n this.toggled = toggled;\n }\n\n this.$emit('input', toggled);\n this.$emit('change', {\n value: toggled,\n tag: this.tag,\n srcEvent: event\n });\n }\n }\n});\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Button_vue__);\n/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, \"ToggleButton\", function() { return __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a; });\n\n\nvar installed = false;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n install: function install(Vue) {\n if (installed) {\n return;\n }\n\n Vue.component('ToggleButton', __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a);\n installed = true;\n }\n});\n\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return isString; });\n/* unused harmony export isBoolean */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return px; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return translate3d; });\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isString = function isString(value) {\n return typeof value === 'string';\n};\n\nvar isBoolean = function isBoolean(value) {\n return typeof value === 'boolean';\n};\n\nvar isObject = function isObject(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';\n};\n\nvar has = function has(object, key) {\n return isObject(object) && object.hasOwnProperty(key);\n};\n\nvar get = function get(object, key, defaultValue) {\n return has(object, key) ? object[key] : defaultValue;\n};\n\nvar px = function px(value) {\n return value + 'px';\n};\n\nvar translate3d = function translate3d(x, y) {\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0px';\n\n return 'translate3d(' + x + ', ' + y + ', ' + z + ')';\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)();\n// imports\n\n\n// module\nexports.push([module.i, \".vue-js-switch[data-v-25adc6c0]{display:inline-block;position:relative;vertical-align:middle;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input[data-v-25adc6c0]{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label[data-v-25adc6c0]{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left[data-v-25adc6c0]{left:10px}.vue-js-switch .v-switch-label.v-right[data-v-25adc6c0]{right:10px}.vue-js-switch .v-switch-core[data-v-25adc6c0]{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;user-select:none}.vue-js-switch .v-switch-core .v-switch-button[data-v-25adc6c0]{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:#fff;z-index:2}.vue-js-switch.disabled[data-v-25adc6c0]{pointer-events:none;opacity:.6}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n scopeId,\n cssModules\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n // inject cssModules\n if (cssModules) {\n var computed = Object.create(options.computed || null)\n Object.keys(cssModules).forEach(function (key) {\n var module = cssModules[key]\n computed[key] = function () { return module }\n })\n options.computed = computed\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('label', {\n class: _vm.className\n }, [_c('input', {\n staticClass: \"v-switch-input\",\n attrs: {\n \"type\": \"checkbox\",\n \"name\": _vm.name,\n \"disabled\": _vm.disabled\n },\n domProps: {\n \"checked\": _vm.value\n },\n on: {\n \"change\": function($event) {\n $event.stopPropagation();\n return _vm.toggle($event)\n }\n }\n }), _vm._v(\" \"), _c('div', {\n staticClass: \"v-switch-core\",\n style: (_vm.coreStyle)\n }, [_c('div', {\n staticClass: \"v-switch-button\",\n style: (_vm.buttonStyle)\n })]), _vm._v(\" \"), (_vm.labels) ? [(_vm.toggled) ? _c('span', {\n staticClass: \"v-switch-label v-left\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"checked\", [\n [_vm._v(_vm._s(_vm.labelChecked))]\n ])], 2) : _c('span', {\n staticClass: \"v-switch-label v-right\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"unchecked\", [\n [_vm._v(_vm._s(_vm.labelUnchecked))]\n ])], 2)] : _vm._e()], 2)\n},staticRenderFns: []}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ModalWindow.vue?vue&type=template&id=96a5a68e&scoped=true&\"\nimport script from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nexport * from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ModalWindow.vue?vue&type=style&index=0&id=96a5a68e&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"96a5a68e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapActions, mapGetters, mapState} from 'vuex'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport ModalWindow from '@/components/utils/ModalWindow.vue'\r\n\r\n\r\nexport default {\r\n name: \"contactsList\",\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n }\r\n\r\n },\r\n components: {\r\n preview,\r\n ModalWindow\r\n },\r\n\r\n props: {\r\n mode: {\r\n default: '',\r\n type: String\r\n },\r\n users: Array,\r\n selected : Object,\r\n title: String,\r\n },\r\n \r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n minimized : state => state.minimized,\r\n\r\n ...mapActions([\r\n 'PREPARE_USERDATA'\r\n ]),\r\n\r\n ...mapState([\r\n 'contactsMap',\r\n 'signedUpUsers',\r\n ]),\r\n\r\n }),\r\n\r\n methods: {\r\n select(contact) {\r\n this.$emit('select', contact)\r\n },\r\n\r\n navigateToProfile(id, contact) {\r\n\r\n if(this.mode == \"Select\"){\r\n this.select(contact)\r\n }\r\n else{\r\n this.$router.push({path: `/contact?id=${id}`}).catch(e => {})\r\n }\r\n },\r\n\r\n toggleUser(contact){\r\n this.$emit('toggleUser', contact.id)\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=691bf714&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=691bf714&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"691bf714\",\n null\n ,true\n)\n\nexport default component.exports","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=9b340a7a&scoped=true&lang=sass&\"","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./time.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./time.vue?vue&type=template&id=9218004e&scoped=true&\"\nimport script from \"./time.vue?vue&type=script&lang=js&\"\nexport * from \"./time.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./time.vue?vue&type=style&index=0&id=9218004e&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"9218004e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapState} from 'vuex';\r\nimport chatName from '@/components/chats/assets/name.vue'\r\nimport chatTime from '@/components/chats/assets/time.vue'\r\nimport chatIcon from '@/components/chats/assets/icon.vue'\r\n\r\n\r\nexport default {\r\n name: 'preview',\r\n props: {\r\n chat: Object,\r\n dummy: Boolean,\r\n },\r\n\r\n components: {\r\n chatName,\r\n chatTime,\r\n chatIcon,\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n roomMuted: false,\r\n ready: false,\r\n lastEvent: {},\r\n userStatusRoom: String,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n m_chat: {\r\n immediate: true,\r\n handler: function () {\r\n\r\n this.ready = false\r\n\r\n if (this.m_chat && !_.isEmpty(this.m_chat)) {\r\n\r\n this.core.mtrx.kit.prepareChat(this.m_chat).then(r => {\r\n this.ready = true\r\n })\r\n }\r\n \r\n }\r\n }\r\n\r\n },\r\n\r\n\r\n mounted : function(){\r\n\r\n \r\n },\r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n blockedCheck: function () {\r\n var users = this.core.mtrx.anotherChatUsers(this.m_chat.roomId)\r\n\r\n if (users.length == 1) {\r\n return this.core.mtrx.blockeduser(users[0].userId)\r\n }\r\n\r\n },\r\n m_chat: function () {\r\n\r\n if (!this.core.mtrx.client || !this.chat) return null\r\n\r\n let pushRules = this.core.mtrx.client._pushProcessor.getPushRuleById(this.chat.roomId)\r\n\r\n if (pushRules !== null) {\r\n this.roomMuted = true\r\n }\r\n\r\n if (this.chat.roomId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(this.chat.roomId)\r\n\r\n return m_chat || null\r\n }\r\n\r\n },\r\n chatevents: function () {\r\n return (this.events[this.chat.roomId] || {}).timeline || []\r\n },\r\n\r\n key: function () {\r\n if (this.event) return this.event.event_id\r\n\r\n return 'key'\r\n },\r\n\r\n unknowngroupusers : function(){\r\n return this.core.mtrx.kit.unknowngroupusers(this.chat)\r\n },\r\n\r\n matrixevent : function(){\r\n var e = this.event\r\n\r\n if (e){\r\n return e.get()\r\n }\r\n },\r\n\r\n event: function () {\r\n\r\n if (this.chat && this.chat.roomId) {\r\n\r\n var members = this.m_chat.currentState.getMembers()\r\n\r\n var events = _.filter(this.chatevents, (e) => {\r\n \r\n if (members.length <= 2 &&\r\n (e.event.type === 'm.room.power_levels' || (\r\n e.event.type === 'm.room.member' && e.event.content.membership !== 'invite'\r\n ))\r\n\r\n ) {\r\n return false\r\n }\r\n if (e.event.type === 'm.room.redaction') {\r\n return false\r\n }\r\n\r\n return !(e.event.content['m.relates_to'] && e.event.content['m.relates_to'][\"rel_type\"] === 'm.replace');\r\n\r\n })\r\n\r\n events = _.sortBy(events, function (e) {\r\n return e.event.origin_server_ts\r\n })\r\n\r\n if (events.length) {\r\n return events[events.length - 1]\r\n }\r\n\r\n }\r\n\r\n },\r\n\r\n ...mapState([\r\n 'minimized',\r\n 'active',\r\n 'events'\r\n ]),\r\n }),\r\n\r\n methods: {},\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=33d22462&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"33d22462\",\n null\n ,true\n)\n\nexport default component.exports","/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n this.init()\n this._w = W\n\n Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n return this\n}\n\nfunction rotl5 (num) {\n return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n if (s === 0) return (b & c) | ((~b) & d)\n if (s === 2) return (b & c) | (b & d) | (c & d)\n return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n var W = this._w\n\n var a = this._a | 0\n var b = this._b | 0\n var c = this._c | 0\n var d = this._d | 0\n var e = this._e | 0\n\n for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n for (var j = 0; j < 80; ++j) {\n var s = ~~(j / 20)\n var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n e = d\n d = c\n c = rotl30(b)\n b = a\n a = t\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n var H = Buffer.allocUnsafe(20)\n\n H.writeInt32BE(this._a | 0, 0)\n H.writeInt32BE(this._b | 0, 4)\n H.writeInt32BE(this._c | 0, 8)\n H.writeInt32BE(this._d | 0, 12)\n H.writeInt32BE(this._e | 0, 16)\n\n return H\n}\n\nmodule.exports = Sha\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"topheader\"},on:{\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"topheader \"},[_c('div',{staticClass:\"work\"},[_c('div',{staticClass:\"headerLine\"},[_c('div',{staticClass:\"leftIcon icon\",on:{\"mouseenter\":_vm.mouseenter}},[_vm._t(\"left\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"leftaddIcon iconsmall\"},[_vm._t(\"leftadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"infoPart\",on:{\"mouseenter\":_vm.mouseenter}},[_c('div',[_vm._t(\"info\",function(){return [_vm._v(\"   \")]})],2)]),_c('div',{staticClass:\"rightaddIcons iconsmall\"},[_vm._t(\"rightadd\",function(){return [_vm._v(\"   \")]})],2),_c('div',{staticClass:\"rightIcons icon\"},[_vm._t(\"right\",function(){return [_vm._v(\"   \")]})],2)]),_vm._t(\"additional\")],2)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'topheader',\r\n props: { },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : function() {\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n mouseenter : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'header'})\r\n },\r\n\r\n mouseleave : function(){\r\n if (this.$store.state.autohide)\r\n this.$store.commit('active', false)\r\n\r\n this.$store.commit('blockactive', {value : false, item : 'header'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=52afd868&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=52afd868&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"52afd868\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {};\r\nexports.default = void 0;\r\n\r\nvar matrixcs = _interopRequireWildcard(require(\"./matrix\"));\r\n\r\nObject.keys(matrixcs).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === matrixcs[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return matrixcs[key];\r\n }\r\n });\r\n});\r\n\r\nvar _browserRequest = _interopRequireDefault(require(\"browser-request\"));\r\n\r\nvar _qs = _interopRequireDefault(require(\"qs\"));\r\n\r\n/*\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nmatrixcs.request(function (opts, fn) {\r\n // We manually fix the query string for browser-request because\r\n // it doesn't correctly handle cases like ?via=one&via=two. Instead\r\n // we mimic `request`'s query string interface to make it all work\r\n // as expected.\r\n // browser-request will happily take the constructed string as the\r\n // query string without trying to modify it further.\r\n opts.qs = _qs.default.stringify(opts.qs || {}, opts.qsStringifyOptions);\r\n return (0, _browserRequest.default)(opts, fn);\r\n}); // just *accessing* indexedDB throws an exception in firefox with\r\n// indexeddb disabled.\r\n\r\nlet indexedDB;\r\n\r\ntry {\r\n indexedDB = global.indexedDB;\r\n} catch (e) {} // if our browser (appears to) support indexeddb, use an indexeddb crypto store.\r\n\r\n\r\nif (indexedDB) {\r\n matrixcs.setCryptoStoreFactory(function () {\r\n return new matrixcs.IndexedDBCryptoStore(indexedDB, \"matrix-js-sdk:crypto\");\r\n });\r\n} // We export 3 things to make browserify happy as well as downstream projects.\r\n// It's awkward, but required.\r\n\r\n\r\nvar _default = matrixcs; // keep export for browserify package deps\r\n\r\nexports.default = _default;\r\nglobal.matrixcs = matrixcs;","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","exports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=332740e2&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=332740e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"332740e2\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.getDesktopCapturerSources = getDesktopCapturerSources;\r\nexports.setAudioOutput = setAudioOutput;\r\nexports.setAudioInput = setAudioInput;\r\nexports.setVideoInput = setVideoInput;\r\nexports.createNewMatrixCall = createNewMatrixCall;\r\nexports.MatrixCall = exports.CallError = exports.CallErrorCode = exports.CallEvent = exports.CallParty = exports.CallDirection = exports.CallType = exports.CallState = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _event = require(\"../@types/event\");\r\n\r\nvar _randomstring = require(\"../randomstring\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link createNewMatrixCall} for the public API.\r\n * @module webrtc/call\r\n */\r\nlet CallState;\r\nexports.CallState = CallState;\r\n\r\n(function (CallState) {\r\n CallState[\"Fledgling\"] = \"fledgling\";\r\n CallState[\"InviteSent\"] = \"invite_sent\";\r\n CallState[\"WaitLocalMedia\"] = \"wait_local_media\";\r\n CallState[\"CreateOffer\"] = \"create_offer\";\r\n CallState[\"CreateAnswer\"] = \"create_answer\";\r\n CallState[\"Connecting\"] = \"connecting\";\r\n CallState[\"Connected\"] = \"connected\";\r\n CallState[\"Ringing\"] = \"ringing\";\r\n CallState[\"Ended\"] = \"ended\";\r\n})(CallState || (exports.CallState = CallState = {}));\r\n\r\nlet CallType;\r\nexports.CallType = CallType;\r\n\r\n(function (CallType) {\r\n CallType[\"Voice\"] = \"voice\";\r\n CallType[\"Video\"] = \"video\";\r\n})(CallType || (exports.CallType = CallType = {}));\r\n\r\nlet CallDirection;\r\nexports.CallDirection = CallDirection;\r\n\r\n(function (CallDirection) {\r\n CallDirection[\"Inbound\"] = \"inbound\";\r\n CallDirection[\"Outbound\"] = \"outbound\";\r\n})(CallDirection || (exports.CallDirection = CallDirection = {}));\r\n\r\nlet CallParty;\r\nexports.CallParty = CallParty;\r\n\r\n(function (CallParty) {\r\n CallParty[\"Local\"] = \"local\";\r\n CallParty[\"Remote\"] = \"remote\";\r\n})(CallParty || (exports.CallParty = CallParty = {}));\r\n\r\nlet CallEvent;\r\nexports.CallEvent = CallEvent;\r\n\r\n(function (CallEvent) {\r\n CallEvent[\"Hangup\"] = \"hangup\";\r\n CallEvent[\"State\"] = \"state\";\r\n CallEvent[\"Error\"] = \"error\";\r\n CallEvent[\"Replaced\"] = \"replaced\";\r\n CallEvent[\"LocalHoldUnhold\"] = \"local_hold_unhold\";\r\n CallEvent[\"RemoteHoldUnhold\"] = \"remote_hold_unhold\";\r\n CallEvent[\"HoldUnhold\"] = \"hold_unhold\";\r\n})(CallEvent || (exports.CallEvent = CallEvent = {}));\r\n\r\nlet CallErrorCode;\r\nexports.CallErrorCode = CallErrorCode;\r\n\r\n(function (CallErrorCode) {\r\n CallErrorCode[\"UserHangup\"] = \"user_hangup\";\r\n CallErrorCode[\"LocalOfferFailed\"] = \"local_offer_failed\";\r\n CallErrorCode[\"NoUserMedia\"] = \"no_user_media\";\r\n CallErrorCode[\"UnknownDevices\"] = \"unknown_devices\";\r\n CallErrorCode[\"SendInvite\"] = \"send_invite\";\r\n CallErrorCode[\"CreateAnswer\"] = \"create_answer\";\r\n CallErrorCode[\"SendAnswer\"] = \"send_answer\";\r\n CallErrorCode[\"SetRemoteDescription\"] = \"set_remote_description\";\r\n CallErrorCode[\"SetLocalDescription\"] = \"set_local_description\";\r\n CallErrorCode[\"AnsweredElsewhere\"] = \"answered_elsewhere\";\r\n CallErrorCode[\"IceFailed\"] = \"ice_failed\";\r\n CallErrorCode[\"InviteTimeout\"] = \"invite_timeout\";\r\n CallErrorCode[\"Replaced\"] = \"replaced\";\r\n CallErrorCode[\"SignallingFailed\"] = \"signalling_timeout\";\r\n})(CallErrorCode || (exports.CallErrorCode = CallErrorCode = {}));\r\n\r\nvar ConstraintsType;\r\n/**\r\n * The version field that we set in m.call.* events\r\n */\r\n\r\n(function (ConstraintsType) {\r\n ConstraintsType[\"Audio\"] = \"audio\";\r\n ConstraintsType[\"Video\"] = \"video\";\r\n})(ConstraintsType || (ConstraintsType = {}));\r\n\r\nconst VOIP_PROTO_VERSION = 1;\r\n/** The fallback ICE server to use for STUN or TURN protocols. */\r\n\r\nconst FALLBACK_ICE_SERVER = 'stun:turn.matrix.org';\r\n/** The length of time a call can be ringing for. */\r\n\r\nconst CALL_TIMEOUT_MS = 60000;\r\n/** Retrieves sources from desktopCapturer */\r\n\r\nfunction getDesktopCapturerSources() {\r\n const options = {\r\n thumbnailSize: {\r\n height: 176,\r\n width: 312\r\n },\r\n types: [\"screen\", \"window\"]\r\n };\r\n return window.electron.getDesktopCapturerSources(options);\r\n}\r\n\r\nclass CallError extends Error {\r\n constructor(code, msg, err) {\r\n // Stil ldon't think there's any way to have proper nested errors\r\n super(msg + \": \" + err);\r\n (0, _defineProperty2.default)(this, \"code\", void 0);\r\n this.code = code;\r\n }\r\n\r\n}\r\n\r\nexports.CallError = CallError;\r\n\r\nfunction genCallID() {\r\n return Date.now().toString() + (0, _randomstring.randomString)(16);\r\n}\r\n/**\r\n * Construct a new Matrix Call.\r\n * @constructor\r\n * @param {Object} opts Config options.\r\n * @param {string} opts.roomId The room ID for this call.\r\n * @param {Object} opts.webRtc The WebRTC globals from the browser.\r\n * @param {boolean} opts.forceTURN whether relay through TURN should be forced.\r\n * @param {Object} opts.URL The URL global.\r\n * @param {Array} opts.turnServers Optional. A list of TURN servers.\r\n * @param {MatrixClient} opts.client The Matrix Client instance to send events to.\r\n */\r\n\r\n\r\nclass MatrixCall extends _events.EventEmitter {\r\n // Fix when client is TSified\r\n // XXX: I don't know why this is called 'config'.\r\n // The party ID of the other side: undefined if we haven't chosen a partner\r\n // yet, null if we have but they didn't send a party ID.\r\n // in the browser it's 'number'\r\n // The logic of when & if a call is on hold is nontrivial and explained in is*OnHold\r\n // This flag represents whether we want the other party to be on hold\r\n // and this one we set when we're transitioning out of the hold state because we\r\n // can't tell the difference between that and the other party holding us\r\n // the stats for the call at the point it ended. We can't get these after we\r\n // tear the call down, so we just grab a snapshot before we stop the call.\r\n // The typescript definitions have this type as 'any' :(\r\n // Perfect negotiation state: https://www.w3.org/TR/webrtc/#perfect-negotiation-example\r\n // If candidates arrive before we've picked an opponent (which, in particular,\r\n // will happen if the opponent sends candidates eagerly before the user answers\r\n // the call) we buffer them up here so we can then add the ones from the party we pick\r\n constructor(opts) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"roomId\", void 0);\r\n (0, _defineProperty2.default)(this, \"type\", void 0);\r\n (0, _defineProperty2.default)(this, \"callId\", void 0);\r\n (0, _defineProperty2.default)(this, \"state\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupParty\", void 0);\r\n (0, _defineProperty2.default)(this, \"hangupReason\", void 0);\r\n (0, _defineProperty2.default)(this, \"direction\", void 0);\r\n (0, _defineProperty2.default)(this, \"ourPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"client\", void 0);\r\n (0, _defineProperty2.default)(this, \"forceTURN\", void 0);\r\n (0, _defineProperty2.default)(this, \"turnServers\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendQueue\", void 0);\r\n (0, _defineProperty2.default)(this, \"candidateSendTries\", void 0);\r\n (0, _defineProperty2.default)(this, \"sentEndOfCandidates\", void 0);\r\n (0, _defineProperty2.default)(this, \"peerConn\", void 0);\r\n (0, _defineProperty2.default)(this, \"localVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteVideoElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteAudioElement\", void 0);\r\n (0, _defineProperty2.default)(this, \"screenSharingStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"localAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteOrAnswerSent\", void 0);\r\n (0, _defineProperty2.default)(this, \"waitForLocalAVStream\", void 0);\r\n (0, _defineProperty2.default)(this, \"config\", void 0);\r\n (0, _defineProperty2.default)(this, \"successor\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentMember\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentVersion\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentPartyId\", void 0);\r\n (0, _defineProperty2.default)(this, \"opponentCaps\", void 0);\r\n (0, _defineProperty2.default)(this, \"inviteTimeout\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteOnHold\", void 0);\r\n (0, _defineProperty2.default)(this, \"unholdingRemote\", void 0);\r\n (0, _defineProperty2.default)(this, \"micMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"vidMuted\", void 0);\r\n (0, _defineProperty2.default)(this, \"callStatsAtEnd\", void 0);\r\n (0, _defineProperty2.default)(this, \"makingOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"ignoreOffer\", void 0);\r\n (0, _defineProperty2.default)(this, \"remoteCandidateBuffer\", new Map());\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForInvite\", async stream => {\r\n if (this.successor) {\r\n this.successor.gotUserMediaForAnswer(stream);\r\n return;\r\n }\r\n\r\n if (this.callHasEnded()) {\r\n this.stopAllMedia();\r\n return;\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n this.setState(CallState.CreateOffer);\r\n\r\n _logger.logger.debug(\"gotUserMediaForInvite -> \" + this.type);\r\n\r\n const videoEl = this.getLocalVideoElement();\r\n\r\n if (videoEl && this.type === CallType.Video) {\r\n videoEl.autoplay = true;\r\n\r\n if (this.screenSharingStream) {\r\n _logger.logger.debug(\"Setting screen sharing stream to the local video element\");\r\n\r\n videoEl.srcObject = this.screenSharingStream;\r\n } else {\r\n videoEl.srcObject = stream;\r\n }\r\n\r\n videoEl.muted = true;\r\n\r\n try {\r\n await videoEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n } // why do we enable audio (and only audio) tracks here? -- matthew\r\n\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const audioTrack of stream.getAudioTracks()) {\r\n _logger.logger.info(\"Adding audio track with id \" + audioTrack.id);\r\n\r\n this.peerConn.addTrack(audioTrack, stream);\r\n }\r\n\r\n for (const videoTrack of (this.screenSharingStream || stream).getVideoTracks()) {\r\n _logger.logger.info(\"Adding video track with id \" + videoTrack.id);\r\n\r\n this.peerConn.addTrack(videoTrack, stream);\r\n } // Now we wait for the negotiationneeded event\r\n\r\n });\r\n (0, _defineProperty2.default)(this, \"gotUserMediaForAnswer\", async stream => {\r\n if (this.callHasEnded()) {\r\n return;\r\n }\r\n\r\n const localVidEl = this.getLocalVideoElement();\r\n\r\n if (localVidEl && this.type === CallType.Video) {\r\n localVidEl.autoplay = true;\r\n localVidEl.srcObject = stream;\r\n localVidEl.muted = true;\r\n\r\n try {\r\n await localVidEl.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n\r\n this.localAVStream = stream;\r\n\r\n _logger.logger.info(\"Got local AV stream with id \" + this.localAVStream.id);\r\n\r\n setTracksEnabled(stream.getAudioTracks(), true);\r\n\r\n for (const track of stream.getTracks()) {\r\n this.peerConn.addTrack(track, stream);\r\n }\r\n\r\n this.setState(CallState.CreateAnswer);\r\n let myAnswer;\r\n\r\n try {\r\n myAnswer = await this.peerConn.createAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Failed to create answer: \", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.CreateAnswer, true);\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(myAnswer);\r\n this.setState(CallState.Connecting); // Allow a short time for initial candidates to be gathered\r\n\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n this.sendAnswer();\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalIceCandidate\", event => {\r\n if (event.candidate) {\r\n _logger.logger.debug(\"Call \" + this.callId + \" got local ICE \" + event.candidate.sdpMid + \" candidate: \" + event.candidate.candidate);\r\n\r\n if (this.callHasEnded()) return; // As with the offer, note we need to make a copy of this object, not\r\n // pass the original: that broke in Chrome ~m43.\r\n\r\n if (event.candidate.candidate !== '' || !this.sentEndOfCandidates) {\r\n this.queueCandidate(event.candidate);\r\n if (event.candidate.candidate === '') this.sentEndOfCandidates = true;\r\n }\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceGatheringStateChange\", event => {\r\n _logger.logger.debug(\"ice gathering state changed to \" + this.peerConn.iceGatheringState);\r\n\r\n if (this.peerConn.iceGatheringState === 'complete' && !this.sentEndOfCandidates) {\r\n // If we didn't get an empty-string candidate to signal the end of candidates,\r\n // create one ourselves now gathering has finished.\r\n // We cast because the interface lists all the properties as required but we\r\n // only want to send 'candidate'\r\n // XXX: We probably want to send either sdpMid or sdpMLineIndex, as it's not strictly\r\n // correct to have a candidate that lacks both of these. We'd have to figure out what\r\n // previous candidates had been sent with and copy them.\r\n const c = {\r\n candidate: ''\r\n };\r\n this.queueCandidate(c);\r\n this.sentEndOfCandidates = true;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"gotLocalOffer\", async description => {\r\n _logger.logger.debug(\"Created offer: \", description);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(\"Ignoring newly created offer on call ID \" + this.callId + \" because the call has ended\");\r\n\r\n return;\r\n }\r\n\r\n try {\r\n await this.peerConn.setLocalDescription(description);\r\n } catch (err) {\r\n _logger.logger.debug(\"Error setting local description!\", err);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetLocalDescription, true);\r\n return;\r\n }\r\n\r\n if (this.peerConn.iceGatheringState === 'gathering') {\r\n // Allow a short time for initial candidates to be gathered\r\n await new Promise(resolve => {\r\n setTimeout(resolve, 200);\r\n });\r\n }\r\n\r\n if (this.callHasEnded()) return;\r\n const eventType = this.state === CallState.CreateOffer ? _event.EventType.CallInvite : _event.EventType.CallNegotiate;\r\n const content = {\r\n lifetime: CALL_TIMEOUT_MS\r\n }; // clunky because TypeScript can't folow the types through if we use an expression as the key\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n content.offer = this.peerConn.localDescription;\r\n } else {\r\n content.description = this.peerConn.localDescription;\r\n }\r\n\r\n if (this.client._supportsCallTransfer) {\r\n content.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // Get rid of any candidates waiting to be sent: they'll be included in the local\r\n // description we just got and will send in the offer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(eventType, content);\r\n } catch (error) {\r\n _logger.logger.error(\"Failed to send invite\", error);\r\n\r\n if (error.event) this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SignallingFailed;\r\n let message = \"Signalling failed\";\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n code = CallErrorCode.SendInvite;\r\n message = \"Failed to send invite\";\r\n }\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.terminate(CallParty.Local, code, false); // no need to carry on & send the candidate queue, but we also\r\n // don't want to rethrow the error\r\n\r\n return;\r\n }\r\n\r\n this.sendCandidateQueue();\r\n\r\n if (this.state === CallState.CreateOffer) {\r\n this.inviteOrAnswerSent = true;\r\n this.setState(CallState.InviteSent);\r\n this.inviteTimeout = setTimeout(() => {\r\n this.inviteTimeout = null;\r\n\r\n if (this.state === CallState.InviteSent) {\r\n this.hangup(CallErrorCode.InviteTimeout, false);\r\n }\r\n }, CALL_TIMEOUT_MS);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"getLocalOfferFailed\", err => {\r\n _logger.logger.error(\"Failed to get local offer\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.LocalOfferFailed, \"Failed to get local offer!\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.LocalOfferFailed, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"getUserMediaFailed\", err => {\r\n if (this.successor) {\r\n this.successor.getUserMediaFailed(err);\r\n return;\r\n }\r\n\r\n _logger.logger.warn(\"Failed to get user media - ending call\", err);\r\n\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Couldn't start capturing media! Is your microphone set up and \" + \"does this app have permission?\", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n });\r\n (0, _defineProperty2.default)(this, \"onIceConnectionStateChanged\", () => {\r\n if (this.callHasEnded()) {\r\n return; // because ICE can still complete as we're ending the call\r\n }\r\n\r\n _logger.logger.debug(\"Call ID \" + this.callId + \": ICE connection state changed to: \" + this.peerConn.iceConnectionState); // ideally we'd consider the call to be connected when we get media but\r\n // chrome doesn't implement any of the 'onstarted' events yet\r\n\r\n\r\n if (this.peerConn.iceConnectionState == 'connected') {\r\n this.setState(CallState.Connected);\r\n } else if (this.peerConn.iceConnectionState == 'failed') {\r\n this.hangup(CallErrorCode.IceFailed, false);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onSignallingStateChanged\", () => {\r\n _logger.logger.debug(\"call \" + this.callId + \": Signalling state changed to: \" + this.peerConn.signalingState);\r\n });\r\n (0, _defineProperty2.default)(this, \"onTrack\", ev => {\r\n if (ev.streams.length === 0) {\r\n _logger.logger.warn(`Streamless ${ev.track.kind} found: ignoring.`);\r\n\r\n return;\r\n } // If we already have a stream, check this track is from the same one\r\n\r\n\r\n if (this.remoteStream && ev.streams[0].id !== this.remoteStream.id) {\r\n _logger.logger.warn(`Ignoring new stream ID ${ev.streams[0].id}: we already have stream ID ${this.remoteStream.id}`);\r\n\r\n return;\r\n }\r\n\r\n if (!this.remoteStream) {\r\n _logger.logger.info(\"Got remote stream with id \" + ev.streams[0].id);\r\n } // Note that we check by ID above and always set the remote stream: Chrome appears\r\n // to make new stream objects when tranciever directionality is changed and the 'active'\r\n // status of streams change\r\n\r\n\r\n this.remoteStream = ev.streams[0];\r\n\r\n _logger.logger.debug(`Track id ${ev.track.id} of kind ${ev.track.kind} added`);\r\n\r\n if (ev.track.kind === 'video') {\r\n if (this.remoteVideoElement) {\r\n this.playRemoteVideo();\r\n }\r\n } else {\r\n if (this.remoteAudioElement) this.playRemoteAudio();\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onNegotiationNeeded\", async () => {\r\n _logger.logger.info(\"Negotation is needed!\");\r\n\r\n if (this.state !== CallState.CreateOffer && this.opponentVersion === 0) {\r\n _logger.logger.info(\"Opponent does not support renegotiation: ignoring negotiationneeded event\");\r\n\r\n return;\r\n }\r\n\r\n this.makingOffer = true;\r\n\r\n try {\r\n const myOffer = await this.peerConn.createOffer();\r\n await this.gotLocalOffer(myOffer);\r\n } catch (e) {\r\n this.getLocalOfferFailed(e);\r\n return;\r\n } finally {\r\n this.makingOffer = false;\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onHangupReceived\", msg => {\r\n _logger.logger.debug(\"Hangup received for call ID \" + this.callId); // party ID must match (our chosen partner hanging up the call) or be undefined (we haven't chosen\r\n // a partner yet but we're treating the hangup as a reject as per VoIP v0)\r\n\r\n\r\n if (this.partyIdMatches(msg) || this.state === CallState.Ringing) {\r\n // default reason is user_hangup\r\n this.terminate(CallParty.Remote, msg.reason || CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.info(`Ignoring message from party ID ${msg.party_id}: our partner is ${this.opponentPartyId}`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onRejectReceived\", msg => {\r\n _logger.logger.debug(\"Reject received for call ID \" + this.callId); // No need to check party_id for reject because if we'd received either\r\n // an answer or reject, we wouldn't be in state InviteSent\r\n\r\n\r\n const shouldTerminate = // reject events also end the call if it's ringing: it's another of\r\n // our devices rejecting the call.\r\n [CallState.InviteSent, CallState.Ringing].includes(this.state) || // also if we're in the init state and it's an inbound call, since\r\n // this means we just haven't entered the ringing state yet\r\n this.state === CallState.Fledgling && this.direction === CallDirection.Inbound;\r\n\r\n if (shouldTerminate) {\r\n this.terminate(CallParty.Remote, CallErrorCode.UserHangup, true);\r\n } else {\r\n _logger.logger.debug(`Call is in state: ${this.state}: ignoring reject`);\r\n }\r\n });\r\n (0, _defineProperty2.default)(this, \"onAnsweredElsewhere\", msg => {\r\n _logger.logger.debug(\"Call ID \" + this.callId + \" answered elsewhere\");\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n });\r\n this.roomId = opts.roomId;\r\n this.client = opts.client;\r\n this.type = null;\r\n this.forceTURN = opts.forceTURN;\r\n this.ourPartyId = this.client.deviceId; // Array of Objects with urls, username, credential keys\r\n\r\n this.turnServers = opts.turnServers || [];\r\n\r\n if (this.turnServers.length === 0 && this.client.isFallbackICEServerAllowed()) {\r\n this.turnServers.push({\r\n urls: [FALLBACK_ICE_SERVER]\r\n });\r\n }\r\n\r\n for (const server of this.turnServers) {\r\n utils.checkObjectHasKeys(server, [\"urls\"]);\r\n }\r\n\r\n this.callId = genCallID();\r\n this.state = CallState.Fledgling; // A queue for candidates waiting to go out.\r\n // We try to amalgamate candidates into a single candidate message where\r\n // possible\r\n\r\n this.candidateSendQueue = [];\r\n this.candidateSendTries = 0;\r\n this.sentEndOfCandidates = false;\r\n this.inviteOrAnswerSent = false;\r\n this.makingOffer = false;\r\n this.remoteOnHold = false;\r\n this.unholdingRemote = false;\r\n this.micMuted = false;\r\n this.vidMuted = false;\r\n }\r\n /**\r\n * Place a voice call to this room.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVoiceCall() {\r\n _logger.logger.debug(\"placeVoiceCall\");\r\n\r\n this.checkForErrorListener();\r\n const constraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.type = CallType.Voice;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a video call to this room.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeVideoCall(remoteVideoElement, localVideoElement) {\r\n _logger.logger.debug(\"placeVideoCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n const constraints = getUserMediaContraints(ConstraintsType.Video);\r\n this.type = CallType.Video;\r\n await this.placeCallWithConstraints(constraints);\r\n }\r\n /**\r\n * Place a screen-sharing call to this room. This includes audio.\r\n * This method is EXPERIMENTAL and subject to change without warning. It\r\n * only works in Google Chrome and Firefox >= 44.\r\n * @param {Element} remoteVideoElement a <video> DOM element\r\n * to render video to.\r\n * @param {Element} localVideoElement a <video> DOM element\r\n * to render the local camera preview.\r\n * @throws If you have not specified a listener for 'error' events.\r\n */\r\n\r\n\r\n async placeScreenSharingCall(remoteVideoElement, localVideoElement, selectDesktopCapturerSource) {\r\n _logger.logger.debug(\"placeScreenSharingCall\");\r\n\r\n this.checkForErrorListener();\r\n this.localVideoElement = localVideoElement;\r\n this.remoteVideoElement = remoteVideoElement;\r\n\r\n try {\r\n var _window$electron;\r\n\r\n const screenshareConstraints = await getScreenshareContraints(selectDesktopCapturerSource);\r\n\r\n if (!screenshareConstraints) {\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n return;\r\n }\r\n\r\n if ((_window$electron = window.electron) !== null && _window$electron !== void 0 && _window$electron.getDesktopCapturerSources) {\r\n // We are using Electron\r\n _logger.logger.debug(\"Getting screen stream using getUserMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getUserMedia(screenshareConstraints);\r\n } else {\r\n // We are not using Electron\r\n _logger.logger.debug(\"Getting screen stream using getDisplayMedia()...\");\r\n\r\n this.screenSharingStream = await navigator.mediaDevices.getDisplayMedia(screenshareConstraints);\r\n }\r\n\r\n _logger.logger.debug(\"Got screen stream, requesting audio stream...\");\r\n\r\n const audioConstraints = getUserMediaContraints(ConstraintsType.Audio);\r\n this.placeCallWithConstraints(audioConstraints);\r\n } catch (err) {\r\n this.emit(CallEvent.Error, new CallError(CallErrorCode.NoUserMedia, \"Failed to get screen-sharing stream: \", err));\r\n this.terminate(CallParty.Local, CallErrorCode.NoUserMedia, false);\r\n }\r\n\r\n this.type = CallType.Video;\r\n }\r\n\r\n getOpponentMember() {\r\n return this.opponentMember;\r\n }\r\n\r\n opponentCanBeTransferred() {\r\n return Boolean(this.opponentCaps && this.opponentCaps[\"m.call.transferee\"]);\r\n }\r\n /**\r\n * Retrieve the local <video> DOM element.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getLocalVideoElement() {\r\n return this.localVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <video> DOM element\r\n * used for playing back video capable streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteVideoElement() {\r\n return this.remoteVideoElement;\r\n }\r\n /**\r\n * Retrieve the remote <audio> DOM element\r\n * used for playing back audio only streams.\r\n * @return {Element} The dom element\r\n */\r\n\r\n\r\n getRemoteAudioElement() {\r\n return this.remoteAudioElement;\r\n }\r\n /**\r\n * Set the local <video> DOM element. If this call is active,\r\n * video will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setLocalVideoElement(element) {\r\n this.localVideoElement = element;\r\n\r\n if (element && this.localAVStream && this.type === CallType.Video) {\r\n element.autoplay = true;\r\n element.srcObject = this.localAVStream;\r\n element.muted = true;\r\n\r\n try {\r\n await element.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play local video element\", e);\r\n }\r\n }\r\n }\r\n /**\r\n * Set the remote <video> DOM element. If this call is active,\r\n * the first received video-capable stream will be rendered to it immediately.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n setRemoteVideoElement(element) {\r\n if (element === this.remoteVideoElement) return;\r\n element.autoplay = true; // if we already have an audio element set, use that instead and mute the audio\r\n // on this video element.\r\n\r\n if (this.remoteAudioElement) element.muted = true;\r\n this.remoteVideoElement = element;\r\n\r\n if (this.remoteStream) {\r\n this.playRemoteVideo();\r\n }\r\n }\r\n /**\r\n * Set the remote <audio> DOM element. If this call is active,\r\n * the first received audio-only stream will be rendered to it immediately.\r\n * The audio will *not* be rendered from the remoteVideoElement.\r\n * @param {Element} element The <video> DOM element.\r\n */\r\n\r\n\r\n async setRemoteAudioElement(element) {\r\n if (element === this.remoteAudioElement) return;\r\n this.remoteAudioElement = element;\r\n if (this.remoteStream) this.playRemoteAudio();\r\n } // The typescript definitions have this type as 'any' :(\r\n\r\n\r\n async getCurrentCallStats() {\r\n if (this.callHasEnded()) {\r\n return this.callStatsAtEnd;\r\n }\r\n\r\n return this.collectCallStats();\r\n }\r\n\r\n async collectCallStats() {\r\n // This happens when the call fails before it starts.\r\n // For example when we fail to get capture sources\r\n if (!this.peerConn) return;\r\n const statsReport = await this.peerConn.getStats();\r\n const stats = [];\r\n\r\n for (const item of statsReport) {\r\n stats.push(item[1]);\r\n }\r\n\r\n return stats;\r\n }\r\n /**\r\n * Configure this call from an invite event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.invite event\r\n */\r\n\r\n\r\n async initWithInvite(event) {\r\n const invite = event.getContent();\r\n this.direction = CallDirection.Inbound; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n }\r\n\r\n this.peerConn = this.createPeerConnection(); // we must set the party ID before await-ing on anything: the call event\r\n // handler will start giving us more call events (eg. candidates) so if\r\n // we haven't set the party ID, we'll ignore them.\r\n\r\n this.chooseOpponent(event);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(invite.offer);\r\n await this.addBufferedIceCandidates();\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // According to previous comments in this file, firefox at some point did not\r\n // add streams until media started ariving on them. Testing latest firefox\r\n // (81 at time of writing), this is no longer a problem, so let's do it the correct way.\r\n\r\n\r\n if (!this.remoteStream || this.remoteStream.getTracks().length === 0) {\r\n _logger.logger.error(\"No remote stream or no tracks after setting remote description!\");\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n }\r\n\r\n this.type = this.remoteStream.getTracks().some(t => t.kind === 'video') ? CallType.Video : CallType.Voice;\r\n this.setState(CallState.Ringing);\r\n\r\n if (event.getLocalAge()) {\r\n setTimeout(() => {\r\n if (this.state == CallState.Ringing) {\r\n _logger.logger.debug(\"Call invite has expired. Hanging up.\");\r\n\r\n this.hangupParty = CallParty.Remote; // effectively\r\n\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn.signalingState != 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n this.emit(CallEvent.Hangup);\r\n }\r\n }, invite.lifetime - event.getLocalAge());\r\n }\r\n }\r\n /**\r\n * Configure this call from a hangup or reject event. Used by MatrixClient.\r\n * @param {MatrixEvent} event The m.call.hangup event\r\n */\r\n\r\n\r\n initWithHangup(event) {\r\n // perverse as it may seem, sometimes we want to instantiate a call with a\r\n // hangup message (because when getting the state of the room on load, events\r\n // come in reverse order and we want to remember that a call has been hung up)\r\n this.setState(CallState.Ended);\r\n }\r\n /**\r\n * Answer a call.\r\n */\r\n\r\n\r\n async answer() {\r\n if (this.inviteOrAnswerSent) {\r\n return;\r\n }\r\n\r\n _logger.logger.debug(`Answering call ${this.callId} of type ${this.type}`);\r\n\r\n if (!this.localAVStream && !this.waitForLocalAVStream) {\r\n const constraints = getUserMediaContraints(this.type == CallType.Video ? ConstraintsType.Video : ConstraintsType.Audio);\r\n\r\n _logger.logger.log(\"Getting user media with constraints\", constraints);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.waitForLocalAVStream = true;\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.waitForLocalAVStream = false;\r\n this.gotUserMediaForAnswer(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n } else if (this.localAVStream) {\r\n this.gotUserMediaForAnswer(this.localAVStream);\r\n } else if (this.waitForLocalAVStream) {\r\n this.setState(CallState.WaitLocalMedia);\r\n }\r\n }\r\n /**\r\n * Replace this call with a new call, e.g. for glare resolution. Used by\r\n * MatrixClient.\r\n * @param {MatrixCall} newCall The new call.\r\n */\r\n\r\n\r\n replacedBy(newCall) {\r\n _logger.logger.debug(this.callId + \" being replaced by \" + newCall.callId);\r\n\r\n if (this.state === CallState.WaitLocalMedia) {\r\n _logger.logger.debug(\"Telling new call to wait for local media\");\r\n\r\n newCall.waitForLocalAVStream = true;\r\n } else if (this.state === CallState.CreateOffer) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n } else if (this.state === CallState.InviteSent) {\r\n _logger.logger.debug(\"Handing local stream to new call\");\r\n\r\n newCall.gotUserMediaForAnswer(this.localAVStream);\r\n delete this.localAVStream;\r\n }\r\n\r\n newCall.localVideoElement = this.localVideoElement;\r\n newCall.remoteVideoElement = this.remoteVideoElement;\r\n newCall.remoteAudioElement = this.remoteAudioElement;\r\n this.successor = newCall;\r\n this.emit(CallEvent.Replaced, newCall);\r\n this.hangup(CallErrorCode.Replaced, true);\r\n }\r\n /**\r\n * Hangup a call.\r\n * @param {string} reason The reason why the call is being hung up.\r\n * @param {boolean} suppressEvent True to suppress emitting an event.\r\n */\r\n\r\n\r\n hangup(reason, suppressEvent) {\r\n if (this.callHasEnded()) return;\r\n\r\n _logger.logger.debug(\"Ending call \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, reason, !suppressEvent); // We don't want to send hangup here if we didn't even get to sending an invite\r\n\r\n if (this.state === CallState.WaitLocalMedia) return;\r\n const content = {}; // Continue to send no reason for user hangups temporarily, until\r\n // clients understand the user_hangup reason (voip v1)\r\n\r\n if (reason !== CallErrorCode.UserHangup) content['reason'] = reason;\r\n this.sendVoipEvent(_event.EventType.CallHangup, {});\r\n }\r\n /**\r\n * Reject a call\r\n * This used to be done by calling hangup, but is a separate method and protocol\r\n * event as of MSC2746.\r\n */\r\n\r\n\r\n reject() {\r\n if (this.state !== CallState.Ringing) {\r\n throw Error(\"Call must be in 'ringing' state to reject!\");\r\n }\r\n\r\n if (this.opponentVersion < 1) {\r\n _logger.logger.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`);\r\n\r\n this.hangup(CallErrorCode.UserHangup, true);\r\n return;\r\n }\r\n\r\n _logger.logger.debug(\"Rejecting call: \" + this.callId);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.UserHangup, true);\r\n this.sendVoipEvent(_event.EventType.CallReject, {});\r\n }\r\n /**\r\n * Set whether our outbound video should be muted or not.\r\n * @param {boolean} muted True to mute the outbound video.\r\n */\r\n\r\n\r\n setLocalVideoMuted(muted) {\r\n this.vidMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if local video is muted.\r\n *\r\n * If there are multiple video tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no video tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the local preview video is muted, else false\r\n * (including if the call is not set up yet).\r\n */\r\n\r\n\r\n isLocalVideoMuted() {\r\n return this.vidMuted;\r\n }\r\n /**\r\n * Set whether the microphone should be muted or not.\r\n * @param {boolean} muted True to mute the mic.\r\n */\r\n\r\n\r\n setMicrophoneMuted(muted) {\r\n this.micMuted = muted;\r\n this.updateMuteStatus();\r\n }\r\n /**\r\n * Check if the microphone is muted.\r\n *\r\n * If there are multiple audio tracks, all of the tracks need to be muted\r\n * for this to return true. This means if there are no audio tracks, this will\r\n * return true.\r\n * @return {Boolean} True if the mic is muted, else false (including if the call\r\n * is not set up yet).\r\n */\r\n\r\n\r\n isMicrophoneMuted() {\r\n return this.micMuted;\r\n }\r\n /**\r\n * @returns true if we have put the party on the other side of the call on hold\r\n * (that is, we are signalling to them that we are not listening)\r\n */\r\n\r\n\r\n isRemoteOnHold() {\r\n return this.remoteOnHold;\r\n }\r\n\r\n setRemoteOnHold(onHold) {\r\n if (this.isRemoteOnHold() === onHold) return;\r\n this.remoteOnHold = onHold;\r\n if (!onHold) this.unholdingRemote = true;\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n // We set 'inactive' rather than 'sendonly' because we're not planning on\r\n // playing music etc. to the other side.\r\n tranceiver.direction = onHold ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n this.updateMuteStatus();\r\n\r\n if (!onHold) {\r\n this.playRemoteAudio();\r\n }\r\n\r\n this.emit(CallEvent.RemoteHoldUnhold, this.remoteOnHold);\r\n }\r\n /**\r\n * Indicates whether we are 'on hold' to the remote party (ie. if true,\r\n * they cannot hear us). Note that this will return true when we put the\r\n * remote on hold too due to the way hold is implemented (since we don't\r\n * wish to play hold music when we put a call on hold, we use 'inactive'\r\n * rather than 'sendonly')\r\n * @returns true if the other party has put us on hold\r\n */\r\n\r\n\r\n isLocalOnHold() {\r\n if (this.state !== CallState.Connected) return false;\r\n if (this.unholdingRemote) return false;\r\n let callOnHold = true; // We consider a call to be on hold only if *all* the tracks are on hold\r\n // (is this the right thing to do?)\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n const trackOnHold = ['inactive', 'recvonly'].includes(tranceiver.currentDirection);\r\n if (!trackOnHold) callOnHold = false;\r\n }\r\n\r\n return callOnHold;\r\n }\r\n /**\r\n * Sends a DTMF digit to the other party\r\n * @param digit The digit (nb. string - '#' and '*' are dtmf too)\r\n */\r\n\r\n\r\n sendDtmfDigit(digit) {\r\n for (const sender of this.peerConn.getSenders()) {\r\n if (sender.track.kind === 'audio' && sender.dtmf) {\r\n sender.dtmf.insertDTMF(digit);\r\n return;\r\n }\r\n }\r\n\r\n throw new Error(\"Unable to find a track to send DTMF on\");\r\n }\r\n\r\n updateMuteStatus() {\r\n if (!this.localAVStream) {\r\n return;\r\n }\r\n\r\n const micShouldBeMuted = this.micMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getAudioTracks(), !micShouldBeMuted);\r\n const vidShouldBeMuted = this.vidMuted || this.remoteOnHold;\r\n setTracksEnabled(this.localAVStream.getVideoTracks(), !vidShouldBeMuted);\r\n\r\n if (this.remoteOnHold) {\r\n if (this.remoteAudioElement && this.remoteAudioElement.srcObject === this.remoteStream) {\r\n this.remoteAudioElement.muted = true;\r\n } else if (this.remoteVideoElement && this.remoteVideoElement.srcObject === this.remoteStream) {\r\n this.remoteVideoElement.muted = true;\r\n }\r\n } else {\r\n this.playRemoteAudio();\r\n }\r\n }\r\n /**\r\n * Internal\r\n * @param {Object} stream\r\n */\r\n\r\n\r\n async sendAnswer() {\r\n const answerContent = {\r\n answer: {\r\n sdp: this.peerConn.localDescription.sdp,\r\n // type is now deprecated as of Matrix VoIP v1, but\r\n // required to still be sent for backwards compat\r\n type: this.peerConn.localDescription.type\r\n }\r\n };\r\n\r\n if (this.client._supportsCallTransfer) {\r\n answerContent.capabilities = {\r\n 'm.call.transferee': true\r\n };\r\n } // We have just taken the local description from the peerconnection which will\r\n // contain all the local candidates added so far, so we can discard any candidates\r\n // we had queued up because they'll be in the answer.\r\n\r\n\r\n _logger.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`);\r\n\r\n this.candidateSendQueue = [];\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallAnswer, answerContent); // If this isn't the first time we've tried to send the answer,\r\n // we may have candidates queued up, so send them now.\r\n\r\n this.inviteOrAnswerSent = true;\r\n } catch (error) {\r\n // We've failed to answer: back to the ringing state\r\n this.setState(CallState.Ringing);\r\n this.client.cancelPendingEvent(error.event);\r\n let code = CallErrorCode.SendAnswer;\r\n let message = \"Failed to send answer\";\r\n\r\n if (error.name == 'UnknownDeviceError') {\r\n code = CallErrorCode.UnknownDevices;\r\n message = \"Unknown devices present in the room\";\r\n }\r\n\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n throw error;\r\n } // error handler re-throws so this won't happen on error, but\r\n // we don't want the same error handling on the candidate queue\r\n\r\n\r\n this.sendCandidateQueue();\r\n }\r\n\r\n async onRemoteIceCandidatesReceived(ev) {\r\n if (this.callHasEnded()) {\r\n //debuglog(\"Ignoring remote ICE candidate because call has ended\");\r\n return;\r\n }\r\n\r\n const cands = ev.getContent().candidates;\r\n\r\n if (!cands) {\r\n _logger.logger.info(\"Ignoring candidates event with no candidates!\");\r\n\r\n return;\r\n }\r\n\r\n const fromPartyId = ev.getContent().version === 0 ? null : ev.getContent().party_id || null;\r\n\r\n if (this.opponentPartyId === undefined) {\r\n // we haven't picked an opponent yet so save the candidates\r\n _logger.logger.info(`Bufferring ${cands.length} candidates until we pick an opponent`);\r\n\r\n const bufferedCands = this.remoteCandidateBuffer.get(fromPartyId) || [];\r\n bufferedCands.push(...cands);\r\n this.remoteCandidateBuffer.set(fromPartyId, bufferedCands);\r\n return;\r\n }\r\n\r\n if (!this.partyIdMatches(ev.getContent())) {\r\n _logger.logger.info(`Ignoring candidates from party ID ${ev.getContent().party_id}: ` + `we have chosen party ID ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n await this.addIceCandidates(cands);\r\n }\r\n /**\r\n * Used by MatrixClient.\r\n * @param {Object} msg\r\n */\r\n\r\n\r\n async onAnswerReceived(event) {\r\n _logger.logger.debug(`Got answer for call ID ${this.callId} from party ID ${event.getContent().party_id}`);\r\n\r\n if (this.callHasEnded()) {\r\n _logger.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);\r\n\r\n return;\r\n }\r\n\r\n if (this.opponentPartyId !== undefined) {\r\n _logger.logger.info(`Ignoring answer from party ID ${event.getContent().party_id}: ` + `we already have an answer/reject from ${this.opponentPartyId}`);\r\n\r\n return;\r\n }\r\n\r\n this.chooseOpponent(event);\r\n await this.addBufferedIceCandidates();\r\n this.setState(CallState.Connecting);\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(event.getContent().answer);\r\n } catch (e) {\r\n _logger.logger.debug(\"Failed to set remote description\", e);\r\n\r\n this.terminate(CallParty.Local, CallErrorCode.SetRemoteDescription, false);\r\n return;\r\n } // If the answer we selected has a party_id, send a select_answer event\r\n // We do this after setting the remote description since otherwise we'd block\r\n // call setup on it\r\n\r\n\r\n if (this.opponentPartyId !== null) {\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallSelectAnswer, {\r\n selected_party_id: this.opponentPartyId\r\n });\r\n } catch (err) {\r\n // This isn't fatal, and will just mean that if another party has raced to answer\r\n // the call, they won't know they got rejected, so we carry on & don't retry.\r\n _logger.logger.warn(\"Failed to send select_answer event\", err);\r\n }\r\n }\r\n }\r\n\r\n async onSelectAnswerReceived(event) {\r\n if (this.direction !== CallDirection.Inbound) {\r\n _logger.logger.warn(\"Got select_answer for an outbound call: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n const selectedPartyId = event.getContent().selected_party_id;\r\n\r\n if (selectedPartyId === undefined || selectedPartyId === null) {\r\n _logger.logger.warn(\"Got nonsensical select_answer with null/undefined selected_party_id: ignoring\");\r\n\r\n return;\r\n }\r\n\r\n if (selectedPartyId !== this.ourPartyId) {\r\n _logger.logger.info(`Got select_answer for party ID ${selectedPartyId}: we are party ID ${this.ourPartyId}.`); // The other party has picked somebody else's answer\r\n\r\n\r\n this.terminate(CallParty.Remote, CallErrorCode.AnsweredElsewhere, true);\r\n }\r\n }\r\n\r\n async onNegotiateReceived(event) {\r\n const description = event.getContent().description;\r\n\r\n if (!description || !description.sdp || !description.type) {\r\n _logger.logger.info(\"Ignoring invalid m.call.negotiate event\");\r\n\r\n return;\r\n } // Politeness always follows the direction of the call: in a glare situation,\r\n // we pick either the inbound or outbound call, so one side will always be\r\n // inbound and one outbound\r\n\r\n\r\n const polite = this.direction === CallDirection.Inbound; // Here we follow the perfect negotiation logic from\r\n // https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation\r\n\r\n const offerCollision = description.type === 'offer' && (this.makingOffer || this.peerConn.signalingState != 'stable');\r\n this.ignoreOffer = !polite && offerCollision;\r\n\r\n if (this.ignoreOffer) {\r\n _logger.logger.info(\"Ignoring colliding negotiate event because we're impolite\");\r\n\r\n return;\r\n }\r\n\r\n const prevLocalOnHold = this.isLocalOnHold();\r\n\r\n if (description.type === 'answer') {\r\n // whenever we get an answer back, clear the flag we set whilst trying to un-hold\r\n // the other party: the state of the channels now reflects reality\r\n this.unholdingRemote = false;\r\n }\r\n\r\n try {\r\n await this.peerConn.setRemoteDescription(description);\r\n\r\n if (description.type === 'offer') {\r\n // First we sent the direction of the tranciever to what we'd like it to be,\r\n // irresepective of whether the other side has us on hold - so just whether we\r\n // want the call to be on hold or not. This is necessary because in a few lines,\r\n // we'll adjust the direction and unless we do this too, we'll never come off hold.\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = this.isRemoteOnHold() ? 'inactive' : 'sendrecv';\r\n }\r\n\r\n const localDescription = await this.peerConn.createAnswer();\r\n await this.peerConn.setLocalDescription(localDescription); // Now we've got our answer, set the direction to the outcome of the negotiation.\r\n // We need to do this otherwise Firefox will notice that the direction is not the\r\n // currentDirection and try to negotiate itself off hold again.\r\n\r\n for (const tranceiver of this.peerConn.getTransceivers()) {\r\n tranceiver.direction = tranceiver.currentDirection;\r\n }\r\n\r\n this.sendVoipEvent(_event.EventType.CallNegotiate, {\r\n description: this.peerConn.localDescription\r\n });\r\n }\r\n } catch (err) {\r\n _logger.logger.warn(\"Failed to complete negotiation\", err);\r\n }\r\n\r\n const newLocalOnHold = this.isLocalOnHold();\r\n\r\n if (prevLocalOnHold !== newLocalOnHold) {\r\n this.emit(CallEvent.LocalHoldUnhold, newLocalOnHold); // also this one for backwards compat\r\n\r\n this.emit(CallEvent.HoldUnhold, newLocalOnHold);\r\n }\r\n }\r\n\r\n callHasEnded() {\r\n // This exists as workaround to typescript trying to be clever and erroring\r\n // when putting if (this.state === CallState.Ended) return; twice in the same\r\n // function, even though that function is async.\r\n return this.state === CallState.Ended;\r\n }\r\n\r\n async playRemoteAudio() {\r\n if (this.remoteVideoElement) this.remoteVideoElement.muted = true;\r\n this.remoteAudioElement.muted = false;\r\n this.remoteAudioElement.srcObject = this.remoteStream; // if audioOutput is non-default:\r\n\r\n try {\r\n if (audioOutput) {\r\n // This seems quite unreliable in Chrome, although I haven't yet managed to make a jsfiddle where\r\n // it fails.\r\n // It seems reliable if you set the sink ID after setting the srcObject and then set the sink ID\r\n // back to the default after the call is over\r\n _logger.logger.info(\"Setting audio sink to \" + audioOutput + \", was \" + this.remoteAudioElement.sinkId);\r\n\r\n await this.remoteAudioElement.setSinkId(audioOutput);\r\n }\r\n } catch (e) {\r\n _logger.logger.warn(\"Couldn't set requested audio output device: using default\", e);\r\n }\r\n\r\n try {\r\n await this.remoteAudioElement.play();\r\n } catch (e) {\r\n _logger.logger.error(\"Failed to play remote audio element\", e);\r\n }\r\n }\r\n\r\n async playRemoteVideo() {\r\n // A note on calling methods on media elements:\r\n // We used to have queues per media element to serialise all calls on those elements.\r\n // The reason given for this was that load() and play() were racing. However, we now\r\n // never call load() explicitly so this seems unnecessary. However, serialising every\r\n // operation was causing bugs where video would not resume because some play command\r\n // had got stuck and all media operations were queued up behind it. If necessary, we\r\n // should serialise the ones that need to be serialised but then be able to interrupt\r\n // them with another load() which will cancel the pending one, but since we don't call\r\n // load() explicitly, it shouldn't be a problem.\r\n this.remoteVideoElement.srcObject = this.remoteStream;\r\n\r\n _logger.logger.info(\"playing remote video. stream active? \" + this.remoteStream.active);\r\n\r\n try {\r\n await this.remoteVideoElement.play();\r\n } catch (e) {\r\n _logger.logger.info(\"Failed to play remote video element\", e);\r\n }\r\n }\r\n\r\n setState(state) {\r\n const oldState = this.state;\r\n this.state = state;\r\n this.emit(CallEvent.State, state, oldState);\r\n }\r\n /**\r\n * Internal\r\n * @param {string} eventType\r\n * @param {Object} content\r\n * @return {Promise}\r\n */\r\n\r\n\r\n sendVoipEvent(eventType, content) {\r\n return this.client.sendEvent(this.roomId, eventType, Object.assign({}, content, {\r\n version: VOIP_PROTO_VERSION,\r\n call_id: this.callId,\r\n party_id: this.ourPartyId\r\n }));\r\n }\r\n\r\n queueCandidate(content) {\r\n // Sends candidates with are sent in a special way because we try to amalgamate\r\n // them into one message\r\n this.candidateSendQueue.push(content); // Don't send the ICE candidates yet if the call is in the ringing state: this\r\n // means we tried to pick (ie. started generating candidates) and then failed to\r\n // send the answer and went back to the ringing state. Queue up the candidates\r\n // to send if we sucessfully send the answer.\r\n // Equally don't send if we haven't yet sent the answer because we can send the\r\n // first batch of candidates along with the answer\r\n\r\n if (this.state === CallState.Ringing || !this.inviteOrAnswerSent) return; // MSC2746 reccomends these values (can be quite long when calling because the\r\n // callee will need a while to answer the call)\r\n\r\n const delay = this.direction === CallDirection.Inbound ? 500 : 2000;\r\n\r\n if (this.candidateSendTries === 0) {\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delay);\r\n }\r\n }\r\n /*\r\n * Transfers this call to another user\r\n */\r\n\r\n\r\n async transfer(targetUserId) {\r\n // Fetch the target user's global profile info: their room avatar / displayname\r\n // could be different in whatever room we shae with them.\r\n const profileInfo = await this.client.getProfileInfo(targetUserId);\r\n const replacementId = genCallID();\r\n const body = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: targetUserId,\r\n display_name: profileInfo.display_name,\r\n avatar_url: profileInfo.avatar_url\r\n },\r\n create_call: replacementId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, body);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n /*\r\n * Transfers this call to the target call, effectively 'joining' the\r\n * two calls (so the remote parties on each call are connected together).\r\n */\r\n\r\n\r\n async transferToCall(transferTargetCall) {\r\n const targetProfileInfo = await this.client.getProfileInfo(transferTargetCall.getOpponentMember().userId);\r\n const transfereeProfileInfo = await this.client.getProfileInfo(this.getOpponentMember().userId);\r\n const newCallId = genCallID();\r\n const bodyToTransferTarget = {\r\n // the replacements on each side have their own ID, and it's distinct from the\r\n // ID of the new call (but we can use the same function to generate it)\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: this.getOpponentMember().userId,\r\n display_name: transfereeProfileInfo.display_name,\r\n avatar_url: transfereeProfileInfo.avatar_url\r\n },\r\n await_call: newCallId\r\n };\r\n await transferTargetCall.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferTarget);\r\n const bodyToTransferee = {\r\n replacement_id: genCallID(),\r\n target_user: {\r\n id: transferTargetCall.getOpponentMember().userId,\r\n display_name: targetProfileInfo.display_name,\r\n avatar_url: targetProfileInfo.avatar_url\r\n },\r\n create_call: newCallId\r\n };\r\n await this.sendVoipEvent(_event.EventType.CallReplaces, bodyToTransferee);\r\n await this.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n await transferTargetCall.terminate(CallParty.Local, CallErrorCode.Replaced, true);\r\n }\r\n\r\n async terminate(hangupParty, hangupReason, shouldEmit) {\r\n if (this.callHasEnded()) return;\r\n this.callStatsAtEnd = await this.collectCallStats();\r\n\r\n if (this.inviteTimeout) {\r\n clearTimeout(this.inviteTimeout);\r\n this.inviteTimeout = null;\r\n }\r\n\r\n const remoteVid = this.getRemoteVideoElement();\r\n const remoteAud = this.getRemoteAudioElement();\r\n const localVid = this.getLocalVideoElement();\r\n\r\n if (remoteVid) {\r\n remoteVid.pause();\r\n remoteVid.srcObject = null;\r\n }\r\n\r\n if (remoteAud) {\r\n remoteAud.pause();\r\n remoteAud.srcObject = null;\r\n\r\n try {\r\n // As per comment in playRemoteAudio, setting the sink ID back to the default\r\n // once the call is over makes setSinkId work reliably.\r\n await this.remoteAudioElement.setSinkId('');\r\n } catch (e) {\r\n _logger.logger.warn(\"Failed to set sink ID back to default\");\r\n }\r\n }\r\n\r\n if (localVid) {\r\n localVid.pause();\r\n localVid.srcObject = null;\r\n }\r\n\r\n this.hangupParty = hangupParty;\r\n this.hangupReason = hangupReason;\r\n this.setState(CallState.Ended);\r\n this.stopAllMedia();\r\n\r\n if (this.peerConn && this.peerConn.signalingState !== 'closed') {\r\n this.peerConn.close();\r\n }\r\n\r\n if (shouldEmit) {\r\n this.emit(CallEvent.Hangup, this);\r\n }\r\n }\r\n\r\n stopAllMedia() {\r\n _logger.logger.debug(`stopAllMedia (stream=${this.localAVStream})`);\r\n\r\n if (this.localAVStream) {\r\n for (const track of this.localAVStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.screenSharingStream) {\r\n for (const track of this.screenSharingStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n\r\n if (this.remoteStream) {\r\n for (const track of this.remoteStream.getTracks()) {\r\n track.stop();\r\n }\r\n }\r\n }\r\n\r\n checkForErrorListener() {\r\n if (this.listeners(\"error\").length === 0) {\r\n throw new Error(\"You MUST attach an error listener using call.on('error', function() {})\");\r\n }\r\n }\r\n\r\n async sendCandidateQueue() {\r\n if (this.candidateSendQueue.length === 0) {\r\n return;\r\n }\r\n\r\n const cands = this.candidateSendQueue;\r\n this.candidateSendQueue = [];\r\n ++this.candidateSendTries;\r\n const content = {\r\n candidates: cands\r\n };\r\n\r\n _logger.logger.debug(\"Attempting to send \" + cands.length + \" candidates\");\r\n\r\n try {\r\n await this.sendVoipEvent(_event.EventType.CallCandidates, content);\r\n } catch (error) {\r\n // don't retry this event: we'll send another one later as we might\r\n // have more candidates by then.\r\n if (error.event) this.client.cancelPendingEvent(error.event); // put all the candidates we failed to send back in the queue\r\n\r\n this.candidateSendQueue.push(...cands);\r\n\r\n if (this.candidateSendTries > 5) {\r\n _logger.logger.debug(\"Failed to send candidates on attempt \" + this.candidateSendTries + \". Giving up on this call.\", error);\r\n\r\n const code = CallErrorCode.SignallingFailed;\r\n const message = \"Signalling failed\";\r\n this.emit(CallEvent.Error, new CallError(code, message, error));\r\n this.hangup(code, false);\r\n return;\r\n }\r\n\r\n const delayMs = 500 * Math.pow(2, this.candidateSendTries);\r\n ++this.candidateSendTries;\r\n\r\n _logger.logger.debug(\"Failed to send candidates. Retrying in \" + delayMs + \"ms\", error);\r\n\r\n setTimeout(() => {\r\n this.sendCandidateQueue();\r\n }, delayMs);\r\n }\r\n }\r\n\r\n async placeCallWithConstraints(constraints) {\r\n _logger.logger.log(\"Getting user media with constraints\", constraints); // XXX Find a better way to do this\r\n\r\n\r\n this.client._callEventHandler.calls.set(this.callId, this);\r\n\r\n this.setState(CallState.WaitLocalMedia);\r\n this.direction = CallDirection.Outbound;\r\n this.config = constraints; // make sure we have valid turn creds. Unless something's gone wrong, it should\r\n // poll and keep the credentials valid so this should be instant.\r\n\r\n const haveTurnCreds = await this.client._checkTurnServers();\r\n\r\n if (!haveTurnCreds) {\r\n _logger.logger.warn(\"Failed to get TURN credentials! Proceeding with call anyway...\");\r\n } // create the peer connection now so it can be gathering candidates while we get user\r\n // media (assuming a candidate pool size is configured)\r\n\r\n\r\n this.peerConn = this.createPeerConnection();\r\n\r\n try {\r\n const mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\r\n this.gotUserMediaForInvite(mediaStream);\r\n } catch (e) {\r\n this.getUserMediaFailed(e);\r\n return;\r\n }\r\n }\r\n\r\n createPeerConnection() {\r\n const pc = new window.RTCPeerConnection({\r\n iceTransportPolicy: this.forceTURN ? 'relay' : undefined,\r\n iceServers: this.turnServers,\r\n iceCandidatePoolSize: this.client._iceCandidatePoolSize\r\n }); // 'connectionstatechange' would be better, but firefox doesn't implement that.\r\n\r\n pc.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChanged);\r\n pc.addEventListener('signalingstatechange', this.onSignallingStateChanged);\r\n pc.addEventListener('icecandidate', this.gotLocalIceCandidate);\r\n pc.addEventListener('icegatheringstatechange', this.onIceGatheringStateChange);\r\n pc.addEventListener('track', this.onTrack);\r\n pc.addEventListener('negotiationneeded', this.onNegotiationNeeded);\r\n return pc;\r\n }\r\n\r\n partyIdMatches(msg) {\r\n // They must either match or both be absent (in which case opponentPartyId will be null)\r\n // Also we ignore party IDs on the invite/offer if the version is 0, so we must do the same\r\n // here and use null if the version is 0 (woe betide any opponent sending messages in the\r\n // same call with different versions)\r\n const msgPartyId = msg.version === 0 ? null : msg.party_id || null;\r\n return msgPartyId === this.opponentPartyId;\r\n } // Commits to an opponent for the call\r\n // ev: An invite or answer event\r\n\r\n\r\n chooseOpponent(ev) {\r\n // I choo-choo-choose you\r\n const msg = ev.getContent();\r\n\r\n _logger.logger.debug(`Choosing party ID ${msg.party_id} for call ID ${this.callId}`);\r\n\r\n this.opponentVersion = msg.version;\r\n\r\n if (this.opponentVersion === 0) {\r\n // set to null to indicate that we've chosen an opponent, but because\r\n // they're v0 they have no party ID (even if they sent one, we're ignoring it)\r\n this.opponentPartyId = null;\r\n } else {\r\n // set to their party ID, or if they're naughty and didn't send one despite\r\n // not being v0, set it to null to indicate we picked an opponent with no\r\n // party ID\r\n this.opponentPartyId = msg.party_id || null;\r\n }\r\n\r\n this.opponentCaps = msg.capabilities || {};\r\n this.opponentMember = ev.sender;\r\n }\r\n\r\n async addBufferedIceCandidates() {\r\n const bufferedCands = this.remoteCandidateBuffer.get(this.opponentPartyId);\r\n\r\n if (bufferedCands) {\r\n _logger.logger.info(`Adding ${bufferedCands.length} buffered candidates for opponent ${this.opponentPartyId}`);\r\n\r\n await this.addIceCandidates(bufferedCands);\r\n }\r\n\r\n this.remoteCandidateBuffer = null;\r\n }\r\n\r\n async addIceCandidates(cands) {\r\n for (const cand of cands) {\r\n if ((cand.sdpMid === null || cand.sdpMid === undefined) && (cand.sdpMLineIndex === null || cand.sdpMLineIndex === undefined)) {\r\n _logger.logger.debug(\"Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex\");\r\n\r\n continue;\r\n }\r\n\r\n _logger.logger.debug(\"Call \" + this.callId + \" got remote ICE \" + cand.sdpMid + \" candidate: \" + cand.candidate);\r\n\r\n try {\r\n await this.peerConn.addIceCandidate(cand);\r\n } catch (err) {\r\n if (!this.ignoreOffer) {\r\n _logger.logger.info(\"Failed to add remote ICE candidate\", err);\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.MatrixCall = MatrixCall;\r\n\r\nfunction setTracksEnabled(tracks, enabled) {\r\n for (let i = 0; i < tracks.length; i++) {\r\n tracks[i].enabled = enabled;\r\n }\r\n}\r\n\r\nfunction getUserMediaContraints(type) {\r\n const isWebkit = !!navigator.webkitGetUserMedia;\r\n\r\n switch (type) {\r\n case ConstraintsType.Audio:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: false\r\n };\r\n }\r\n\r\n case ConstraintsType.Video:\r\n {\r\n return {\r\n audio: {\r\n deviceId: audioInput ? {\r\n ideal: audioInput\r\n } : undefined\r\n },\r\n video: {\r\n deviceId: videoInput ? {\r\n ideal: videoInput\r\n } : undefined,\r\n\r\n /* We want 640x360. Chrome will give it only if we ask exactly,\r\n FF refuses entirely if we ask exactly, so have to ask for ideal\r\n instead\r\n XXX: Is this still true?\r\n */\r\n width: isWebkit ? {\r\n exact: 640\r\n } : {\r\n ideal: 640\r\n },\r\n height: isWebkit ? {\r\n exact: 360\r\n } : {\r\n ideal: 360\r\n }\r\n }\r\n };\r\n }\r\n }\r\n}\r\n\r\nasync function getScreenshareContraints(selectDesktopCapturerSource) {\r\n var _window$electron2;\r\n\r\n if ((_window$electron2 = window.electron) !== null && _window$electron2 !== void 0 && _window$electron2.getDesktopCapturerSources && selectDesktopCapturerSource) {\r\n // We have access to getDesktopCapturerSources()\r\n _logger.logger.debug(\"Electron getDesktopCapturerSources() is available...\");\r\n\r\n const selectedSource = await selectDesktopCapturerSource();\r\n if (!selectedSource) return null;\r\n return {\r\n audio: false,\r\n video: {\r\n mandatory: {\r\n chromeMediaSource: \"desktop\",\r\n chromeMediaSourceId: selectedSource.id\r\n }\r\n }\r\n };\r\n } else {\r\n // We do not have access to the Electron desktop capturer,\r\n // therefore we can assume we are on the web\r\n _logger.logger.debug(\"Electron desktopCapturer is not available...\");\r\n\r\n return {\r\n audio: false,\r\n video: true\r\n };\r\n }\r\n}\r\n\r\nlet audioOutput;\r\nlet audioInput;\r\nlet videoInput;\r\n/**\r\n * Set an audio output device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\nfunction setAudioOutput(deviceId) {\r\n audioOutput = deviceId;\r\n}\r\n/**\r\n * Set an audio input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setAudioInput(deviceId) {\r\n audioInput = deviceId;\r\n}\r\n/**\r\n * Set a video input device to use for MatrixCalls\r\n * @function\r\n * @param {string=} deviceId the identifier for the device\r\n * undefined treated as unset\r\n */\r\n\r\n\r\nfunction setVideoInput(deviceId) {\r\n videoInput = deviceId;\r\n}\r\n/**\r\n * Create a new Matrix call for the browser.\r\n * @param {MatrixClient} client The client instance to use.\r\n * @param {string} roomId The room the call is in.\r\n * @param {Object?} options DEPRECATED optional options map.\r\n * @param {boolean} options.forceTURN DEPRECATED whether relay through TURN should be\r\n * forced. This option is deprecated - use opts.forceTURN when creating the matrix client\r\n * since it's only possible to set this option on outbound calls.\r\n * @return {MatrixCall} the call or null if the browser doesn't support calling.\r\n */\r\n\r\n\r\nfunction createNewMatrixCall(client, roomId, options) {\r\n // typeof prevents Node from erroring on an undefined reference\r\n if (typeof window === 'undefined' || typeof document === 'undefined') {\r\n // NB. We don't log here as apps try to create a call object as a test for\r\n // whether calls are supported, so we shouldn't fill the logs up.\r\n return null;\r\n } // Firefox throws on so little as accessing the RTCPeerConnection when operating in\r\n // a secure mode. There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616\r\n // though the concern is that the browser throwing a SecurityError will brick the\r\n // client creation process.\r\n\r\n\r\n try {\r\n const supported = Boolean(window.RTCPeerConnection || window.RTCSessionDescription || window.RTCIceCandidate || navigator.mediaDevices);\r\n\r\n if (!supported) {\r\n _logger.logger.error(\"WebRTC is not supported in this browser / environment\");\r\n\r\n return null;\r\n }\r\n } catch (e) {\r\n _logger.logger.error(\"Exception thrown when trying to access WebRTC\", e);\r\n\r\n return null;\r\n }\r\n\r\n const optionsForceTURN = options ? options.forceTURN : false;\r\n const opts = {\r\n client: client,\r\n roomId: roomId,\r\n turnServers: client.getTurnServers(),\r\n // call level options\r\n forceTURN: client._forceTURN || optionsForceTURN\r\n };\r\n const call = new MatrixCall(opts);\r\n client.reEmitter.reEmit(call, Object.values(CallEvent));\r\n return call;\r\n}","\r\nvar createHash = null\r\n\r\nvar f = {}\r\n\r\nf.sha224 = function(text){\r\n\r\n if(!createHash){\r\n createHash = require('create-hash')\r\n }\r\n\r\n var hash = createHash('sha224')\r\n hash.update(text)\r\n return hash.digest()\r\n\r\n}\r\n\r\n\r\nf.language = function () {\r\n\r\n var language;\r\n if (window.navigator.languages) {\r\n language = window.navigator.languages[0];\r\n } else {\r\n language = window.navigator.userLanguage || window.navigator.language;\r\n }\r\n\r\n return language\r\n}\r\nf.deep = function (obj, key) {\r\n var _key = _.isArray(key) ? key : key.split(\".\");\r\n\r\n var tkey = _key[0];\r\n\r\n if (typeof obj == 'undefined' || !obj) return undefined;\r\n\r\n if (typeof obj[tkey] != 'undefined') {\r\n _key.splice(0, 1);\r\n\r\n if (_key.length === 0) {\r\n return obj[tkey];\r\n }\r\n else {\r\n return f.deep(obj[tkey], _key)\r\n }\r\n }\r\n else {\r\n return undefined;\r\n }\r\n}\r\n\r\nvar renderFrameEqualizer = function (canvas, ctx, analyser, stop, colornumbers, offset) {\r\n\r\n\r\n\r\n if (!colornumbers) {\r\n colornumbers = {\r\n r: 25,\r\n g: 250,\r\n b: 50\r\n }\r\n }\r\n\r\n if (!offset) {\r\n offset = {\r\n x: 25,\r\n offset: [0, 0]\r\n }\r\n }\r\n\r\n var WIDTH = canvas.width;\r\n var HEIGHT = canvas.height;\r\n\r\n var bufferLength = analyser.frequencyBinCount;\r\n var dataArray = new Uint8Array(bufferLength);\r\n\r\n var barWidth = (WIDTH / bufferLength) / 2.5;\r\n var barHeight;\r\n\r\n var x = offset.x // offset[0] -15;\r\n\r\n analyser.getByteFrequencyData(dataArray);\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n for (var i = 0; i < bufferLength; i++) {\r\n\r\n barHeight = dataArray[i];\r\n\r\n var r = barHeight + (colornumbers.r * (i / bufferLength));\r\n var g = colornumbers.g * (i / bufferLength);\r\n var b = colornumbers.b;\r\n\r\n var opacity = - Math.abs(i - bufferLength / 2) / bufferLength + 1 / 2\r\n\r\n\r\n if (i > offset.offset[0] && i < bufferLength - offset.offset[1]) {\r\n ctx.fillStyle = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + opacity * 2 + \")\";\r\n ctx.fillRect(x, HEIGHT / 2 - (barHeight * opacity), barWidth, barHeight * opacity * 2);\r\n }\r\n\r\n\r\n x += barWidth + 1;\r\n }\r\n\r\n requestAnimationFrame(function () {\r\n if (stop()) {\r\n\r\n ctx.clearRect(0, 0, WIDTH, HEIGHT);\r\n\r\n return\r\n }\r\n\r\n renderFrameEqualizer(canvas, ctx, analyser, stop, colornumbers, offset)\r\n });\r\n\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nf.permutations = function (array, k) {\r\n\r\n k || (k = 1)\r\n\r\n var m = [];\r\n var combinations = [];\r\n var indices = [];\r\n var len = array.length;\r\n function run(level) {\r\n for (var i = 0; i < len; i++) {\r\n if (!indices[i]) {\r\n indices[i] = true;\r\n combinations[level] = array[i];\r\n if (level < k - 1) {\r\n run(level + 1, i + 1);\r\n } else {\r\n m.push(([]).concat(combinations));\r\n }\r\n indices[i] = false;\r\n }\r\n }\r\n }\r\n run(0);\r\n return m;\r\n}\r\n\r\nvar copytext = function (text) {\r\n if (window.clipboardData && window.clipboardData.setData) {\r\n // IE specific code path to prevent textarea being shown while dialog is visible.\r\n return clipboardData.setData(\"Text\", text);\r\n\r\n } else if (document.queryCommandSupported && document.queryCommandSupported(\"copy\")) {\r\n var textarea = document.createElement(\"textarea\");\r\n textarea.textContent = text\r\n textarea.style.position = \"fixed\"; // Prevent scrolling to bottom of page in MS Edge.\r\n document.body.appendChild(textarea);\r\n textarea.select();\r\n try {\r\n return document.execCommand(\"copy\"); // Security exception may be thrown by some browsers.\r\n } catch (ex) {\r\n console.warn(\"Copy to clipboard failed.\", ex);\r\n return false;\r\n } finally {\r\n document.body.removeChild(textarea);\r\n }\r\n }\r\n}\r\n\r\nvar makeid = function (valid) {\r\n\r\n function s4() {\r\n return Math.floor((1 + Math.random()) * 0x10000)\r\n .toString(16)\r\n .substring(1);\r\n }\r\n\r\n if (!valid) {\r\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\r\n s4() + '-' + s4() + s4() + s4();\r\n }\r\n\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\r\n for (var i = 0; i < 16; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n return text;\r\n}\r\n// roomalias\r\n\r\nvar flball = function (str) {\r\n\r\n //return flbb(str)\r\n\r\n if (!str || !str.split) return str\r\n\r\n var exception = [\"2ndEdison, 3dCarbon\", \"A-Pmcs\"];\r\n var lower = [\"TO\", \"K\", \"X\", \"10X\", \"THE\", \"AN\", \"AND\", \"OR\", \"AT\", \"BUT\", \"BY\", \"FOR\", \"IN\", \"OF\", \"OFF\", \"ON\", \"OUT\", \"PER\", \"UP\", \"VIA\", \"AS\", \"FOR\"];\r\n var upper = [\"2MCBL\", \"USA\", \"TONS\", \"BHCC\", \"LLC\", \"LTD\", \"1BWK\", \"AGMA\", \"VIII\", \"XIII\", \"BHCC\"];\r\n var capital = [\"LAS\", \"LAW\", \"SON\", \"DEE\", \"ST\", \"PET\", \"BIG\", \"WAY\", \"AIR\", \"ALL\", \"TOP\", \"JOY\", \"CO\", \"INC\", \"INC.\", \"AVE\", \"PAY\", \"ST.\", \"FOX\", \"CAR\", \"TAX\", \"DAY\", \"MAN\", \"CO.\", \"NEW\"];\r\n var capitalReg = new RegExp(capital.join('|'));\r\n var upperReg = new RegExp(upper.join('|'));\r\n\r\n\r\n var nameArr = str.split(' ').map(function (word) {\r\n if (exception.some(function (w) { return w.toUpperCase() === word })) {\r\n\r\n return exception.find(function (w) { return w.toUpperCase() === word });\r\n }\r\n\r\n if (\r\n lower.some(function (w) {\r\n if (w === word) {\r\n return true;\r\n };\r\n var wArr = w.split(' ');\r\n for (var i = 0; i < wArr.length; i++) {\r\n if (/[0-9]/.test(wArr[i]) && /ST|ND|RD|TH|K/.test(wArr[i + 1] + wArr[i + 2])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n })\r\n ) {\r\n return word.toLowerCase();\r\n }\r\n\r\n if (capitalReg.test(word)) {\r\n return word[0] + word.slice(1).toLowerCase();\r\n }\r\n if (word.replace(/\\(|\\)/g, '').length <= 3 || upperReg.test(word)) {\r\n return word;\r\n }\r\n var wordCap = word.toLowerCase().replace(/[A-Za-z]/, function (l) { return l.toUpperCase() });\r\n var wordArr = [];\r\n wordArr.push(wordCap[0]);\r\n for (var i = 0; i < wordCap.length; i++) {\r\n if (wordCap[i + 1] && (/\\.|\\/|[0-9]|\\&|\\-|\\s/.test(wordCap[i]) || (wordCap[i - 1] + wordCap[i]).toLowerCase() === 'mc')) {\r\n wordArr.push(wordCap[i + 1].toUpperCase());\r\n } else if (wordCap[i + 1]) {\r\n wordArr.push(wordCap[i + 1])\r\n }\r\n };\r\n return wordArr.join('')\r\n })\r\n\r\n return flb(nameArr.join(' '))\r\n}\r\n\r\nvar flb = function (str) {\r\n return str[0].toUpperCase() + str.substr(1);\r\n}\r\n\r\nvar flbs = function (str) {\r\n\r\n return str[0].toUpperCase() + str.substr(1).toLowerCase();\r\n}\r\n\r\nvar flbb = function (str) {\r\n\r\n var s = str.split(' ');\r\n\r\n return _.map(s, function (s) {\r\n return flbs(s);\r\n }).join(' ')\r\n\r\n}\r\nvar group = function (array, _function) {\r\n var group = {};\r\n\r\n _.each(array, function (el, i) {\r\n\r\n var index = _function(el, i);\r\n\r\n if (!index) return;\r\n\r\n if (!group[index])\r\n group[index] = [];\r\n\r\n group[index].push(el);\r\n\r\n })\r\n\r\n return group;\r\n}\r\n\r\nvar _scrollTop = function (scrollTop, el, time) {\r\n\r\n if (!el) el = $(\"body,html\");\r\n\r\n if (!time) time = 200;\r\n\r\n el.animate({ scrollTop: scrollTop }, time);\r\n}\r\n\r\nvar _scrollTo = function (to, el, time) {\r\n\r\n if (!to) to = $(this);\r\n\r\n var ofssetObj = to.offset();\r\n\r\n var offset = (to.height() - $(window).height()) / 2;\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTop = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.offset();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar _scrollToTopP = function (to, el, time, offset) {\r\n\r\n if (!to) to = $(this);\r\n\r\n if (!offset) offset = 0;\r\n\r\n var ofssetObj = to.position();\r\n\r\n if (ofssetObj) {\r\n var scrollTop = ofssetObj.top + offset;\r\n\r\n _scrollTop(scrollTop, el, time);\r\n }\r\n\r\n}\r\n\r\nvar stringEq = function (s1, s2) {\r\n\r\n if (!s1) s1 = ''\r\n if (!s2) s2 = ''\r\n\r\n var bw = function (s) {\r\n return s.split(/[ \\t\\v\\r\\n\\f,.]+/)\r\n }\r\n\r\n var hash = function (s) {\r\n\r\n var ps = bw(s).join(' ')\r\n\r\n return ps.toLowerCase().replace(/[^a-zа-я0-9&]*/g, '');\r\n }\r\n\r\n\r\n\r\n var makeTr = function (w) {\r\n var trs = {};\r\n\r\n var takeC = function (index) {\r\n var c;\r\n\r\n if (index < 0 || index >= w.length) c = \"_\";\r\n\r\n else c = w[index];\r\n\r\n return c;\r\n }\r\n\r\n for (var i = -1; i <= w.length; i++) {\r\n\r\n var tr = \"\";\r\n\r\n for (var j = i - 1; j <= i + 1; j++) {\r\n tr = tr + takeC(j);\r\n }\r\n\r\n\r\n trs[tr] = 1;\r\n }\r\n\r\n return trs;\r\n }\r\n\r\n\r\n var t1 = makeTr(hash(s1)),\r\n t2 = makeTr(hash(s2));\r\n\r\n\r\n var c = 0,\r\n m = Math.max(_.toArray(t1).length, _.toArray(t2).length)\r\n\r\n _.each(t1, function (t, index) {\r\n\r\n if (t2[index]) c++;\r\n\r\n })\r\n\r\n return c / m;\r\n\r\n\r\n}\r\n\r\nvar pretry = function (_function, time, totaltime) {\r\n\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n retry(_function, resolve, time, totaltime)\r\n\r\n })\r\n}\r\n\r\nvar retry = function (_function, clbk, time, totaltime) {\r\n\r\n if (_function()){\r\n\r\n \r\n\r\n if (clbk) clbk();\r\n\r\n return\r\n }\r\n\r\n if (!time) time = 20;\r\n\r\n var totalTimeCounter = 0\r\n\r\n var interval = setInterval(function () {\r\n\r\n if (_function() || (totaltime && totaltime <= totalTimeCounter)) {\r\n\r\n\r\n clearInterval(interval);\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n totalTimeCounter += time\r\n\r\n }, time);\r\n}\r\n\r\nvar md5 = function (d) {\r\n var result = M(V(Y(X(d), 8 * d.length))); return result.toLowerCase()\r\n}; function M(d) { for (var _, m = \"0123456789ABCDEF\", f = \"\", r = 0; r < d.length; r++)_ = d.charCodeAt(r), f += m.charAt(_ >>> 4 & 15) + m.charAt(15 & _); return f } function X(d) { for (var _ = Array(d.length >> 2), m = 0; m < _.length; m++)_[m] = 0; for (m = 0; m < 8 * d.length; m += 8)_[m >> 5] |= (255 & d.charCodeAt(m / 8)) << m % 32; return _ } function V(d) { for (var _ = \"\", m = 0; m < 32 * d.length; m += 8)_ += String.fromCharCode(d[m >> 5] >>> m % 32 & 255); return _ } function Y(d, _) { d[_ >> 5] |= 128 << _ % 32, d[14 + (_ + 64 >>> 9 << 4)] = _; for (var m = 1732584193, f = -271733879, r = -1732584194, i = 271733878, n = 0; n < d.length; n += 16) { var h = m, t = f, g = r, e = i; f = md5_ii(f = md5_ii(f = md5_ii(f = md5_ii(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_hh(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_gg(f = md5_ff(f = md5_ff(f = md5_ff(f = md5_ff(f, r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 0], 7, -680876936), f, r, d[n + 1], 12, -389564586), m, f, d[n + 2], 17, 606105819), i, m, d[n + 3], 22, -1044525330), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 4], 7, -176418897), f, r, d[n + 5], 12, 1200080426), m, f, d[n + 6], 17, -1473231341), i, m, d[n + 7], 22, -45705983), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 8], 7, 1770035416), f, r, d[n + 9], 12, -1958414417), m, f, d[n + 10], 17, -42063), i, m, d[n + 11], 22, -1990404162), r = md5_ff(r, i = md5_ff(i, m = md5_ff(m, f, r, i, d[n + 12], 7, 1804603682), f, r, d[n + 13], 12, -40341101), m, f, d[n + 14], 17, -1502002290), i, m, d[n + 15], 22, 1236535329), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 1], 5, -165796510), f, r, d[n + 6], 9, -1069501632), m, f, d[n + 11], 14, 643717713), i, m, d[n + 0], 20, -373897302), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 5], 5, -701558691), f, r, d[n + 10], 9, 38016083), m, f, d[n + 15], 14, -660478335), i, m, d[n + 4], 20, -405537848), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 9], 5, 568446438), f, r, d[n + 14], 9, -1019803690), m, f, d[n + 3], 14, -187363961), i, m, d[n + 8], 20, 1163531501), r = md5_gg(r, i = md5_gg(i, m = md5_gg(m, f, r, i, d[n + 13], 5, -1444681467), f, r, d[n + 2], 9, -51403784), m, f, d[n + 7], 14, 1735328473), i, m, d[n + 12], 20, -1926607734), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 5], 4, -378558), f, r, d[n + 8], 11, -2022574463), m, f, d[n + 11], 16, 1839030562), i, m, d[n + 14], 23, -35309556), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 1], 4, -1530992060), f, r, d[n + 4], 11, 1272893353), m, f, d[n + 7], 16, -155497632), i, m, d[n + 10], 23, -1094730640), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 13], 4, 681279174), f, r, d[n + 0], 11, -358537222), m, f, d[n + 3], 16, -722521979), i, m, d[n + 6], 23, 76029189), r = md5_hh(r, i = md5_hh(i, m = md5_hh(m, f, r, i, d[n + 9], 4, -640364487), f, r, d[n + 12], 11, -421815835), m, f, d[n + 15], 16, 530742520), i, m, d[n + 2], 23, -995338651), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 0], 6, -198630844), f, r, d[n + 7], 10, 1126891415), m, f, d[n + 14], 15, -1416354905), i, m, d[n + 5], 21, -57434055), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 12], 6, 1700485571), f, r, d[n + 3], 10, -1894986606), m, f, d[n + 10], 15, -1051523), i, m, d[n + 1], 21, -2054922799), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 8], 6, 1873313359), f, r, d[n + 15], 10, -30611744), m, f, d[n + 6], 15, -1560198380), i, m, d[n + 13], 21, 1309151649), r = md5_ii(r, i = md5_ii(i, m = md5_ii(m, f, r, i, d[n + 4], 6, -145523070), f, r, d[n + 11], 10, -1120210379), m, f, d[n + 2], 15, 718787259), i, m, d[n + 9], 21, -343485551), m = safe_add(m, h), f = safe_add(f, t), r = safe_add(r, g), i = safe_add(i, e) } return Array(m, f, r, i) } function md5_cmn(d, _, m, f, r, i) { return safe_add(bit_rol(safe_add(safe_add(_, d), safe_add(f, i)), r), m) } function md5_ff(d, _, m, f, r, i, n) { return md5_cmn(_ & m | ~_ & f, d, _, r, i, n) } function md5_gg(d, _, m, f, r, i, n) { return md5_cmn(_ & f | m & ~f, d, _, r, i, n) } function md5_hh(d, _, m, f, r, i, n) { return md5_cmn(_ ^ m ^ f, d, _, r, i, n) } function md5_ii(d, _, m, f, r, i, n) { return md5_cmn(m ^ (_ | ~f), d, _, r, i, n) } function safe_add(d, _) { var m = (65535 & d) + (65535 & _); return (d >> 16) + (_ >> 16) + (m >> 16) << 16 | 65535 & m } function bit_rol(d, _) { return d << _ | d >>> 32 - _ }\r\n\r\nvar retryLazy = function (_function, clbk, time) {\r\n if (!time) time = 200;\r\n\r\n var f = function () {\r\n _function(function (result) {\r\n\r\n if (result) {\r\n\r\n if (clbk) clbk();\r\n\r\n }\r\n\r\n else {\r\n setTimeout(f, time)\r\n }\r\n\r\n })\r\n }\r\n\r\n f();\r\n}\r\n\r\nvar isAndroid = function () {\r\n var ua = navigator.userAgent.toLowerCase();\r\n var isAndroid = ua.indexOf(\"android\") > -1;\r\n\r\n if (isAndroid) {\r\n return true\r\n }\r\n}\r\n\r\nvar isMobile = function () {\r\n return $('html').hasClass('mobile');\r\n}\r\n\r\nvar isTablet = function () {\r\n return $('html').hasClass('mobile') || $('html').hasClass('tablet');\r\n}\r\n\r\nvar slowMade = function (_function, timer, time) {\r\n\r\n if (!time) time = 20\r\n\r\n if (timer)\r\n clearTimeout(timer);\r\n\r\n timer = setTimeout(_function, time);\r\n\r\n return timer;\r\n}\r\n\r\nvar rand = function (min, max) {\r\n min = parseInt(min);\r\n max = parseInt(max);\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}\r\n\r\nvar trim = function (s) {\r\n return rtrim(ltrim(s));\r\n}\r\n\r\nvar ltrim = function (s) {\r\n return (s || \"\").replace(/^\\s+/, '');\r\n}\r\n\r\nvar rtrim = function (s) {\r\n return (s || \"\").replace(/\\s+$/, '');\r\n}\r\n\r\nvar ltrimrn = function (s) {\r\n return (s || \"\").replace(/^[\\r\\n\\t ]+/, '');\r\n}\r\n\r\nvar rtrimrn = function (s) {\r\n return (s || \"\").replace(/[\\r\\n\\t ]+$/, '');\r\n}\r\n\r\nvar trimrn = function (s) {\r\n return rtrimrn(ltrimrn(s));\r\n}\r\n\r\nvar hexEncode = function (text) {\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 0; i < text.length; i++) {\r\n ch = text.charCodeAt(i);\r\n if (ch > 0xFF) ch -= 0x350;\r\n ch = ch.toString(16);\r\n while (ch.length < 2) ch = \"0\" + ch;\r\n result += ch;\r\n }\r\n return result;\r\n}\r\n\r\nvar stringify = function(e){\r\n\r\n if(!e) return null\r\n\r\n if(e.toString) {\r\n\r\n var s = e.toString()\r\n\r\n if (s != '[object Object]')\r\n return s\r\n }\r\n\r\n if(_.isObject(e)) return JSON.stringify(e)\r\n\r\n return e\r\n}\r\n\r\nvar hexstorage = {}\r\n\r\n\r\nvar hexDecode = function (hex) {\r\n\r\n if (hexstorage[hex]) return hexstorage[hex]\r\n\r\n var ch = 0;\r\n var result = \"\";\r\n for (var i = 2; i <= hex.length; i += 2) {\r\n ch = parseInt(hex.substring(i - 2, i), 16);\r\n if (ch >= 128) ch += 0x350;\r\n ch = String.fromCharCode(\"0x\" + ch.toString(16));\r\n result += ch;\r\n }\r\n\r\n hexstorage[hex] = result\r\n\r\n return result;\r\n}\r\nvar imgDimensions = function (data) {\r\n let img = new Image()\r\n img.src = data.base64\r\n data.width = img.width\r\n data.height = img.height\r\n return data\r\n}\r\n\r\nvar knsites = ['bastyon.com', 'pocketnet.app', 'zoom.us', 'youtube', 'facebook', 'instagram', 'vk.com', 'twitter', 'pinterest', 'vimeo', 'ask.fm', 'change.org', 'wikipedia', 'livejournal', 'linkedin', 'myspace', 'reddit', 'tumblr', 'ok.ru', 'flickr', 'google', 'yandex', 'yahoo', 'bing', 'gmail', 'mail']\r\n\r\nvar knsite = function (url) {\r\n return _.find(knsites, function (u) {\r\n return url.indexOf(u) > -1\r\n })\r\n}\r\n\r\nvar getUrl = function (data) {\r\n\r\n /*if(!linkify){\r\n linkify = require('linkifyjs');\r\n linkify.registerCustomProtocol('pocketnet')\r\n linkify.registerCustomProtocol('bastyon')\r\n }*/\r\n\r\n var links = linkify.find(data)\r\n\r\n if (links.length) {\r\n return links[0].href\r\n }\r\n}\r\nvar getTxt = function (data) {\r\n return data.replace(/\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/g, '')\r\n}\r\nvar getmatrixid = function (str) {\r\n return str.split(\":\")[0].replace(\"@\", '')\r\n}\r\nvar getMatrixIdFull = function (id, domain) {\r\n id || (id = '')\r\n\r\n if (id.indexOf(\"@\") == 0) return id\r\n return '@' + id + ':' + domain\r\n}\r\nvar ObjDiff = function (x, y) {\r\n var target = {};\r\n var diffProps = Object.keys(x).filter(function (i) {\r\n return x[i] !== y[i];\r\n\r\n }).map(function (j) {\r\n var obj = {};\r\n obj[j] = x[j];\r\n target = Object.assign(target, obj)\r\n });\r\n return target;\r\n}\r\nvar filterByUserId = function (arr, data) {\r\n var a = arr.map(function (e) {\r\n return e.id;\r\n });\r\n var d = data.map(function (e) {\r\n return e.id;\r\n });\r\n\r\n var x = [];\r\n a.forEach(function (e) {\r\n x.push(data[d.indexOf(e)]);\r\n });\r\n\r\n return x;\r\n}\r\nvar formatBytes = function (bytes, decimals = 2) {\r\n if (bytes === 0) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\r\n}\r\n\r\nvar poketnetUrlParser = function (url) {\r\n var newURL = new URL(url)\r\n return {\r\n post: newURL.searchParams.get('s'),\r\n user: newURL.pathname.replace('/', ''),\r\n }\r\n}\r\n\r\n// Takes a url and returns another one that fits into iframe\r\nvar videoUrlParser = function (url) {\r\n var youtube_host = ['www.youtube.com', 'youtube.com', 'youtu.be']\r\n var vimeo_host = ['www.vimeo.com', 'vimeo.com']\r\n var peertube_host = ['peer.tube', 'peertube.social']\r\n\r\n var newURL = new URL(url)\r\n\r\n if (youtube_host.indexOf(newURL.hostname) > -1) return `https://www.youtube.com/embed/${newURL.searchParams.get('v')}`\r\n if (vimeo_host.indexOf(newURL.hostname) > -1) return `https://player.vimeo.com/video${newURL.pathname}`\r\n if (peertube_host.indexOf(newURL.hostname) > -1) return `https://pocketnetpeertube1.nohost.me/${newURL.pathname.replace('watch', 'embed')}`\r\n}\r\n\r\n// Cuts string if its length longer than 'lenght'\r\nvar textFormatter = function (text, length) {\r\n return text.slice(0, length) + `...`\r\n}\r\n\r\n// takes a text and returns it without url in it\r\nvar urlSeparator = function (text) {\r\n var url = getUrl(text)\r\n return text.replace(url, \"\")\r\n}\r\n\r\n// takes a timestamp and turns it into a string like `Dec 25, 2000 at 2:15 PM`\r\nvar dateParser = function (data) {\r\n var parsedDate = new Date(data * 1000)\r\n\r\n var year = parsedDate.getFullYear()\r\n var month = parsedDate.getMonth()\r\n var day = parsedDate.getDate()\r\n\r\n var meridian = parsedDate.getHours() > 13 ? `PM` : `AM`\r\n var hour = parsedDate.getHours() > 13 ? parsedDate.getHours() - 12 : parsedDate.getHours()\r\n var minutes = parsedDate.getMinutes() < 10 ? `0${parsedDate.getMinutes()}` : parsedDate.getMinutes()\r\n\r\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\r\n\r\n return `${months[month]} ${day}, ${year} at ${hour}:${minutes} ${meridian}`\r\n}\r\n\r\n// calculates rating and returns star icons\r\nvar setRating = function (total_score, votes) {\r\n\r\n var average_score = total_score / votes\r\n\r\n var full_star = ``\r\n var half_star = ``\r\n var emply_star = ``\r\n\r\n var rating = [``, ``, ``, ``, ``]\r\n\r\n if (total_score === 0) {\r\n return rating.map(item => item = emply_star)\r\n }\r\n\r\n return rating.map(item => {\r\n if (average_score >= 1) {\r\n average_score--\r\n return item = full_star\r\n }\r\n if (average_score < 1 && average_score >= 0.5) {\r\n average_score--\r\n return item = half_star\r\n }\r\n if (average_score < 0.5) {\r\n average_score--\r\n return item = emply_star\r\n }\r\n })\r\n}\r\n\r\n// Indicates whether an object is on at least 80% within viewport or not\r\nvar isVisible = function (element) {\r\n var topY = element.getBoundingClientRect().top\r\n var bottomY = element.getBoundingClientRect().bottom\r\n var window_height = document.documentElement.clientHeight\r\n var elem_height = bottomY - topY\r\n\r\n var isVisibleOnTop = bottomY >= elem_height * 0.8\r\n var isVisibleOnbottom = bottomY <= window_height + elem_height * 0.2\r\n\r\n if (isVisibleOnTop && isVisibleOnbottom) return true\r\n else return false\r\n}\r\nvar _arrayBufferToBase64 = function (buffer) {\r\n var binary = '';\r\n var bytes = new Uint8Array(buffer);\r\n var len = bytes.byteLength;\r\n for (var i = 0; i < len; i++) {\r\n binary += String.fromCharCode(bytes[i]);\r\n }\r\n return window.btoa(binary);\r\n}\r\n\r\nvar _base64ToArrayBuffer = function (base64) {\r\n var binary_string = window.atob(base64);\r\n var len = binary_string.length;\r\n var bytes = new Uint8Array(len);\r\n for (var i = 0; i < len; i++) {\r\n bytes[i] = binary_string.charCodeAt(i);\r\n }\r\n return bytes.buffer;\r\n}\r\n\r\nvar Base64 = {\r\n // private property\r\n _keyStr: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\r\n\r\n // public method for encoding\r\n encode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = Base64._utf8_encode(input);\r\n\r\n while (i < input.length) {\r\n\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output +\r\n Base64._keyStr.charAt(enc1) + Base64._keyStr.charAt(enc2) +\r\n Base64._keyStr.charAt(enc3) + Base64._keyStr.charAt(enc4);\r\n\r\n }\r\n\r\n return output;\r\n },\r\n\r\n // public method for decoding\r\n decode: function (input) {\r\n var output = \"\";\r\n var chr1, chr2, chr3;\r\n var enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n\r\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\r\n\r\n while (i < input.length) {\r\n\r\n enc1 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc2 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc3 = Base64._keyStr.indexOf(input.charAt(i++));\r\n enc4 = Base64._keyStr.indexOf(input.charAt(i++));\r\n\r\n chr1 = (enc1 << 2) | (enc2 >> 4);\r\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\r\n chr3 = ((enc3 & 3) << 6) | enc4;\r\n\r\n output = output + String.fromCharCode(chr1);\r\n\r\n if (enc3 != 64) {\r\n output = output + String.fromCharCode(chr2);\r\n }\r\n if (enc4 != 64) {\r\n output = output + String.fromCharCode(chr3);\r\n }\r\n\r\n }\r\n\r\n output = Base64._utf8_decode(output);\r\n\r\n return output;\r\n\r\n },\r\n\r\n // private method for UTF-8 encoding\r\n _utf8_encode: function (string) {\r\n string = string.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < string.length; n++) {\r\n\r\n var c = string.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n\r\n }\r\n\r\n return utftext;\r\n },\r\n\r\n // private method for UTF-8 decoding\r\n _utf8_decode: function (utftext) {\r\n var string = \"\";\r\n var i = 0;\r\n var c = 0, c1 = 0, c2 = 0;\r\n\r\n while (i < utftext.length) {\r\n\r\n c = utftext.charCodeAt(i);\r\n\r\n if (c < 128) {\r\n string += String.fromCharCode(c);\r\n i++;\r\n }\r\n else if ((c > 191) && (c < 224)) {\r\n c2 = utftext.charCodeAt(i + 1);\r\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n i += 2;\r\n }\r\n else {\r\n c2 = utftext.charCodeAt(i + 1);\r\n c3 = utftext.charCodeAt(i + 2);\r\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n i += 3;\r\n }\r\n\r\n }\r\n return string;\r\n },\r\n\r\n fromFile: file => new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n\r\n reader.readAsDataURL(file);\r\n reader.onloadend = () => resolve(reader.result);\r\n reader.onerror = error => reject(error);\r\n }),\r\n\r\n toFileFetch: function (base64) {\r\n return fetch(base64).then(res => {\r\n return res.blob()\r\n }).then(blob => {\r\n return new (window.wFile || window.File)([blob], \"File name\", { type: \"image/png\" })\r\n })\r\n },\r\n\r\n toFile: function (base64) {\r\n\r\n try {\r\n var arr = base64.split(','),\r\n mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]),\r\n n = bstr.length,\r\n u8arr = new Uint8Array(n);\r\n\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n var file = new (window.wFile || window.File)([u8arr], \"Filename\", { type: mime });\r\n\r\n return Promise.resolve(file)\r\n }\r\n catch (e) {\r\n return Promise.reject(e)\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nf.copyArrayBuffer = function(src){\r\n var dst = new ArrayBuffer(src.byteLength);\r\n new Uint8Array(dst).set(new Uint8Array(src));\r\n return dst;\r\n}\r\n\r\nf.readFile = function (file) {\r\n\r\n let reader = new FileReader();\r\n\r\n reader.readAsArrayBuffer(file);\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n reader.onload = function () {\r\n resolve(reader.result);\r\n };\r\n\r\n reader.onerror = function () {\r\n reject(reader.error);\r\n };\r\n })\r\n}\r\n\r\nf.fetchLocal = function (url) {\r\n\r\n\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest\r\n\r\n xhr.onload = function () {\r\n\r\n var type = xhr.getResponseHeader('content-type')\r\n\r\n\r\n resolve({\r\n data: new Blob([xhr.response], { type: type, name: 'file' })\r\n })\r\n\r\n // resolve()\r\n }\r\n\r\n xhr.onerror = function (e) {\r\n console.error(e, url)\r\n reject(new TypeError('Local request failed'))\r\n }\r\n\r\n xhr.open('GET', url)\r\n xhr.responseType = \"arraybuffer\";\r\n xhr.send(null)\r\n })\r\n};\r\n\r\n\r\n\r\nf.saveFileCordova = function(file, name, clbk, todownloads){\r\n\r\n var storageLocation = \"\";\r\n\r\n switch (device.platform) {\r\n case \"Android\":\r\n storageLocation = 'file:///storage/emulated/0/'; //LocalFileSystem.PERSISTENT\r\n break;\r\n case \"iOS\":\r\n storageLocation = cordova.file.cacheDirectory;\r\n break;\r\n }\r\n\r\n\r\n var onsuccess = function (fileSystem) {\r\n\r\n fileSystem.getDirectory('Download', { exclusive: false }, function (directory) {\r\n\r\n directory.getFile(name, { create: true, exclusive: false }, function (entry) {\r\n // After you save the file, you can access it with this URL\r\n var myFileUrl = entry.toURL();\r\n\r\n\r\n entry.createWriter(function (writer) {\r\n\r\n writer.onwriteend = function (evt) {\r\n //sitemessage(\"File \" + name + \" successfully downloaded\");\r\n\r\n if (window.galleryRefresh){\r\n\r\n window.galleryRefresh.refresh(myFileUrl, function (msg) {\r\n\r\n }, function (err) {\r\n\r\n\r\n })\r\n\r\n }\r\n\r\n if (clbk)\r\n clbk({\r\n name,\r\n url : myFileUrl\r\n })\r\n };\r\n\r\n writer.onerror = function (e) {\r\n\r\n if (clbk)\r\n clbk(null, e)\r\n\r\n };\r\n\r\n // Write to the file\r\n writer.seek(0);\r\n\r\n writer.write(file);\r\n\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file writer, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n }, function (error) {\r\n\r\n /*dialog({\r\n html : \"Error: Could not create file, \" + error.code,\r\n class : \"one\"\r\n })*/\r\n\r\n if(clbk) clbk(null, error)\r\n\r\n });\r\n\r\n })\r\n }\r\n\r\n var onerror = function (evt) {\r\n if(clbk) clbk(null, evt)\r\n }\r\n \r\n if(todownloads){\r\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){\r\n\r\n\r\n onsuccess(fileSystem.root)\r\n }, onerror)\r\n }\r\n else{\r\n window.resolveLocalFileSystemURL(storageLocation, onsuccess, onerror)\r\n }\r\n\r\n}\r\n\r\nfunction iOS() {\r\n return [\r\n 'iPad Simulator',\r\n 'iPhone Simulator',\r\n 'iPod Simulator',\r\n 'iPad',\r\n 'iPhone',\r\n 'iPod'\r\n ].includes(navigator.platform)\r\n // iPad on iOS 13 detection\r\n || (navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document)\r\n}\r\n\r\nf.isios = function () {\r\n return (window.cordova && window.device && deep(window, 'device.platform') == 'iOS') || iOS()\r\n}\r\n\r\nf.now = function (date) {\r\n var now = date || (new Date);\r\n var UTCseconds = (now.getTime() + now.getTimezoneOffset() * 60 * 1000);\r\n var d = new Date(UTCseconds);\r\n d.toString();\r\n\r\n return d\r\n}\r\n\r\nf.date = {\r\n addseconds: function (now, seconds) {\r\n if (!now) now = new Date\r\n\r\n var ntime = now.getTime() + seconds * 1000\r\n var d = new Date(ntime);\r\n\r\n return d\r\n }\r\n}\r\n\r\nf.getservers = function(arr, mult, address) {\r\n\r\n if(!arr.length) return []\r\n\r\n mult || (mult = 1)\r\n\r\n if(mult > arr.length) mult = arr.length\r\n\r\n var mutations = f.permutations(arr, mult);\r\n\r\n var index = f.helpers.base58.decode(address) % mutations.length;\r\n\r\n return mutations[index]\r\n}\r\n\r\nf.helpers = {\r\n base58: {\r\n ALPHABET: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz',\r\n ALPHABET_MAP: {},\r\n i: 0,\r\n\r\n encode(buffer) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var carry, digits, j;\r\n if (buffer.length === 0) {\r\n return '';\r\n }\r\n i = void 0;\r\n j = void 0;\r\n digits = [0];\r\n i = 0;\r\n while (i < buffer.length) {\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] <<= 8;\r\n j++;\r\n }\r\n digits[0] += buffer[i];\r\n carry = 0;\r\n j = 0;\r\n while (j < digits.length) {\r\n digits[j] += carry;\r\n carry = (digits[j] / 58) | 0;\r\n digits[j] %= 58;\r\n ++j;\r\n }\r\n while (carry) {\r\n digits.push(carry % 58);\r\n carry = (carry / 58) | 0;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (buffer[i] === 0 && i < buffer.length - 1) {\r\n digits.push(0);\r\n i++;\r\n }\r\n return digits\r\n .reverse()\r\n .map(function (digit) {\r\n return ALPHABET[digit];\r\n })\r\n .join('');\r\n },\r\n\r\n decode(string) {\r\n const { ALPHABET, ALPHABET_MAP } = this;\r\n let { i } = this;\r\n\r\n if (!Object.keys(ALPHABET_MAP).length) {\r\n while (i < ALPHABET.length) {\r\n ALPHABET_MAP[ALPHABET.charAt(i)] = i;\r\n i++;\r\n }\r\n }\r\n\r\n var bytes, c, carry, j;\r\n if (string.length === 0) {\r\n return new (\r\n typeof Uint8Array !== 'undefined' && Uint8Array !== null\r\n ? Uint8Array\r\n : Buffer\r\n )(0);\r\n }\r\n i = void 0;\r\n j = void 0;\r\n bytes = [0];\r\n i = 0;\r\n while (i < string.length) {\r\n c = string[i];\r\n if (!(c in ALPHABET_MAP)) {\r\n throw (\r\n \"Base58.decode received unacceptable input. Character '\" +\r\n c +\r\n \"' is not in the Base58 alphabet.\"\r\n );\r\n }\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] *= 58;\r\n j++;\r\n }\r\n bytes[0] += ALPHABET_MAP[c];\r\n carry = 0;\r\n j = 0;\r\n while (j < bytes.length) {\r\n bytes[j] += carry;\r\n carry = bytes[j] >> 8;\r\n bytes[j] &= 0xff;\r\n ++j;\r\n }\r\n while (carry) {\r\n bytes.push(carry & 0xff);\r\n carry >>= 8;\r\n }\r\n i++;\r\n }\r\n i = 0;\r\n while (string[i] === '1' && i < string.length - 1) {\r\n bytes.push(0);\r\n i++;\r\n }\r\n\r\n const outputArray = new Uint8Array(bytes.reverse());\r\n\r\n let buffer = Buffer.from(outputArray);\r\n return buffer.readUIntBE(0, outputArray.length);\r\n },\r\n },\r\n};\r\n\r\nf.getCaretPosition = function(ctrl){\r\n // IE < 9 Support \r\n if (document.selection) {\r\n ctrl.focus();\r\n var range = document.selection.createRange();\r\n var rangelen = range.text.length;\r\n range.moveStart('character', -ctrl.value.length);\r\n var start = range.text.length - rangelen;\r\n return {\r\n 'start': start,\r\n 'end': start + rangelen\r\n };\r\n } // IE >=9 and other browsers\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0') {\r\n return {\r\n 'start': ctrl.selectionStart,\r\n 'end': ctrl.selectionEnd\r\n };\r\n } else {\r\n return {\r\n 'start': 0,\r\n 'end': 0\r\n };\r\n }\r\n}\r\n\r\nf.setCaretPosition = function(ctrl, start, end) {\r\n // IE >= 9 and other browsers\r\n if (ctrl.setSelectionRange) {\r\n ctrl.focus();\r\n ctrl.setSelectionRange(start, end);\r\n }\r\n // IE < 9 \r\n else if (ctrl.createTextRange) {\r\n var range = ctrl.createTextRange();\r\n range.collapse(true);\r\n range.moveEnd('character', end);\r\n range.moveStart('character', start);\r\n range.select();\r\n }\r\n}\r\n\r\nf.ObjDiff = ObjDiff\r\nf._arrayBufferToBase64 = _arrayBufferToBase64\r\nf._base64ToArrayBuffer = _base64ToArrayBuffer\r\nf.Base64 = Base64\r\nf.getmatrixid = getmatrixid\r\nf.getMatrixIdFull = getMatrixIdFull\r\nf.formatBytes = formatBytes\r\nf.filterByUserId = filterByUserId\r\nf.trim = trim\r\nf.isAndroid = isAndroid\r\nf.isMobile = isMobile\r\nf.isTablet = isTablet\r\nf.rand = rand\r\nf.group = group\r\nf.flball = flball\r\nf.flb = flb\r\nf.flbs = flbs\r\nf.flbb = flbb\r\nf.makeid = makeid\r\nf.scrollTo = _scrollTo\r\nf.stringEq = stringEq\r\nf.pretry = pretry\r\nf.retry = retry\r\nf.retryLazy = retryLazy\r\nf.slowMade = slowMade\r\nf.renderFrameEqualizer = renderFrameEqualizer\r\nf.hexEncode = hexEncode\r\nf.hexDecode = hexDecode\r\nf.imgDimensions = imgDimensions\r\nf.getUrl = getUrl\r\nf.getTxt = getTxt\r\nf.poketnetUrlParser = poketnetUrlParser\r\nf.textFormatter = textFormatter\r\nf.urlSeparator = urlSeparator\r\nf.dateParser = dateParser\r\nf.setRating = setRating\r\nf.videoUrlParser = videoUrlParser\r\nf.isVisible = isVisible\r\nf.copytext = copytext\r\nf.md5 = md5\r\nf.knsite = knsite\r\nf.stringify = stringify\r\nexport default f","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","import listToStyles from './listToStyles'\n\nexport default function addStylesToShadowDOM (parentId, list, shadowRoot) {\n var styles = listToStyles(parentId, list)\n addStyles(styles, shadowRoot)\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nfunction addStyles (styles /* Array */, shadowRoot) {\n const injectedStyles =\n shadowRoot._injectedStyles ||\n (shadowRoot._injectedStyles = {})\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i]\n var style = injectedStyles[item.id]\n if (!style) {\n for (var j = 0; j < item.parts.length; j++) {\n addStyle(item.parts[j], shadowRoot)\n }\n injectedStyles[item.id] = true\n }\n }\n}\n\nfunction createStyleElement (shadowRoot) {\n var styleElement = document.createElement('style')\n styleElement.type = 'text/css'\n shadowRoot.appendChild(styleElement)\n return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */, shadowRoot) {\n var styleElement = createStyleElement(shadowRoot)\n var css = obj.css\n var media = obj.media\n var sourceMap = obj.sourceMap\n\n if (media) {\n styleElement.setAttribute('media', media)\n }\n\n if (sourceMap) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n }\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild)\n }\n styleElement.appendChild(document.createTextNode(css))\n }\n}\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.AutoDiscovery = void 0;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _url = require(\"url\");\r\n\r\n/*\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/** @module auto-discovery */\r\n// Dev note: Auto discovery is part of the spec.\r\n// See: https://matrix.org/docs/spec/client_server/r0.4.0.html#server-discovery\r\n\r\n/**\r\n * Description for what an automatically discovered client configuration\r\n * would look like. Although this is a class, it is recommended that it\r\n * be treated as an interface definition rather than as a class.\r\n *\r\n * Additional properties than those defined here may be present, and\r\n * should follow the Java package naming convention.\r\n */\r\nclass DiscoveredClientConfig {\r\n // eslint-disable-line no-unused-vars\r\n // Dev note: this is basically a copy/paste of the .well-known response\r\n // object as defined in the spec. It does have additional information,\r\n // however. Overall, this exists to serve as a place for documentation\r\n // and not functionality.\r\n // See https://matrix.org/docs/spec/client_server/r0.4.0.html#get-well-known-matrix-client\r\n constructor() {\r\n /**\r\n * The homeserver configuration the client should use. This will\r\n * always be present on the object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n this[\"m.homeserver\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey. Additionally,\r\n * if this is not AutoDiscovery.SUCCESS then the client should\r\n * assume the other properties in the client config (such as\r\n * the identity server configuration) are not valid.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * If the state is AutoDiscovery.FAIL_ERROR or .FAIL_PROMPT\r\n * then this will contain a human-readable (English) message\r\n * for what went wrong. If the state is none of those previously\r\n * mentioned, this will be falsey.\r\n */\r\n error: \"Something went wrong\",\r\n\r\n /**\r\n * The base URL clients should use to talk to the homeserver,\r\n * particularly for the login process. May be falsey if the\r\n * state is not AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://matrix.org\"\r\n };\r\n /**\r\n * The identity server configuration the client should use. This\r\n * will always be present on teh object.\r\n * @type {{state: string, base_url: string}} The configuration.\r\n */\r\n\r\n this[\"m.identity_server\"] = {\r\n /**\r\n * The lookup result state. If this is anything other than\r\n * AutoDiscovery.SUCCESS then base_url may be falsey.\r\n */\r\n state: AutoDiscovery.PROMPT,\r\n\r\n /**\r\n * The base URL clients should use for interacting with the\r\n * identity server. May be falsey if the state is not\r\n * AutoDiscovery.SUCCESS.\r\n */\r\n base_url: \"https://vector.im\"\r\n };\r\n }\r\n\r\n}\r\n/**\r\n * Utilities for automatically discovery resources, such as homeservers\r\n * for users to log in to.\r\n */\r\n\r\n\r\nclass AutoDiscovery {\r\n // Dev note: the constants defined here are related to but not\r\n // exactly the same as those in the spec. This is to hopefully\r\n // translate the meaning of the states in the spec, but also\r\n // support our own if needed.\r\n static get ERROR_INVALID() {\r\n return \"Invalid homeserver discovery response\";\r\n }\r\n\r\n static get ERROR_GENERIC_FAILURE() {\r\n return \"Failed to get autodiscovery configuration from server\";\r\n }\r\n\r\n static get ERROR_INVALID_HS_BASE_URL() {\r\n return \"Invalid base_url for m.homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_HOMESERVER() {\r\n return \"Homeserver URL does not appear to be a valid Matrix homeserver\";\r\n }\r\n\r\n static get ERROR_INVALID_IS_BASE_URL() {\r\n return \"Invalid base_url for m.identity_server\";\r\n }\r\n\r\n static get ERROR_INVALID_IDENTITY_SERVER() {\r\n return \"Identity server URL does not appear to be a valid identity server\";\r\n }\r\n\r\n static get ERROR_INVALID_IS() {\r\n return \"Invalid identity server discovery response\";\r\n }\r\n\r\n static get ERROR_MISSING_WELLKNOWN() {\r\n return \"No .well-known JSON file found\";\r\n }\r\n\r\n static get ERROR_INVALID_JSON() {\r\n return \"Invalid JSON\";\r\n }\r\n\r\n static get ALL_ERRORS() {\r\n return [AutoDiscovery.ERROR_INVALID, AutoDiscovery.ERROR_GENERIC_FAILURE, AutoDiscovery.ERROR_INVALID_HS_BASE_URL, AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IS_BASE_URL, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, AutoDiscovery.ERROR_INVALID_IS, AutoDiscovery.ERROR_MISSING_WELLKNOWN, AutoDiscovery.ERROR_INVALID_JSON];\r\n }\r\n /**\r\n * The auto discovery failed. The client is expected to communicate\r\n * the error to the user and refuse logging in.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_ERROR() {\r\n return \"FAIL_ERROR\";\r\n }\r\n /**\r\n * The auto discovery failed, however the client may still recover\r\n * from the problem. The client is recommended to that the same\r\n * action it would for PROMPT while also warning the user about\r\n * what went wrong. The client may also treat this the same as\r\n * a FAIL_ERROR state.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get FAIL_PROMPT() {\r\n return \"FAIL_PROMPT\";\r\n }\r\n /**\r\n * The auto discovery didn't fail but did not find anything of\r\n * interest. The client is expected to prompt the user for more\r\n * information, or fail if it prefers.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get PROMPT() {\r\n return \"PROMPT\";\r\n }\r\n /**\r\n * The auto discovery was successful.\r\n * @return {string}\r\n * @constructor\r\n */\r\n\r\n\r\n static get SUCCESS() {\r\n return \"SUCCESS\";\r\n }\r\n /**\r\n * Validates and verifies client configuration information for purposes\r\n * of logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be included, and will be transparently brought into the\r\n * response object unaltered.\r\n * @param {string} wellknown The configuration object itself, as returned\r\n * by the .well-known auto-discovery endpoint.\r\n * @return {Promise} Resolves to the verified\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when verification fails.\r\n */\r\n\r\n\r\n static async fromDiscoveryConfig(wellknown) {\r\n // Step 1 is to get the config, which is provided to us here.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n };\r\n\r\n if (!wellknown || !wellknown[\"m.homeserver\"]) {\r\n _logger.logger.error(\"No m.homeserver key in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n return Promise.resolve(clientConfig);\r\n }\r\n\r\n if (!wellknown[\"m.homeserver\"][\"base_url\"]) {\r\n _logger.logger.error(\"No m.homeserver base_url in config\");\r\n\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Make sure the homeserver URL is valid *looking*. We'll make\r\n // sure it points to a homeserver in Step 3.\r\n\r\n\r\n const hsUrl = this._sanitizeWellKnownUrl(wellknown[\"m.homeserver\"][\"base_url\"]);\r\n\r\n if (!hsUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.homeserver\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HS_BASE_URL;\r\n return Promise.resolve(clientConfig);\r\n } // Step 3: Make sure the homeserver URL points to a homeserver.\r\n\r\n\r\n const hsVersions = await this._fetchWellKnownObject(`${hsUrl}/_matrix/client/versions`);\r\n\r\n if (!hsVersions || !hsVersions.raw[\"versions\"]) {\r\n _logger.logger.error(\"Invalid /versions response\");\r\n\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID_HOMESERVER; // Supply the base_url to the caller because they may be ignoring liveliness\r\n // errors, like this one.\r\n\r\n clientConfig[\"m.homeserver\"].base_url = hsUrl;\r\n return Promise.resolve(clientConfig);\r\n } // Step 4: Now that the homeserver looks valid, update our client config.\r\n\r\n\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: hsUrl\r\n }; // Step 5: Try to pull out the identity server configuration\r\n\r\n let isUrl = \"\";\r\n\r\n if (wellknown[\"m.identity_server\"]) {\r\n // We prepare a failing identity server response to save lines later\r\n // in this branch.\r\n const failingClientConfig = {\r\n \"m.homeserver\": clientConfig[\"m.homeserver\"],\r\n \"m.identity_server\": {\r\n state: AutoDiscovery.FAIL_PROMPT,\r\n error: AutoDiscovery.ERROR_INVALID_IS,\r\n base_url: null\r\n }\r\n }; // Step 5a: Make sure the URL is valid *looking*. We'll make sure it\r\n // points to an identity server in Step 5b.\r\n\r\n isUrl = this._sanitizeWellKnownUrl(wellknown[\"m.identity_server\"][\"base_url\"]);\r\n\r\n if (!isUrl) {\r\n _logger.logger.error(\"Invalid base_url for m.identity_server\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IS_BASE_URL;\r\n return Promise.resolve(failingClientConfig);\r\n } // Step 5b: Verify there is an identity server listening on the provided\r\n // URL.\r\n\r\n\r\n const isResponse = await this._fetchWellKnownObject(`${isUrl}/_matrix/identity/api/v1`);\r\n\r\n if (!isResponse || !isResponse.raw || isResponse.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"Invalid /api/v1 response\");\r\n\r\n failingClientConfig[\"m.identity_server\"].error = AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER; // Supply the base_url to the caller because they may be ignoring\r\n // liveliness errors, like this one.\r\n\r\n failingClientConfig[\"m.identity_server\"].base_url = isUrl;\r\n return Promise.resolve(failingClientConfig);\r\n }\r\n } // Step 6: Now that the identity server is valid, or never existed,\r\n // populate the IS section.\r\n\r\n\r\n if (isUrl && isUrl.length > 0) {\r\n clientConfig[\"m.identity_server\"] = {\r\n state: AutoDiscovery.SUCCESS,\r\n error: null,\r\n base_url: isUrl\r\n };\r\n } // Step 7: Copy any other keys directly into the clientConfig. This is for\r\n // things like custom configuration of services.\r\n\r\n\r\n Object.keys(wellknown).map(k => {\r\n if (k === \"m.homeserver\" || k === \"m.identity_server\") {\r\n // Only copy selected parts of the config to avoid overwriting\r\n // properties computed by the validation logic above.\r\n const notProps = [\"error\", \"state\", \"base_url\"];\r\n\r\n for (const prop of Object.keys(wellknown[k])) {\r\n if (notProps.includes(prop)) continue;\r\n clientConfig[k][prop] = wellknown[k][prop];\r\n }\r\n } else {\r\n // Just copy the whole thing over otherwise\r\n clientConfig[k] = wellknown[k];\r\n }\r\n }); // Step 8: Give the config to the caller (finally)\r\n\r\n return Promise.resolve(clientConfig);\r\n }\r\n /**\r\n * Attempts to automatically discover client configuration information\r\n * prior to logging in. Such information includes the homeserver URL\r\n * and identity server URL the client would want. Additional details\r\n * may also be discovered, and will be transparently included in the\r\n * response object unaltered.\r\n * @param {string} domain The homeserver domain to perform discovery\r\n * on. For example, \"matrix.org\".\r\n * @return {Promise} Resolves to the discovered\r\n * configuration, which may include error states. Rejects on unexpected\r\n * failure, not when discovery fails.\r\n */\r\n\r\n\r\n static async findClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n } // We use a .well-known lookup for all cases. According to the spec, we\r\n // can do other discovery mechanisms if we want such as custom lookups\r\n // however we won't bother with that here (mostly because the spec only\r\n // supports .well-known right now).\r\n //\r\n // By using .well-known, we need to ensure we at least pull out a URL\r\n // for the homeserver. We don't really need an identity server configuration\r\n // but will return one anyways (with state PROMPT) to make development\r\n // easier for clients. If we can't get a homeserver URL, all bets are\r\n // off on the rest of the config and we'll assume it is invalid too.\r\n // We default to an error state to make the first few checks easier to\r\n // write. We'll update the properties of this object over the duration\r\n // of this function.\r\n\r\n\r\n const clientConfig = {\r\n \"m.homeserver\": {\r\n state: AutoDiscovery.FAIL_ERROR,\r\n error: AutoDiscovery.ERROR_INVALID,\r\n base_url: null\r\n },\r\n \"m.identity_server\": {\r\n // Technically, we don't have a problem with the identity server\r\n // config at this point.\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n }\r\n }; // Step 1: Actually request the .well-known JSON file and make sure it\r\n // at least has a homeserver definition.\r\n\r\n const wellknown = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n\r\n if (!wellknown || wellknown.action !== \"SUCCESS\") {\r\n _logger.logger.error(\"No response or error when parsing .well-known\");\r\n\r\n if (wellknown.reason) _logger.logger.error(wellknown.reason);\r\n\r\n if (wellknown.action === \"IGNORE\") {\r\n clientConfig[\"m.homeserver\"] = {\r\n state: AutoDiscovery.PROMPT,\r\n error: null,\r\n base_url: null\r\n };\r\n } else {\r\n // this can only ever be FAIL_PROMPT at this point.\r\n clientConfig[\"m.homeserver\"].state = AutoDiscovery.FAIL_PROMPT;\r\n clientConfig[\"m.homeserver\"].error = AutoDiscovery.ERROR_INVALID;\r\n }\r\n\r\n return Promise.resolve(clientConfig);\r\n } // Step 2: Validate and parse the config\r\n\r\n\r\n return AutoDiscovery.fromDiscoveryConfig(wellknown.raw);\r\n }\r\n /**\r\n * Gets the raw discovery client configuration for the given domain name.\r\n * Should only be used if there's no validation to be done on the resulting\r\n * object, otherwise use findClientConfig().\r\n * @param {string} domain The domain to get the client config for.\r\n * @returns {Promise} Resolves to the domain's client config. Can\r\n * be an empty object.\r\n */\r\n\r\n\r\n static async getRawClientConfig(domain) {\r\n if (!domain || typeof domain !== \"string\" || domain.length === 0) {\r\n throw new Error(\"'domain' must be a string of non-zero length\");\r\n }\r\n\r\n const response = await this._fetchWellKnownObject(`https://${domain}/.well-known/matrix/client`);\r\n if (!response) return {};\r\n return response.raw || {};\r\n }\r\n /**\r\n * Sanitizes a given URL to ensure it is either an HTTP or HTTP URL and\r\n * is suitable for the requirements laid out by .well-known auto discovery.\r\n * If valid, the URL will also be stripped of any trailing slashes.\r\n * @param {string} url The potentially invalid URL to sanitize.\r\n * @return {string|boolean} The sanitized URL or a falsey value if the URL is invalid.\r\n * @private\r\n */\r\n\r\n\r\n static _sanitizeWellKnownUrl(url) {\r\n if (!url) return false;\r\n\r\n try {\r\n // We have to try and parse the URL using the NodeJS URL\r\n // library if we're on NodeJS and use the browser's URL\r\n // library when we're in a browser. To accomplish this, we\r\n // try the NodeJS version first and fall back to the browser.\r\n let parsed = null;\r\n\r\n try {\r\n if (_url.URL) parsed = new _url.URL(url);else parsed = new URL(url);\r\n } catch (e) {\r\n parsed = new URL(url);\r\n }\r\n\r\n if (!parsed || !parsed.hostname) return false;\r\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") return false;\r\n const port = parsed.port ? `:${parsed.port}` : \"\";\r\n const path = parsed.pathname ? parsed.pathname : \"\";\r\n let saferUrl = `${parsed.protocol}//${parsed.hostname}${port}${path}`;\r\n\r\n if (saferUrl.endsWith(\"/\")) {\r\n saferUrl = saferUrl.substring(0, saferUrl.length - 1);\r\n }\r\n\r\n return saferUrl;\r\n } catch (e) {\r\n _logger.logger.error(e);\r\n\r\n return false;\r\n }\r\n }\r\n /**\r\n * Fetches a JSON object from a given URL, as expected by all .well-known\r\n * related lookups. If the server gives a 404 then the `action` will be\r\n * IGNORE. If the server returns something that isn't JSON, the `action`\r\n * will be FAIL_PROMPT. For any other failure the `action` will be FAIL_PROMPT.\r\n *\r\n * The returned object will be a result of the call in object form with\r\n * the following properties:\r\n * raw: The JSON object returned by the server.\r\n * action: One of SUCCESS, IGNORE, or FAIL_PROMPT.\r\n * reason: Relatively human readable description of what went wrong.\r\n * error: The actual Error, if one exists.\r\n * @param {string} url The URL to fetch a JSON object from.\r\n * @return {Promise} Resolves to the returned state.\r\n * @private\r\n */\r\n\r\n\r\n static async _fetchWellKnownObject(url) {\r\n return new Promise(function (resolve, reject) {\r\n const request = require(\"./matrix\").getRequest();\r\n\r\n if (!request) throw new Error(\"No request library available\");\r\n request({\r\n method: \"GET\",\r\n uri: url,\r\n timeout: 5000\r\n }, (err, response, body) => {\r\n if (err || response && (response.statusCode < 200 || response.statusCode >= 300)) {\r\n let action = \"FAIL_PROMPT\";\r\n let reason = (err ? err.message : null) || \"General failure\";\r\n\r\n if (response && response.statusCode === 404) {\r\n action = \"IGNORE\";\r\n reason = AutoDiscovery.ERROR_MISSING_WELLKNOWN;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: action,\r\n reason: reason,\r\n error: err\r\n });\r\n return;\r\n }\r\n\r\n try {\r\n resolve({\r\n raw: JSON.parse(body),\r\n action: \"SUCCESS\"\r\n });\r\n } catch (e) {\r\n let reason = AutoDiscovery.ERROR_INVALID;\r\n\r\n if (e.name === \"SyntaxError\") {\r\n reason = AutoDiscovery.ERROR_INVALID_JSON;\r\n }\r\n\r\n resolve({\r\n raw: {},\r\n action: \"FAIL_PROMPT\",\r\n reason: reason,\r\n error: e\r\n });\r\n }\r\n });\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.AutoDiscovery = AutoDiscovery;","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"label[data-v-6b3704ba]{display:inline}.likelink[data-v-6b3704ba]{text-decoration:underline;cursor:pointer}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.setNow = setNow;\r\nexports.setTimeout = setTimeout;\r\nexports.clearTimeout = clearTimeout;\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* A re-implementation of the javascript callback functions (setTimeout,\r\n * clearTimeout; setInterval and clearInterval are not yet implemented) which\r\n * try to improve handling of large clock jumps (as seen when\r\n * suspending/resuming the system).\r\n *\r\n * In particular, if a timeout would have fired while the system was suspended,\r\n * it will instead fire as soon as possible after resume.\r\n */\r\n// we schedule a callback at least this often, to check if we've missed out on\r\n// some wall-clock time due to being suspended.\r\nconst TIMER_CHECK_PERIOD_MS = 1000; // counter, for making up ids to return from setTimeout\r\n\r\nlet _count = 0; // the key for our callback with the real global.setTimeout\r\n\r\nlet _realCallbackKey; // a sorted list of the callbacks to be run.\r\n// each is an object with keys [runAt, func, params, key].\r\n\r\n\r\nconst _callbackList = []; // var debuglog = logger.log.bind(logger);\r\n\r\nconst debuglog = function () {};\r\n/**\r\n * Replace the function used by this module to get the current time.\r\n *\r\n * Intended for use by the unit tests.\r\n *\r\n * @param {function} [f] function which should return a millisecond counter\r\n *\r\n * @internal\r\n */\r\n\r\n\r\nfunction setNow(f) {\r\n _now = f || Date.now;\r\n}\r\n\r\nlet _now = Date.now;\r\n/**\r\n * reimplementation of window.setTimeout, which will call the callback if\r\n * the wallclock time goes past the deadline.\r\n *\r\n * @param {function} func callback to be called after a delay\r\n * @param {Number} delayMs number of milliseconds to delay by\r\n *\r\n * @return {Number} an identifier for this callback, which may be passed into\r\n * clearTimeout later.\r\n */\r\n\r\nfunction setTimeout(func, delayMs) {\r\n delayMs = delayMs || 0;\r\n\r\n if (delayMs < 0) {\r\n delayMs = 0;\r\n }\r\n\r\n const params = Array.prototype.slice.call(arguments, 2);\r\n const runAt = _now() + delayMs;\r\n const key = _count++;\r\n debuglog(\"setTimeout: scheduling cb\", key, \"at\", runAt, \"(delay\", delayMs, \")\");\r\n const data = {\r\n runAt: runAt,\r\n func: func,\r\n params: params,\r\n key: key\r\n }; // figure out where it goes in the list\r\n\r\n const idx = binarySearch(_callbackList, function (el) {\r\n return el.runAt - runAt;\r\n });\r\n\r\n _callbackList.splice(idx, 0, data);\r\n\r\n _scheduleRealCallback();\r\n\r\n return key;\r\n}\r\n/**\r\n * reimplementation of window.clearTimeout, which mirrors setTimeout\r\n *\r\n * @param {Number} key result from an earlier setTimeout call\r\n */\r\n\r\n\r\nfunction clearTimeout(key) {\r\n if (_callbackList.length === 0) {\r\n return;\r\n } // remove the element from the list\r\n\r\n\r\n let i;\r\n\r\n for (i = 0; i < _callbackList.length; i++) {\r\n const cb = _callbackList[i];\r\n\r\n if (cb.key == key) {\r\n _callbackList.splice(i, 1);\r\n\r\n break;\r\n }\r\n } // iff it was the first one in the list, reschedule our callback.\r\n\r\n\r\n if (i === 0) {\r\n _scheduleRealCallback();\r\n }\r\n} // use the real global.setTimeout to schedule a callback to _runCallbacks.\r\n\r\n\r\nfunction _scheduleRealCallback() {\r\n if (_realCallbackKey) {\r\n global.clearTimeout(_realCallbackKey);\r\n }\r\n\r\n const first = _callbackList[0];\r\n\r\n if (!first) {\r\n debuglog(\"_scheduleRealCallback: no more callbacks, not rescheduling\");\r\n return;\r\n }\r\n\r\n const now = _now();\r\n\r\n const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);\r\n debuglog(\"_scheduleRealCallback: now:\", now, \"delay:\", delayMs);\r\n _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);\r\n}\r\n\r\nfunction _runCallbacks() {\r\n let cb;\r\n\r\n const now = _now();\r\n\r\n debuglog(\"_runCallbacks: now:\", now); // get the list of things to call\r\n\r\n const callbacksToRun = [];\r\n\r\n while (true) {\r\n const first = _callbackList[0];\r\n\r\n if (!first || first.runAt > now) {\r\n break;\r\n }\r\n\r\n cb = _callbackList.shift();\r\n debuglog(\"_runCallbacks: popping\", cb.key);\r\n callbacksToRun.push(cb);\r\n } // reschedule the real callback before running our functions, to\r\n // keep the codepaths the same whether or not our functions\r\n // register their own setTimeouts.\r\n\r\n\r\n _scheduleRealCallback();\r\n\r\n for (let i = 0; i < callbacksToRun.length; i++) {\r\n cb = callbacksToRun[i];\r\n\r\n try {\r\n cb.func.apply(global, cb.params);\r\n } catch (e) {\r\n _logger.logger.error(\"Uncaught exception in callback function\", e.stack || e);\r\n }\r\n }\r\n}\r\n/* search in a sorted array.\r\n *\r\n * returns the index of the last element for which func returns\r\n * greater than zero, or array.length if no such element exists.\r\n */\r\n\r\n\r\nfunction binarySearch(array, func) {\r\n // min is inclusive, max exclusive.\r\n let min = 0;\r\n let max = array.length;\r\n\r\n while (min < max) {\r\n const mid = min + max >> 1;\r\n const res = func(array[mid]);\r\n\r\n if (res > 0) {\r\n // the element at 'mid' is too big; set it as the new max.\r\n max = mid;\r\n } else {\r\n // the element at 'mid' is too small. 'min' is inclusive, so +1.\r\n min = mid + 1;\r\n }\r\n } // presumably, min==max now.\r\n\r\n\r\n return min;\r\n}","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nvar _exportNames = {\r\n request: true,\r\n getRequest: true,\r\n wrapRequest: true,\r\n setCryptoStoreFactory: true,\r\n createClient: true,\r\n ContentHelpers: true,\r\n createNewMatrixCall: true,\r\n setMatrixCallAudioOutput: true,\r\n setMatrixCallAudioInput: true,\r\n setMatrixCallVideoInput: true\r\n};\r\nexports.request = request;\r\nexports.getRequest = getRequest;\r\nexports.wrapRequest = wrapRequest;\r\nexports.setCryptoStoreFactory = setCryptoStoreFactory;\r\nexports.createClient = createClient;\r\nObject.defineProperty(exports, \"createNewMatrixCall\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.createNewMatrixCall;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioOutput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioOutput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallAudioInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setAudioInput;\r\n }\r\n});\r\nObject.defineProperty(exports, \"setMatrixCallVideoInput\", {\r\n enumerable: true,\r\n get: function () {\r\n return _call.setVideoInput;\r\n }\r\n});\r\nexports.ContentHelpers = void 0;\r\n\r\nvar _memoryCryptoStore = require(\"./crypto/store/memory-crypto-store\");\r\n\r\nObject.keys(_memoryCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memoryCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memoryCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _memory = require(\"./store/memory\");\r\n\r\nObject.keys(_memory).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _memory[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _memory[key];\r\n }\r\n });\r\n});\r\n\r\nvar _scheduler = require(\"./scheduler\");\r\n\r\nObject.keys(_scheduler).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _scheduler[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _scheduler[key];\r\n }\r\n });\r\n});\r\n\r\nvar _client = require(\"./client\");\r\n\r\nObject.keys(_client).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _client[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _client[key];\r\n }\r\n });\r\n});\r\n\r\nvar _httpApi = require(\"./http-api\");\r\n\r\nObject.keys(_httpApi).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _httpApi[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _httpApi[key];\r\n }\r\n });\r\n});\r\n\r\nvar _autodiscovery = require(\"./autodiscovery\");\r\n\r\nObject.keys(_autodiscovery).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _autodiscovery[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _autodiscovery[key];\r\n }\r\n });\r\n});\r\n\r\nvar _syncAccumulator = require(\"./sync-accumulator\");\r\n\r\nObject.keys(_syncAccumulator).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _syncAccumulator[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _syncAccumulator[key];\r\n }\r\n });\r\n});\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\nObject.keys(_errors).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _errors[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _errors[key];\r\n }\r\n });\r\n});\r\n\r\nvar _event = require(\"./models/event\");\r\n\r\nObject.keys(_event).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _event[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _event[key];\r\n }\r\n });\r\n});\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nObject.keys(_room).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _room[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _room[key];\r\n }\r\n });\r\n});\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nObject.keys(_group).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _group[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _group[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nObject.keys(_eventTimeline).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimeline[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimeline[key];\r\n }\r\n });\r\n});\r\n\r\nvar _eventTimelineSet = require(\"./models/event-timeline-set\");\r\n\r\nObject.keys(_eventTimelineSet).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _eventTimelineSet[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _eventTimelineSet[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomMember = require(\"./models/room-member\");\r\n\r\nObject.keys(_roomMember).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomMember[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomMember[key];\r\n }\r\n });\r\n});\r\n\r\nvar _roomState = require(\"./models/room-state\");\r\n\r\nObject.keys(_roomState).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _roomState[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _roomState[key];\r\n }\r\n });\r\n});\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nObject.keys(_user).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _user[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _user[key];\r\n }\r\n });\r\n});\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nObject.keys(_filter).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _filter[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _filter[key];\r\n }\r\n });\r\n});\r\n\r\nvar _timelineWindow = require(\"./timeline-window\");\r\n\r\nObject.keys(_timelineWindow).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _timelineWindow[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _timelineWindow[key];\r\n }\r\n });\r\n});\r\n\r\nvar _interactiveAuth = require(\"./interactive-auth\");\r\n\r\nObject.keys(_interactiveAuth).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _interactiveAuth[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _interactiveAuth[key];\r\n }\r\n });\r\n});\r\n\r\nvar _serviceTypes = require(\"./service-types\");\r\n\r\nObject.keys(_serviceTypes).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _serviceTypes[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _serviceTypes[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddb = require(\"./store/indexeddb\");\r\n\r\nObject.keys(_indexeddb).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddb[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddb[key];\r\n }\r\n });\r\n});\r\n\r\nvar _webstorage = require(\"./store/session/webstorage\");\r\n\r\nObject.keys(_webstorage).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _webstorage[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _webstorage[key];\r\n }\r\n });\r\n});\r\n\r\nvar _indexeddbCryptoStore = require(\"./crypto/store/indexeddb-crypto-store\");\r\n\r\nObject.keys(_indexeddbCryptoStore).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _indexeddbCryptoStore[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _indexeddbCryptoStore[key];\r\n }\r\n });\r\n});\r\n\r\nvar _contentRepo = require(\"./content-repo\");\r\n\r\nObject.keys(_contentRepo).forEach(function (key) {\r\n if (key === \"default\" || key === \"__esModule\") return;\r\n if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\r\n if (key in exports && exports[key] === _contentRepo[key]) return;\r\n Object.defineProperty(exports, key, {\r\n enumerable: true,\r\n get: function () {\r\n return _contentRepo[key];\r\n }\r\n });\r\n});\r\n\r\nvar _ContentHelpers = _interopRequireWildcard(require(\"./content-helpers\"));\r\n\r\nexports.ContentHelpers = _ContentHelpers;\r\n\r\nvar _call = require(\"./webrtc/call\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2019, 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n// expose the underlying request object so different environments can use\r\n// different request libs (e.g. request or browser-request)\r\nlet requestInstance;\r\n/**\r\n * The function used to perform HTTP requests. Only use this if you want to\r\n * use a different HTTP library, e.g. Angular's $http. This should\r\n * be set prior to calling {@link createClient}.\r\n * @param {requestFunction} r The request function to use.\r\n */\r\n\r\nfunction request(r) {\r\n requestInstance = r;\r\n}\r\n/**\r\n * Return the currently-set request function.\r\n * @return {requestFunction} The current request function.\r\n */\r\n\r\n\r\nfunction getRequest() {\r\n return requestInstance;\r\n}\r\n/**\r\n * Apply wrapping code around the request function. The wrapper function is\r\n * installed as the new request handler, and when invoked it is passed the\r\n * previous value, along with the options and callback arguments.\r\n * @param {requestWrapperFunction} wrapper The wrapping function.\r\n */\r\n\r\n\r\nfunction wrapRequest(wrapper) {\r\n const origRequest = requestInstance;\r\n\r\n requestInstance = function (options, callback) {\r\n return wrapper(origRequest, options, callback);\r\n };\r\n}\r\n\r\nlet cryptoStoreFactory = () => new _memoryCryptoStore.MemoryCryptoStore();\r\n/**\r\n * Configure a different factory to be used for creating crypto stores\r\n *\r\n * @param {Function} fac a function which will return a new\r\n * {@link module:crypto.store.base~CryptoStore}.\r\n */\r\n\r\n\r\nfunction setCryptoStoreFactory(fac) {\r\n cryptoStoreFactory = fac;\r\n}\r\n\r\n/**\r\n * Construct a Matrix Client. Similar to {@link module:client.MatrixClient}\r\n * except that the 'request', 'store' and 'scheduler' dependencies are satisfied.\r\n * @param {(Object|string)} opts The configuration options for this client. If\r\n * this is a string, it is assumed to be the base URL. These configuration\r\n * options will be passed directly to {@link module:client.MatrixClient}.\r\n * @param {Object} opts.store If not set, defaults to\r\n * {@link module:store/memory.MemoryStore}.\r\n * @param {Object} opts.scheduler If not set, defaults to\r\n * {@link module:scheduler~MatrixScheduler}.\r\n * @param {requestFunction} opts.request If not set, defaults to the function\r\n * supplied to {@link request} which defaults to the request module from NPM.\r\n *\r\n * @param {module:crypto.store.base~CryptoStore=} opts.cryptoStore\r\n * crypto store implementation. Calls the factory supplied to\r\n * {@link setCryptoStoreFactory} if unspecified; or if no factory has been\r\n * specified, uses a default implementation (indexeddb in the browser,\r\n * in-memory otherwise).\r\n *\r\n * @return {MatrixClient} A new matrix client.\r\n * @see {@link module:client.MatrixClient} for the full list of options for\r\n * opts.\r\n */\r\nfunction createClient(opts) {\r\n if (typeof opts === \"string\") {\r\n opts = {\r\n \"baseUrl\": opts\r\n };\r\n }\r\n\r\n opts.request = opts.request || requestInstance;\r\n opts.store = opts.store || new _memory.MemoryStore({\r\n localStorage: global.localStorage\r\n });\r\n opts.scheduler = opts.scheduler || new _scheduler.MatrixScheduler();\r\n opts.cryptoStore = opts.cryptoStore || cryptoStoreFactory();\r\n return new _client.MatrixClient(opts);\r\n}\r\n/**\r\n * The request function interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will attempt to call this function in order to\r\n * perform an HTTP request.\r\n * @callback requestFunction\r\n * @param {Object} opts The options for this HTTP request.\r\n * @param {string} opts.uri The complete URI.\r\n * @param {string} opts.method The HTTP method.\r\n * @param {Object} opts.qs The query parameters to append to the URI.\r\n * @param {Object} opts.body The JSON-serializable object.\r\n * @param {boolean} opts.json True if this is a JSON request.\r\n * @param {Object} opts._matrix_opts The underlying options set for\r\n * {@link MatrixHttpApi}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * A wrapper for the request function interface.\r\n * @callback requestWrapperFunction\r\n * @param {requestFunction} origRequest The underlying request function being\r\n * wrapped\r\n * @param {Object} opts The options for this HTTP request, given in the same\r\n * form as {@link requestFunction}.\r\n * @param {requestCallback} callback The request callback.\r\n */\r\n\r\n/**\r\n * The request callback interface for performing HTTP requests. This matches the\r\n * API for the {@link https://github.com/request/request#requestoptions-callback|\r\n * request NPM module}. The SDK will implement a callback which meets this\r\n * interface in order to handle the HTTP response.\r\n * @callback requestCallback\r\n * @param {Error} err The error if one occurred, else falsey.\r\n * @param {Object} response The HTTP response which consists of\r\n * {statusCode: {Number}, headers: {Object}}\r\n * @param {Object} body The parsed HTTP response body.\r\n */","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.encodeParams = encodeParams;\r\nexports.encodeUri = encodeUri;\r\nexports.map = map;\r\nexports.filter = filter;\r\nexports.keys = keys;\r\nexports.values = values;\r\nexports.forEach = forEach;\r\nexports.findElement = findElement;\r\nexports.removeElement = removeElement;\r\nexports.isFunction = isFunction;\r\nexports.isArray = isArray;\r\nexports.checkObjectHasKeys = checkObjectHasKeys;\r\nexports.checkObjectHasNoAdditionalKeys = checkObjectHasNoAdditionalKeys;\r\nexports.deepCopy = deepCopy;\r\nexports.deepCompare = deepCompare;\r\nexports.extend = extend;\r\nexports.runPolyfills = runPolyfills;\r\nexports.inherits = inherits;\r\nexports.polyfillSuper = polyfillSuper;\r\nexports.isNumber = isNumber;\r\nexports.removeHiddenChars = removeHiddenChars;\r\nexports.escapeRegExp = escapeRegExp;\r\nexports.globToRegexp = globToRegexp;\r\nexports.ensureNoTrailingSlash = ensureNoTrailingSlash;\r\nexports.sleep = sleep;\r\nexports.isNullOrUndefined = isNullOrUndefined;\r\nexports.defer = defer;\r\nexports.promiseMapSeries = promiseMapSeries;\r\nexports.promiseTry = promiseTry;\r\nexports.chunkPromises = chunkPromises;\r\nexports.setCrypto = setCrypto;\r\nexports.getCrypto = getCrypto;\r\n\r\nvar _unhomoglyph = _interopRequireDefault(require(\"unhomoglyph\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module.\r\n * @module utils\r\n */\r\n\r\n/**\r\n * Encode a dictionary of query parameters.\r\n * @param {Object} params A dict of key/values to encode e.g.\r\n * {\"foo\": \"bar\", \"baz\": \"taz\"}\r\n * @return {string} The encoded string e.g. foo=bar&baz=taz\r\n */\r\nfunction encodeParams(params) {\r\n let qs = \"\";\r\n\r\n for (const key in params) {\r\n if (!params.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n qs += \"&\" + encodeURIComponent(key) + \"=\" + encodeURIComponent(params[key]);\r\n }\r\n\r\n return qs.substring(1);\r\n}\r\n/**\r\n * Encodes a URI according to a set of template variables. Variables will be\r\n * passed through encodeURIComponent.\r\n * @param {string} pathTemplate The path with template variables e.g. '/foo/$bar'.\r\n * @param {Object} variables The key/value pairs to replace the template\r\n * variables with. E.g. { \"$bar\": \"baz\" }.\r\n * @return {string} The result of replacing all template variables e.g. '/foo/baz'.\r\n */\r\n\r\n\r\nfunction encodeUri(pathTemplate, variables) {\r\n for (const key in variables) {\r\n if (!variables.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n pathTemplate = pathTemplate.replace(key, encodeURIComponent(variables[key]));\r\n }\r\n\r\n return pathTemplate;\r\n}\r\n/**\r\n * Applies a map function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array with the signature fn(element){...}\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction map(array, fn) {\r\n const results = new Array(array.length);\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n results[i] = fn(array[i]);\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Applies a filter function to the given array.\r\n * @param {Array} array The array to apply the function to.\r\n * @param {Function} fn The function that will be invoked for each element in\r\n * the array. It should return true to keep the element. The function signature\r\n * looks like fn(element, index, array){...}.\r\n * @return {Array} A new array with the results of the function.\r\n */\r\n\r\n\r\nfunction filter(array, fn) {\r\n const results = [];\r\n\r\n for (let i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n results.push(array[i]);\r\n }\r\n }\r\n\r\n return results;\r\n}\r\n/**\r\n * Get the keys for an object. Same as Object.keys().\r\n * @param {Object} obj The object to get the keys for.\r\n * @return {string[]} The keys of the object.\r\n */\r\n\r\n\r\nfunction keys(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(key);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Get the values for an object.\r\n * @param {Object} obj The object to get the values for.\r\n * @return {Array<*>} The values of the object.\r\n */\r\n\r\n\r\nfunction values(obj) {\r\n const result = [];\r\n\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n result.push(obj[key]);\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Invoke a function for each item in the array.\r\n * @param {Array} array The array.\r\n * @param {Function} fn The function to invoke for each element. Has the\r\n * function signature fn(element, index).\r\n */\r\n\r\n\r\nfunction forEach(array, fn) {\r\n for (let i = 0; i < array.length; i++) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * The findElement() method returns a value in the array, if an element in the array\r\n * satisfies (returns true) the provided testing function. Otherwise undefined\r\n * is returned.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array)\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {*} The first value in the array which returns true for\r\n * the given function.\r\n */\r\n\r\n\r\nfunction findElement(array, fn, reverse) {\r\n let i;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n return array[i];\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * The removeElement() method removes the first element in the array that\r\n * satisfies (returns true) the provided testing function.\r\n * @param {Array} array The array.\r\n * @param {Function} fn Function to execute on each value in the array, with the\r\n * function signature fn(element, index, array). Return true to\r\n * remove this element and break.\r\n * @param {boolean} reverse True to search in reverse order.\r\n * @return {boolean} True if an element was removed.\r\n */\r\n\r\n\r\nfunction removeElement(array, fn, reverse) {\r\n let i;\r\n let removed;\r\n\r\n if (reverse) {\r\n for (i = array.length - 1; i >= 0; i--) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < array.length; i++) {\r\n if (fn(array[i], i, array)) {\r\n removed = array[i];\r\n array.splice(i, 1);\r\n return removed;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n/**\r\n * Checks if the given thing is a function.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is a function.\r\n */\r\n\r\n\r\nfunction isFunction(value) {\r\n return Object.prototype.toString.call(value) === \"[object Function]\";\r\n}\r\n/**\r\n * Checks if the given thing is an array.\r\n * @param {*} value The thing to check.\r\n * @return {boolean} True if it is an array.\r\n */\r\n\r\n\r\nfunction isArray(value) {\r\n return Array.isArray ? Array.isArray(value) : Boolean(value && value.constructor === Array);\r\n}\r\n/**\r\n * Checks that the given object has the specified keys.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} keys The list of keys that 'obj' must have.\r\n * @throws If the object is missing keys.\r\n */\r\n// note using 'keys' here would shadow the 'keys' function defined above\r\n\r\n\r\nfunction checkObjectHasKeys(obj, keys_) {\r\n for (let i = 0; i < keys_.length; i++) {\r\n if (!obj.hasOwnProperty(keys_[i])) {\r\n throw new Error(\"Missing required key: \" + keys_[i]);\r\n }\r\n }\r\n}\r\n/**\r\n * Checks that the given object has no extra keys other than the specified ones.\r\n * @param {Object} obj The object to check.\r\n * @param {string[]} allowedKeys The list of allowed key names.\r\n * @throws If there are extra keys.\r\n */\r\n\r\n\r\nfunction checkObjectHasNoAdditionalKeys(obj, allowedKeys) {\r\n for (const key in obj) {\r\n if (!obj.hasOwnProperty(key)) {\r\n continue;\r\n }\r\n\r\n if (allowedKeys.indexOf(key) === -1) {\r\n throw new Error(\"Unknown key: \" + key);\r\n }\r\n }\r\n}\r\n/**\r\n * Deep copy the given object. The object MUST NOT have circular references and\r\n * MUST NOT have functions.\r\n * @param {Object} obj The object to deep copy.\r\n * @return {Object} A copy of the object without any references to the original.\r\n */\r\n\r\n\r\nfunction deepCopy(obj) {\r\n return JSON.parse(JSON.stringify(obj));\r\n}\r\n/**\r\n * Compare two objects for equality. The objects MUST NOT have circular references.\r\n *\r\n * @param {Object} x The first object to compare.\r\n * @param {Object} y The second object to compare.\r\n *\r\n * @return {boolean} true if the two objects are equal\r\n */\r\n\r\n\r\nfunction deepCompare(x, y) {\r\n // Inspired by\r\n // http://stackoverflow.com/questions/1068834/object-comparison-in-javascript#1144249\r\n // Compare primitives and functions.\r\n // Also check if both arguments link to the same object.\r\n if (x === y) {\r\n return true;\r\n }\r\n\r\n if (typeof x !== typeof y) {\r\n return false;\r\n } // special-case NaN (since NaN !== NaN)\r\n\r\n\r\n if (typeof x === 'number' && isNaN(x) && isNaN(y)) {\r\n return true;\r\n } // special-case null (since typeof null == 'object', but null.constructor\r\n // throws)\r\n\r\n\r\n if (x === null || y === null) {\r\n return x === y;\r\n } // everything else is either an unequal primitive, or an object\r\n\r\n\r\n if (!(x instanceof Object)) {\r\n return false;\r\n } // check they are the same type of object\r\n\r\n\r\n if (x.constructor !== y.constructor || x.prototype !== y.prototype) {\r\n return false;\r\n } // special-casing for some special types of object\r\n\r\n\r\n if (x instanceof RegExp || x instanceof Date) {\r\n return x.toString() === y.toString();\r\n } // the object algorithm works for Array, but it's sub-optimal.\r\n\r\n\r\n if (x instanceof Array) {\r\n if (x.length !== y.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < x.length; i++) {\r\n if (!deepCompare(x[i], y[i])) {\r\n return false;\r\n }\r\n }\r\n } else {\r\n // disable jshint \"The body of a for in should be wrapped in an if\r\n // statement\"\r\n\r\n /* jshint -W089 */\r\n // check that all of y's direct keys are in x\r\n let p;\r\n\r\n for (p in y) {\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n } // finally, compare each of x's keys with y\r\n\r\n\r\n for (p in y) {\r\n // eslint-disable-line guard-for-in\r\n if (y.hasOwnProperty(p) !== x.hasOwnProperty(p)) {\r\n return false;\r\n }\r\n\r\n if (!deepCompare(x[p], y[p])) {\r\n return false;\r\n }\r\n }\r\n }\r\n /* jshint +W089 */\r\n\r\n\r\n return true;\r\n}\r\n/**\r\n * Copy properties from one object to another.\r\n *\r\n * All enumerable properties, included inherited ones, are copied.\r\n *\r\n * This is approximately equivalent to ES6's Object.assign, except\r\n * that the latter doesn't copy inherited properties.\r\n *\r\n * @param {Object} target The object that will receive new properties\r\n * @param {...Object} source Objects from which to copy properties\r\n *\r\n * @return {Object} target\r\n */\r\n\r\n\r\nfunction extend(...restParams) {\r\n const target = restParams[0] || {};\r\n\r\n for (let i = 1; i < restParams.length; i++) {\r\n const source = restParams[i];\r\n if (!source) continue;\r\n\r\n for (const propName in source) {\r\n // eslint-disable-line guard-for-in\r\n target[propName] = source[propName];\r\n }\r\n }\r\n\r\n return target;\r\n}\r\n/**\r\n * Run polyfills to add Array.map and Array.filter if they are missing.\r\n */\r\n\r\n\r\nfunction runPolyfills() {\r\n // Array.prototype.filter\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\r\n if (!Array.prototype.filter) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.filter = function (fun,\r\n /*, thisArg*/\r\n ...restProps) {\r\n if (this === void 0 || this === null) {\r\n throw new TypeError();\r\n }\r\n\r\n const t = Object(this);\r\n const len = t.length >>> 0;\r\n\r\n if (typeof fun !== 'function') {\r\n throw new TypeError();\r\n }\r\n\r\n const res = [];\r\n const thisArg = restProps ? restProps[0] : void 0;\r\n\r\n for (let i = 0; i < len; i++) {\r\n if (i in t) {\r\n const val = t[i]; // NOTE: Technically this should Object.defineProperty at\r\n // the next index, as push can be affected by\r\n // properties on Object.prototype and Array.prototype.\r\n // But that method's new, and collisions should be\r\n // rare, so use the more-compatible alternative.\r\n\r\n if (fun.call(thisArg, val, i, t)) {\r\n res.push(val);\r\n }\r\n }\r\n }\r\n\r\n return res;\r\n };\r\n } // Array.prototype.map\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.19\r\n // Reference: http://es5.github.io/#x15.4.4.19\r\n\r\n\r\n if (!Array.prototype.map) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.map = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this|\r\n // value as the argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal\r\n // method of O with the argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== 'function') {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let A be a new array created as if by the expression new Array(len)\r\n // where Array is the standard built-in constructor with that name and\r\n // len is the value of len.\r\n\r\n\r\n const A = new Array(len); // 7. Let k be 0\r\n\r\n k = 0; // 8. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue;\r\n let mappedValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal\r\n // method of O with argument Pk.\r\n kValue = O[k]; // ii. Let mappedValue be the result of calling the Call internal\r\n // method of callback with T as the this value and argument\r\n // list containing kValue, k, and O.\r\n\r\n mappedValue = callback.call(T, kValue, k, O); // iii. Call the DefineOwnProperty internal method of A with arguments\r\n // Pk, Property Descriptor\r\n // { Value: mappedValue,\r\n // Writable: true,\r\n // Enumerable: true,\r\n // Configurable: true },\r\n // and false.\r\n // In browsers that support Object.defineProperty, use the following:\r\n // Object.defineProperty(A, k, {\r\n // value: mappedValue,\r\n // writable: true,\r\n // enumerable: true,\r\n // configurable: true\r\n // });\r\n // For best browser support, use the following:\r\n\r\n A[k] = mappedValue;\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 9. return A\r\n\r\n\r\n return A;\r\n };\r\n } // Array.prototype.forEach\r\n // ========================================================\r\n // SOURCE:\r\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r\n // Production steps of ECMA-262, Edition 5, 15.4.4.18\r\n // Reference: http://es5.github.io/#x15.4.4.18\r\n\r\n\r\n if (!Array.prototype.forEach) {\r\n // eslint-disable-next-line no-extend-native\r\n Array.prototype.forEach = function (callback, thisArg) {\r\n let T;\r\n let k;\r\n\r\n if (this === null || this === undefined) {\r\n throw new TypeError(' this is null or not defined');\r\n } // 1. Let O be the result of calling ToObject passing the |this| value as the\r\n // argument.\r\n\r\n\r\n const O = Object(this); // 2. Let lenValue be the result of calling the Get internal method of O with the\r\n // argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n\r\n const len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n\r\n if (typeof callback !== \"function\") {\r\n throw new TypeError(callback + ' is not a function');\r\n } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n\r\n\r\n if (arguments.length > 1) {\r\n T = thisArg;\r\n } // 6. Let k be 0\r\n\r\n\r\n k = 0; // 7. Repeat, while k < len\r\n\r\n while (k < len) {\r\n let kValue; // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal\r\n // method of O with\r\n // argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal method of O with\r\n // argument Pk\r\n kValue = O[k]; // ii. Call the Call internal method of callback with T as the this value and\r\n // argument list containing kValue, k, and O.\r\n\r\n callback.call(T, kValue, k, O);\r\n } // d. Increase k by 1.\r\n\r\n\r\n k++;\r\n } // 8. return undefined\r\n\r\n };\r\n }\r\n}\r\n/**\r\n * Inherit the prototype methods from one constructor into another. This is a\r\n * port of the Node.js implementation with an Object.create polyfill.\r\n *\r\n * @param {function} ctor Constructor function which needs to inherit the\r\n * prototype.\r\n * @param {function} superCtor Constructor function to inherit prototype from.\r\n */\r\n\r\n\r\nfunction inherits(ctor, superCtor) {\r\n // Add util.inherits from Node.js\r\n // Source:\r\n // https://github.com/joyent/node/blob/master/lib/util.js\r\n // Copyright Joyent, Inc. and other Node contributors.\r\n //\r\n // Permission is hereby granted, free of charge, to any person obtaining a\r\n // copy of this software and associated documentation files (the\r\n // \"Software\"), to deal in the Software without restriction, including\r\n // without limitation the rights to use, copy, modify, merge, publish,\r\n // distribute, sublicense, and/or sell copies of the Software, and to permit\r\n // persons to whom the Software is furnished to do so, subject to the\r\n // following conditions:\r\n //\r\n // The above copyright notice and this permission notice shall be included\r\n // in all copies or substantial portions of the Software.\r\n //\r\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n ctor.super_ = superCtor;\r\n ctor.prototype = Object.create(superCtor.prototype, {\r\n constructor: {\r\n value: ctor,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true\r\n }\r\n });\r\n}\r\n/**\r\n * Polyfills inheritance for prototypes by allowing different kinds of\r\n * super types. Typically prototypes would use `SuperType.call(this, params)`\r\n * though this doesn't always work in some environments - this function\r\n * falls back to using `Object.assign()` to clone a constructed copy\r\n * of the super type onto `thisArg`.\r\n * @param {any} thisArg The child instance. Modified in place.\r\n * @param {any} SuperType The type to act as a super instance\r\n * @param {any} params Arguments to supply to the super type's constructor\r\n */\r\n\r\n\r\nfunction polyfillSuper(thisArg, SuperType, ...params) {\r\n try {\r\n SuperType.call(thisArg, ...params);\r\n } catch (e) {\r\n // fall back to Object.assign to just clone the thing\r\n const fakeSuper = new SuperType(...params);\r\n Object.assign(thisArg, fakeSuper);\r\n }\r\n}\r\n/**\r\n * Returns whether the given value is a finite number without type-coercion\r\n *\r\n * @param {*} value the value to test\r\n * @return {boolean} whether or not value is a finite number without type-coercion\r\n */\r\n\r\n\r\nfunction isNumber(value) {\r\n return typeof value === 'number' && isFinite(value);\r\n}\r\n/**\r\n * Removes zero width chars, diacritics and whitespace from the string\r\n * Also applies an unhomoglyph on the string, to prevent similar looking chars\r\n * @param {string} str the string to remove hidden characters from\r\n * @return {string} a string with the hidden characters removed\r\n */\r\n\r\n\r\nfunction removeHiddenChars(str) {\r\n if (typeof str === \"string\") {\r\n return (0, _unhomoglyph.default)(str.normalize('NFD').replace(removeHiddenCharsRegex, ''));\r\n }\r\n\r\n return \"\";\r\n} // Regex matching bunch of unicode control characters and otherwise misleading/invisible characters.\r\n// Includes:\r\n// various width spaces U+2000 - U+200D\r\n// LTR and RTL marks U+200E and U+200F\r\n// LTR/RTL and other directional formatting marks U+202A - U+202F\r\n// Combining characters U+0300 - U+036F\r\n// Zero width no-break space (BOM) U+FEFF\r\n// eslint-disable-next-line no-misleading-character-class\r\n\r\n\r\nconst removeHiddenCharsRegex = /[\\u2000-\\u200F\\u202A-\\u202F\\u0300-\\u036f\\uFEFF\\s]/g;\r\n\r\nfunction escapeRegExp(string) {\r\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n}\r\n\r\nfunction globToRegexp(glob, extended) {\r\n extended = typeof extended === 'boolean' ? extended : true; // From\r\n // https://github.com/matrix-org/synapse/blob/abbee6b29be80a77e05730707602f3bbfc3f38cb/synapse/push/__init__.py#L132\r\n // Because micromatch is about 130KB with dependencies,\r\n // and minimatch is not much better.\r\n\r\n let pat = escapeRegExp(glob);\r\n pat = pat.replace(/\\\\\\*/g, '.*');\r\n pat = pat.replace(/\\?/g, '.');\r\n\r\n if (extended) {\r\n pat = pat.replace(/\\\\\\[(!|)(.*)\\\\]/g, function (match, p1, p2, offset, string) {\r\n const first = p1 && '^' || '';\r\n const second = p2.replace(/\\\\-/, '-');\r\n return '[' + first + second + ']';\r\n });\r\n }\r\n\r\n return pat;\r\n}\r\n\r\nfunction ensureNoTrailingSlash(url) {\r\n if (url && url.endsWith(\"/\")) {\r\n return url.substr(0, url.length - 1);\r\n } else {\r\n return url;\r\n }\r\n} // Returns a promise which resolves with a given value after the given number of ms\r\n\r\n\r\nfunction sleep(ms, value) {\r\n return new Promise(resolve => {\r\n setTimeout(resolve, ms, value);\r\n });\r\n}\r\n\r\nfunction isNullOrUndefined(val) {\r\n return val === null || val === undefined;\r\n} // Returns a Deferred\r\n\r\n\r\nfunction defer() {\r\n let resolve;\r\n let reject;\r\n const promise = new Promise((_resolve, _reject) => {\r\n resolve = _resolve;\r\n reject = _reject;\r\n });\r\n return {\r\n resolve,\r\n reject,\r\n promise\r\n };\r\n}\r\n\r\nasync function promiseMapSeries(promises, fn) {\r\n for (const o of await promises) {\r\n await fn(await o);\r\n }\r\n}\r\n\r\nfunction promiseTry(fn) {\r\n return new Promise(resolve => resolve(fn()));\r\n} // Creates and awaits all promises, running no more than `chunkSize` at the same time\r\n\r\n\r\nasync function chunkPromises(fns, chunkSize) {\r\n const results = [];\r\n\r\n for (let i = 0; i < fns.length; i += chunkSize) {\r\n results.push(...(await Promise.all(fns.slice(i, i + chunkSize).map(fn => fn()))));\r\n }\r\n\r\n return results;\r\n} // We need to be able to access the Node.js crypto library from within the\r\n// Matrix SDK without needing to `require(\"crypto\")`, which will fail in\r\n// browsers. So `index.ts` will call `setCrypto` to store it, and when we need\r\n// it, we can call `getCrypto`.\r\n\r\n\r\nlet crypto;\r\n\r\nfunction setCrypto(c) {\r\n crypto = c;\r\n}\r\n\r\nfunction getCrypto() {\r\n return crypto;\r\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"body[data-v-0635047f]{--sweetalert-icons-animation-background:transparent}.sa[data-v-0635047f]{width:140px;height:140px;padding:26px;margin:auto}.sa-loading[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);left:-4px;top:-4px;z-index:2;border-top:4px solid var(--icon-color);-webkit-animation:animateLoadingSpin-data-v-0635047f .75s infinite;animation:animateLoadingSpin-data-v-0635047f .75s infinite}.sa-error[data-v-0635047f],.sa-loading[data-v-0635047f]{box-sizing:content-box;height:80px;position:relative;width:80px}.sa-error[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);padding:0;-webkit-animation:animateErrorIcon-data-v-0635047f .5s;animation:animateErrorIcon-data-v-0635047f .5s}.sa-error[data-v-0635047f]:after,.sa-error[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-error[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-error[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-error-x[data-v-0635047f]{display:block;position:relative;z-index:2}.sa-error-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-error-fix[data-v-0635047f]{height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-error-left[data-v-0635047f],.sa-error-right[data-v-0635047f]{border-radius:2px;display:block;height:5px;position:absolute;z-index:2;background-color:var(--icon-color);top:37px;width:47px}.sa-error-left[data-v-0635047f]{left:17px;transform:rotate(45deg);-webkit-animation:animateXLeft-data-v-0635047f .75s;animation:animateXLeft-data-v-0635047f .75s}.sa-error-right[data-v-0635047f]{right:16px;transform:rotate(-45deg);-webkit-animation:animateXRight-data-v-0635047f .75s;animation:animateXRight-data-v-0635047f .75s}.sa-warning[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleWarning-data-v-0635047f .75s infinite alternate;animation:scaleWarning-data-v-0635047f .75s infinite alternate}.sa-warning[data-v-0635047f]:after,.sa-warning[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-warning[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseWarning-data-v-0635047f 2s linear infinite;animation:pulseWarning-data-v-0635047f 2s linear infinite}.sa-warning[data-v-0635047f]:after{display:block;z-index:1}.sa-warning-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-warning-body[data-v-0635047f],.sa-warning-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseWarningIns-data-v-0635047f .75s infinite alternate;animation:pulseWarningIns-data-v-0635047f .75s infinite alternate}.sa-warning-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-info[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px;-webkit-animation:scaleInfo-data-v-0635047f .75s infinite alternate;animation:scaleInfo-data-v-0635047f .75s infinite alternate}.sa-info[data-v-0635047f]:after,.sa-info[data-v-0635047f]:before{content:\\\"\\\";border-radius:50%;height:100%;position:absolute;width:100%}.sa-info[data-v-0635047f]:before{display:inline-block;opacity:0;-webkit-animation:pulseInfo-data-v-0635047f 2s linear infinite;animation:pulseInfo-data-v-0635047f 2s linear infinite}.sa-info[data-v-0635047f]:after{display:block;z-index:1}.sa-info-body[data-v-0635047f]{border-radius:2px;height:47px;margin-left:-2px;top:10px;width:5px}.sa-info-body[data-v-0635047f],.sa-info-dot[data-v-0635047f]{background-color:var(--icon-color);left:50%;position:absolute;z-index:2;-webkit-animation:pulseInfoIns-data-v-0635047f .75s infinite alternate;animation:pulseInfoIns-data-v-0635047f .75s infinite alternate}.sa-info-dot[data-v-0635047f]{border-radius:50%;bottom:10px;height:7px;margin-left:-3px;width:7px}.sa-success[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color);box-sizing:content-box;height:80px;padding:0;position:relative;width:80px}.sa-success[data-v-0635047f],.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{background-color:var(--sweetalert-icons-animation-background)}.sa-success[data-v-0635047f]:after,.sa-success[data-v-0635047f]:before{content:\\\"\\\";height:120px;position:absolute;transform:rotate(45deg);width:60px}.sa-success[data-v-0635047f]:before{border-radius:40px 0 0 40px;width:26px;height:80px;top:-17px;left:5px;transform-origin:60px 60px;transform:rotate(-45deg)}.sa-success[data-v-0635047f]:after{border-radius:0 120px 120px 0;left:30px;top:-11px;transform-origin:0 60px;transform:rotate(-45deg);-webkit-animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in;animation:rotatePlaceholder-data-v-0635047f 4.25s ease-in}.sa-success-placeholder[data-v-0635047f]{border-radius:50%;border:4px solid var(--icon-color-alpha);box-sizing:content-box;height:80px;left:-4px;position:absolute;top:-4px;width:80px;z-index:2}.sa-success-fix[data-v-0635047f]{background-color:var(--sweetalert-icons-animation-background);height:90px;left:28px;position:absolute;top:8px;transform:rotate(-45deg);width:5px;z-index:1}.sa-success-long[data-v-0635047f],.sa-success-tip[data-v-0635047f]{background-color:var(--icon-color);border-radius:2px;height:5px;position:absolute;z-index:2}.sa-success-tip[data-v-0635047f]{left:14px;top:46px;transform:rotate(45deg);width:25px;-webkit-animation:animateSuccessTip-data-v-0635047f .75s;animation:animateSuccessTip-data-v-0635047f .75s}.sa-success-long[data-v-0635047f]{right:8px;top:38px;transform:rotate(-45deg);width:47px;-webkit-animation:animateSuccessLong-data-v-0635047f .75s;animation:animateSuccessLong-data-v-0635047f .75s}@-webkit-keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@keyframes animateSuccessTip-data-v-0635047f{0%,54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}to{width:25px;left:14px;top:45px}}@-webkit-keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@keyframes animateSuccessLong-data-v-0635047f{0%,65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}to{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@keyframes rotatePlaceholder-data-v-0635047f{0%,5%{transform:rotate(-45deg)}12%,to{transform:rotate(-405deg)}}@-webkit-keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleWarning-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseWarning-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@keyframes pulseWarningIns-data-v-0635047f{0%{filter:brightness(1.2)}to{filter:brightness(1)}}@-webkit-keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes scaleInfo-data-v-0635047f{0%{transform:scale(1)}30%{transform:scale(1.02)}to{transform:scale(1)}}@-webkit-keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@keyframes pulseInfo-data-v-0635047f{0%{transform:scale(1);opacity:.5}30%{transform:scale(1);opacity:.5}to{background-color:var(--icon-color);transform:scale(2);opacity:0}}@-webkit-keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@keyframes pulseInfoIns-data-v-0635047f{0%{background-color:var(--icon-color)}to{background-color:var(--icon-color)}}@-webkit-keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@keyframes animateErrorIcon-data-v-0635047f{0%{transform:rotateX(100deg);opacity:0}to{transform:rotateX(0deg);opacity:1}}@-webkit-keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@keyframes animateXLeft-data-v-0635047f{0%,65%{left:82px;top:95px;width:0}84%{left:14px;top:33px;width:47px}to{left:17px;top:37px;width:47px}}@-webkit-keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@keyframes animateXRight-data-v-0635047f{0%,65%{right:82px;top:95px;width:0}84%{right:14px;top:33px;width:47px}to{right:16px;top:37px;width:47px}}@-webkit-keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}@keyframes animateLoadingSpin-data-v-0635047f{0%{transform:rotate(-45deg)}to{transform:rotate(-405deg)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.upgradeDatabase = upgradeDatabase;\r\nexports.Backend = exports.VERSION = void 0;\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2020 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nconst VERSION = 10;\r\nexports.VERSION = VERSION;\r\nconst PROFILE_TRANSACTIONS = false;\r\n/**\r\n * Implementation of a CryptoStore which is backed by an existing\r\n * IndexedDB connection. Generally you want IndexedDBCryptoStore\r\n * which connects to the database and defers to one of these.\r\n *\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\n\r\nclass Backend {\r\n /**\r\n * @param {IDBDatabase} db\r\n */\r\n constructor(db) {\r\n this._db = db;\r\n this._nextTxnId = 0; // make sure we close the db on `onversionchange` - otherwise\r\n // attempts to delete the database will block (and subsequent\r\n // attempts to re-create it will also block).\r\n\r\n db.onversionchange = ev => {\r\n _logger.logger.log(`versionchange for indexeddb ${this._dbName}: closing`);\r\n\r\n db.close();\r\n };\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n txn.onerror = reject; // first see if we already have an entry for this request.\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n resolve(existing);\r\n return;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n txn.oncomplete = () => {\r\n resolve(request);\r\n };\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n store.add(request);\r\n });\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n this._getOutgoingRoomKeyRequest(txn, requestBody, existing => {\r\n resolve(existing);\r\n });\r\n });\r\n }\r\n /**\r\n * look for an existing room key request in the db\r\n *\r\n * @private\r\n * @param {IDBTransaction} txn database transaction\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n * @param {Function} callback function to call with the results of the\r\n * search. Either passed a matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found.\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(txn, requestBody, callback) {\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const idx = store.index(\"session\");\r\n const cursorReq = idx.openCursor([requestBody.room_id, requestBody.session_id]);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n // no match found\r\n callback(null);\r\n return;\r\n }\r\n\r\n const existing = cursor.value;\r\n\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n // got a match\r\n callback(existing);\r\n return;\r\n } // look at the next entry in the index\r\n\r\n\r\n cursor.continue();\r\n };\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states. If there are multiple\r\n * requests in those states, an arbitrary one is chosen.\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n if (wantedStates.length === 0) {\r\n return Promise.resolve(null);\r\n } // this is a bit tortuous because we need to make sure we do the lookup\r\n // in a single transaction, to avoid having a race with the insertion\r\n // code.\r\n // index into the wantedStates array\r\n\r\n\r\n let stateIndex = 0;\r\n let result;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n // got a match\r\n result = cursor.value;\r\n return;\r\n } // try the next state in the list\r\n\r\n\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All elements in a given state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return new Promise((resolve, reject) => {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const index = store.index(\"state\");\r\n const request = index.getAll(wantedState);\r\n\r\n request.onsuccess = ev => resolve(ev.target.result);\r\n\r\n request.onerror = ev => reject(ev.target.error);\r\n });\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n let stateIndex = 0;\r\n const results = [];\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (cursor) {\r\n const keyReq = cursor.value;\r\n\r\n if (keyReq.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(keyReq);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n // try the next state in the list\r\n stateIndex++;\r\n\r\n if (stateIndex >= wantedStates.length) {\r\n // no matches\r\n return;\r\n }\r\n\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = ev.target.source.openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n }\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readonly\");\r\n\r\n const store = txn.objectStore(\"outgoingRoomKeyRequests\");\r\n const wantedState = wantedStates[stateIndex];\r\n const cursorReq = store.index(\"state\").openCursor(wantedState);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n let result = null;\r\n\r\n function onsuccess(ev) {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${data.state}`);\r\n\r\n return;\r\n }\r\n\r\n Object.assign(data, updates);\r\n cursor.update(data);\r\n result = data;\r\n }\r\n\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n cursorReq.onsuccess = onsuccess;\r\n return promiseifyTxn(txn).then(() => result);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n const txn = this._db.transaction(\"outgoingRoomKeyRequests\", \"readwrite\");\r\n\r\n const cursorReq = txn.objectStore(\"outgoingRoomKeyRequests\").openCursor(requestId);\r\n\r\n cursorReq.onsuccess = ev => {\r\n const cursor = ev.target.result;\r\n\r\n if (!cursor) {\r\n return;\r\n }\r\n\r\n const data = cursor.value;\r\n\r\n if (data.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${data.state} ` + `(expected ${expectedState})`);\r\n\r\n return;\r\n }\r\n\r\n cursor.delete();\r\n };\r\n\r\n return promiseifyTxn(txn);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(newData, \"-\");\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(\"crossSigningKeys\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const objectStore = txn.objectStore(\"account\");\r\n const getReq = objectStore.get(`ssss_cache:${type}`);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(keys, \"crossSigningKeys\");\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n const objectStore = txn.objectStore(\"account\");\r\n objectStore.put(key, `ssss_cache:${type}`);\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const countReq = objectStore.count();\r\n\r\n countReq.onsuccess = function () {\r\n try {\r\n func(countReq.result);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const idx = objectStore.index(\"deviceKey\");\r\n const getReq = idx.openCursor(deviceKey);\r\n const results = {};\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n results[cursor.value.sessionId] = {\r\n session: cursor.value.session,\r\n lastReceivedMessageTs: cursor.value.lastReceivedMessageTs\r\n };\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(results);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.get([deviceKey, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n func({\r\n session: getReq.result.session,\r\n lastReceivedMessageTs: getReq.result.lastReceivedMessageTs\r\n });\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n func(cursor.value);\r\n cursor.continue();\r\n } else {\r\n func(null);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n const objectStore = txn.objectStore(\"sessions\");\r\n objectStore.put({\r\n deviceKey,\r\n sessionId,\r\n session: sessionInfo.session,\r\n lastReceivedMessageTs: sessionInfo.lastReceivedMessageTs\r\n });\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n objectStore.put({\r\n deviceKey,\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n return promiseifyTxn(txn);\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n let result;\r\n\r\n const txn = this._db.transaction(\"session_problems\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"session_problems\");\r\n const index = objectStore.index(\"deviceKey\");\r\n const req = index.getAll(deviceKey);\r\n\r\n req.onsuccess = event => {\r\n const problems = req.result;\r\n\r\n if (!problems.length) {\r\n result = null;\r\n return;\r\n }\r\n\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n result = Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n return;\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n result = null;\r\n } else {\r\n result = lastProblem;\r\n }\r\n };\r\n\r\n await promiseifyTxn(txn);\r\n return result;\r\n } // FIXME: we should probably prune this when devices get deleted\r\n\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const txn = this._db.transaction(\"notified_error_devices\", \"readwrite\");\r\n\r\n const objectStore = txn.objectStore(\"notified_error_devices\");\r\n const ret = [];\r\n await Promise.all(devices.map(device => {\r\n return new Promise(resolve => {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n const getReq = objectStore.get([userId, deviceInfo.deviceId]);\r\n\r\n getReq.onsuccess = function () {\r\n if (!getReq.result) {\r\n objectStore.put({\r\n userId,\r\n deviceId: deviceInfo.deviceId\r\n });\r\n ret.push(device);\r\n }\r\n\r\n resolve();\r\n };\r\n });\r\n }));\r\n return ret;\r\n } // Inbound group sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n let session = false;\r\n let withheld = false;\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n if (getReq.result) {\r\n session = getReq.result.session;\r\n } else {\r\n session = null;\r\n }\r\n\r\n if (withheld !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n\r\n const withheldObjectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n const withheldGetReq = withheldObjectStore.get([senderCurve25519Key, sessionId]);\r\n\r\n withheldGetReq.onsuccess = function () {\r\n try {\r\n if (withheldGetReq.result) {\r\n withheld = withheldGetReq.result.session;\r\n } else {\r\n withheld = null;\r\n }\r\n\r\n if (session !== false) {\r\n func(session, withheld);\r\n }\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n try {\r\n func({\r\n senderKey: cursor.value.senderCurve25519Key,\r\n sessionId: cursor.value.sessionId,\r\n sessionData: cursor.value.session\r\n });\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n const addReq = objectStore.add({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n\r\n addReq.onerror = ev => {\r\n if (addReq.error.name === 'ConstraintError') {\r\n // This stops the error from triggering the txn's onerror\r\n ev.stopPropagation(); // ...and this stops it from aborting the transaction\r\n\r\n ev.preventDefault();\r\n\r\n _logger.logger.log(\"Ignoring duplicate inbound group session: \" + senderCurve25519Key + \" / \" + sessionId);\r\n } else {\r\n abortWithException(txn, new Error(\"Failed to add inbound group session: \" + addReq.error));\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const objectStore = txn.objectStore(\"inbound_group_sessions_withheld\");\r\n objectStore.put({\r\n senderCurve25519Key,\r\n sessionId,\r\n session: sessionData\r\n });\r\n }\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n const getReq = objectStore.get(\"-\");\r\n\r\n getReq.onsuccess = function () {\r\n try {\r\n func(getReq.result || null);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n };\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n const objectStore = txn.objectStore(\"device_data\");\r\n objectStore.put(deviceData, \"-\");\r\n }\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n const objectStore = txn.objectStore(\"rooms\");\r\n objectStore.put(roomInfo, roomId);\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n const rooms = {};\r\n const objectStore = txn.objectStore(\"rooms\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n rooms[cursor.key] = cursor.value;\r\n cursor.continue();\r\n } else {\r\n try {\r\n func(rooms);\r\n } catch (e) {\r\n abortWithException(txn, e);\r\n }\r\n }\r\n };\r\n } // session backups\r\n\r\n\r\n getSessionsNeedingBackup(limit) {\r\n return new Promise((resolve, reject) => {\r\n const sessions = [];\r\n\r\n const txn = this._db.transaction([\"sessions_needing_backup\", \"inbound_group_sessions\"], \"readonly\");\r\n\r\n txn.onerror = reject;\r\n\r\n txn.oncomplete = function () {\r\n resolve(sessions);\r\n };\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n const sessionStore = txn.objectStore(\"inbound_group_sessions\");\r\n const getReq = objectStore.openCursor();\r\n\r\n getReq.onsuccess = function () {\r\n const cursor = getReq.result;\r\n\r\n if (cursor) {\r\n const sessionGetReq = sessionStore.get(cursor.key);\r\n\r\n sessionGetReq.onsuccess = function () {\r\n sessions.push({\r\n senderKey: sessionGetReq.result.senderCurve25519Key,\r\n sessionId: sessionGetReq.result.sessionId,\r\n sessionData: sessionGetReq.result.session\r\n });\r\n };\r\n\r\n if (!limit || sessions.length < limit) {\r\n cursor.continue();\r\n }\r\n }\r\n };\r\n });\r\n }\r\n\r\n countSessionsNeedingBackup(txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.count();\r\n req.onerror = reject;\r\n\r\n req.onsuccess = () => resolve(req.result);\r\n });\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.delete([session.senderKey, session.sessionId]);\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n markSessionsNeedingBackup(sessions, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"sessions_needing_backup\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"sessions_needing_backup\");\r\n return Promise.all(sessions.map(session => {\r\n return new Promise((resolve, reject) => {\r\n const req = objectStore.put({\r\n senderCurve25519Key: session.senderKey,\r\n sessionId: session.sessionId\r\n });\r\n req.onsuccess = resolve;\r\n req.onerror = reject;\r\n });\r\n }));\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readwrite\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n sessions.push([senderKey, sessionId]);\r\n objectStore.put({\r\n roomId,\r\n sessions\r\n });\r\n };\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId, txn) {\r\n if (!txn) {\r\n txn = this._db.transaction(\"shared_history_inbound_group_sessions\", \"readonly\");\r\n }\r\n\r\n const objectStore = txn.objectStore(\"shared_history_inbound_group_sessions\");\r\n const req = objectStore.get([roomId]);\r\n return new Promise((resolve, reject) => {\r\n req.onsuccess = () => {\r\n const {\r\n sessions\r\n } = req.result || {\r\n sessions: []\r\n };\r\n resolve(sessions);\r\n };\r\n\r\n req.onerror = reject;\r\n });\r\n }\r\n\r\n doTxn(mode, stores, func, log = _logger.logger) {\r\n let startTime;\r\n let description;\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n const txnId = this._nextTxnId++;\r\n startTime = Date.now();\r\n description = `${mode} crypto store transaction ${txnId} in ${stores}`;\r\n log.debug(`Starting ${description}`);\r\n }\r\n\r\n const txn = this._db.transaction(stores, mode);\r\n\r\n const promise = promiseifyTxn(txn);\r\n const result = func(txn);\r\n\r\n if (PROFILE_TRANSACTIONS) {\r\n promise.then(() => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.debug(`Finished ${description}, took ${elapsedTime} ms`);\r\n }, () => {\r\n const elapsedTime = Date.now() - startTime;\r\n log.error(`Failed ${description}, took ${elapsedTime} ms`);\r\n });\r\n }\r\n\r\n return promise.then(() => {\r\n return result;\r\n });\r\n }\r\n\r\n}\r\n\r\nexports.Backend = Backend;\r\n\r\nfunction upgradeDatabase(db, oldVersion) {\r\n _logger.logger.log(`Upgrading IndexedDBCryptoStore from version ${oldVersion}` + ` to ${VERSION}`);\r\n\r\n if (oldVersion < 1) {\r\n // The database did not previously exist.\r\n createDatabase(db);\r\n }\r\n\r\n if (oldVersion < 2) {\r\n db.createObjectStore(\"account\");\r\n }\r\n\r\n if (oldVersion < 3) {\r\n const sessionsStore = db.createObjectStore(\"sessions\", {\r\n keyPath: [\"deviceKey\", \"sessionId\"]\r\n });\r\n sessionsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n }\r\n\r\n if (oldVersion < 4) {\r\n db.createObjectStore(\"inbound_group_sessions\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 5) {\r\n db.createObjectStore(\"device_data\");\r\n }\r\n\r\n if (oldVersion < 6) {\r\n db.createObjectStore(\"rooms\");\r\n }\r\n\r\n if (oldVersion < 7) {\r\n db.createObjectStore(\"sessions_needing_backup\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 8) {\r\n db.createObjectStore(\"inbound_group_sessions_withheld\", {\r\n keyPath: [\"senderCurve25519Key\", \"sessionId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 9) {\r\n const problemsStore = db.createObjectStore(\"session_problems\", {\r\n keyPath: [\"deviceKey\", \"time\"]\r\n });\r\n problemsStore.createIndex(\"deviceKey\", \"deviceKey\");\r\n db.createObjectStore(\"notified_error_devices\", {\r\n keyPath: [\"userId\", \"deviceId\"]\r\n });\r\n }\r\n\r\n if (oldVersion < 10) {\r\n db.createObjectStore(\"shared_history_inbound_group_sessions\", {\r\n keyPath: [\"roomId\"]\r\n });\r\n } // Expand as needed.\r\n\r\n}\r\n\r\nfunction createDatabase(db) {\r\n const outgoingRoomKeyRequestsStore = db.createObjectStore(\"outgoingRoomKeyRequests\", {\r\n keyPath: \"requestId\"\r\n }); // we assume that the RoomKeyRequestBody will have room_id and session_id\r\n // properties, to make the index efficient.\r\n\r\n outgoingRoomKeyRequestsStore.createIndex(\"session\", [\"requestBody.room_id\", \"requestBody.session_id\"]);\r\n outgoingRoomKeyRequestsStore.createIndex(\"state\", \"state\");\r\n}\r\n/*\r\n * Aborts a transaction with a given exception\r\n * The transaction promise will be rejected with this exception.\r\n */\r\n\r\n\r\nfunction abortWithException(txn, e) {\r\n // We cheekily stick our exception onto the transaction object here\r\n // We could alternatively make the thing we pass back to the app\r\n // an object containing the transaction and exception.\r\n txn._mx_abortexception = e;\r\n\r\n try {\r\n txn.abort();\r\n } catch (e) {// sometimes we won't be able to abort the transaction\r\n // (ie. if it's aborted or completed)\r\n }\r\n}\r\n\r\nfunction promiseifyTxn(txn) {\r\n return new Promise((resolve, reject) => {\r\n txn.oncomplete = () => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n }\r\n\r\n resolve();\r\n };\r\n\r\n txn.onerror = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n\r\n txn.onabort = event => {\r\n if (txn._mx_abortexception !== undefined) {\r\n reject(txn._mx_abortexception);\r\n } else {\r\n _logger.logger.log(\"Error performing indexeddb txn\", event);\r\n\r\n reject(event.target.error);\r\n }\r\n };\r\n });\r\n}","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#linepreloader[data-v-bcf20e38]{display:inline-block;font-size:0;padding:0}#linepreloader span[data-v-bcf20e38]{vertical-align:middle;border-radius:50%;background:rgb(var(--neutral-grad-2));display:inline-block;width:6px;height:6px;margin:3px 2px;-webkit-animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate;animation:linepreloader-data-v-bcf20e38 .8s linear infinite alternate}#linepreloader span[data-v-bcf20e38]:first-child{-webkit-animation-delay:-.8;animation-delay:-.8s}#linepreloader span[data-v-bcf20e38]:nth-child(2){-webkit-animation-delay:-.53333s;animation-delay:-.53333s}#linepreloader span[data-v-bcf20e38]:nth-child(3){-webkit-animation-delay:-.26666s;animation-delay:-.26666s}@keyframes linepreloader-data-v-bcf20e38{0%{transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes linepreloader-data-v-bcf20e38{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1)}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.ReEmitter = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nclass ReEmitter {\r\n constructor(target) {\r\n (0, _defineProperty2.default)(this, \"target\", void 0);\r\n this.target = target;\r\n }\r\n\r\n reEmit(source, eventNames) {\r\n for (const eventName of eventNames) {\r\n // We include the source as the last argument for event handlers which may need it,\r\n // such as read receipt listeners on the client class which won't have the context\r\n // of the room.\r\n const forSource = (...args) => {\r\n // EventEmitter special cases 'error' to make the emit function throw if no\r\n // handler is attached, which sort of makes sense for making sure that something\r\n // handles an error, but for re-emitting, there could be a listener on the original\r\n // source object so the test doesn't really work. We *could* try to replicate the\r\n // same logic and throw if there is no listener on either the source or the target,\r\n // but this behaviour is fairly undesireable for us anyway: the main place we throw\r\n // 'error' events is for calls, where error events are usually emitted some time\r\n // later by a different part of the code where 'emit' throwing because the app hasn't\r\n // added an error handler isn't terribly helpful. (A better fix in retrospect may\r\n // have been to just avoid using the event name 'error', but backwards compat...)\r\n if (eventName === 'error' && this.target.listenerCount('error') === 0) return;\r\n this.target.emit(eventName, ...args, source);\r\n };\r\n\r\n source.on(eventName, forSource);\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.ReEmitter = ReEmitter;","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Exceptions */\n__export(require(\"./exceptions\"));\n/** Symmetric encryption APIs */\nvar aead_1 = require(\"./aead\");\nexports.AEAD = aead_1.AEAD;\nvar siv_1 = require(\"./siv\");\nexports.SIV = siv_1.SIV;\n/** STREAM streaming encryption */\nvar stream_1 = require(\"./stream\");\nexports.StreamEncryptor = stream_1.StreamEncryptor;\nexports.StreamDecryptor = stream_1.StreamDecryptor;\n/** MAC functions */\nvar cmac_1 = require(\"./mac/cmac\");\nexports.CMAC = cmac_1.CMAC;\nvar pmac_1 = require(\"./mac/pmac\");\nexports.PMAC = pmac_1.PMAC;\n/** Crypto providers */\nvar polyfill_1 = require(\"./providers/polyfill\");\nexports.PolyfillCryptoProvider = polyfill_1.PolyfillCryptoProvider;\nvar webcrypto_1 = require(\"./providers/webcrypto\");\nexports.WebCryptoProvider = webcrypto_1.WebCryptoProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Number of trailing zeros in a given byte value */\nconst CTZ_TABLE = new Uint8Array([\n 8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,\n]);\n/** Count the number of trailing zeroes in a given number */\nfunction ctz(value) {\n return CTZ_TABLE[value];\n}\nexports.ctz = ctz;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".footer-chat[data-v-517e1e1f]{bottom:0;left:0;right:0;background:rgb(var(--background-total-theme));border-top:1px solid rgb(var(--background-secondary-theme));position:absolute;height:90px;padding-bottom:30px}.footer-chat.bout[data-v-517e1e1f]{position:fixed;will-change:transform}.footer-chat .work[data-v-517e1e1f]{height:100%;padding:0!important}.footer-chat.bin[data-v-517e1e1f]{border-top:0;position:static}.footer-chat.fix[data-v-517e1e1f]{position:absolute;height:auto}.footer-chat.fix.minimized[data-v-517e1e1f]{background:transparent;padding-bottom:0}.footer-chat.fix.minimized .menuItems[data-v-517e1e1f]{display:block;transition:.3s;padding-top:.5em}.footer-chat.fix.minimized .menuItems a[data-v-517e1e1f]{padding:0}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]{width:44px;height:44px;background:rgba(var(--neutral-grad-3),.4);color:rgba(var(--neutral-grad-3),.8);border-radius:50%;border:1px solid transparent;margin-bottom:.25em;line-height:40px;transition:.3s}.footer-chat.fix.minimized .menuItems .menuItem .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem .label[data-v-517e1e1f]{display:none}.footer-chat.fix.minimized .menuItems .menuItem i[data-v-517e1e1f]{vertical-align:middle;font-size:.8em}.footer-chat.fix.minimized .menuItems .menuItem.active[data-v-517e1e1f]{text-shadow:0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright));background:rgba(var(--color-bg-ac-bright),.9);border:1px solid rgba(var(--color-bg-ac-bright),.9);color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--background-total-theme))}.footer-chat.fix.minimized .menuItems .menuItem[data-v-517e1e1f]:hover:not(.active){background:rgba(var(--color-bg-ac-bright),.95);color:#fff;text-shadow:0 0 10px rgb(var(--color-bg-ac-bright)),0 0 15px rgb(var(--color-bg-ac-bright)),0 0 20px rgb(var(--color-bg-ac-bright)),0 0 25px rgb(var(--color-bg-ac-bright)),0 0 30px #02061a,0 0 35px rgb(var(--color-bg-ac-bright)),0 0 40px #02061a}.footer-chat.fix.minimized.active .menuItems[data-v-517e1e1f]{border-top:0}.menuItems[data-v-517e1e1f]{display:flex;justify-content:space-around;align-items:center;height:100%}.menuItems a[data-v-517e1e1f]{display:block;flex-grow:1;text-align:center;padding:1em;color:#213850}.menuItems .icon[data-v-517e1e1f]{font-size:.9em;color:rgba(var(--color-txt-gray-dark),.7)}.menuItems .label[data-v-517e1e1f]{font-size:.7em;position:absolute;bottom:0;left:0;right:0;line-height:1em;text-align:center;opacity:.7}.menuItems .menuItem[data-v-517e1e1f]{position:relative;text-align:center;cursor:pointer;width:64px;height:44px;line-height:44px}.menuItems .menuItem.active .icon[data-v-517e1e1f]{color:rgb(var(--color-txt-ac))}.menuItems .menuItem .unseen[data-v-517e1e1f]{position:absolute;width:22px;height:22px;right:-10%;bottom:-10%;background:rgba(var(--color-txt-ac),.9);line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em;color:rgb(var(--text-on-bg-ac-color))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.Relations = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2019 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * A container for relation events that supports easy access to common ways of\r\n * aggregating such events. Each instance holds events that of a single relation\r\n * type and event type. All of the events also relate to the same original event.\r\n *\r\n * The typical way to get one of these containers is via\r\n * EventTimelineSet#getRelationsForEvent.\r\n */\r\nclass Relations extends _events.EventEmitter {\r\n /**\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\",\r\n * \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @param {?Room} room\r\n * Room for this container. May be null for non-room cases, such as the\r\n * notification timeline.\r\n */\r\n constructor(relationType, eventType, room) {\r\n super();\r\n (0, _defineProperty2.default)(this, \"_onEventStatus\", (event, status) => {\r\n if (!event.isSending()) {\r\n // Sending is done, so we don't need to listen anymore\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n return;\r\n }\r\n\r\n if (status !== _event.EventStatus.CANCELLED) {\r\n return;\r\n } // Event was cancelled, remove from the collection\r\n\r\n\r\n event.removeListener(\"Event.status\", this._onEventStatus);\r\n\r\n this._removeEvent(event);\r\n });\r\n (0, _defineProperty2.default)(this, \"_onBeforeRedaction\", redactedEvent => {\r\n if (!this._relations.has(redactedEvent)) {\r\n return;\r\n }\r\n\r\n this._relations.delete(redactedEvent);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n // Remove the redacted annotation from aggregation by key\r\n this._removeAnnotationFromAggregation(redactedEvent);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n redactedEvent.removeListener(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.redaction\", redactedEvent);\r\n });\r\n this.relationType = relationType;\r\n this.eventType = eventType;\r\n this._relations = new Set();\r\n this._annotationsByKey = {};\r\n this._annotationsBySender = {};\r\n this._sortedAnnotationsByKey = [];\r\n this._targetEvent = null;\r\n }\r\n /**\r\n * Add relation events to this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be added.\r\n */\r\n\r\n\r\n addEvent(event) {\r\n if (this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n } // If the event is in the process of being sent, listen for cancellation\r\n // so we can remove the event from the collection.\r\n\r\n\r\n if (event.isSending()) {\r\n event.on(\"Event.status\", this._onEventStatus);\r\n }\r\n\r\n this._relations.add(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._addAnnotationToAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n event.on(\"Event.beforeRedaction\", this._onBeforeRedaction);\r\n this.emit(\"Relations.add\", event);\r\n }\r\n /**\r\n * Remove relation event from this collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The relation event to remove.\r\n */\r\n\r\n\r\n _removeEvent(event) {\r\n if (!this._relations.has(event)) {\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n _logger.logger.error(\"Event must have relation info\");\r\n\r\n return;\r\n }\r\n\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType();\r\n\r\n if (this.relationType !== relationType || this.eventType !== eventType) {\r\n _logger.logger.error(\"Event relation info doesn't match this container\");\r\n\r\n return;\r\n }\r\n\r\n this._relations.delete(event);\r\n\r\n if (this.relationType === \"m.annotation\") {\r\n this._removeAnnotationFromAggregation(event);\r\n } else if (this.relationType === \"m.replace\" && this._targetEvent) {\r\n this._targetEvent.makeReplaced(this.getLastReplacement());\r\n }\r\n\r\n this.emit(\"Relations.remove\", event);\r\n }\r\n /**\r\n * Listens for event status changes to remove cancelled events.\r\n *\r\n * @param {MatrixEvent} event The event whose status has changed\r\n * @param {EventStatus} status The new status\r\n */\r\n\r\n\r\n /**\r\n * Get all relation events in this collection.\r\n *\r\n * These are currently in the order of insertion to this collection, which\r\n * won't match timeline order in the case of scrollback.\r\n * TODO: Tweak `addEvent` to insert correctly for scrollback.\r\n *\r\n * @return {Array}\r\n * Relation events in insertion order.\r\n */\r\n getRelations() {\r\n return [...this._relations];\r\n }\r\n\r\n _addAnnotationToAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n let eventsForKey = this._annotationsByKey[key];\r\n\r\n if (!eventsForKey) {\r\n eventsForKey = this._annotationsByKey[key] = new Set();\r\n\r\n this._sortedAnnotationsByKey.push([key, eventsForKey]);\r\n } // Add the new event to the set for this key\r\n\r\n\r\n eventsForKey.add(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n\r\n const sender = event.getSender();\r\n let eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (!eventsFromSender) {\r\n eventsFromSender = this._annotationsBySender[sender] = new Set();\r\n } // Add the new event to the set for this sender\r\n\r\n\r\n eventsFromSender.add(event);\r\n }\r\n\r\n _removeAnnotationFromAggregation(event) {\r\n const {\r\n key\r\n } = event.getRelation();\r\n\r\n if (!key) {\r\n return;\r\n }\r\n\r\n const eventsForKey = this._annotationsByKey[key];\r\n\r\n if (eventsForKey) {\r\n eventsForKey.delete(event); // Re-sort the [key, events] pairs in descending order of event count\r\n\r\n this._sortedAnnotationsByKey.sort((a, b) => {\r\n const aEvents = a[1];\r\n const bEvents = b[1];\r\n return bEvents.size - aEvents.size;\r\n });\r\n }\r\n\r\n const sender = event.getSender();\r\n const eventsFromSender = this._annotationsBySender[sender];\r\n\r\n if (eventsFromSender) {\r\n eventsFromSender.delete(event);\r\n }\r\n }\r\n /**\r\n * For relations that have been redacted, we want to remove them from\r\n * aggregation data sets and emit an update event.\r\n *\r\n * To do so, we listen for `Event.beforeRedaction`, which happens:\r\n * - after the server accepted the redaction and remote echoed back to us\r\n * - before the original event has been marked redacted in the client\r\n *\r\n * @param {MatrixEvent} redactedEvent\r\n * The original relation event that is about to be redacted.\r\n */\r\n\r\n\r\n /**\r\n * Get all events in this collection grouped by key and sorted by descending\r\n * event count in each group.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Array}\r\n * An array of [key, events] pairs sorted by descending event count.\r\n * The events are stored in a Set (which preserves insertion order).\r\n */\r\n getSortedAnnotationsByKey() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._sortedAnnotationsByKey;\r\n }\r\n /**\r\n * Get all events in this collection grouped by sender.\r\n *\r\n * This is currently only supported for the annotation relation type.\r\n *\r\n * @return {Object}\r\n * An object with each relation sender as a key and the matching Set of\r\n * events for that sender as a value.\r\n */\r\n\r\n\r\n getAnnotationsBySender() {\r\n if (this.relationType !== \"m.annotation\") {\r\n // Other relation types are not grouped currently.\r\n return null;\r\n }\r\n\r\n return this._annotationsBySender;\r\n }\r\n /**\r\n * Returns the most recent (and allowed) m.replace relation, if any.\r\n *\r\n * This is currently only supported for the m.replace relation type,\r\n * once the target event is known, see `addEvent`.\r\n *\r\n * @return {MatrixEvent?}\r\n */\r\n\r\n\r\n getLastReplacement() {\r\n if (this.relationType !== \"m.replace\") {\r\n // Aggregating on last only makes sense for this relation type\r\n return null;\r\n }\r\n\r\n if (!this._targetEvent) {\r\n // Don't know which replacements to accept yet.\r\n // This method shouldn't be called before the original\r\n // event is known anyway.\r\n return null;\r\n } // the all-knowning server tells us that the event at some point had\r\n // this timestamp for its replacement, so any following replacement should definitely not be less\r\n\r\n\r\n const replaceRelation = this._targetEvent.getServerAggregatedRelation(\"m.replace\");\r\n\r\n const minTs = replaceRelation && replaceRelation.origin_server_ts;\r\n return this.getRelations().reduce((last, event) => {\r\n if (event.getSender() !== this._targetEvent.getSender()) {\r\n return last;\r\n }\r\n\r\n if (minTs && minTs > event.getTs()) {\r\n return last;\r\n }\r\n\r\n if (last && last.getTs() > event.getTs()) {\r\n return last;\r\n }\r\n\r\n return event;\r\n }, null);\r\n }\r\n /*\r\n * @param {MatrixEvent} targetEvent the event the relations are related to.\r\n */\r\n\r\n\r\n setTargetEvent(event) {\r\n if (this._targetEvent) {\r\n return;\r\n }\r\n\r\n this._targetEvent = event;\r\n\r\n if (this.relationType === \"m.replace\") {\r\n const replacement = this.getLastReplacement(); // this is the initial update, so only call it if we already have something\r\n // to not emit Event.replaced needlessly\r\n\r\n if (replacement) {\r\n this._targetEvent.makeReplaced(replacement);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexports.Relations = Relations;","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\"","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=951b8314&scoped=true&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".nameofchat[data-v-72a9c575]{white-space:nowrap}.nameline[data-v-72a9c575]{display:flex;align-items:flex-end;justify-content:center}.iconGroup[data-v-72a9c575]{font-size:.4em;width:16px;text-align:center;height:16px;line-height:16px;border-radius:8px;background:rgb(var(--neutral-grad-2));margin-right:.5em;margin-block:.25em}.iconGroup i[data-v-72a9c575]{color:rgb(var(--neutral-grad-1))}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VuePageTransition.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./VuePageTransition.vue?vue&type=template&id=108c57b8&scoped=true&\"\nimport script from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nexport * from \"./VuePageTransition.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./VuePageTransition.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./VuePageTransition.vue?vue&type=style&index=1&id=108c57b8&lang=scss&scoped=true&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"108c57b8\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root{--overlay-bg:#1867c0;--transition-duration:.35s}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"\", \"\"]);\n// Exports\nmodule.exports = exports;\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=06594ccd&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * AES-CTR using a WebCrypto (or similar) API\n */\nclass WebCryptoAesCtr {\n constructor(key, crypto) {\n this.key = key;\n this.crypto = crypto;\n }\n static importKey(crypto, keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n // Only AES-128 and AES-256 supported. AES-192 is not.\n if (keyData.length !== 16 && keyData.length !== 32) {\n throw new Error(`Miscreant: invalid key length: ${keyData.length} (expected 16 or 32 bytes)`);\n }\n const key = yield crypto.subtle.importKey(\"raw\", keyData, \"AES-CTR\", false, [\"encrypt\"]);\n return new WebCryptoAesCtr(key, crypto);\n });\n }\n encryptCtr(iv, plaintext) {\n return __awaiter(this, void 0, void 0, function* () {\n const ciphertext = yield this.crypto.subtle.encrypt({ name: \"AES-CTR\", counter: iv, length: 16 }, this.key, plaintext);\n return new Uint8Array(ciphertext);\n });\n }\n clear() {\n // TODO: actually clear something. Do we need to?\n return this;\n }\n}\nexports.default = WebCryptoAesCtr;\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryCryptoStore = void 0;\r\n\r\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\r\n\r\nvar _logger = require(\"../../logger\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../../utils\"));\r\n\r\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\r\n\r\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\r\n\r\n/**\r\n * Internal module. in-memory storage for e2e.\r\n *\r\n * @module\r\n */\r\n\r\n/**\r\n * @implements {module:crypto/store/base~CryptoStore}\r\n */\r\nclass MemoryCryptoStore {\r\n constructor() {\r\n this._outgoingRoomKeyRequests = [];\r\n this._account = null;\r\n this._crossSigningKeys = null;\r\n this._privateKeys = {};\r\n this._backupKeys = {}; // Map of {devicekey -> {sessionId -> session pickle}}\r\n\r\n this._sessions = {}; // Map of {devicekey -> array of problems}\r\n\r\n this._sessionProblems = {}; // Map of {userId -> deviceId -> true}\r\n\r\n this._notifiedErrorDevices = {}; // Map of {senderCurve25519Key+'/'+sessionId -> session data object}\r\n\r\n this._inboundGroupSessions = {};\r\n this._inboundGroupSessionsWithheld = {}; // Opaque device data object\r\n\r\n this._deviceData = null; // roomId -> Opaque roomInfo object\r\n\r\n this._rooms = {}; // Set of {senderCurve25519Key+'/'+sessionId}\r\n\r\n this._sessionsNeedingBackup = {}; // roomId -> array of [senderKey, sessionId]\r\n\r\n this._sharedHistoryInboundGroupSessions = {};\r\n }\r\n /**\r\n * Ensure the database exists and is up-to-date.\r\n *\r\n * This must be called before the store can be used.\r\n *\r\n * @return {Promise} resolves to the store.\r\n */\r\n\r\n\r\n async startup() {\r\n // No startup work to do for the memory store.\r\n return this;\r\n }\r\n /**\r\n * Delete all data from this store.\r\n *\r\n * @returns {Promise} Promise which resolves when the store has been cleared.\r\n */\r\n\r\n\r\n deleteAllData() {\r\n return Promise.resolve();\r\n }\r\n /**\r\n * Look for an existing outgoing room key request, and if none is found,\r\n * add a new one\r\n *\r\n * @param {module:crypto/store/base~OutgoingRoomKeyRequest} request\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}: either the\r\n * same instance as passed in, or the existing one.\r\n */\r\n\r\n\r\n getOrAddOutgoingRoomKeyRequest(request) {\r\n const requestBody = request.requestBody;\r\n return utils.promiseTry(() => {\r\n // first see if we already have an entry for this request.\r\n const existing = this._getOutgoingRoomKeyRequest(requestBody);\r\n\r\n if (existing) {\r\n // this entry matches the request - return it.\r\n _logger.logger.log(`already have key request outstanding for ` + `${requestBody.room_id} / ${requestBody.session_id}: ` + `not sending another`);\r\n\r\n return existing;\r\n } // we got to the end of the list without finding a match\r\n // - add the new request.\r\n\r\n\r\n _logger.logger.log(`enqueueing key request for ${requestBody.room_id} / ` + requestBody.session_id);\r\n\r\n this._outgoingRoomKeyRequests.push(request);\r\n\r\n return request;\r\n });\r\n }\r\n /**\r\n * Look for an existing room key request\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {Promise} resolves to the matching\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * not found\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequest(requestBody) {\r\n return Promise.resolve(this._getOutgoingRoomKeyRequest(requestBody));\r\n }\r\n /**\r\n * Looks for existing room key request, and returns the result synchronously.\r\n *\r\n * @internal\r\n *\r\n * @param {module:crypto~RoomKeyRequestBody} requestBody\r\n * existing request to look for\r\n *\r\n * @return {module:crypto/store/base~OutgoingRoomKeyRequest?}\r\n * the matching request, or null if not found\r\n */\r\n\r\n\r\n _getOutgoingRoomKeyRequest(requestBody) {\r\n for (const existing of this._outgoingRoomKeyRequests) {\r\n if (utils.deepCompare(existing.requestBody, requestBody)) {\r\n return existing;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n /**\r\n * Look for room key requests by state\r\n *\r\n * @param {Array} wantedStates list of acceptable states\r\n *\r\n * @return {Promise} resolves to the a\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}, or null if\r\n * there are no pending requests in those states\r\n */\r\n\r\n\r\n getOutgoingRoomKeyRequestByState(wantedStates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state) {\r\n return Promise.resolve(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n *\r\n * @param {Number} wantedState\r\n * @return {Promise>} All OutgoingRoomKeyRequests in state\r\n */\r\n\r\n\r\n getAllOutgoingRoomKeyRequestsByState(wantedState) {\r\n return Promise.resolve(this._outgoingRoomKeyRequests.filter(r => r.state == wantedState));\r\n }\r\n\r\n getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates) {\r\n const results = [];\r\n\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n for (const state of wantedStates) {\r\n if (req.state === state && req.recipients.includes({\r\n userId,\r\n deviceId\r\n })) {\r\n results.push(req);\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(results);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and update it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n * @param {Object} updates name/value map of updates to apply\r\n *\r\n * @returns {Promise} resolves to\r\n * {@link module:crypto/store/base~OutgoingRoomKeyRequest}\r\n * updated request, or null if no matching row was found\r\n */\r\n\r\n\r\n updateOutgoingRoomKeyRequest(requestId, expectedState, updates) {\r\n for (const req of this._outgoingRoomKeyRequests) {\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot update room key request from ${expectedState} ` + `as it was already updated to ${req.state}`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n Object.assign(req, updates);\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n }\r\n /**\r\n * Look for an existing room key request by id and state, and delete it if\r\n * found\r\n *\r\n * @param {string} requestId ID of request to update\r\n * @param {number} expectedState state we expect to find the request in\r\n *\r\n * @returns {Promise} resolves once the operation is completed\r\n */\r\n\r\n\r\n deleteOutgoingRoomKeyRequest(requestId, expectedState) {\r\n for (let i = 0; i < this._outgoingRoomKeyRequests.length; i++) {\r\n const req = this._outgoingRoomKeyRequests[i];\r\n\r\n if (req.requestId !== requestId) {\r\n continue;\r\n }\r\n\r\n if (req.state != expectedState) {\r\n _logger.logger.warn(`Cannot delete room key request in state ${req.state} ` + `(expected ${expectedState})`);\r\n\r\n return Promise.resolve(null);\r\n }\r\n\r\n this._outgoingRoomKeyRequests.splice(i, 1);\r\n\r\n return Promise.resolve(req);\r\n }\r\n\r\n return Promise.resolve(null);\r\n } // Olm Account\r\n\r\n\r\n getAccount(txn, func) {\r\n func(this._account);\r\n }\r\n\r\n storeAccount(txn, newData) {\r\n this._account = newData;\r\n }\r\n\r\n getCrossSigningKeys(txn, func) {\r\n func(this._crossSigningKeys);\r\n }\r\n\r\n getSecretStorePrivateKey(txn, func, type) {\r\n const result = this._privateKeys[type];\r\n return func(result || null);\r\n }\r\n\r\n storeCrossSigningKeys(txn, keys) {\r\n this._crossSigningKeys = keys;\r\n }\r\n\r\n storeSecretStorePrivateKey(txn, type, key) {\r\n this._privateKeys[type] = key;\r\n } // Olm Sessions\r\n\r\n\r\n countEndToEndSessions(txn, func) {\r\n return Object.keys(this._sessions).length;\r\n }\r\n\r\n getEndToEndSession(deviceKey, sessionId, txn, func) {\r\n const deviceSessions = this._sessions[deviceKey] || {};\r\n func(deviceSessions[sessionId] || null);\r\n }\r\n\r\n getEndToEndSessions(deviceKey, txn, func) {\r\n func(this._sessions[deviceKey] || {});\r\n }\r\n\r\n getAllEndToEndSessions(txn, func) {\r\n Object.entries(this._sessions).forEach(([deviceKey, deviceSessions]) => {\r\n Object.entries(deviceSessions).forEach(([sessionId, session]) => {\r\n func(_objectSpread(_objectSpread({}, session), {}, {\r\n deviceKey,\r\n sessionId\r\n }));\r\n });\r\n });\r\n }\r\n\r\n storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn) {\r\n let deviceSessions = this._sessions[deviceKey];\r\n\r\n if (deviceSessions === undefined) {\r\n deviceSessions = {};\r\n this._sessions[deviceKey] = deviceSessions;\r\n }\r\n\r\n deviceSessions[sessionId] = sessionInfo;\r\n }\r\n\r\n async storeEndToEndSessionProblem(deviceKey, type, fixed) {\r\n const problems = this._sessionProblems[deviceKey] = this._sessionProblems[deviceKey] || [];\r\n problems.push({\r\n type,\r\n fixed,\r\n time: Date.now()\r\n });\r\n problems.sort((a, b) => {\r\n return a.time - b.time;\r\n });\r\n }\r\n\r\n async getEndToEndSessionProblem(deviceKey, timestamp) {\r\n const problems = this._sessionProblems[deviceKey] || [];\r\n\r\n if (!problems.length) {\r\n return null;\r\n }\r\n\r\n const lastProblem = problems[problems.length - 1];\r\n\r\n for (const problem of problems) {\r\n if (problem.time > timestamp) {\r\n return Object.assign({}, problem, {\r\n fixed: lastProblem.fixed\r\n });\r\n }\r\n }\r\n\r\n if (lastProblem.fixed) {\r\n return null;\r\n } else {\r\n return lastProblem;\r\n }\r\n }\r\n\r\n async filterOutNotifiedErrorDevices(devices) {\r\n const notifiedErrorDevices = this._notifiedErrorDevices;\r\n const ret = [];\r\n\r\n for (const device of devices) {\r\n const {\r\n userId,\r\n deviceInfo\r\n } = device;\r\n\r\n if (userId in notifiedErrorDevices) {\r\n if (!(deviceInfo.deviceId in notifiedErrorDevices[userId])) {\r\n ret.push(device);\r\n notifiedErrorDevices[userId][deviceInfo.deviceId] = true;\r\n }\r\n } else {\r\n ret.push(device);\r\n notifiedErrorDevices[userId] = {\r\n [deviceInfo.deviceId]: true\r\n };\r\n }\r\n }\r\n\r\n return ret;\r\n } // Inbound Group Sessions\r\n\r\n\r\n getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n func(this._inboundGroupSessions[k] || null, this._inboundGroupSessionsWithheld[k] || null);\r\n }\r\n\r\n getAllEndToEndInboundGroupSessions(txn, func) {\r\n for (const key of Object.keys(this._inboundGroupSessions)) {\r\n // we can't use split, as the components we are trying to split out\r\n // might themselves contain '/' characters. We rely on the\r\n // senderKey being a (32-byte) curve25519 key, base64-encoded\r\n // (hence 43 characters long).\r\n func({\r\n senderKey: key.substr(0, 43),\r\n sessionId: key.substr(44),\r\n sessionData: this._inboundGroupSessions[key]\r\n });\r\n }\r\n\r\n func(null);\r\n }\r\n\r\n addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n\r\n if (this._inboundGroupSessions[k] === undefined) {\r\n this._inboundGroupSessions[k] = sessionData;\r\n }\r\n }\r\n\r\n storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn) {\r\n this._inboundGroupSessions[senderCurve25519Key + '/' + sessionId] = sessionData;\r\n }\r\n\r\n storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn) {\r\n const k = senderCurve25519Key + '/' + sessionId;\r\n this._inboundGroupSessionsWithheld[k] = sessionData;\r\n } // Device Data\r\n\r\n\r\n getEndToEndDeviceData(txn, func) {\r\n func(this._deviceData);\r\n }\r\n\r\n storeEndToEndDeviceData(deviceData, txn) {\r\n this._deviceData = deviceData;\r\n } // E2E rooms\r\n\r\n\r\n storeEndToEndRoom(roomId, roomInfo, txn) {\r\n this._rooms[roomId] = roomInfo;\r\n }\r\n\r\n getEndToEndRooms(txn, func) {\r\n func(this._rooms);\r\n }\r\n\r\n getSessionsNeedingBackup(limit) {\r\n const sessions = [];\r\n\r\n for (const session in this._sessionsNeedingBackup) {\r\n if (this._inboundGroupSessions[session]) {\r\n sessions.push({\r\n senderKey: session.substr(0, 43),\r\n sessionId: session.substr(44),\r\n sessionData: this._inboundGroupSessions[session]\r\n });\r\n\r\n if (limit && session.length >= limit) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return Promise.resolve(sessions);\r\n }\r\n\r\n countSessionsNeedingBackup() {\r\n return Promise.resolve(Object.keys(this._sessionsNeedingBackup).length);\r\n }\r\n\r\n unmarkSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n delete this._sessionsNeedingBackup[sessionKey];\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n markSessionsNeedingBackup(sessions) {\r\n for (const session of sessions) {\r\n const sessionKey = session.senderKey + '/' + session.sessionId;\r\n this._sessionsNeedingBackup[sessionKey] = true;\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId) {\r\n const sessions = this._sharedHistoryInboundGroupSessions[roomId] || [];\r\n sessions.push([senderKey, sessionId]);\r\n this._sharedHistoryInboundGroupSessions[roomId] = sessions;\r\n }\r\n\r\n getSharedHistoryInboundGroupSessions(roomId) {\r\n return Promise.resolve(this._sharedHistoryInboundGroupSessions[roomId] || []);\r\n } // Session key backups\r\n\r\n\r\n doTxn(mode, stores, func) {\r\n return Promise.resolve(func(null));\r\n }\r\n\r\n}\r\n\r\nexports.MemoryCryptoStore = MemoryCryptoStore;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.FilterComponent = FilterComponent;\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module filter-component\r\n */\r\n\r\n/**\r\n * Checks if a value matches a given field value, which may be a * terminated\r\n * wildcard pattern.\r\n * @param {String} actual_value The value to be compared\r\n * @param {String} filter_value The filter pattern to be compared\r\n * @return {bool} true if the actual_value matches the filter_value\r\n */\r\nfunction _matches_wildcard(actual_value, filter_value) {\r\n if (filter_value.endsWith(\"*\")) {\r\n const type_prefix = filter_value.slice(0, -1);\r\n return actual_value.substr(0, type_prefix.length) === type_prefix;\r\n } else {\r\n return actual_value === filter_value;\r\n }\r\n}\r\n/**\r\n * FilterComponent is a section of a Filter definition which defines the\r\n * types, rooms, senders filters etc to be applied to a particular type of resource.\r\n * This is all ported over from synapse's Filter object.\r\n *\r\n * N.B. that synapse refers to these as 'Filters', and what js-sdk refers to as\r\n * 'Filters' are referred to as 'FilterCollections'.\r\n *\r\n * @constructor\r\n * @param {Object} filter_json the definition of this filter JSON, e.g. { 'contains_url': true }\r\n */\r\n\r\n\r\nfunction FilterComponent(filter_json) {\r\n this.filter_json = filter_json;\r\n this.types = filter_json.types || null;\r\n this.not_types = filter_json.not_types || [];\r\n this.rooms = filter_json.rooms || null;\r\n this.not_rooms = filter_json.not_rooms || [];\r\n this.senders = filter_json.senders || null;\r\n this.not_senders = filter_json.not_senders || [];\r\n this.contains_url = filter_json.contains_url || null;\r\n}\r\n/**\r\n * Checks with the filter component matches the given event\r\n * @param {MatrixEvent} event event to be checked against the filter\r\n * @return {bool} true if the event matches the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype.check = function (event) {\r\n return this._checkFields(event.getRoomId(), event.getSender(), event.getType(), event.getContent() ? event.getContent().url !== undefined : false);\r\n};\r\n/**\r\n * Checks whether the filter component matches the given event fields.\r\n * @param {String} room_id the room_id for the event being checked\r\n * @param {String} sender the sender of the event being checked\r\n * @param {String} event_type the type of the event being checked\r\n * @param {String} contains_url whether the event contains a content.url field\r\n * @return {bool} true if the event fields match the filter\r\n */\r\n\r\n\r\nFilterComponent.prototype._checkFields = function (room_id, sender, event_type, contains_url) {\r\n const literal_keys = {\r\n \"rooms\": function (v) {\r\n return room_id === v;\r\n },\r\n \"senders\": function (v) {\r\n return sender === v;\r\n },\r\n \"types\": function (v) {\r\n return _matches_wildcard(event_type, v);\r\n }\r\n };\r\n const self = this;\r\n\r\n for (let n = 0; n < Object.keys(literal_keys).length; n++) {\r\n const name = Object.keys(literal_keys)[n];\r\n const match_func = literal_keys[name];\r\n const not_name = \"not_\" + name;\r\n const disallowed_values = self[not_name];\r\n\r\n if (disallowed_values.filter(match_func).length > 0) {\r\n return false;\r\n }\r\n\r\n const allowed_values = self[name];\r\n\r\n if (allowed_values && allowed_values.length > 0) {\r\n const anyMatch = allowed_values.some(match_func);\r\n\r\n if (!anyMatch) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n const contains_url_filter = this.filter_json.contains_url;\r\n\r\n if (contains_url_filter !== undefined) {\r\n if (contains_url_filter !== contains_url) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n/**\r\n * Filters a list of events down to those which match this filter component\r\n * @param {MatrixEvent[]} events Events to be checked againt the filter component\r\n * @return {MatrixEvent[]} events which matched the filter component\r\n */\r\n\r\n\r\nFilterComponent.prototype.filter = function (events) {\r\n return events.filter(this.check, this);\r\n};\r\n/**\r\n * Returns the limit field for a given filter component, providing a default of\r\n * 10 if none is otherwise specified. Cargo-culted from Synapse.\r\n * @return {Number} the limit for this filter component.\r\n */\r\n\r\n\r\nFilterComponent.prototype.limit = function () {\r\n return this.filter_json.limit !== undefined ? this.filter_json.limit : 10;\r\n};","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","import f from \"../functions.js\";\r\nclass User {\r\n constructor(core, p){\r\n if(!p) p = {}\r\n\r\n this.core = core\r\n this.state = 0\r\n this.keysupdatetimeout = null\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n \r\n }\r\n\r\n destroy (){\r\n if(this.keysupdatetimeout){\r\n clearTimeout(this.keysupdatetimeout)\r\n }\r\n\r\n this.keysupdatetimeout = null\r\n this.state = 0\r\n\r\n this.userinfo = {\r\n image : '',\r\n name : '',\r\n id : '',\r\n keys : []\r\n }\r\n\r\n this.private = []\r\n\r\n }\r\n\r\n setCredentials (credentials){\r\n if (credentials)\r\n this.credentials = credentials\r\n }\r\n\r\n setUsersInfo (usersinfo, reload){\r\n _.each(usersinfo || [], v => {\r\n\r\n this.core.store.commit('SET_USERINFO', {\r\n info : v,\r\n reload : reload\r\n })\r\n })\r\n }\r\n\r\n setContacts (usersinfo){\r\n \r\n //this.core.store.commit('SET_CONTACTS', usersinfo)\r\n \r\n }\r\n\r\n myMatrixId(){\r\n return this.matrixId(this.userinfo.id)\r\n }\r\n\r\n matrixId(id, domain){\r\n \r\n id || (id = '')\r\n\r\n if(id.indexOf(\"@\") == 0) return id\r\n\r\n return '@' + id + ':' + (domain || this.core.domain)\r\n }\r\n\r\n fromMatrixId(matrixid){\r\n return f.getmatrixid(matrixid)\r\n }\r\n}\r\n\r\nexport default User","var inherits = require('inherits')\nvar Hash = require('./hash')\nvar Buffer = require('safe-buffer').Buffer\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n this._ah = 0x6a09e667\n this._bh = 0xbb67ae85\n this._ch = 0x3c6ef372\n this._dh = 0xa54ff53a\n this._eh = 0x510e527f\n this._fh = 0x9b05688c\n this._gh = 0x1f83d9ab\n this._hh = 0x5be0cd19\n\n this._al = 0xf3bcc908\n this._bl = 0x84caa73b\n this._cl = 0xfe94f82b\n this._dl = 0x5f1d36f1\n this._el = 0xade682d1\n this._fl = 0x2b3e6c1f\n this._gl = 0xfb41bd6b\n this._hl = 0x137e2179\n\n return this\n}\n\nfunction Ch (x, y, z) {\n return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n var W = this._w\n\n var ah = this._ah | 0\n var bh = this._bh | 0\n var ch = this._ch | 0\n var dh = this._dh | 0\n var eh = this._eh | 0\n var fh = this._fh | 0\n var gh = this._gh | 0\n var hh = this._hh | 0\n\n var al = this._al | 0\n var bl = this._bl | 0\n var cl = this._cl | 0\n var dl = this._dl | 0\n var el = this._el | 0\n var fl = this._fl | 0\n var gl = this._gl | 0\n var hl = this._hl | 0\n\n for (var i = 0; i < 32; i += 2) {\n W[i] = M.readInt32BE(i * 4)\n W[i + 1] = M.readInt32BE(i * 4 + 4)\n }\n for (; i < 160; i += 2) {\n var xh = W[i - 15 * 2]\n var xl = W[i - 15 * 2 + 1]\n var gamma0 = Gamma0(xh, xl)\n var gamma0l = Gamma0l(xl, xh)\n\n xh = W[i - 2 * 2]\n xl = W[i - 2 * 2 + 1]\n var gamma1 = Gamma1(xh, xl)\n var gamma1l = Gamma1l(xl, xh)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7h = W[i - 7 * 2]\n var Wi7l = W[i - 7 * 2 + 1]\n\n var Wi16h = W[i - 16 * 2]\n var Wi16l = W[i - 16 * 2 + 1]\n\n var Wil = (gamma0l + Wi7l) | 0\n var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n Wil = (Wil + gamma1l) | 0\n Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n Wil = (Wil + Wi16l) | 0\n Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n W[i] = Wih\n W[i + 1] = Wil\n }\n\n for (var j = 0; j < 160; j += 2) {\n Wih = W[j]\n Wil = W[j + 1]\n\n var majh = maj(ah, bh, ch)\n var majl = maj(al, bl, cl)\n\n var sigma0h = sigma0(ah, al)\n var sigma0l = sigma0(al, ah)\n var sigma1h = sigma1(eh, el)\n var sigma1l = sigma1(el, eh)\n\n // t1 = h + sigma1 + ch + K[j] + W[j]\n var Kih = K[j]\n var Kil = K[j + 1]\n\n var chh = Ch(eh, fh, gh)\n var chl = Ch(el, fl, gl)\n\n var t1l = (hl + sigma1l) | 0\n var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n t1l = (t1l + chl) | 0\n t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n t1l = (t1l + Kil) | 0\n t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n t1l = (t1l + Wil) | 0\n t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n // t2 = sigma0 + maj\n var t2l = (sigma0l + majl) | 0\n var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n hh = gh\n hl = gl\n gh = fh\n gl = fl\n fh = eh\n fl = el\n el = (dl + t1l) | 0\n eh = (dh + t1h + getCarry(el, dl)) | 0\n dh = ch\n dl = cl\n ch = bh\n cl = bl\n bh = ah\n bl = al\n al = (t1l + t2l) | 0\n ah = (t1h + t2h + getCarry(al, t1l)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n var H = Buffer.allocUnsafe(64)\n\n function writeInt64BE (h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._ah, this._al, 0)\n writeInt64BE(this._bh, this._bl, 8)\n writeInt64BE(this._ch, this._cl, 16)\n writeInt64BE(this._dh, this._dl, 24)\n writeInt64BE(this._eh, this._el, 32)\n writeInt64BE(this._fh, this._fl, 40)\n writeInt64BE(this._gh, this._gl, 48)\n writeInt64BE(this._hh, this._hl, 56)\n\n return H\n}\n\nmodule.exports = Sha512\n","var EXIF = require('exif-js');\r\n\r\nimport f from '@/application/functions'\r\n\r\nvar Images = function(){\r\n var self = this;\r\n\r\n self.orientation = function(image, exif){\r\n\r\n return new Promise((resolve, reject) => {\r\n if(!exif.orientation){\r\n return resolve(image)\r\n }\r\n\r\n var img = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d');\r\n \r\n img.src = srcData;\r\n\r\n img.onload = function(){\r\n\r\n var width = img.width,\r\n height = img.height;\r\n \r\n // set proper canvas dimensions before transform & export\r\n if ($.inArray(exif.orientation, [5, 6, 7, 8]) > -1) {\r\n canvas.width = height;\r\n canvas.height = width;\r\n } else {\r\n canvas.width = width;\r\n canvas.height = height;\r\n }\r\n \r\n // transform context before drawing image\r\n switch (exif.orientation) {\r\n case 1:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 2:\r\n // flip horizontal\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 3:\r\n // rotate 180\r\n ctx.translate(width, height);\r\n ctx.rotate(Math.PI);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 4:\r\n // flip vertical\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 5:\r\n // flip vertical, rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.scale(1, -1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 6:\r\n // rotate 90 clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(0, -height);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 7:\r\n // flip horizontal, rotate 90 counter clockwise\r\n ctx.rotate(Math.PI / 2);\r\n ctx.translate(width, -height);\r\n ctx.scale(-1, 1);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n case 8:\r\n // rotate 90 counter clockwise\r\n ctx.rotate(-Math.PI / 2);\r\n ctx.translate(-width, 0);\r\n ctx.drawImage(this, 0, 0, width, height);\r\n break;\r\n default:\r\n // normal\r\n ctx.drawImage(this, 0, 0, width, height);\r\n return;\r\n }\r\n \r\n // Draw img into canvas\r\n // ctx.drawImage(img, 0, 0, width, height);\r\n\r\n var url = canvas.toDataURL(\"image/jpeg\", 0.95);\r\n\r\n $(canvas).remove();\r\n\r\n resolve(url)\r\n\r\n }\r\n })\r\n }\r\n\r\n self.autorotation = function(file, base64){\r\n return new Promise((resolve, reject) => {\r\n\r\n if (file && !f.isios()) {\r\n EXIF.getData(file, function() {\r\n \r\n var exif = EXIF.getAllTags(this)\r\n \r\n self.orientation(base64, exif).then(res => {\r\n return resolve(res)\r\n })\r\n \r\n })\r\n } else {\r\n return resolve(base64)\r\n }\r\n }) \r\n\r\n }\r\n\r\n self.srcToData = function(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function() {\r\n var reader = new FileReader();\r\n reader.onloadend = function() {\r\n callback(reader.result);\r\n }\r\n reader.readAsDataURL(xhr.response);\r\n };\r\n \r\n xhr.onerror = function(){}\r\n \r\n xhr.open('GET', url);\r\n xhr.responseType = 'blob';\r\n xhr.send();\r\n }\r\n\r\n self.resize = {\r\n fit : function(srcData, width, height, format, quality) {\r\n\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\";\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n\r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n var c = Math.max(((newHeight - height) / newHeight), ((newWidth - width) / newWidth))\r\n \r\n if(c > 0){\r\n newHeight = newHeight * (c + 1)\r\n newWidth = newWidth * (c + 1)\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n\r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n }) \r\n \r\n },\r\n\r\n def : function(srcData, width, height, format, quality) {\r\n var imageObj = new Image(),\r\n canvas = document.createElement(\"canvas\"),\r\n ctx = canvas.getContext('2d'),\r\n aspectRadio,\r\n newWidth,\r\n newHeight;\r\n \r\n imageObj.crossOrigin = \"Anonymous\"\r\n imageObj.src = srcData;\r\n \r\n format || (format = 'image/jpeg');\r\n quality || (quality = 1);\r\n \r\n return new Promise((resolve, reject) => {\r\n \r\n imageObj.onload = function(){\r\n \r\n aspectRadio = imageObj.height / imageObj.width;\r\n newHeight = imageObj.height;\r\n newWidth = imageObj.width;\r\n \r\n if(newHeight <= height && newWidth <= width)\r\n {\r\n \r\n }\r\n else\r\n {\r\n if(newWidth > width)\r\n {\r\n newWidth = width;\r\n newHeight = width * aspectRadio;\r\n }\r\n \r\n if(newHeight > height)\r\n {\r\n newHeight = height;\r\n newWidth = newHeight / aspectRadio\r\n }\r\n \r\n }\r\n \r\n canvas.width = newWidth;\r\n canvas.height = newHeight;\r\n \r\n ctx.drawImage(imageObj, 0, 0, newWidth, newHeight);\r\n \r\n var url = canvas.toDataURL(format, quality);\r\n \r\n $(canvas).remove();\r\n \r\n resolve(url);\r\n \r\n }\r\n \r\n })\r\n \r\n \r\n }\r\n }\r\n \r\n \r\n self.grayscaleImage = function (srcData, clbk){\r\n\r\n var image = new Image();\r\n\r\n image.src = srcData;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n image.onload = function(){\r\n\r\n var myCanvas = document.createElement(\"canvas\");\r\n var myCanvasContext = myCanvas.getContext(\"2d\");\r\n\r\n var imgWidth = image.width;\r\n var imgHeight = image.height;\r\n \r\n myCanvas.width = imgWidth;\r\n myCanvas.height = imgHeight;\r\n\r\n myCanvasContext.drawImage(image, 0, 0);\r\n\r\n var imageData = myCanvasContext.getImageData(0,0, imgWidth, imgHeight);\r\n\r\n var j = 0, i = 0;\r\n\r\n for (i = 0; i < imageData.height; i++)\r\n {\r\n for (j = 0; j < imageData.width; j++)\r\n {\r\n var index=(i*4)*imageData.width+(j*4);\r\n var red=imageData.data[index];\r\n var green=imageData.data[index+1];\r\n var blue=imageData.data[index+2];\r\n var alpha=imageData.data[index+3];\r\n var average = (3 * red + green + blue)/3;\r\n\r\n imageData.data[index] = average;\r\n imageData.data[index+1]= average;\r\n imageData.data[index+2]= average;\r\n imageData.data[index+3]= alpha;\r\n }\r\n }\r\n\r\n myCanvasContext.putImageData(imageData, 0, 0, 0, 0, imageData.width, imageData.height);\r\n \r\n resolve(myCanvas.toDataURL());\r\n\r\n }\r\n\r\n })\r\n }\r\n\r\n self.wh = function(base64){\r\n const img = new Image();\r\n var imgInfo = {};\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n img.onload = function () {\r\n imgInfo.w = this.width\r\n imgInfo.h = this.height\r\n resolve(imgInfo)\r\n }\r\n\r\n img.onerror = function (e) {\r\n reject(e)\r\n }\r\n\r\n img.src = base64\r\n //this.info = imgInfo\r\n\r\n })\r\n \r\n }\r\n\r\n return self;\r\n}\r\n\r\nexport default Images","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","module.exports = require('./readable').PassThrough\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=16157ecb&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=16157ecb&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"16157ecb\",\n null\n ,true\n)\n\nexport default component.exports","import Vue from 'vue'\r\nimport Vuex from 'vuex'\r\nimport f from '@/application/functions.js'\r\n\r\n\r\nVue.use(Vuex);\r\n\r\nvar themes = {\r\n\twhite: \"White\",\r\n\tblack: \"Dark\",\r\n\tclassic: \"Classic\"\r\n}\r\n\r\nvar mex = {\r\n\ttheme: function (state, value) {\r\n\r\n\t\tif (themes[value]) {\r\n\t\t\tstate.theme = value\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar activetimeout = null\r\n\r\nvar store = new Vuex.Store({\r\n\tstate: {\r\n\t\tcontacts: {},\r\n\t\tcontactsFromMatrix: {},\r\n\t\tcontactsMap: {},\r\n\t\tchats: [],\r\n\t\tprechats: [],\r\n\t\tchatsMap: {},\r\n\t\tevents: {},\r\n\t\tusers: {},\r\n\t\ttyping: {},\r\n\t\ticon: null,\r\n\t\tloading: false,\r\n\t\tonline: true,\r\n\t\tunauthorized: false,\r\n\t\ttheme: 'white',\r\n\t\tthemes: themes,\r\n\t\tsignedUpUsers: [],\r\n\t\tpocketnet: '',\r\n\t\tmobile: '',\r\n\t\tvoiceMessagesEnabled: '',\r\n\t\tcurrentPlayingVoiceMessage: null,\r\n\t\tcurrent_user: {},\r\n\t\tminimized: true,\r\n\t\tactive: false,\r\n\t\tactiveBlock: {},\r\n\t\tglobalpreloader: false,\r\n\t\tallnotifications: 0,\r\n\t\tpocketteammessages: [],\r\n\t\treadedteammessages: {},\r\n\t\tchatsready: false,\r\n\t\tautohide: false,\r\n\t\titeraction: false,\r\n\t\troomMembes: [],\r\n\t\tgallery: null,\r\n\t\tshare: null,\r\n\t\tcontact: null,\r\n\t\tconnect: null,\r\n\t\tjoinroom: null,\r\n\t\tchatusers: {},\r\n\t\tforce: {},\r\n\t\twasunhidden: false,\r\n\t\thiddenInParent: false,\r\n\t\thideOptimization: false,\r\n\t\tmodalShowed: null,\r\n\t\tmenu: null,\r\n\t\tpinchat: false,\r\n\t\tlastroom: null,\r\n\t\tdontreadreceipts: false,\r\n\t\tvoicerecording : false,\r\n\t\tdeletedrooms: {},\r\n\t\tpkoindisabled : false\r\n\t\t//share : {url : 'https://yandex.ru/'} //null\r\n\t},\r\n\tgetters: {\r\n\t\tgetUser: state => {\r\n\t\t\treturn state.user\r\n\t\t},\r\n\t\tgetConnection: state => {\r\n\t\t\treturn state.localMatrixStore\r\n\t\t},\r\n\r\n\t\tgetSignedUpUsers: state => {\r\n\t\t\treturn state.signedUpUsers\r\n\t\t},\r\n\t},\r\n\tmutations: {\r\n\t\tSET_CURRENT_PLAYING_VOICE_MESSAGE(state, message) {\r\n\t\t\tstate.currentPlayingVoiceMessage = message\r\n\t\t},\r\n\t\tsetUser(state, userData) {\r\n\t\t\tstate.current_user = userData || {}\r\n\t\t},\r\n\r\n\t\tclearall(state) {\r\n\r\n\t\t\tstate.contacts = {}\r\n\t\t\tstate.contactsFromMatrix = {}\r\n\t\t\tstate.contactsMap = {}\r\n\t\t\tstate.chats = []\r\n\t\t\tstate.prechats = []\r\n\t\t\tstate.chatsMap = {}\r\n\t\t\tstate.events = {}\r\n\t\t\tstate.users = {}\r\n\t\t\tstate.typing = {}\r\n\t\t\tstate.icon = null\r\n\t\t\tstate.loading = false\r\n\t\t\tstate.online = true\r\n\t\t\tstate.unauthorized = false\r\n\t\t\tstate.signedUpUsers = []\r\n\t\t\t/*state.pocketnet = ''*/\r\n\t\t\tstate.current_user = {}\r\n\t\t\tstate.minimized = false\r\n\t\t\tstate.active = false\r\n\t\t\tstate.activeBlock = {}\r\n\t\t\tstate.globalpreloader = false\r\n\t\t\tstate.allnotifications = 0\r\n\t\t\tstate.pocketteammessages = []\r\n\t\t\tstate.readedteammessages = {}\r\n\t\t\tstate.chatsready = false\r\n\t\t\tstate.autohide = false\r\n\t\t\tstate.gallery = null\r\n\t\t\tstate.modalShowed = null\r\n\t\t\tstate.menu = null\r\n\t\t\tstate.pinchat = false\r\n\t\t\tstate.dontreadreceipts = false\r\n\t\t\tstate.lastroom = null\r\n\t\t\tstate.voicerecording = false\r\n\r\n\t\t\t// state.share = null\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t} else state.minimized = true\r\n\r\n\t\t\tif (activetimeout) {\r\n\t\t\t\tclearTimeout(activetimeout)\r\n\t\t\t\tactivetimeout = null\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tblockactive(state, a) {\r\n\t\t\tif (a.value)\r\n\t\t\t\tVue.set(state.activeBlock, a.item, a.value)\r\n\t\t\telse\r\n\t\t\t\tVue.delete(state.activeBlock, a.item, a.value)\r\n\r\n\t\t},\r\n\r\n\t\tglobalpreloader: function (state, value) {\r\n\t\t\tstate.globalpreloader = value\r\n\t\t},\r\n\r\n\t\ticon(state, value) {\r\n\r\n\t\t\tstate.icon = value\r\n\r\n\t\t\tvar mv = f.deep(window, 'window.POCKETNETINSTANCE.mobile.vibration')\r\n\r\n\t\t\tif (mv) {\r\n\t\t\t\tmv.small()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tpkoindisabled(state, value){\r\n\t\t\tstate.pkoindisabled = value && value == 'true' ? true : false\r\n\t\t},\r\n\r\n\t\twasunhidden(state, value) {\r\n\t\t\tstate.wasunhidden = true\r\n\t\t},\r\n\r\n\t\thiddenInParent(state, value) {\r\n\t\t\tstate.hiddenInParent = value\r\n\t\t},\r\n\r\n\t\thideOptimization(state, value) {\r\n\t\t\tstate.hideOptimization = value\r\n\t\t},\r\n\r\n\t\tpinchat(state, value) {\r\n\t\t\tstate.pinchat = value\r\n\t\t\tlocalStorage['pinchat'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tdontreadreceipts(state, value) {\r\n\t\t\tstate.dontreadreceipts = value\r\n\r\n\t\t\tlocalStorage['dontreadreceipts'] = value ? true : ''\r\n\t\t},\r\n\r\n\t\tSET_LAST_ROOM(state, value) {\r\n\r\n\t\t\tif (!value) state.lastroom = null\r\n\r\n\t\t\telse\r\n\t\t\t\tstate.lastroom = {\r\n\t\t\t\t\tid: value,\r\n\t\t\t\t\ttime: new Date()\r\n\t\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tactive(state, value) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.active = false;\r\n\t\t\t\tstate.iteraction = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tvar time = 50;\r\n\r\n\t\t\tif (!value) time = 1000\r\n\r\n\t\t\tactivetimeout = f.slowMade(() => {\r\n\r\n\t\t\t\tif (!value) {\r\n\t\t\t\t\tif (!_.isEmpty(state.activeBlock)) {\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstate.iteraction = false\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstate.active = value\r\n\r\n\t\t\t\tif (!state.active) {\r\n\t\t\t\t\tstate.share = null\r\n\t\t\t\t\tdelete state.activeBlock.share\r\n\t\t\t\t}\r\n\r\n\t\t\t}, activetimeout, time)\r\n\t\t},\r\n\r\n\t\tsetiteraction(state, value) {\r\n\t\t\tstate.iteraction = value\r\n\t\t},\r\n\r\n\t\tmaximize(state, route) {\r\n\t\t\tstate.minimized = false\r\n\t\t},\r\n\r\n\t\tminimize(state, v) {\r\n\r\n\t\t\tif (state.mobile) {\r\n\t\t\t\tstate.minimized = false;\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\tif (state.minimized) {\r\n\t\t\t\tstate.activeBlock = {}\r\n\t\t\t\tstate.active = false\r\n\t\t\t}\r\n\r\n\t\t\tstate.minimized = true\r\n\t\t},\r\n\r\n\t\tsetmodal(state, v) {\r\n\t\t\tstate.modalShowed = v;\r\n\t\t},\r\n\r\n\t\tsetPocketnet(state, pocketnet) {\r\n\t\t\tstate.pocketnet = pocketnet;\r\n\t\t},\r\n\t\tsetMobile(state, mobile) {\r\n\t\t\tstate.mobile = mobile;\r\n\t\t},\r\n\r\n\t\tsetVoiceMessagesEnabled(state, voiceMessagesEnabled) {\r\n\t\t\tstate.voiceMessagesEnabled = voiceMessagesEnabled;\r\n\t\t},\r\n\r\n\t\tls(state) {\r\n\t\t\tif (typeof localStorage.getItem('pinchat') != 'undefined')\r\n\t\t\t\tstate.pinchat = localStorage.getItem('pinchat') ? true : false\r\n\r\n\t\t\tif (typeof localStorage.getItem('dontreadreceipts') != 'undefined')\r\n\t\t\t\tstate.dontreadreceipts = localStorage.getItem('dontreadreceipts') ? true : false\r\n\t\t},\r\n\r\n\t\tinit(state) {\r\n\t\t\tmex.theme(state, localStorage.getItem('theme') || 'white')\r\n\r\n\r\n\r\n\t\t},\r\n\r\n\t\tALL_NOTIFICATIONS_COUNT(state, rooms) {\r\n\r\n\t\t\tvar n = new Date()\r\n\r\n\t\t\tvar count = _.filter(rooms, room => {\r\n\r\n\t\t\t\tif (room._selfMembership === 'invite') {\r\n\t\t\t\t\tvar users = store._vm.core.mtrx.anotherChatUsers(room)\r\n\r\n\t\t\t\t\tif (users.length == 1 && store._vm.core.mtrx.blockeduser(users[0].userId)) {\r\n\t\t\t\t\t\treturn false\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (f.date.addseconds(new Date(room.summary.lastModified), 86400) > n) return true\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tstate.allnotifications = _.reduce(rooms, (s, chat) => {\r\n\r\n\t\t\t\treturn s + (chat.getUnreadNotificationCount() || 0)\r\n\r\n\t\t\t}, 0) + count.length\r\n\r\n\r\n\t\t\tif (state.chats.length <= 3) {\r\n\t\t\t\t// Count notifications from pocketnet team room\r\n\t\t\t\tvar pocketMessages = _.filter(state.pocketteammessages, function (m) {\r\n\t\t\t\t\treturn !state.readedteammessages[m.id];\r\n\t\t\t\t}).length;\r\n\t\t\t\tstate.allnotifications += pocketMessages\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar external = f.deep(store, '_vm.core.external.clbks.ALL_NOTIFICATIONS_COUNT') || {}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(state.allnotifications)\r\n\t\t\t})\r\n\r\n\t\t\treturn state.allnotifications\r\n\t\t},\r\n\r\n\t\tSET_CHATS_READY(state, v) {\r\n\t\t\tstate.chatsready = v\r\n\t\t},\r\n\r\n\t\tSET_PRECHATS_TO_STORE(state, chats) {\r\n\t\t\tstate.prechats = chats;\r\n\t\t},\r\n\r\n\t\tSET_CHAT_TO_FORCE(state, id) {\r\n\r\n\r\n\t\t\tVue.set(state.force, id, true)\r\n\r\n\t\t},\r\n\r\n\t\tSET_CHATS_TO_STORE(state, chats) {\r\n\r\n\t\t\tstate.chats = chats;\r\n\r\n\t\t\tvar chatsMap = {}\r\n\r\n\t\t\t_.each(chats, (chat) => {\r\n\r\n\t\t\t\tvar aid = chat.info.title.replace(\"#\", '')\r\n\r\n\t\t\t\tif (!state.chatsMap[chat.roomId] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, chat.roomId, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!state.chatsMap[aid] || state.force[chat.roomId]) {\r\n\t\t\t\t\tVue.set(state.chatsMap, aid, chat)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchatsMap[chat.roomId] = chat\r\n\t\t\t\tchatsMap[chat.info.title.replace(\"#\", '')] = chat\r\n\r\n\t\t\t\tVue.delete(state.force, chat.roomId)\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.chatsMap, function (c, id) {\r\n\t\t\t\tif (!chatsMap[id]) Vue.delete(state.chatsMap, id)\r\n\t\t\t})\r\n\r\n\t\t\t//state.chatsMap = chatsMap;\r\n\r\n\t\t},\r\n\t\tSET_EVENTS_TO_STORE(state, events) {\r\n\t\t\t//state.events = events\r\n\t\t\t\r\n\t\t\t_.each(events, function(ev, k){\r\n\t\t\t\tvar timeline = []\r\n\r\n\t\t\t\t_.each(ev.timeline, function(__e){\r\n\t\t\t\t\tvar e = __e.event\r\n\r\n\t\t\t\t\tvar _e = {\r\n\r\n\t\t\t\t\t\tevent : {\r\n\t\t\t\t\t\t\tcontent : _.clone(e.content),\r\n\t\t\t\t\t\t\tevent_id: e.event_id,\r\n\t\t\t\t\t\t\torigin_server_ts: e.origin_server_ts,\r\n\t\t\t\t\t\t\troom_id: e.room_id,\r\n\t\t\t\t\t\t\tsender: e.sender,\r\n\t\t\t\t\t\t\tstate_key: e.state_key,\r\n\t\t\t\t\t\t\ttype: e.type\r\n\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\tget : () => __e\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttimeline.push(_e)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\tVue.set(state.events, k, {timeline})\r\n\t\t\t});\r\n\r\n\t\t},\r\n\r\n\t\tSET_TYPING_TO_STORE(state, data) {\r\n\t\t\tstate.typing[data.room] || (state.typing[data.room] = {})\r\n\t\t\tstate.typing[data.room][data.name] = data.typing\r\n\r\n\t\t\tfunction allTrue(data) {\r\n\t\t\t\tfor (var o in data)\r\n\t\t\t\t\tif (!data[o]) return false;\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tallTrue(data.typing)\r\n\r\n\t\t},\r\n\t\tDELETE_ROOM(state, roomid) {\r\n\r\n\t\t\tVue.set(state.deletedrooms, roomid, true)\r\n\r\n\r\n\r\n\t\t},\r\n\t\tSET_CONTACTS(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tmp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contacts = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CHATS_USERS(state, v) {\r\n\r\n\t\t\t_.each(v || {}, function (u, i) {\r\n\t\t\t\tif (!state.chatusers[i] || !_.isEqual(state.chatusers[i], u)) {\r\n\t\t\t\t\tVue.set(state.chatusers, i, u)\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\r\n\t\t\t//state.chatusers = v || {}\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_FROM_MATRIX(state, v) {\r\n\t\t\tvar mp = {}\r\n\r\n\t\t\t_.each(v, function (c) {\r\n\t\t\t\tif (f.getmatrixid(c.id) != (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)) mp[c.id] = c\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsFromMatrix = mp\r\n\r\n\t\t\tstore.commit('SET_CONTACTS_MAP')\r\n\t\t},\r\n\r\n\t\tSET_CONTACTS_MAP(state) {\r\n\r\n\t\t\tvar contactsMap = {}\r\n\r\n\t\t\t_.each(state.contacts, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(state.contactsFromMatrix, function (contact) {\r\n\t\t\t\tcontactsMap[contact.id] = contact\r\n\t\t\t})\r\n\r\n\t\t\tstate.contactsMap = contactsMap;\r\n\t\t},\r\n\r\n\t\tSET_UNAUTHORIZED(state, v) {\r\n\t\t\tstate.unauthorized = v\r\n\t\t},\r\n\r\n\t\tSET_USERINFO(state, v) {\r\n\r\n\t\t\tif (!v.info) return\r\n\r\n\t\t\tif (v.reload || !state.users[v.info.id]) Vue.set(state.users, v.info.id, v.info)\r\n\r\n\r\n\t\t},\r\n\r\n\t\tSET_CURRENT_ROOM(state, v) {\r\n\r\n\t\t\tstate.currentRoom = v\r\n\t\t},\r\n\r\n\t\tCLEAR_USERSINFO(state, v) {\r\n\t\t\tstate.users = {}\r\n\t\t},\r\n\r\n\t\tGALLERY(state, v) {\r\n\r\n\t\t\tstate.gallery = v || null\r\n\r\n\t\t\tvar fu = null\r\n\r\n\t\t\tif(v){\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.gallerybackground')\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfu = f.deep(window, 'window.POCKETNETINSTANCE.mobile.statusbar.background')\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif (fu) {\r\n\t\t\t\tfu()\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tSHARE(state, v) {\r\n\t\t\tstate.share = v || null\r\n\r\n\t\t\tif (!state.mobile) {\r\n\t\t\t\tstate.activeBlock.share = true\r\n\t\t\t\tstate.active = true;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tCONNECT(state, v) {\r\n\t\t\tstate.connect = v\r\n\t\t},\r\n\r\n\t\tJOINROOM(state, v) {\r\n\t\t\tstate.joinroom = v\r\n\t\t},\r\n\r\n\t\tCONTACT(state, v) {\r\n\t\t\tstate.contact = v || null\r\n\t\t},\r\n\r\n\t\ttheme(state, value) {\r\n\t\t\tmex.theme(state, value)\r\n\t\t},\r\n\r\n\t\tSET_POCKETTEAMMESSAGES(state, v) {\r\n\t\t\tstate.pocketteammessages = v;\r\n\t\t\t// Check local storage\r\n\t\t\tvar readedMessagesStr = localStorage.getItem('readedpocketteammessages');\r\n\t\t\tif (readedMessagesStr) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar readedMessages = JSON.parse(readedMessagesStr);\r\n\t\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tlocalStorage.removeItem('readedpocketteammessages');\r\n\t\t\t\t\tstate.readedteammessages = {};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_READEDTEAMMESSAGES(state, v) {\r\n\t\t\tif (v && v.length > 0) {\r\n\t\t\t\tvar readedMessages = {};\r\n\t\t\t\t_.each(v, function (m) {\r\n\t\t\t\t\treadedMessages[m.id] = true;\r\n\t\t\t\t});\r\n\t\t\t\tstate.readedteammessages = readedMessages;\r\n\t\t\t\t// Update local storage\r\n\t\t\t\tlocalStorage.setItem('readedpocketteammessages', JSON.stringify(readedMessages));\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tSET_MENU(state, v) {\r\n\t\t\tstate.menu = v\r\n\r\n\t\t},\r\n\r\n\t\tSET_VOICERECORDING(state, v){\r\n\t\t\tstate.voicerecording = v\r\n\t\t}\r\n\r\n\t},\r\n\tactions: {\r\n\t\tSET_CHAT_MEMBERS({ commit }, chat) {\r\n\r\n\t\t},\r\n\t\tTYPING_EVENT({ commit }, member) {\r\n\t\t\tlet room = member.roomId\r\n\t\t\tlet name = member.name\r\n\t\t\tlet data = { room, name, typing: member.typing }\r\n\t\t\tcommit('SET_TYPING_TO_STORE', data)\r\n\t\t},\r\n\t\tCHAT_MEMBERS({ commit }) {\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY_FROMEVENTS({ commit, dispatch }, { events, event }) {\r\n\r\n\t\t\tvar images = [], index = 0\r\n\r\n\t\t\tvar encrypted = function (event) {\r\n\t\t\t\treturn f.deep(event, 'event.content.info.secrets') ? true : false\r\n\t\t\t}\r\n\r\n\t\t\t_.each(events, event => {\r\n\r\n\t\t\t\tif (event.event.content.msgtype === 'm.image') {\r\n\r\n\t\t\t\t\tvar url = event.event.content.url\r\n\r\n\t\t\t\t\tif (encrypted(event)) {\r\n\t\t\t\t\t\turl = event.event.decryptedImage\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\timages.push({\r\n\t\t\t\t\t\tsrc: url,\r\n\t\t\t\t\t\tw: event.event.content.info.w || 500,\r\n\t\t\t\t\t\th: event.event.content.info.h || 500,\r\n\t\t\t\t\t\teventId: event.event.event_id\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t})\r\n\r\n\t\t\timages = _.filter(images, function (i) {\r\n\t\t\t\treturn i.src\r\n\t\t\t})\r\n\r\n\t\t\tindex = images.map(function (e) {\r\n\t\t\t\treturn e.eventId\r\n\t\t\t}).indexOf(event.event.event_id)\r\n\r\n\t\t\tdispatch('SHOW_GALLERY', { images, index })\r\n\r\n\t\t},\r\n\t\tSHOW_GALLERY({ commit }, { images, index }) {\r\n\r\n\t\t\tif (!index) index = 0\r\n\r\n\t\t\tif (!images) images = []\r\n\r\n\t\t\tif (images.length) {\r\n\r\n\t\t\t\tcommit('GALLERY', {\r\n\t\t\t\t\timages: images,\r\n\t\t\t\t\tindex: index\r\n\t\t\t\t})\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcommit('GALLERY', null)\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tRELOAD_CHAT_USERS({ commit }, m_chats) {\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats, true).then(i => {\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tFETCH_CHATS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar id = store._vm.core.user.myMatrixId()\r\n\r\n\t\t\tvar chats = _.map(m_chats, function (r) {\r\n\t\t\t\tif (r.getLastActiveTimestamp() === -9007199254740991) {\r\n\r\n\t\t\t\t\tif (r.getMember(id)) {\r\n\t\t\t\t\t\tr.summary.lastModified = r.getMember(id).events.member.event.origin_server_ts\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tr.summary.lastModified = r.getLastActiveTimestamp()\r\n\t\t\t\t}\r\n\t\t\t\treturn r.summary\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_PRECHATS_TO_STORE', chats)\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.allchatmembers(m_chats).then(r => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_TO_STORE', chats)\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\r\n\t\t\t\treturn store._vm.core.mtrx.kit.fillContacts(m_chats)\r\n\r\n\t\t\t})\r\n\r\n\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\treturn store._vm.core.mtrx.kit.usersInfoForChats(m_chats).then(i => {\r\n\r\n\t\t\t\tcommit('SET_CHATS_USERS', store._vm.core.mtrx.kit.usersFromChats(m_chats))\r\n\t\t\t\tcommit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n\t\t\t\t\treturn m.id !== (store._vm.core.user.userinfo && store._vm.core.user.userinfo.id)\r\n\t\t\t\t}))\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t}).catch(e => {\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\r\n\t\tFETCH_EVENTS({ commit }) {\r\n\r\n\t\t\tvar m_chats = f.deep(store._vm, 'core.mtrx.store.rooms') || {}\r\n\r\n\t\t\tvar events = {}\r\n\r\n\t\t\t_.each(m_chats, function (chat) {\r\n\r\n\t\t\t\tevents[chat.roomId] = {}\r\n\r\n\t\t\t\tvar timeline = [].concat(chat.timeline, chat.currentState.getStateEvents('m.room.member'))\r\n\r\n\t\t\t\tevents[chat.roomId].timeline = timeline\r\n\r\n\t\t\t})\r\n\r\n\t\t\t_.each(events, function (e) {\r\n\r\n\t\t\t\te.timeline = _.sortBy(e.timeline, function (event) {\r\n\t\t\t\t\treturn event.getDate()\r\n\t\t\t\t})\r\n\r\n\t\t\t})\r\n\r\n\t\t\tcommit('SET_EVENTS_TO_STORE', events)\r\n\r\n\t\t\t//store._vm.core.mtrx.kit.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n\t\t\t//})\r\n\r\n\t\t},\r\n\t}\r\n})\r\n\r\n\r\nexport default store;","/*!\n * vue-router v3.5.3\n * (c) 2021 Evan You\n * @license MIT\n */\n/* */\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error((\"[vue-router] \" + message))\n }\n}\n\nfunction warn (condition, message) {\n if (!condition) {\n typeof console !== 'undefined' && console.warn((\"[vue-router] \" + message));\n }\n}\n\nfunction extend (a, b) {\n for (var key in b) {\n a[key] = b[key];\n }\n return a\n}\n\n/* */\n\nvar encodeReserveRE = /[!'()*]/g;\nvar encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };\nvar commaRE = /%2C/g;\n\n// fixed encodeURIComponent which is more conformant to RFC3986:\n// - escapes [!'()*]\n// - preserve commas\nvar encode = function (str) { return encodeURIComponent(str)\n .replace(encodeReserveRE, encodeReserveReplacer)\n .replace(commaRE, ','); };\n\nfunction decode (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"Error decoding \\\"\" + str + \"\\\". Leaving it intact.\"));\n }\n }\n return str\n}\n\nfunction resolveQuery (\n query,\n extraQuery,\n _parseQuery\n) {\n if ( extraQuery === void 0 ) extraQuery = {};\n\n var parse = _parseQuery || parseQuery;\n var parsedQuery;\n try {\n parsedQuery = parse(query || '');\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn(false, e.message);\n parsedQuery = {};\n }\n for (var key in extraQuery) {\n var value = extraQuery[key];\n parsedQuery[key] = Array.isArray(value)\n ? value.map(castQueryParamValue)\n : castQueryParamValue(value);\n }\n return parsedQuery\n}\n\nvar castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };\n\nfunction parseQuery (query) {\n var res = {};\n\n query = query.trim().replace(/^(\\?|#|&)/, '');\n\n if (!query) {\n return res\n }\n\n query.split('&').forEach(function (param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = decode(parts.shift());\n var val = parts.length > 0 ? decode(parts.join('=')) : null;\n\n if (res[key] === undefined) {\n res[key] = val;\n } else if (Array.isArray(res[key])) {\n res[key].push(val);\n } else {\n res[key] = [res[key], val];\n }\n });\n\n return res\n}\n\nfunction stringifyQuery (obj) {\n var res = obj\n ? Object.keys(obj)\n .map(function (key) {\n var val = obj[key];\n\n if (val === undefined) {\n return ''\n }\n\n if (val === null) {\n return encode(key)\n }\n\n if (Array.isArray(val)) {\n var result = [];\n val.forEach(function (val2) {\n if (val2 === undefined) {\n return\n }\n if (val2 === null) {\n result.push(encode(key));\n } else {\n result.push(encode(key) + '=' + encode(val2));\n }\n });\n return result.join('&')\n }\n\n return encode(key) + '=' + encode(val)\n })\n .filter(function (x) { return x.length > 0; })\n .join('&')\n : null;\n return res ? (\"?\" + res) : ''\n}\n\n/* */\n\nvar trailingSlashRE = /\\/?$/;\n\nfunction createRoute (\n record,\n location,\n redirectedFrom,\n router\n) {\n var stringifyQuery = router && router.options.stringifyQuery;\n\n var query = location.query || {};\n try {\n query = clone(query);\n } catch (e) {}\n\n var route = {\n name: location.name || (record && record.name),\n meta: (record && record.meta) || {},\n path: location.path || '/',\n hash: location.hash || '',\n query: query,\n params: location.params || {},\n fullPath: getFullPath(location, stringifyQuery),\n matched: record ? formatMatch(record) : []\n };\n if (redirectedFrom) {\n route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);\n }\n return Object.freeze(route)\n}\n\nfunction clone (value) {\n if (Array.isArray(value)) {\n return value.map(clone)\n } else if (value && typeof value === 'object') {\n var res = {};\n for (var key in value) {\n res[key] = clone(value[key]);\n }\n return res\n } else {\n return value\n }\n}\n\n// the starting route that represents the initial state\nvar START = createRoute(null, {\n path: '/'\n});\n\nfunction formatMatch (record) {\n var res = [];\n while (record) {\n res.unshift(record);\n record = record.parent;\n }\n return res\n}\n\nfunction getFullPath (\n ref,\n _stringifyQuery\n) {\n var path = ref.path;\n var query = ref.query; if ( query === void 0 ) query = {};\n var hash = ref.hash; if ( hash === void 0 ) hash = '';\n\n var stringify = _stringifyQuery || stringifyQuery;\n return (path || '/') + stringify(query) + hash\n}\n\nfunction isSameRoute (a, b, onlyPath) {\n if (b === START) {\n return a === b\n } else if (!b) {\n return false\n } else if (a.path && b.path) {\n return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query))\n } else if (a.name && b.name) {\n return (\n a.name === b.name &&\n (onlyPath || (\n a.hash === b.hash &&\n isObjectEqual(a.query, b.query) &&\n isObjectEqual(a.params, b.params))\n )\n )\n } else {\n return false\n }\n}\n\nfunction isObjectEqual (a, b) {\n if ( a === void 0 ) a = {};\n if ( b === void 0 ) b = {};\n\n // handle null value #1566\n if (!a || !b) { return a === b }\n var aKeys = Object.keys(a).sort();\n var bKeys = Object.keys(b).sort();\n if (aKeys.length !== bKeys.length) {\n return false\n }\n return aKeys.every(function (key, i) {\n var aVal = a[key];\n var bKey = bKeys[i];\n if (bKey !== key) { return false }\n var bVal = b[key];\n // query values can be null and undefined\n if (aVal == null || bVal == null) { return aVal === bVal }\n // check nested equality\n if (typeof aVal === 'object' && typeof bVal === 'object') {\n return isObjectEqual(aVal, bVal)\n }\n return String(aVal) === String(bVal)\n })\n}\n\nfunction isIncludedRoute (current, target) {\n return (\n current.path.replace(trailingSlashRE, '/').indexOf(\n target.path.replace(trailingSlashRE, '/')\n ) === 0 &&\n (!target.hash || current.hash === target.hash) &&\n queryIncludes(current.query, target.query)\n )\n}\n\nfunction queryIncludes (current, target) {\n for (var key in target) {\n if (!(key in current)) {\n return false\n }\n }\n return true\n}\n\nfunction handleRouteEntered (route) {\n for (var i = 0; i < route.matched.length; i++) {\n var record = route.matched[i];\n for (var name in record.instances) {\n var instance = record.instances[name];\n var cbs = record.enteredCbs[name];\n if (!instance || !cbs) { continue }\n delete record.enteredCbs[name];\n for (var i$1 = 0; i$1 < cbs.length; i$1++) {\n if (!instance._isBeingDestroyed) { cbs[i$1](instance); }\n }\n }\n }\n}\n\nvar View = {\n name: 'RouterView',\n functional: true,\n props: {\n name: {\n type: String,\n default: 'default'\n }\n },\n render: function render (_, ref) {\n var props = ref.props;\n var children = ref.children;\n var parent = ref.parent;\n var data = ref.data;\n\n // used by devtools to display a router-view badge\n data.routerView = true;\n\n // directly use parent context's createElement() function\n // so that components rendered by router-view can resolve named slots\n var h = parent.$createElement;\n var name = props.name;\n var route = parent.$route;\n var cache = parent._routerViewCache || (parent._routerViewCache = {});\n\n // determine current view depth, also check to see if the tree\n // has been toggled inactive but kept-alive.\n var depth = 0;\n var inactive = false;\n while (parent && parent._routerRoot !== parent) {\n var vnodeData = parent.$vnode ? parent.$vnode.data : {};\n if (vnodeData.routerView) {\n depth++;\n }\n if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {\n inactive = true;\n }\n parent = parent.$parent;\n }\n data.routerViewDepth = depth;\n\n // render previous view if the tree is inactive and kept-alive\n if (inactive) {\n var cachedData = cache[name];\n var cachedComponent = cachedData && cachedData.component;\n if (cachedComponent) {\n // #2301\n // pass props\n if (cachedData.configProps) {\n fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);\n }\n return h(cachedComponent, data, children)\n } else {\n // render previous empty view\n return h()\n }\n }\n\n var matched = route.matched[depth];\n var component = matched && matched.components[name];\n\n // render empty node if no matched route or no config component\n if (!matched || !component) {\n cache[name] = null;\n return h()\n }\n\n // cache component\n cache[name] = { component: component };\n\n // attach instance registration hook\n // this will be called in the instance's injected lifecycle hooks\n data.registerRouteInstance = function (vm, val) {\n // val could be undefined for unregistration\n var current = matched.instances[name];\n if (\n (val && current !== vm) ||\n (!val && current === vm)\n ) {\n matched.instances[name] = val;\n }\n }\n\n // also register instance in prepatch hook\n // in case the same component instance is reused across different routes\n ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {\n matched.instances[name] = vnode.componentInstance;\n };\n\n // register instance in init hook\n // in case kept-alive component be actived when routes changed\n data.hook.init = function (vnode) {\n if (vnode.data.keepAlive &&\n vnode.componentInstance &&\n vnode.componentInstance !== matched.instances[name]\n ) {\n matched.instances[name] = vnode.componentInstance;\n }\n\n // if the route transition has already been confirmed then we weren't\n // able to call the cbs during confirmation as the component was not\n // registered yet, so we call it here.\n handleRouteEntered(route);\n };\n\n var configProps = matched.props && matched.props[name];\n // save route and configProps in cache\n if (configProps) {\n extend(cache[name], {\n route: route,\n configProps: configProps\n });\n fillPropsinData(component, data, route, configProps);\n }\n\n return h(component, data, children)\n }\n};\n\nfunction fillPropsinData (component, data, route, configProps) {\n // resolve props\n var propsToPass = data.props = resolveProps(route, configProps);\n if (propsToPass) {\n // clone to prevent mutation\n propsToPass = data.props = extend({}, propsToPass);\n // pass non-declared props as attrs\n var attrs = data.attrs = data.attrs || {};\n for (var key in propsToPass) {\n if (!component.props || !(key in component.props)) {\n attrs[key] = propsToPass[key];\n delete propsToPass[key];\n }\n }\n }\n}\n\nfunction resolveProps (route, config) {\n switch (typeof config) {\n case 'undefined':\n return\n case 'object':\n return config\n case 'function':\n return config(route)\n case 'boolean':\n return config ? route.params : undefined\n default:\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n \"props in \\\"\" + (route.path) + \"\\\" is a \" + (typeof config) + \", \" +\n \"expecting an object, function or boolean.\"\n );\n }\n }\n}\n\n/* */\n\nfunction resolvePath (\n relative,\n base,\n append\n) {\n var firstChar = relative.charAt(0);\n if (firstChar === '/') {\n return relative\n }\n\n if (firstChar === '?' || firstChar === '#') {\n return base + relative\n }\n\n var stack = base.split('/');\n\n // remove trailing segment if:\n // - not appending\n // - appending to trailing slash (last segment is empty)\n if (!append || !stack[stack.length - 1]) {\n stack.pop();\n }\n\n // resolve relative path\n var segments = relative.replace(/^\\//, '').split('/');\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n if (segment === '..') {\n stack.pop();\n } else if (segment !== '.') {\n stack.push(segment);\n }\n }\n\n // ensure leading slash\n if (stack[0] !== '') {\n stack.unshift('');\n }\n\n return stack.join('/')\n}\n\nfunction parsePath (path) {\n var hash = '';\n var query = '';\n\n var hashIndex = path.indexOf('#');\n if (hashIndex >= 0) {\n hash = path.slice(hashIndex);\n path = path.slice(0, hashIndex);\n }\n\n var queryIndex = path.indexOf('?');\n if (queryIndex >= 0) {\n query = path.slice(queryIndex + 1);\n path = path.slice(0, queryIndex);\n }\n\n return {\n path: path,\n query: query,\n hash: hash\n }\n}\n\nfunction cleanPath (path) {\n return path.replace(/\\/+/g, '/')\n}\n\nvar isarray = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n/**\n * Expose `pathToRegexp`.\n */\nvar pathToRegexp_1 = pathToRegexp;\nvar parse_1 = parse;\nvar compile_1 = compile;\nvar tokensToFunction_1 = tokensToFunction;\nvar tokensToRegExp_1 = tokensToRegExp;\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \"/:test(\\\\d+)?\" => [\"/\", \"test\", \"\\d+\", undefined, \"?\", undefined]\n // \"/route(\\\\d+)\" => [undefined, undefined, undefined, \"\\d+\", undefined, undefined]\n // \"/*\" => [\"/\", undefined, undefined, undefined, undefined, \"*\"]\n '([\\\\/.])?(?:(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?|(\\\\*))'\n].join('|'), 'g');\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = [];\n var key = 0;\n var index = 0;\n var path = '';\n var defaultDelimiter = options && options.delimiter || '/';\n var res;\n\n while ((res = PATH_REGEXP.exec(str)) != null) {\n var m = res[0];\n var escaped = res[1];\n var offset = res.index;\n path += str.slice(index, offset);\n index = offset + m.length;\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1];\n continue\n }\n\n var next = str[index];\n var prefix = res[2];\n var name = res[3];\n var capture = res[4];\n var group = res[5];\n var modifier = res[6];\n var asterisk = res[7];\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path);\n path = '';\n }\n\n var partial = prefix != null && next != null && next !== prefix;\n var repeat = modifier === '+' || modifier === '*';\n var optional = modifier === '?' || modifier === '*';\n var delimiter = res[2] || defaultDelimiter;\n var pattern = capture || group;\n\n tokens.push({\n name: name || key++,\n prefix: prefix || '',\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n partial: partial,\n asterisk: !!asterisk,\n pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')\n });\n }\n\n // Match any characters still remaining.\n if (index < str.length) {\n path += str.substr(index);\n }\n\n // If the path exists, push it onto the end.\n if (path) {\n tokens.push(path);\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Prettier encoding of URI path segments.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeURIComponentPretty (str) {\n return encodeURI(str).replace(/[\\/?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.\n *\n * @param {string}\n * @return {string}\n */\nfunction encodeAsterisk (str) {\n return encodeURI(str).replace(/[?#]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n var path = '';\n var data = obj || {};\n var options = opts || {};\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|\\/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$\\/()])/g, '\\\\$1')\n}\n\n/**\n * Attach the keys as a property of the regexp.\n *\n * @param {!RegExp} re\n * @param {Array} keys\n * @return {!RegExp}\n */\nfunction attachKeys (re, keys) {\n re.keys = keys;\n return re\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {!Array} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n partial: false,\n asterisk: false,\n pattern: null\n });\n }\n }\n\n return attachKeys(path, keys)\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = [];\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source);\n }\n\n var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));\n\n return attachKeys(regexp, keys)\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {!Array} keys\n * @param {!Object} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n var strict = options.strict;\n var end = options.end !== false;\n var route = '';\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n route += escapeString(token);\n } else {\n var prefix = escapeString(token.prefix);\n var capture = '(?:' + token.pattern + ')';\n\n keys.push(token);\n\n if (token.repeat) {\n capture += '(?:' + prefix + capture + ')*';\n }\n\n if (token.optional) {\n if (!token.partial) {\n capture = '(?:' + prefix + '(' + capture + '))?';\n } else {\n capture = prefix + '(' + capture + ')?';\n }\n } else {\n capture = prefix + '(' + capture + ')';\n }\n\n route += capture;\n }\n }\n\n var delimiter = escapeString(options.delimiter || '/');\n var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;\n\n // In non-strict mode we allow a slash at the end of match. If the path to\n // match already ends with a slash, we remove it for consistency. The slash\n // is valid at the end of a path match, not in the middle. This is important\n // in non-ending mode, where \"/test/\" shouldn't match \"/test//route\".\n if (!strict) {\n route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';\n }\n\n if (end) {\n route += '$';\n } else {\n // In non-ending mode, we need the capturing groups to match as much as\n // possible by using a positive lookahead to the end or next path segment.\n route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';\n }\n\n return attachKeys(new RegExp('^' + route, flags(options)), keys)\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {(Array|Object)=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (!isarray(keys)) {\n options = /** @type {!Object} */ (keys || options);\n keys = [];\n }\n\n options = options || {};\n\n if (path instanceof RegExp) {\n return regexpToRegexp(path, /** @type {!Array} */ (keys))\n }\n\n if (isarray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)\n}\npathToRegexp_1.parse = parse_1;\npathToRegexp_1.compile = compile_1;\npathToRegexp_1.tokensToFunction = tokensToFunction_1;\npathToRegexp_1.tokensToRegExp = tokensToRegExp_1;\n\n/* */\n\n// $flow-disable-line\nvar regexpCompileCache = Object.create(null);\n\nfunction fillParams (\n path,\n params,\n routeMsg\n) {\n params = params || {};\n try {\n var filler =\n regexpCompileCache[path] ||\n (regexpCompileCache[path] = pathToRegexp_1.compile(path));\n\n // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}\n // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string\n if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }\n\n return filler(params, { pretty: true })\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n // Fix #3072 no warn if `pathMatch` is string\n warn(typeof params.pathMatch === 'string', (\"missing param for \" + routeMsg + \": \" + (e.message)));\n }\n return ''\n } finally {\n // delete the 0 if it was added\n delete params[0];\n }\n}\n\n/* */\n\nfunction normalizeLocation (\n raw,\n current,\n append,\n router\n) {\n var next = typeof raw === 'string' ? { path: raw } : raw;\n // named target\n if (next._normalized) {\n return next\n } else if (next.name) {\n next = extend({}, raw);\n var params = next.params;\n if (params && typeof params === 'object') {\n next.params = extend({}, params);\n }\n return next\n }\n\n // relative params\n if (!next.path && next.params && current) {\n next = extend({}, next);\n next._normalized = true;\n var params$1 = extend(extend({}, current.params), next.params);\n if (current.name) {\n next.name = current.name;\n next.params = params$1;\n } else if (current.matched.length) {\n var rawPath = current.matched[current.matched.length - 1].path;\n next.path = fillParams(rawPath, params$1, (\"path \" + (current.path)));\n } else if (process.env.NODE_ENV !== 'production') {\n warn(false, \"relative params navigation requires a current route.\");\n }\n return next\n }\n\n var parsedPath = parsePath(next.path || '');\n var basePath = (current && current.path) || '/';\n var path = parsedPath.path\n ? resolvePath(parsedPath.path, basePath, append || next.append)\n : basePath;\n\n var query = resolveQuery(\n parsedPath.query,\n next.query,\n router && router.options.parseQuery\n );\n\n var hash = next.hash || parsedPath.hash;\n if (hash && hash.charAt(0) !== '#') {\n hash = \"#\" + hash;\n }\n\n return {\n _normalized: true,\n path: path,\n query: query,\n hash: hash\n }\n}\n\n/* */\n\n// work around weird flow bug\nvar toTypes = [String, Object];\nvar eventTypes = [String, Array];\n\nvar noop = function () {};\n\nvar warnedCustomSlot;\nvar warnedTagProp;\nvar warnedEventProp;\n\nvar Link = {\n name: 'RouterLink',\n props: {\n to: {\n type: toTypes,\n required: true\n },\n tag: {\n type: String,\n default: 'a'\n },\n custom: Boolean,\n exact: Boolean,\n exactPath: Boolean,\n append: Boolean,\n replace: Boolean,\n activeClass: String,\n exactActiveClass: String,\n ariaCurrentValue: {\n type: String,\n default: 'page'\n },\n event: {\n type: eventTypes,\n default: 'click'\n }\n },\n render: function render (h) {\n var this$1 = this;\n\n var router = this.$router;\n var current = this.$route;\n var ref = router.resolve(\n this.to,\n current,\n this.append\n );\n var location = ref.location;\n var route = ref.route;\n var href = ref.href;\n\n var classes = {};\n var globalActiveClass = router.options.linkActiveClass;\n var globalExactActiveClass = router.options.linkExactActiveClass;\n // Support global empty active class\n var activeClassFallback =\n globalActiveClass == null ? 'router-link-active' : globalActiveClass;\n var exactActiveClassFallback =\n globalExactActiveClass == null\n ? 'router-link-exact-active'\n : globalExactActiveClass;\n var activeClass =\n this.activeClass == null ? activeClassFallback : this.activeClass;\n var exactActiveClass =\n this.exactActiveClass == null\n ? exactActiveClassFallback\n : this.exactActiveClass;\n\n var compareTarget = route.redirectedFrom\n ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)\n : route;\n\n classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);\n classes[activeClass] = this.exact || this.exactPath\n ? classes[exactActiveClass]\n : isIncludedRoute(current, compareTarget);\n\n var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;\n\n var handler = function (e) {\n if (guardEvent(e)) {\n if (this$1.replace) {\n router.replace(location, noop);\n } else {\n router.push(location, noop);\n }\n }\n };\n\n var on = { click: guardEvent };\n if (Array.isArray(this.event)) {\n this.event.forEach(function (e) {\n on[e] = handler;\n });\n } else {\n on[this.event] = handler;\n }\n\n var data = { class: classes };\n\n var scopedSlot =\n !this.$scopedSlots.$hasNormal &&\n this.$scopedSlots.default &&\n this.$scopedSlots.default({\n href: href,\n route: route,\n navigate: handler,\n isActive: classes[activeClass],\n isExactActive: classes[exactActiveClass]\n });\n\n if (scopedSlot) {\n if (process.env.NODE_ENV !== 'production' && !this.custom) {\n !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an element. Use the custom prop to remove this warning:\\n\\n');\n warnedCustomSlot = true;\n }\n if (scopedSlot.length === 1) {\n return scopedSlot[0]\n } else if (scopedSlot.length > 1 || !scopedSlot.length) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false,\n (\" with to=\\\"\" + (this.to) + \"\\\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.\")\n );\n }\n return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if ('tag' in this.$options.propsData && !warnedTagProp) {\n warn(\n false,\n \"'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedTagProp = true;\n }\n if ('event' in this.$options.propsData && !warnedEventProp) {\n warn(\n false,\n \"'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.\"\n );\n warnedEventProp = true;\n }\n }\n\n if (this.tag === 'a') {\n data.on = on;\n data.attrs = { href: href, 'aria-current': ariaCurrentValue };\n } else {\n // find the first child and apply listener and href\n var a = findAnchor(this.$slots.default);\n if (a) {\n // in case the is a static node\n a.isStatic = false;\n var aData = (a.data = extend({}, a.data));\n aData.on = aData.on || {};\n // transform existing events in both objects into arrays so we can push later\n for (var event in aData.on) {\n var handler$1 = aData.on[event];\n if (event in on) {\n aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];\n }\n }\n // append new listeners for router-link\n for (var event$1 in on) {\n if (event$1 in aData.on) {\n // on[event] is always a function\n aData.on[event$1].push(on[event$1]);\n } else {\n aData.on[event$1] = handler;\n }\n }\n\n var aAttrs = (a.data.attrs = extend({}, a.data.attrs));\n aAttrs.href = href;\n aAttrs['aria-current'] = ariaCurrentValue;\n } else {\n // doesn't have child, apply listener to self\n data.on = on;\n }\n }\n\n return h(this.tag, data, this.$slots.default)\n }\n};\n\nfunction guardEvent (e) {\n // don't redirect with control keys\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }\n // don't redirect when preventDefault called\n if (e.defaultPrevented) { return }\n // don't redirect on right click\n if (e.button !== undefined && e.button !== 0) { return }\n // don't redirect if `target=\"_blank\"`\n if (e.currentTarget && e.currentTarget.getAttribute) {\n var target = e.currentTarget.getAttribute('target');\n if (/\\b_blank\\b/i.test(target)) { return }\n }\n // this may be a Weex event which doesn't have this method\n if (e.preventDefault) {\n e.preventDefault();\n }\n return true\n}\n\nfunction findAnchor (children) {\n if (children) {\n var child;\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n if (child.tag === 'a') {\n return child\n }\n if (child.children && (child = findAnchor(child.children))) {\n return child\n }\n }\n }\n}\n\nvar _Vue;\n\nfunction install (Vue) {\n if (install.installed && _Vue === Vue) { return }\n install.installed = true;\n\n _Vue = Vue;\n\n var isDef = function (v) { return v !== undefined; };\n\n var registerInstance = function (vm, callVal) {\n var i = vm.$options._parentVnode;\n if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {\n i(vm, callVal);\n }\n };\n\n Vue.mixin({\n beforeCreate: function beforeCreate () {\n if (isDef(this.$options.router)) {\n this._routerRoot = this;\n this._router = this.$options.router;\n this._router.init(this);\n Vue.util.defineReactive(this, '_route', this._router.history.current);\n } else {\n this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;\n }\n registerInstance(this, this);\n },\n destroyed: function destroyed () {\n registerInstance(this);\n }\n });\n\n Object.defineProperty(Vue.prototype, '$router', {\n get: function get () { return this._routerRoot._router }\n });\n\n Object.defineProperty(Vue.prototype, '$route', {\n get: function get () { return this._routerRoot._route }\n });\n\n Vue.component('RouterView', View);\n Vue.component('RouterLink', Link);\n\n var strats = Vue.config.optionMergeStrategies;\n // use the same hook merging strategy for route hooks\n strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;\n}\n\n/* */\n\nvar inBrowser = typeof window !== 'undefined';\n\n/* */\n\nfunction createRouteMap (\n routes,\n oldPathList,\n oldPathMap,\n oldNameMap,\n parentRoute\n) {\n // the path list is used to control path matching priority\n var pathList = oldPathList || [];\n // $flow-disable-line\n var pathMap = oldPathMap || Object.create(null);\n // $flow-disable-line\n var nameMap = oldNameMap || Object.create(null);\n\n routes.forEach(function (route) {\n addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);\n });\n\n // ensure wildcard routes are always at the end\n for (var i = 0, l = pathList.length; i < l; i++) {\n if (pathList[i] === '*') {\n pathList.push(pathList.splice(i, 1)[0]);\n l--;\n i--;\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n // warn if routes do not include leading slashes\n var found = pathList\n // check for missing leading slash\n .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });\n\n if (found.length > 0) {\n var pathNames = found.map(function (path) { return (\"- \" + path); }).join('\\n');\n warn(false, (\"Non-nested routes must include a leading slash character. Fix the following routes: \\n\" + pathNames));\n }\n }\n\n return {\n pathList: pathList,\n pathMap: pathMap,\n nameMap: nameMap\n }\n}\n\nfunction addRouteRecord (\n pathList,\n pathMap,\n nameMap,\n route,\n parent,\n matchAs\n) {\n var path = route.path;\n var name = route.name;\n if (process.env.NODE_ENV !== 'production') {\n assert(path != null, \"\\\"path\\\" is required in a route configuration.\");\n assert(\n typeof route.component !== 'string',\n \"route config \\\"component\\\" for path: \" + (String(\n path || name\n )) + \" cannot be a \" + \"string id. Use an actual component instead.\"\n );\n\n warn(\n // eslint-disable-next-line no-control-regex\n !/[^\\u0000-\\u007F]+/.test(path),\n \"Route with path \\\"\" + path + \"\\\" contains unencoded characters, make sure \" +\n \"your path is correctly encoded before passing it to the router. Use \" +\n \"encodeURI to encode static segments of your path.\"\n );\n }\n\n var pathToRegexpOptions =\n route.pathToRegexpOptions || {};\n var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);\n\n if (typeof route.caseSensitive === 'boolean') {\n pathToRegexpOptions.sensitive = route.caseSensitive;\n }\n\n var record = {\n path: normalizedPath,\n regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),\n components: route.components || { default: route.component },\n alias: route.alias\n ? typeof route.alias === 'string'\n ? [route.alias]\n : route.alias\n : [],\n instances: {},\n enteredCbs: {},\n name: name,\n parent: parent,\n matchAs: matchAs,\n redirect: route.redirect,\n beforeEnter: route.beforeEnter,\n meta: route.meta || {},\n props:\n route.props == null\n ? {}\n : route.components\n ? route.props\n : { default: route.props }\n };\n\n if (route.children) {\n // Warn if route is named, does not redirect and has a default child route.\n // If users navigate to this route by name, the default child will\n // not be rendered (GH Issue #629)\n if (process.env.NODE_ENV !== 'production') {\n if (\n route.name &&\n !route.redirect &&\n route.children.some(function (child) { return /^\\/?$/.test(child.path); })\n ) {\n warn(\n false,\n \"Named Route '\" + (route.name) + \"' has a default child route. \" +\n \"When navigating to this named route (:to=\\\"{name: '\" + (route.name) + \"'\\\"), \" +\n \"the default child route will not be rendered. Remove the name from \" +\n \"this route and use the name of the default child route for named \" +\n \"links instead.\"\n );\n }\n }\n route.children.forEach(function (child) {\n var childMatchAs = matchAs\n ? cleanPath((matchAs + \"/\" + (child.path)))\n : undefined;\n addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);\n });\n }\n\n if (!pathMap[record.path]) {\n pathList.push(record.path);\n pathMap[record.path] = record;\n }\n\n if (route.alias !== undefined) {\n var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];\n for (var i = 0; i < aliases.length; ++i) {\n var alias = aliases[i];\n if (process.env.NODE_ENV !== 'production' && alias === path) {\n warn(\n false,\n (\"Found an alias with the same value as the path: \\\"\" + path + \"\\\". You have to remove that alias. It will be ignored in development.\")\n );\n // skip in dev to make it work\n continue\n }\n\n var aliasRoute = {\n path: alias,\n children: route.children\n };\n addRouteRecord(\n pathList,\n pathMap,\n nameMap,\n aliasRoute,\n parent,\n record.path || '/' // matchAs\n );\n }\n }\n\n if (name) {\n if (!nameMap[name]) {\n nameMap[name] = record;\n } else if (process.env.NODE_ENV !== 'production' && !matchAs) {\n warn(\n false,\n \"Duplicate named routes definition: \" +\n \"{ name: \\\"\" + name + \"\\\", path: \\\"\" + (record.path) + \"\\\" }\"\n );\n }\n }\n}\n\nfunction compileRouteRegex (\n path,\n pathToRegexpOptions\n) {\n var regex = pathToRegexp_1(path, [], pathToRegexpOptions);\n if (process.env.NODE_ENV !== 'production') {\n var keys = Object.create(null);\n regex.keys.forEach(function (key) {\n warn(\n !keys[key.name],\n (\"Duplicate param keys in route with path: \\\"\" + path + \"\\\"\")\n );\n keys[key.name] = true;\n });\n }\n return regex\n}\n\nfunction normalizePath (\n path,\n parent,\n strict\n) {\n if (!strict) { path = path.replace(/\\/$/, ''); }\n if (path[0] === '/') { return path }\n if (parent == null) { return path }\n return cleanPath(((parent.path) + \"/\" + path))\n}\n\n/* */\n\n\n\nfunction createMatcher (\n routes,\n router\n) {\n var ref = createRouteMap(routes);\n var pathList = ref.pathList;\n var pathMap = ref.pathMap;\n var nameMap = ref.nameMap;\n\n function addRoutes (routes) {\n createRouteMap(routes, pathList, pathMap, nameMap);\n }\n\n function addRoute (parentOrRoute, route) {\n var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;\n // $flow-disable-line\n createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);\n\n // add aliases of parent\n if (parent && parent.alias.length) {\n createRouteMap(\n // $flow-disable-line route is defined if parent is\n parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),\n pathList,\n pathMap,\n nameMap,\n parent\n );\n }\n }\n\n function getRoutes () {\n return pathList.map(function (path) { return pathMap[path]; })\n }\n\n function match (\n raw,\n currentRoute,\n redirectedFrom\n ) {\n var location = normalizeLocation(raw, currentRoute, false, router);\n var name = location.name;\n\n if (name) {\n var record = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n warn(record, (\"Route with name '\" + name + \"' does not exist\"));\n }\n if (!record) { return _createRoute(null, location) }\n var paramNames = record.regex.keys\n .filter(function (key) { return !key.optional; })\n .map(function (key) { return key.name; });\n\n if (typeof location.params !== 'object') {\n location.params = {};\n }\n\n if (currentRoute && typeof currentRoute.params === 'object') {\n for (var key in currentRoute.params) {\n if (!(key in location.params) && paramNames.indexOf(key) > -1) {\n location.params[key] = currentRoute.params[key];\n }\n }\n }\n\n location.path = fillParams(record.path, location.params, (\"named route \\\"\" + name + \"\\\"\"));\n return _createRoute(record, location, redirectedFrom)\n } else if (location.path) {\n location.params = {};\n for (var i = 0; i < pathList.length; i++) {\n var path = pathList[i];\n var record$1 = pathMap[path];\n if (matchRoute(record$1.regex, location.path, location.params)) {\n return _createRoute(record$1, location, redirectedFrom)\n }\n }\n }\n // no match\n return _createRoute(null, location)\n }\n\n function redirect (\n record,\n location\n ) {\n var originalRedirect = record.redirect;\n var redirect = typeof originalRedirect === 'function'\n ? originalRedirect(createRoute(record, location, null, router))\n : originalRedirect;\n\n if (typeof redirect === 'string') {\n redirect = { path: redirect };\n }\n\n if (!redirect || typeof redirect !== 'object') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\n false, (\"invalid redirect option: \" + (JSON.stringify(redirect)))\n );\n }\n return _createRoute(null, location)\n }\n\n var re = redirect;\n var name = re.name;\n var path = re.path;\n var query = location.query;\n var hash = location.hash;\n var params = location.params;\n query = re.hasOwnProperty('query') ? re.query : query;\n hash = re.hasOwnProperty('hash') ? re.hash : hash;\n params = re.hasOwnProperty('params') ? re.params : params;\n\n if (name) {\n // resolved named direct\n var targetRecord = nameMap[name];\n if (process.env.NODE_ENV !== 'production') {\n assert(targetRecord, (\"redirect failed: named route \\\"\" + name + \"\\\" not found.\"));\n }\n return match({\n _normalized: true,\n name: name,\n query: query,\n hash: hash,\n params: params\n }, undefined, location)\n } else if (path) {\n // 1. resolve relative redirect\n var rawPath = resolveRecordPath(path, record);\n // 2. resolve params\n var resolvedPath = fillParams(rawPath, params, (\"redirect route with path \\\"\" + rawPath + \"\\\"\"));\n // 3. rematch with existing query and hash\n return match({\n _normalized: true,\n path: resolvedPath,\n query: query,\n hash: hash\n }, undefined, location)\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, (\"invalid redirect option: \" + (JSON.stringify(redirect))));\n }\n return _createRoute(null, location)\n }\n }\n\n function alias (\n record,\n location,\n matchAs\n ) {\n var aliasedPath = fillParams(matchAs, location.params, (\"aliased route with path \\\"\" + matchAs + \"\\\"\"));\n var aliasedMatch = match({\n _normalized: true,\n path: aliasedPath\n });\n if (aliasedMatch) {\n var matched = aliasedMatch.matched;\n var aliasedRecord = matched[matched.length - 1];\n location.params = aliasedMatch.params;\n return _createRoute(aliasedRecord, location)\n }\n return _createRoute(null, location)\n }\n\n function _createRoute (\n record,\n location,\n redirectedFrom\n ) {\n if (record && record.redirect) {\n return redirect(record, redirectedFrom || location)\n }\n if (record && record.matchAs) {\n return alias(record, location, record.matchAs)\n }\n return createRoute(record, location, redirectedFrom, router)\n }\n\n return {\n match: match,\n addRoute: addRoute,\n getRoutes: getRoutes,\n addRoutes: addRoutes\n }\n}\n\nfunction matchRoute (\n regex,\n path,\n params\n) {\n var m = path.match(regex);\n\n if (!m) {\n return false\n } else if (!params) {\n return true\n }\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = regex.keys[i - 1];\n if (key) {\n // Fix #1994: using * with props: true generates a param named 0\n params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];\n }\n }\n\n return true\n}\n\nfunction resolveRecordPath (path, record) {\n return resolvePath(path, record.parent ? record.parent.path : '/', true)\n}\n\n/* */\n\n// use User Timing api (if present) for more accurate key precision\nvar Time =\n inBrowser && window.performance && window.performance.now\n ? window.performance\n : Date;\n\nfunction genStateKey () {\n return Time.now().toFixed(3)\n}\n\nvar _key = genStateKey();\n\nfunction getStateKey () {\n return _key\n}\n\nfunction setStateKey (key) {\n return (_key = key)\n}\n\n/* */\n\nvar positionStore = Object.create(null);\n\nfunction setupScroll () {\n // Prevent browser scroll behavior on History popstate\n if ('scrollRestoration' in window.history) {\n window.history.scrollRestoration = 'manual';\n }\n // Fix for #1585 for Firefox\n // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678\n // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with\n // window.location.protocol + '//' + window.location.host\n // location.host contains the port and location.hostname doesn't\n var protocolAndPath = window.location.protocol + '//' + window.location.host;\n var absolutePath = window.location.href.replace(protocolAndPath, '');\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, window.history.state);\n stateCopy.key = getStateKey();\n window.history.replaceState(stateCopy, '', absolutePath);\n window.addEventListener('popstate', handlePopState);\n return function () {\n window.removeEventListener('popstate', handlePopState);\n }\n}\n\nfunction handleScroll (\n router,\n to,\n from,\n isPop\n) {\n if (!router.app) {\n return\n }\n\n var behavior = router.options.scrollBehavior;\n if (!behavior) {\n return\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(typeof behavior === 'function', \"scrollBehavior must be a function\");\n }\n\n // wait until re-render finishes before scrolling\n router.app.$nextTick(function () {\n var position = getScrollPosition();\n var shouldScroll = behavior.call(\n router,\n to,\n from,\n isPop ? position : null\n );\n\n if (!shouldScroll) {\n return\n }\n\n if (typeof shouldScroll.then === 'function') {\n shouldScroll\n .then(function (shouldScroll) {\n scrollToPosition((shouldScroll), position);\n })\n .catch(function (err) {\n if (process.env.NODE_ENV !== 'production') {\n assert(false, err.toString());\n }\n });\n } else {\n scrollToPosition(shouldScroll, position);\n }\n });\n}\n\nfunction saveScrollPosition () {\n var key = getStateKey();\n if (key) {\n positionStore[key] = {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n }\n}\n\nfunction handlePopState (e) {\n saveScrollPosition();\n if (e.state && e.state.key) {\n setStateKey(e.state.key);\n }\n}\n\nfunction getScrollPosition () {\n var key = getStateKey();\n if (key) {\n return positionStore[key]\n }\n}\n\nfunction getElementPosition (el, offset) {\n var docEl = document.documentElement;\n var docRect = docEl.getBoundingClientRect();\n var elRect = el.getBoundingClientRect();\n return {\n x: elRect.left - docRect.left - offset.x,\n y: elRect.top - docRect.top - offset.y\n }\n}\n\nfunction isValidPosition (obj) {\n return isNumber(obj.x) || isNumber(obj.y)\n}\n\nfunction normalizePosition (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : window.pageXOffset,\n y: isNumber(obj.y) ? obj.y : window.pageYOffset\n }\n}\n\nfunction normalizeOffset (obj) {\n return {\n x: isNumber(obj.x) ? obj.x : 0,\n y: isNumber(obj.y) ? obj.y : 0\n }\n}\n\nfunction isNumber (v) {\n return typeof v === 'number'\n}\n\nvar hashStartsWithNumberRE = /^#\\d/;\n\nfunction scrollToPosition (shouldScroll, position) {\n var isObject = typeof shouldScroll === 'object';\n if (isObject && typeof shouldScroll.selector === 'string') {\n // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]\n // but at the same time, it doesn't make much sense to select an element with an id and an extra selector\n var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line\n ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line\n : document.querySelector(shouldScroll.selector);\n\n if (el) {\n var offset =\n shouldScroll.offset && typeof shouldScroll.offset === 'object'\n ? shouldScroll.offset\n : {};\n offset = normalizeOffset(offset);\n position = getElementPosition(el, offset);\n } else if (isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n } else if (isObject && isValidPosition(shouldScroll)) {\n position = normalizePosition(shouldScroll);\n }\n\n if (position) {\n // $flow-disable-line\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n left: position.x,\n top: position.y,\n // $flow-disable-line\n behavior: shouldScroll.behavior\n });\n } else {\n window.scrollTo(position.x, position.y);\n }\n }\n}\n\n/* */\n\nvar supportsPushState =\n inBrowser &&\n (function () {\n var ua = window.navigator.userAgent;\n\n if (\n (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n ) {\n return false\n }\n\n return window.history && typeof window.history.pushState === 'function'\n })();\n\nfunction pushState (url, replace) {\n saveScrollPosition();\n // try...catch the pushState call to get around Safari\n // DOM Exception 18 where it limits to 100 pushState calls\n var history = window.history;\n try {\n if (replace) {\n // preserve existing history state as it could be overriden by the user\n var stateCopy = extend({}, history.state);\n stateCopy.key = getStateKey();\n history.replaceState(stateCopy, '', url);\n } else {\n history.pushState({ key: setStateKey(genStateKey()) }, '', url);\n }\n } catch (e) {\n window.location[replace ? 'replace' : 'assign'](url);\n }\n}\n\nfunction replaceState (url) {\n pushState(url, true);\n}\n\n/* */\n\nfunction runQueue (queue, fn, cb) {\n var step = function (index) {\n if (index >= queue.length) {\n cb();\n } else {\n if (queue[index]) {\n fn(queue[index], function () {\n step(index + 1);\n });\n } else {\n step(index + 1);\n }\n }\n };\n step(0);\n}\n\n// When changing thing, also edit router.d.ts\nvar NavigationFailureType = {\n redirected: 2,\n aborted: 4,\n cancelled: 8,\n duplicated: 16\n};\n\nfunction createNavigationRedirectedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.redirected,\n (\"Redirected when going from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (stringifyRoute(\n to\n )) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createNavigationDuplicatedError (from, to) {\n var error = createRouterError(\n from,\n to,\n NavigationFailureType.duplicated,\n (\"Avoided redundant navigation to current location: \\\"\" + (from.fullPath) + \"\\\".\")\n );\n // backwards compatible with the first introduction of Errors\n error.name = 'NavigationDuplicated';\n return error\n}\n\nfunction createNavigationCancelledError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.cancelled,\n (\"Navigation cancelled from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" with a new navigation.\")\n )\n}\n\nfunction createNavigationAbortedError (from, to) {\n return createRouterError(\n from,\n to,\n NavigationFailureType.aborted,\n (\"Navigation aborted from \\\"\" + (from.fullPath) + \"\\\" to \\\"\" + (to.fullPath) + \"\\\" via a navigation guard.\")\n )\n}\n\nfunction createRouterError (from, to, type, message) {\n var error = new Error(message);\n error._isRouter = true;\n error.from = from;\n error.to = to;\n error.type = type;\n\n return error\n}\n\nvar propertiesToLog = ['params', 'query', 'hash'];\n\nfunction stringifyRoute (to) {\n if (typeof to === 'string') { return to }\n if ('path' in to) { return to.path }\n var location = {};\n propertiesToLog.forEach(function (key) {\n if (key in to) { location[key] = to[key]; }\n });\n return JSON.stringify(location, null, 2)\n}\n\nfunction isError (err) {\n return Object.prototype.toString.call(err).indexOf('Error') > -1\n}\n\nfunction isNavigationFailure (err, errorType) {\n return (\n isError(err) &&\n err._isRouter &&\n (errorType == null || err.type === errorType)\n )\n}\n\n/* */\n\nfunction resolveAsyncComponents (matched) {\n return function (to, from, next) {\n var hasAsync = false;\n var pending = 0;\n var error = null;\n\n flatMapComponents(matched, function (def, _, match, key) {\n // if it's a function and doesn't have cid attached,\n // assume it's an async component resolve function.\n // we are not using Vue's default async resolving mechanism because\n // we want to halt the navigation until the incoming component has been\n // resolved.\n if (typeof def === 'function' && def.cid === undefined) {\n hasAsync = true;\n pending++;\n\n var resolve = once(function (resolvedDef) {\n if (isESModule(resolvedDef)) {\n resolvedDef = resolvedDef.default;\n }\n // save resolved on async factory in case it's used elsewhere\n def.resolved = typeof resolvedDef === 'function'\n ? resolvedDef\n : _Vue.extend(resolvedDef);\n match.components[key] = resolvedDef;\n pending--;\n if (pending <= 0) {\n next();\n }\n });\n\n var reject = once(function (reason) {\n var msg = \"Failed to resolve async component \" + key + \": \" + reason;\n process.env.NODE_ENV !== 'production' && warn(false, msg);\n if (!error) {\n error = isError(reason)\n ? reason\n : new Error(msg);\n next(error);\n }\n });\n\n var res;\n try {\n res = def(resolve, reject);\n } catch (e) {\n reject(e);\n }\n if (res) {\n if (typeof res.then === 'function') {\n res.then(resolve, reject);\n } else {\n // new syntax in Vue 2.3\n var comp = res.component;\n if (comp && typeof comp.then === 'function') {\n comp.then(resolve, reject);\n }\n }\n }\n }\n });\n\n if (!hasAsync) { next(); }\n }\n}\n\nfunction flatMapComponents (\n matched,\n fn\n) {\n return flatten(matched.map(function (m) {\n return Object.keys(m.components).map(function (key) { return fn(\n m.components[key],\n m.instances[key],\n m, key\n ); })\n }))\n}\n\nfunction flatten (arr) {\n return Array.prototype.concat.apply([], arr)\n}\n\nvar hasSymbol =\n typeof Symbol === 'function' &&\n typeof Symbol.toStringTag === 'symbol';\n\nfunction isESModule (obj) {\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')\n}\n\n// in Webpack 2, require.ensure now also returns a Promise\n// so the resolve/reject functions may get called an extra time\n// if the user uses an arrow function shorthand that happens to\n// return that Promise.\nfunction once (fn) {\n var called = false;\n return function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (called) { return }\n called = true;\n return fn.apply(this, args)\n }\n}\n\n/* */\n\nvar History = function History (router, base) {\n this.router = router;\n this.base = normalizeBase(base);\n // start with a route object that stands for \"nowhere\"\n this.current = START;\n this.pending = null;\n this.ready = false;\n this.readyCbs = [];\n this.readyErrorCbs = [];\n this.errorCbs = [];\n this.listeners = [];\n};\n\nHistory.prototype.listen = function listen (cb) {\n this.cb = cb;\n};\n\nHistory.prototype.onReady = function onReady (cb, errorCb) {\n if (this.ready) {\n cb();\n } else {\n this.readyCbs.push(cb);\n if (errorCb) {\n this.readyErrorCbs.push(errorCb);\n }\n }\n};\n\nHistory.prototype.onError = function onError (errorCb) {\n this.errorCbs.push(errorCb);\n};\n\nHistory.prototype.transitionTo = function transitionTo (\n location,\n onComplete,\n onAbort\n) {\n var this$1 = this;\n\n var route;\n // catch redirect option https://github.com/vuejs/vue-router/issues/3201\n try {\n route = this.router.match(location, this.current);\n } catch (e) {\n this.errorCbs.forEach(function (cb) {\n cb(e);\n });\n // Exception should still be thrown\n throw e\n }\n var prev = this.current;\n this.confirmTransition(\n route,\n function () {\n this$1.updateRoute(route);\n onComplete && onComplete(route);\n this$1.ensureURL();\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n\n // fire ready cbs once\n if (!this$1.ready) {\n this$1.ready = true;\n this$1.readyCbs.forEach(function (cb) {\n cb(route);\n });\n }\n },\n function (err) {\n if (onAbort) {\n onAbort(err);\n }\n if (err && !this$1.ready) {\n // Initial redirection should not mark the history as ready yet\n // because it's triggered by the redirection instead\n // https://github.com/vuejs/vue-router/issues/3225\n // https://github.com/vuejs/vue-router/issues/3331\n if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {\n this$1.ready = true;\n this$1.readyErrorCbs.forEach(function (cb) {\n cb(err);\n });\n }\n }\n }\n );\n};\n\nHistory.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {\n var this$1 = this;\n\n var current = this.current;\n this.pending = route;\n var abort = function (err) {\n // changed after adding errors with\n // https://github.com/vuejs/vue-router/pull/3047 before that change,\n // redirect and aborted navigation would produce an err == null\n if (!isNavigationFailure(err) && isError(err)) {\n if (this$1.errorCbs.length) {\n this$1.errorCbs.forEach(function (cb) {\n cb(err);\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'uncaught error during route navigation:');\n }\n console.error(err);\n }\n }\n onAbort && onAbort(err);\n };\n var lastRouteIndex = route.matched.length - 1;\n var lastCurrentIndex = current.matched.length - 1;\n if (\n isSameRoute(route, current) &&\n // in the case the route map has been dynamically appended to\n lastRouteIndex === lastCurrentIndex &&\n route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]\n ) {\n this.ensureURL();\n if (route.hash) {\n handleScroll(this.router, current, route, false);\n }\n return abort(createNavigationDuplicatedError(current, route))\n }\n\n var ref = resolveQueue(\n this.current.matched,\n route.matched\n );\n var updated = ref.updated;\n var deactivated = ref.deactivated;\n var activated = ref.activated;\n\n var queue = [].concat(\n // in-component leave guards\n extractLeaveGuards(deactivated),\n // global before hooks\n this.router.beforeHooks,\n // in-component update hooks\n extractUpdateHooks(updated),\n // in-config enter guards\n activated.map(function (m) { return m.beforeEnter; }),\n // async components\n resolveAsyncComponents(activated)\n );\n\n var iterator = function (hook, next) {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n try {\n hook(route, current, function (to) {\n if (to === false) {\n // next(false) -> abort navigation, ensure current URL\n this$1.ensureURL(true);\n abort(createNavigationAbortedError(current, route));\n } else if (isError(to)) {\n this$1.ensureURL(true);\n abort(to);\n } else if (\n typeof to === 'string' ||\n (typeof to === 'object' &&\n (typeof to.path === 'string' || typeof to.name === 'string'))\n ) {\n // next('/') or next({ path: '/' }) -> redirect\n abort(createNavigationRedirectedError(current, route));\n if (typeof to === 'object' && to.replace) {\n this$1.replace(to);\n } else {\n this$1.push(to);\n }\n } else {\n // confirm transition and pass on the value\n next(to);\n }\n });\n } catch (e) {\n abort(e);\n }\n };\n\n runQueue(queue, iterator, function () {\n // wait until async components are resolved before\n // extracting in-component enter guards\n var enterGuards = extractEnterGuards(activated);\n var queue = enterGuards.concat(this$1.router.resolveHooks);\n runQueue(queue, iterator, function () {\n if (this$1.pending !== route) {\n return abort(createNavigationCancelledError(current, route))\n }\n this$1.pending = null;\n onComplete(route);\n if (this$1.router.app) {\n this$1.router.app.$nextTick(function () {\n handleRouteEntered(route);\n });\n }\n });\n });\n};\n\nHistory.prototype.updateRoute = function updateRoute (route) {\n this.current = route;\n this.cb && this.cb(route);\n};\n\nHistory.prototype.setupListeners = function setupListeners () {\n // Default implementation is empty\n};\n\nHistory.prototype.teardown = function teardown () {\n // clean up event listeners\n // https://github.com/vuejs/vue-router/issues/2341\n this.listeners.forEach(function (cleanupListener) {\n cleanupListener();\n });\n this.listeners = [];\n\n // reset current history route\n // https://github.com/vuejs/vue-router/issues/3294\n this.current = START;\n this.pending = null;\n};\n\nfunction normalizeBase (base) {\n if (!base) {\n if (inBrowser) {\n // respect tag\n var baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^https?:\\/\\/[^\\/]+/, '');\n } else {\n base = '/';\n }\n }\n // make sure there's the starting slash\n if (base.charAt(0) !== '/') {\n base = '/' + base;\n }\n // remove trailing slash\n return base.replace(/\\/$/, '')\n}\n\nfunction resolveQueue (\n current,\n next\n) {\n var i;\n var max = Math.max(current.length, next.length);\n for (i = 0; i < max; i++) {\n if (current[i] !== next[i]) {\n break\n }\n }\n return {\n updated: next.slice(0, i),\n activated: next.slice(i),\n deactivated: current.slice(i)\n }\n}\n\nfunction extractGuards (\n records,\n name,\n bind,\n reverse\n) {\n var guards = flatMapComponents(records, function (def, instance, match, key) {\n var guard = extractGuard(def, name);\n if (guard) {\n return Array.isArray(guard)\n ? guard.map(function (guard) { return bind(guard, instance, match, key); })\n : bind(guard, instance, match, key)\n }\n });\n return flatten(reverse ? guards.reverse() : guards)\n}\n\nfunction extractGuard (\n def,\n key\n) {\n if (typeof def !== 'function') {\n // extend now so that global mixins are applied.\n def = _Vue.extend(def);\n }\n return def.options[key]\n}\n\nfunction extractLeaveGuards (deactivated) {\n return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)\n}\n\nfunction extractUpdateHooks (updated) {\n return extractGuards(updated, 'beforeRouteUpdate', bindGuard)\n}\n\nfunction bindGuard (guard, instance) {\n if (instance) {\n return function boundRouteGuard () {\n return guard.apply(instance, arguments)\n }\n }\n}\n\nfunction extractEnterGuards (\n activated\n) {\n return extractGuards(\n activated,\n 'beforeRouteEnter',\n function (guard, _, match, key) {\n return bindEnterGuard(guard, match, key)\n }\n )\n}\n\nfunction bindEnterGuard (\n guard,\n match,\n key\n) {\n return function routeEnterGuard (to, from, next) {\n return guard(to, from, function (cb) {\n if (typeof cb === 'function') {\n if (!match.enteredCbs[key]) {\n match.enteredCbs[key] = [];\n }\n match.enteredCbs[key].push(cb);\n }\n next(cb);\n })\n }\n}\n\n/* */\n\nvar HTML5History = /*@__PURE__*/(function (History) {\n function HTML5History (router, base) {\n History.call(this, router, base);\n\n this._startLocation = getLocation(this.base);\n }\n\n if ( History ) HTML5History.__proto__ = History;\n HTML5History.prototype = Object.create( History && History.prototype );\n HTML5History.prototype.constructor = HTML5History;\n\n HTML5History.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n\n // Avoiding first `popstate` event dispatched in some browsers but first\n // history route not updated since async guard at the same time.\n var location = getLocation(this$1.base);\n if (this$1.current === START && location === this$1._startLocation) {\n return\n }\n\n this$1.transitionTo(location, function (route) {\n if (supportsScroll) {\n handleScroll(router, route, current, true);\n }\n });\n };\n window.addEventListener('popstate', handleRoutingEvent);\n this.listeners.push(function () {\n window.removeEventListener('popstate', handleRoutingEvent);\n });\n };\n\n HTML5History.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HTML5History.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n pushState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(location, function (route) {\n replaceState(cleanPath(this$1.base + route.fullPath));\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n }, onAbort);\n };\n\n HTML5History.prototype.ensureURL = function ensureURL (push) {\n if (getLocation(this.base) !== this.current.fullPath) {\n var current = cleanPath(this.base + this.current.fullPath);\n push ? pushState(current) : replaceState(current);\n }\n };\n\n HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {\n return getLocation(this.base)\n };\n\n return HTML5History;\n}(History));\n\nfunction getLocation (base) {\n var path = window.location.pathname;\n var pathLowerCase = path.toLowerCase();\n var baseLowerCase = base.toLowerCase();\n // base=\"/a\" shouldn't turn path=\"/app\" into \"/a/pp\"\n // https://github.com/vuejs/vue-router/issues/3555\n // so we ensure the trailing slash in the base\n if (base && ((pathLowerCase === baseLowerCase) ||\n (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {\n path = path.slice(base.length);\n }\n return (path || '/') + window.location.search + window.location.hash\n}\n\n/* */\n\nvar HashHistory = /*@__PURE__*/(function (History) {\n function HashHistory (router, base, fallback) {\n History.call(this, router, base);\n // check history fallback deeplinking\n if (fallback && checkFallback(this.base)) {\n return\n }\n ensureSlash();\n }\n\n if ( History ) HashHistory.__proto__ = History;\n HashHistory.prototype = Object.create( History && History.prototype );\n HashHistory.prototype.constructor = HashHistory;\n\n // this is delayed until the app mounts\n // to avoid the hashchange listener being fired too early\n HashHistory.prototype.setupListeners = function setupListeners () {\n var this$1 = this;\n\n if (this.listeners.length > 0) {\n return\n }\n\n var router = this.router;\n var expectScroll = router.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll) {\n this.listeners.push(setupScroll());\n }\n\n var handleRoutingEvent = function () {\n var current = this$1.current;\n if (!ensureSlash()) {\n return\n }\n this$1.transitionTo(getHash(), function (route) {\n if (supportsScroll) {\n handleScroll(this$1.router, route, current, true);\n }\n if (!supportsPushState) {\n replaceHash(route.fullPath);\n }\n });\n };\n var eventType = supportsPushState ? 'popstate' : 'hashchange';\n window.addEventListener(\n eventType,\n handleRoutingEvent\n );\n this.listeners.push(function () {\n window.removeEventListener(eventType, handleRoutingEvent);\n });\n };\n\n HashHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n pushHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n var ref = this;\n var fromRoute = ref.current;\n this.transitionTo(\n location,\n function (route) {\n replaceHash(route.fullPath);\n handleScroll(this$1.router, route, fromRoute, false);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n HashHistory.prototype.go = function go (n) {\n window.history.go(n);\n };\n\n HashHistory.prototype.ensureURL = function ensureURL (push) {\n var current = this.current.fullPath;\n if (getHash() !== current) {\n push ? pushHash(current) : replaceHash(current);\n }\n };\n\n HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n return getHash()\n };\n\n return HashHistory;\n}(History));\n\nfunction checkFallback (base) {\n var location = getLocation(base);\n if (!/^\\/#/.test(location)) {\n window.location.replace(cleanPath(base + '/#' + location));\n return true\n }\n}\n\nfunction ensureSlash () {\n var path = getHash();\n if (path.charAt(0) === '/') {\n return true\n }\n replaceHash('/' + path);\n return false\n}\n\nfunction getHash () {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var index = href.indexOf('#');\n // empty path\n if (index < 0) { return '' }\n\n href = href.slice(index + 1);\n\n return href\n}\n\nfunction getUrl (path) {\n var href = window.location.href;\n var i = href.indexOf('#');\n var base = i >= 0 ? href.slice(0, i) : href;\n return (base + \"#\" + path)\n}\n\nfunction pushHash (path) {\n if (supportsPushState) {\n pushState(getUrl(path));\n } else {\n window.location.hash = path;\n }\n}\n\nfunction replaceHash (path) {\n if (supportsPushState) {\n replaceState(getUrl(path));\n } else {\n window.location.replace(getUrl(path));\n }\n}\n\n/* */\n\nvar AbstractHistory = /*@__PURE__*/(function (History) {\n function AbstractHistory (router, base) {\n History.call(this, router, base);\n this.stack = [];\n this.index = -1;\n }\n\n if ( History ) AbstractHistory.__proto__ = History;\n AbstractHistory.prototype = Object.create( History && History.prototype );\n AbstractHistory.prototype.constructor = AbstractHistory;\n\n AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);\n this$1.index++;\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n this.transitionTo(\n location,\n function (route) {\n this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);\n onComplete && onComplete(route);\n },\n onAbort\n );\n };\n\n AbstractHistory.prototype.go = function go (n) {\n var this$1 = this;\n\n var targetIndex = this.index + n;\n if (targetIndex < 0 || targetIndex >= this.stack.length) {\n return\n }\n var route = this.stack[targetIndex];\n this.confirmTransition(\n route,\n function () {\n var prev = this$1.current;\n this$1.index = targetIndex;\n this$1.updateRoute(route);\n this$1.router.afterHooks.forEach(function (hook) {\n hook && hook(route, prev);\n });\n },\n function (err) {\n if (isNavigationFailure(err, NavigationFailureType.duplicated)) {\n this$1.index = targetIndex;\n }\n }\n );\n };\n\n AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {\n var current = this.stack[this.stack.length - 1];\n return current ? current.fullPath : '/'\n };\n\n AbstractHistory.prototype.ensureURL = function ensureURL () {\n // noop\n };\n\n return AbstractHistory;\n}(History));\n\n/* */\n\nvar VueRouter = function VueRouter (options) {\n if ( options === void 0 ) options = {};\n\n if (process.env.NODE_ENV !== 'production') {\n warn(this instanceof VueRouter, \"Router must be called with the new operator.\");\n }\n this.app = null;\n this.apps = [];\n this.options = options;\n this.beforeHooks = [];\n this.resolveHooks = [];\n this.afterHooks = [];\n this.matcher = createMatcher(options.routes || [], this);\n\n var mode = options.mode || 'hash';\n this.fallback =\n mode === 'history' && !supportsPushState && options.fallback !== false;\n if (this.fallback) {\n mode = 'hash';\n }\n if (!inBrowser) {\n mode = 'abstract';\n }\n this.mode = mode;\n\n switch (mode) {\n case 'history':\n this.history = new HTML5History(this, options.base);\n break\n case 'hash':\n this.history = new HashHistory(this, options.base, this.fallback);\n break\n case 'abstract':\n this.history = new AbstractHistory(this, options.base);\n break\n default:\n if (process.env.NODE_ENV !== 'production') {\n assert(false, (\"invalid mode: \" + mode));\n }\n }\n};\n\nvar prototypeAccessors = { currentRoute: { configurable: true } };\n\nVueRouter.prototype.match = function match (raw, current, redirectedFrom) {\n return this.matcher.match(raw, current, redirectedFrom)\n};\n\nprototypeAccessors.currentRoute.get = function () {\n return this.history && this.history.current\n};\n\nVueRouter.prototype.init = function init (app /* Vue component instance */) {\n var this$1 = this;\n\n process.env.NODE_ENV !== 'production' &&\n assert(\n install.installed,\n \"not installed. Make sure to call `Vue.use(VueRouter)` \" +\n \"before creating root instance.\"\n );\n\n this.apps.push(app);\n\n // set up app destroyed handler\n // https://github.com/vuejs/vue-router/issues/2639\n app.$once('hook:destroyed', function () {\n // clean out app from this.apps array once destroyed\n var index = this$1.apps.indexOf(app);\n if (index > -1) { this$1.apps.splice(index, 1); }\n // ensure we still have a main app or null if no apps\n // we do not release the router so it can be reused\n if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }\n\n if (!this$1.app) { this$1.history.teardown(); }\n });\n\n // main app previously initialized\n // return as we don't need to set up new history listener\n if (this.app) {\n return\n }\n\n this.app = app;\n\n var history = this.history;\n\n if (history instanceof HTML5History || history instanceof HashHistory) {\n var handleInitialScroll = function (routeOrError) {\n var from = history.current;\n var expectScroll = this$1.options.scrollBehavior;\n var supportsScroll = supportsPushState && expectScroll;\n\n if (supportsScroll && 'fullPath' in routeOrError) {\n handleScroll(this$1, routeOrError, from, false);\n }\n };\n var setupListeners = function (routeOrError) {\n history.setupListeners();\n handleInitialScroll(routeOrError);\n };\n history.transitionTo(\n history.getCurrentLocation(),\n setupListeners,\n setupListeners\n );\n }\n\n history.listen(function (route) {\n this$1.apps.forEach(function (app) {\n app._route = route;\n });\n });\n};\n\nVueRouter.prototype.beforeEach = function beforeEach (fn) {\n return registerHook(this.beforeHooks, fn)\n};\n\nVueRouter.prototype.beforeResolve = function beforeResolve (fn) {\n return registerHook(this.resolveHooks, fn)\n};\n\nVueRouter.prototype.afterEach = function afterEach (fn) {\n return registerHook(this.afterHooks, fn)\n};\n\nVueRouter.prototype.onReady = function onReady (cb, errorCb) {\n this.history.onReady(cb, errorCb);\n};\n\nVueRouter.prototype.onError = function onError (errorCb) {\n this.history.onError(errorCb);\n};\n\nVueRouter.prototype.push = function push (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.push(location, resolve, reject);\n })\n } else {\n this.history.push(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.replace = function replace (location, onComplete, onAbort) {\n var this$1 = this;\n\n // $flow-disable-line\n if (!onComplete && !onAbort && typeof Promise !== 'undefined') {\n return new Promise(function (resolve, reject) {\n this$1.history.replace(location, resolve, reject);\n })\n } else {\n this.history.replace(location, onComplete, onAbort);\n }\n};\n\nVueRouter.prototype.go = function go (n) {\n this.history.go(n);\n};\n\nVueRouter.prototype.back = function back () {\n this.go(-1);\n};\n\nVueRouter.prototype.forward = function forward () {\n this.go(1);\n};\n\nVueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {\n var route = to\n ? to.matched\n ? to\n : this.resolve(to).route\n : this.currentRoute;\n if (!route) {\n return []\n }\n return [].concat.apply(\n [],\n route.matched.map(function (m) {\n return Object.keys(m.components).map(function (key) {\n return m.components[key]\n })\n })\n )\n};\n\nVueRouter.prototype.resolve = function resolve (\n to,\n current,\n append\n) {\n current = current || this.history.current;\n var location = normalizeLocation(to, current, append, this);\n var route = this.match(location, current);\n var fullPath = route.redirectedFrom || route.fullPath;\n var base = this.history.base;\n var href = createHref(base, fullPath, this.mode);\n return {\n location: location,\n route: route,\n href: href,\n // for backwards compat\n normalizedTo: location,\n resolved: route\n }\n};\n\nVueRouter.prototype.getRoutes = function getRoutes () {\n return this.matcher.getRoutes()\n};\n\nVueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {\n this.matcher.addRoute(parentOrRoute, route);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nVueRouter.prototype.addRoutes = function addRoutes (routes) {\n if (process.env.NODE_ENV !== 'production') {\n warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');\n }\n this.matcher.addRoutes(routes);\n if (this.history.current !== START) {\n this.history.transitionTo(this.history.getCurrentLocation());\n }\n};\n\nObject.defineProperties( VueRouter.prototype, prototypeAccessors );\n\nfunction registerHook (list, fn) {\n list.push(fn);\n return function () {\n var i = list.indexOf(fn);\n if (i > -1) { list.splice(i, 1); }\n }\n}\n\nfunction createHref (base, fullPath, mode) {\n var path = mode === 'hash' ? '#' + fullPath : fullPath;\n return base ? cleanPath(base + '/' + path) : path\n}\n\nVueRouter.install = install;\nVueRouter.version = '3.5.3';\nVueRouter.isNavigationFailure = isNavigationFailure;\nVueRouter.NavigationFailureType = NavigationFailureType;\nVueRouter.START_LOCATION = START;\n\nif (inBrowser && window.Vue) {\n window.Vue.use(VueRouter);\n}\n\nexport default VueRouter;\n","import Vue from 'vue'\r\nimport Router from 'vue-router'\r\n\r\nVue.use(Router);\r\n\r\n\r\nconst router = new Router({\r\n routes: [\r\n \r\n {\r\n path: '/contacts',\r\n name: 'contacts',\r\n component: () => import ('@/views/contacts')\r\n },\r\n {\r\n path: '/contact',\r\n name: 'contact',\r\n component: () => import ('@/views/contact') \r\n },\r\n {\r\n path: '/chats',\r\n name: 'chats',\r\n component: () => import ('@/views/chats')\r\n },\r\n {\r\n path: '/chat',\r\n name: 'chat',\r\n component: () => import ('@/views/chat')\r\n },\r\n {\r\n path: '/publicPreview',\r\n name: 'publicPreview',\r\n component: () => import ('@/views/publicPreview')\r\n },\r\n {\r\n path: '/chatSettings',\r\n name: 'chatSettings',\r\n component: () => import ('@/views/chatSettings')\r\n },\r\n {\r\n path: '/chatInfo',\r\n name: 'chatInfo',\r\n component: () => import ('@/views/chatinfo')\r\n },\r\n {\r\n path: '/teamRoom',\r\n name: 'teamRoom',\r\n component: () => import ('@/views/teamroom')\r\n },\r\n {\r\n path: '/settings',\r\n name: 'settings',\r\n component: () => import ('@/views/settings')\r\n },\r\n\r\n {\r\n path: '/invite',\r\n name: 'invite',\r\n component: () => import ('@/views/invite')\r\n },\r\n\r\n \r\n ],\r\n \r\n mode: document.getElementById('automomous') ? 'history' : 'abstract',\r\n \r\n})\r\n\r\n\r\nexport default router","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},attrs:{\"id\":\"modal\"}},[_c('div',{staticClass:\"modal-backdrop\",on:{\"click\":_vm.close}}),_c('div',{staticClass:\"modal-wrapper\"},[_c('div',{staticClass:\"modal\",attrs:{\"role\":\"dialog\",\"aria-labelledby\":\"modalTitle\",\"aria-describedby\":\"modalDescription\"}},[_c('div',{staticClass:\"modal-header\"},[_vm._t(\"header\",function(){return [_vm._v(\" \"+_vm._s(_vm.$t(\"caption.header\"))+\" \")]})],2),_c('div',{staticClass:\"modal-body\",attrs:{\"id\":\"modalDescription\"}},[_vm._t(\"body\")],2),(_vm.displayFooter)?_c('div',{staticClass:\"modal-footer\"}):_vm._e(),_c('div',{staticClass:\"modal-close\",on:{\"click\":_vm.close}},[_c('i',{staticClass:\"fas fa-times\"})])])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'modal',\r\n props: {\r\n displayFooter : {\r\n default : true,\r\n type : Boolean\r\n },\r\n cantclose : Boolean\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'modal'})\r\n },\r\n \r\n destroyed() {\r\n this.$store.commit('blockactive', {value : false, item : 'modal'})\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n \r\n computed: mapState({\r\n auth : state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active: state => state.active,\r\n mobile: state => state.mobile,\r\n }),\r\n\r\n methods : {\r\n close : function(){\r\n this.$emit('close')\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f016832&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"pmenu\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile}},[(_vm.menu)?_c('div',{staticClass:\"menubgwrapper\"},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menu.items},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"items\"},[_c('transition-group',{attrs:{\"name\":\"menulis2t\",\"tag\":\"div\"}},_vm._l((_vm.filteredItems),function(item){return _c('div',{key:item.click,staticClass:\"item\"},[_vm._t(\"default\",function(){return [_c('router-link',{attrs:{\"to\":'/' + item.route}},[_c('div',{staticClass:\"iwr\"},[(item.icon)?_c('i',{class:item.icon}):_vm._e(),_c('span',[_vm._v(_vm._s(item.name && typeof item.name === 'string' ? item.name : 'undefined'))])])])]},{\"item\":item})],2)}),0)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./simpleMenu.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./simpleMenu.vue?vue&type=template&id=79bb4e47&scoped=true&\"\nimport script from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nexport * from \"./simpleMenu.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"79bb4e47\",\n null\n ,true\n)\n\nexport default component.exports","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'pmenu',\r\n props: {\r\n \r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n return {\r\n last : null\r\n }\r\n },\r\n\r\n watch: {\r\n \r\n },\r\n\r\n computed: {\r\n\r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent,\r\n\r\n menu : state => state.menu\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n if (this.menu){\r\n\r\n this.last = this.menu\r\n\r\n\r\n this.menu.handler(item, this.menu.item, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n })\r\n\r\n // this.$emit('itemClicked', item, this.menu.item, );\r\n }\r\n \r\n },\r\n\r\n showPopup : function(){\r\n if (this.last){\r\n this.$store.commit('SET_MENU', this.last);\r\n this.last = null\r\n }\r\n },\r\n \r\n hidePopup() {\r\n this.$store.commit('SET_MENU', null);\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=6078dda8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=6078dda8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6078dda8\",\n null\n ,true\n)\n\nexport default component.exports","/*!\n * vue-textarea-autosize v1.1.1 \n * (c) 2019 Saymon\n * Released under the MIT License.\n */\n//\n//\n//\n//\n//\n//\n//\nvar script = {\n name: 'TextareaAutosize',\n props: {\n value: {\n type: [String, Number],\n default: ''\n },\n autosize: {\n type: Boolean,\n default: true\n },\n minHeight: {\n type: [Number],\n 'default': null\n },\n maxHeight: {\n type: [Number],\n 'default': null\n },\n\n /*\n * Force !important for style properties\n */\n important: {\n type: [Boolean, Array],\n default: false\n }\n },\n data: function data() {\n return {\n // data property for v-model binding with real textarea tag\n val: null,\n // works when content height becomes more then value of the maxHeight property\n maxHeightScroll: false,\n height: 'auto'\n };\n },\n computed: {\n computedStyles: function computedStyles() {\n if (!this.autosize) return {};\n return {\n resize: !this.isResizeImportant ? 'none' : 'none !important',\n height: this.height,\n overflow: this.maxHeightScroll ? 'auto' : !this.isOverflowImportant ? 'hidden' : 'hidden !important'\n };\n },\n isResizeImportant: function isResizeImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('resize');\n },\n isOverflowImportant: function isOverflowImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('overflow');\n },\n isHeightImportant: function isHeightImportant() {\n var imp = this.important;\n return imp === true || Array.isArray(imp) && imp.includes('height');\n }\n },\n watch: {\n value: function value(val) {\n this.val = val;\n },\n val: function val(_val) {\n this.$nextTick(this.resize);\n this.$emit('input', _val);\n },\n minHeight: function minHeight() {\n this.$nextTick(this.resize);\n },\n maxHeight: function maxHeight() {\n this.$nextTick(this.resize);\n },\n autosize: function autosize(val) {\n if (val) this.resize();\n }\n },\n methods: {\n resize: function resize() {\n var _this = this;\n\n var important = this.isHeightImportant ? 'important' : '';\n this.height = \"auto\".concat(important ? ' !important' : '');\n this.$nextTick(function () {\n var contentHeight = _this.$el.scrollHeight + 1;\n\n if (_this.minHeight) {\n contentHeight = contentHeight < _this.minHeight ? _this.minHeight : contentHeight;\n }\n\n if (_this.maxHeight) {\n if (contentHeight > _this.maxHeight) {\n contentHeight = _this.maxHeight;\n _this.maxHeightScroll = true;\n } else {\n _this.maxHeightScroll = false;\n }\n }\n\n var heightVal = contentHeight + 'px';\n _this.height = \"\".concat(heightVal).concat(important ? ' !important' : '');\n });\n return this;\n }\n },\n created: function created() {\n this.val = this.value;\n },\n mounted: function mounted() {\n this.resize();\n }\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\n/* server only */\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n } // Vue.extend constructor export interop.\n\n\n var options = typeof script === 'function' ? script.options : script; // render functions\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true; // functional template\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n } // scopedId\n\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n var hook;\n\n if (moduleIdentifier) {\n // server build\n hook = function hook(context) {\n // 2.3 injection\n context = context || // cached call\n this.$vnode && this.$vnode.ssrContext || // stateful\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\n // 2.2 with runInNewContext: true\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n } // inject component styles\n\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n } // register component module identifier for async chunk inference\n\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n }; // used by ssr in case component is cached and beforeCreate\n // never gets called\n\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function () {\n style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n // register for functional component in vue file\n var originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\nvar normalizeComponent_1 = normalizeComponent;\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.val),expression:\"val\"}],style:(_vm.computedStyles),domProps:{\"value\":(_vm.val)},on:{\"focus\":_vm.resize,\"input\":function($event){if($event.target.composing){ return; }_vm.val=$event.target.value;}}})};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n\n \n var TextareaAutosize = normalizeComponent_1(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n undefined,\n undefined\n );\n\nvar version = '1.1.1';\n\nvar install = function install(Vue) {\n Vue.component('TextareaAutosize', TextareaAutosize);\n};\n\nvar plugin = {\n install: install,\n version: version\n};\n\nif (typeof window !== 'undefined' && window.Vue) {\n window.Vue.use(plugin);\n}\n\nexport default plugin;\n","/*!\n * vue-i18n v8.27.0 \n * (c) 2022 kazuya kawaguchi\n * Released under the MIT License.\n */\n/* */\n\n/**\n * constants\n */\n\nvar numberFormatKeys = [\n 'compactDisplay',\n 'currency',\n 'currencyDisplay',\n 'currencySign',\n 'localeMatcher',\n 'notation',\n 'numberingSystem',\n 'signDisplay',\n 'style',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits'\n];\n\n/**\n * utilities\n */\n\nfunction warn (msg, err) {\n if (typeof console !== 'undefined') {\n console.warn('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.warn(err.stack);\n }\n }\n}\n\nfunction error (msg, err) {\n if (typeof console !== 'undefined') {\n console.error('[vue-i18n] ' + msg);\n /* istanbul ignore if */\n if (err) {\n console.error(err.stack);\n }\n }\n}\n\nvar isArray = Array.isArray;\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isBoolean (val) {\n return typeof val === 'boolean'\n}\n\nfunction isString (val) {\n return typeof val === 'string'\n}\n\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\nfunction isPlainObject (obj) {\n return toString.call(obj) === OBJECT_STRING\n}\n\nfunction isNull (val) {\n return val === null || val === undefined\n}\n\nfunction isFunction (val) {\n return typeof val === 'function'\n}\n\nfunction parseArgs () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var locale = null;\n var params = null;\n if (args.length === 1) {\n if (isObject(args[0]) || isArray(args[0])) {\n params = args[0];\n } else if (typeof args[0] === 'string') {\n locale = args[0];\n }\n } else if (args.length === 2) {\n if (typeof args[0] === 'string') {\n locale = args[0];\n }\n /* istanbul ignore if */\n if (isObject(args[1]) || isArray(args[1])) {\n params = args[1];\n }\n }\n\n return { locale: locale, params: params }\n}\n\nfunction looseClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction remove (arr, item) {\n if (arr.delete(item)) {\n return arr\n }\n}\n\nfunction arrayFrom (arr) {\n var ret = [];\n arr.forEach(function (a) { return ret.push(a); });\n return ret\n}\n\nfunction includes (arr, item) {\n return !!~arr.indexOf(item)\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\nfunction merge (target) {\n var arguments$1 = arguments;\n\n var output = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments$1[i];\n if (source !== undefined && source !== null) {\n var key = (void 0);\n for (key in source) {\n if (hasOwn(source, key)) {\n if (isObject(source[key])) {\n output[key] = merge(output[key], source[key]);\n } else {\n output[key] = source[key];\n }\n }\n }\n }\n }\n return output\n}\n\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = isArray(a);\n var isArrayB = isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Sanitizes html special characters from input strings. For mitigating risk of XSS attacks.\n * @param rawText The raw input from the user that should be escaped.\n */\nfunction escapeHtml(rawText) {\n return rawText\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\n/**\n * Escapes html tags and special symbols from all provided params which were returned from parseArgs().params.\n * This method performs an in-place operation on the params object.\n *\n * @param {any} params Parameters as provided from `parseArgs().params`.\n * May be either an array of strings or a string->any map.\n *\n * @returns The manipulated `params` object.\n */\nfunction escapeParams(params) {\n if(params != null) {\n Object.keys(params).forEach(function (key) {\n if(typeof(params[key]) == 'string') {\n params[key] = escapeHtml(params[key]);\n }\n });\n }\n return params\n}\n\n/* */\n\nfunction extend (Vue) {\n if (!Vue.prototype.hasOwnProperty('$i18n')) {\n // $FlowFixMe\n Object.defineProperty(Vue.prototype, '$i18n', {\n get: function get () { return this._i18n }\n });\n }\n\n Vue.prototype.$t = function (key) {\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n\n var i18n = this.$i18n;\n return i18n._t.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this ].concat( values ))\n };\n\n Vue.prototype.$tc = function (key, choice) {\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n\n var i18n = this.$i18n;\n return i18n._tc.apply(i18n, [ key, i18n.locale, i18n._getMessages(), this, choice ].concat( values ))\n };\n\n Vue.prototype.$te = function (key, locale) {\n var i18n = this.$i18n;\n return i18n._te(key, i18n.locale, i18n._getMessages(), locale)\n };\n\n Vue.prototype.$d = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).d.apply(ref, [ value ].concat( args ))\n };\n\n Vue.prototype.$n = function (value) {\n var ref;\n\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n return (ref = this.$i18n).n.apply(ref, [ value ].concat( args ))\n };\n}\n\n/* */\n\n/**\n * Mixin\n * \n * If `bridge` mode, empty mixin is returned,\n * else regulary mixin implementation is returned.\n */\nfunction defineMixin (bridge) {\n if ( bridge === void 0 ) bridge = false;\n\n function mounted () {\n if (this !== this.$root && this.$options.__INTLIFY_META__ && this.$el) {\n this.$el.setAttribute('data-intlify', this.$options.__INTLIFY_META__);\n }\n }\n\n return bridge\n ? { mounted: mounted } // delegate `vue-i18n-bridge` mixin implementation\n : { // regulary \n beforeCreate: function beforeCreate () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n = options.__i18nBridge || options.__i18n;\n _i18n.forEach(function (resource) {\n localeMessages = merge(localeMessages, JSON.parse(resource));\n });\n Object.keys(localeMessages).forEach(function (locale) {\n options.i18n.mergeLocaleMessage(locale, localeMessages[locale]);\n });\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n this._i18n = options.i18n;\n this._i18nWatcher = this._i18n.watchI18nData();\n } else if (isPlainObject(options.i18n)) {\n var rootI18n = this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n\n ? this.$root.$i18n\n : null;\n // component local i18n\n if (rootI18n) {\n options.i18n.root = this.$root;\n options.i18n.formatter = rootI18n.formatter;\n options.i18n.fallbackLocale = rootI18n.fallbackLocale;\n options.i18n.formatFallbackMessages = rootI18n.formatFallbackMessages;\n options.i18n.silentTranslationWarn = rootI18n.silentTranslationWarn;\n options.i18n.silentFallbackWarn = rootI18n.silentFallbackWarn;\n options.i18n.pluralizationRules = rootI18n.pluralizationRules;\n options.i18n.preserveDirectiveContent = rootI18n.preserveDirectiveContent;\n }\n\n // init locale messages via custom blocks\n if ((options.__i18nBridge || options.__i18n)) {\n try {\n var localeMessages$1 = options.i18n && options.i18n.messages ? options.i18n.messages : {};\n var _i18n$1 = options.__i18nBridge || options.__i18n;\n _i18n$1.forEach(function (resource) {\n localeMessages$1 = merge(localeMessages$1, JSON.parse(resource));\n });\n options.i18n.messages = localeMessages$1;\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot parse locale messages via custom blocks.\", e);\n }\n }\n }\n\n var ref = options.i18n;\n var sharedMessages = ref.sharedMessages;\n if (sharedMessages && isPlainObject(sharedMessages)) {\n options.i18n.messages = merge(options.i18n.messages, sharedMessages);\n }\n\n this._i18n = new VueI18n(options.i18n);\n this._i18nWatcher = this._i18n.watchI18nData();\n\n if (options.i18n.sync === undefined || !!options.i18n.sync) {\n this._localeWatcher = this.$i18n.watchLocale();\n }\n\n if (rootI18n) {\n rootI18n.onComponentInstanceCreated(this._i18n);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n // root i18n\n this._i18n = this.$root.$i18n;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n // parent i18n\n this._i18n = options.parent.$i18n;\n }\n },\n\n beforeMount: function beforeMount () {\n var options = this.$options;\n options.i18n = options.i18n || ((options.__i18nBridge || options.__i18n) ? {} : null);\n\n if (options.i18n) {\n if (options.i18n instanceof VueI18n) {\n // init locale messages via custom blocks\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (isPlainObject(options.i18n)) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Cannot be interpreted 'i18n' option.\");\n }\n }\n } else if (this.$root && this.$root.$i18n && this.$root.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n } else if (options.parent && options.parent.$i18n && options.parent.$i18n instanceof VueI18n) {\n this._i18n.subscribeDataChanging(this);\n this._subscribing = true;\n }\n },\n\n mounted: mounted,\n\n beforeDestroy: function beforeDestroy () {\n if (!this._i18n) { return }\n\n var self = this;\n this.$nextTick(function () {\n if (self._subscribing) {\n self._i18n.unsubscribeDataChanging(self);\n delete self._subscribing;\n }\n\n if (self._i18nWatcher) {\n self._i18nWatcher();\n self._i18n.destroyVM();\n delete self._i18nWatcher;\n }\n\n if (self._localeWatcher) {\n self._localeWatcher();\n delete self._localeWatcher;\n }\n });\n }\n }\n}\n\n/* */\n\nvar interpolationComponent = {\n name: 'i18n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n path: {\n type: String,\n required: true\n },\n locale: {\n type: String\n },\n places: {\n type: [Array, Object]\n }\n },\n render: function render (h, ref) {\n var data = ref.data;\n var parent = ref.parent;\n var props = ref.props;\n var slots = ref.slots;\n\n var $i18n = parent.$i18n;\n if (!$i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return\n }\n\n var path = props.path;\n var locale = props.locale;\n var places = props.places;\n var params = slots();\n var children = $i18n.i(\n path,\n locale,\n onlyHasDefaultPlace(params) || places\n ? useLegacyPlaces(params.default, places)\n : params\n );\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag ? h(tag, data, children) : children\n }\n};\n\nfunction onlyHasDefaultPlace (params) {\n var prop;\n for (prop in params) {\n if (prop !== 'default') { return false }\n }\n return Boolean(prop)\n}\n\nfunction useLegacyPlaces (children, places) {\n var params = places ? createParamsFromPlaces(places) : {};\n\n if (!children) { return params }\n\n // Filter empty text nodes\n children = children.filter(function (child) {\n return child.tag || child.text.trim() !== ''\n });\n\n var everyPlace = children.every(vnodeHasPlaceAttribute);\n if (process.env.NODE_ENV !== 'production' && everyPlace) {\n warn('`place` attribute is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return children.reduce(\n everyPlace ? assignChildPlace : assignChildIndex,\n params\n )\n}\n\nfunction createParamsFromPlaces (places) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`places` prop is deprecated in next major version. Please switch to Vue slots.');\n }\n\n return Array.isArray(places)\n ? places.reduce(assignChildIndex, {})\n : Object.assign({}, places)\n}\n\nfunction assignChildPlace (params, child) {\n if (child.data && child.data.attrs && child.data.attrs.place) {\n params[child.data.attrs.place] = child;\n }\n return params\n}\n\nfunction assignChildIndex (params, child, index) {\n params[index] = child;\n return params\n}\n\nfunction vnodeHasPlaceAttribute (vnode) {\n return Boolean(vnode.data && vnode.data.attrs && vnode.data.attrs.place)\n}\n\n/* */\n\nvar numberComponent = {\n name: 'i18n-n',\n functional: true,\n props: {\n tag: {\n type: [String, Boolean, Object],\n default: 'span'\n },\n value: {\n type: Number,\n required: true\n },\n format: {\n type: [String, Object]\n },\n locale: {\n type: String\n }\n },\n render: function render (h, ref) {\n var props = ref.props;\n var parent = ref.parent;\n var data = ref.data;\n\n var i18n = parent.$i18n;\n\n if (!i18n) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot find VueI18n instance!');\n }\n return null\n }\n\n var key = null;\n var options = null;\n\n if (isString(props.format)) {\n key = props.format;\n } else if (isObject(props.format)) {\n if (props.format.key) {\n key = props.format.key;\n }\n\n // Filter out number format options only\n options = Object.keys(props.format).reduce(function (acc, prop) {\n var obj;\n\n if (includes(numberFormatKeys, prop)) {\n return Object.assign({}, acc, ( obj = {}, obj[prop] = props.format[prop], obj ))\n }\n return acc\n }, null);\n }\n\n var locale = props.locale || i18n.locale;\n var parts = i18n._ntp(props.value, locale, key, options);\n\n var values = parts.map(function (part, index) {\n var obj;\n\n var slot = data.scopedSlots && data.scopedSlots[part.type];\n return slot ? slot(( obj = {}, obj[part.type] = part.value, obj.index = index, obj.parts = parts, obj )) : part.value\n });\n\n var tag = (!!props.tag && props.tag !== true) || props.tag === false ? props.tag : 'span';\n return tag\n ? h(tag, {\n attrs: data.attrs,\n 'class': data['class'],\n staticClass: data.staticClass\n }, values)\n : values\n }\n};\n\n/* */\n\nfunction bind (el, binding, vnode) {\n if (!assert(el, vnode)) { return }\n\n t(el, binding, vnode);\n}\n\nfunction update (el, binding, vnode, oldVNode) {\n if (!assert(el, vnode)) { return }\n\n var i18n = vnode.context.$i18n;\n if (localeEqual(el, vnode) &&\n (looseEqual(binding.value, binding.oldValue) &&\n looseEqual(el._localeMessage, i18n.getLocaleMessage(i18n.locale)))) { return }\n\n t(el, binding, vnode);\n}\n\nfunction unbind (el, binding, vnode, oldVNode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return\n }\n\n var i18n = vnode.context.$i18n || {};\n if (!binding.modifiers.preserve && !i18n.preserveDirectiveContent) {\n el.textContent = '';\n }\n el._vt = undefined;\n delete el['_vt'];\n el._locale = undefined;\n delete el['_locale'];\n el._localeMessage = undefined;\n delete el['_localeMessage'];\n}\n\nfunction assert (el, vnode) {\n var vm = vnode.context;\n if (!vm) {\n warn('Vue instance does not exists in VNode context');\n return false\n }\n\n if (!vm.$i18n) {\n warn('VueI18n instance does not exists in Vue instance');\n return false\n }\n\n return true\n}\n\nfunction localeEqual (el, vnode) {\n var vm = vnode.context;\n return el._locale === vm.$i18n.locale\n}\n\nfunction t (el, binding, vnode) {\n var ref$1, ref$2;\n\n var value = binding.value;\n\n var ref = parseValue(value);\n var path = ref.path;\n var locale = ref.locale;\n var args = ref.args;\n var choice = ref.choice;\n if (!path && !locale && !args) {\n warn('value type not supported');\n return\n }\n\n if (!path) {\n warn('`path` is required in v-t directive');\n return\n }\n\n var vm = vnode.context;\n if (choice != null) {\n el._vt = el.textContent = (ref$1 = vm.$i18n).tc.apply(ref$1, [ path, choice ].concat( makeParams(locale, args) ));\n } else {\n el._vt = el.textContent = (ref$2 = vm.$i18n).t.apply(ref$2, [ path ].concat( makeParams(locale, args) ));\n }\n el._locale = vm.$i18n.locale;\n el._localeMessage = vm.$i18n.getLocaleMessage(vm.$i18n.locale);\n}\n\nfunction parseValue (value) {\n var path;\n var locale;\n var args;\n var choice;\n\n if (isString(value)) {\n path = value;\n } else if (isPlainObject(value)) {\n path = value.path;\n locale = value.locale;\n args = value.args;\n choice = value.choice;\n }\n\n return { path: path, locale: locale, args: args, choice: choice }\n}\n\nfunction makeParams (locale, args) {\n var params = [];\n\n locale && params.push(locale);\n if (args && (Array.isArray(args) || isPlainObject(args))) {\n params.push(args);\n }\n\n return params\n}\n\nvar Vue;\n\nfunction install (_Vue, options) {\n if ( options === void 0 ) options = { bridge: false };\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && install.installed && _Vue === Vue) {\n warn('already installed.');\n return\n }\n install.installed = true;\n\n Vue = _Vue;\n\n var version = (Vue.version && Number(Vue.version.split('.')[0])) || -1;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && version < 2) {\n warn((\"vue-i18n (\" + (install.version) + \") need to use Vue 2.0 or later (Vue: \" + (Vue.version) + \").\"));\n return\n }\n\n extend(Vue);\n Vue.mixin(defineMixin(options.bridge));\n Vue.directive('t', { bind: bind, update: update, unbind: unbind });\n Vue.component(interpolationComponent.name, interpolationComponent);\n Vue.component(numberComponent.name, numberComponent);\n\n // use simple mergeStrategies to prevent i18n instance lose '__proto__'\n var strats = Vue.config.optionMergeStrategies;\n strats.i18n = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n };\n}\n\n/* */\n\nvar BaseFormatter = function BaseFormatter () {\n this._caches = Object.create(null);\n};\n\nBaseFormatter.prototype.interpolate = function interpolate (message, values) {\n if (!values) {\n return [message]\n }\n var tokens = this._caches[message];\n if (!tokens) {\n tokens = parse(message);\n this._caches[message] = tokens;\n }\n return compile(tokens, values)\n};\n\n\n\nvar RE_TOKEN_LIST_VALUE = /^(?:\\d)+/;\nvar RE_TOKEN_NAMED_VALUE = /^(?:\\w)+/;\n\nfunction parse (format) {\n var tokens = [];\n var position = 0;\n\n var text = '';\n while (position < format.length) {\n var char = format[position++];\n if (char === '{') {\n if (text) {\n tokens.push({ type: 'text', value: text });\n }\n\n text = '';\n var sub = '';\n char = format[position++];\n while (char !== undefined && char !== '}') {\n sub += char;\n char = format[position++];\n }\n var isClosed = char === '}';\n\n var type = RE_TOKEN_LIST_VALUE.test(sub)\n ? 'list'\n : isClosed && RE_TOKEN_NAMED_VALUE.test(sub)\n ? 'named'\n : 'unknown';\n tokens.push({ value: sub, type: type });\n } else if (char === '%') {\n // when found rails i18n syntax, skip text capture\n if (format[(position)] !== '{') {\n text += char;\n }\n } else {\n text += char;\n }\n }\n\n text && tokens.push({ type: 'text', value: text });\n\n return tokens\n}\n\nfunction compile (tokens, values) {\n var compiled = [];\n var index = 0;\n\n var mode = Array.isArray(values)\n ? 'list'\n : isObject(values)\n ? 'named'\n : 'unknown';\n if (mode === 'unknown') { return compiled }\n\n while (index < tokens.length) {\n var token = tokens[index];\n switch (token.type) {\n case 'text':\n compiled.push(token.value);\n break\n case 'list':\n compiled.push(values[parseInt(token.value, 10)]);\n break\n case 'named':\n if (mode === 'named') {\n compiled.push((values)[token.value]);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Type of token '\" + (token.type) + \"' and format of value '\" + mode + \"' don't match!\"));\n }\n }\n break\n case 'unknown':\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Detect 'unknown' type of token!\");\n }\n break\n }\n index++;\n }\n\n return compiled\n}\n\n/* */\n\n/**\n * Path parser\n * - Inspired:\n * Vue.js Path parser\n */\n\n// actions\nvar APPEND = 0;\nvar PUSH = 1;\nvar INC_SUB_PATH_DEPTH = 2;\nvar PUSH_SUB_PATH = 3;\n\n// states\nvar BEFORE_PATH = 0;\nvar IN_PATH = 1;\nvar BEFORE_IDENT = 2;\nvar IN_IDENT = 3;\nvar IN_SUB_PATH = 4;\nvar IN_SINGLE_QUOTE = 5;\nvar IN_DOUBLE_QUOTE = 6;\nvar AFTER_PATH = 7;\nvar ERROR = 8;\n\nvar pathStateMachine = [];\n\npathStateMachine[BEFORE_PATH] = {\n 'ws': [BEFORE_PATH],\n 'ident': [IN_IDENT, APPEND],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[IN_PATH] = {\n 'ws': [IN_PATH],\n '.': [BEFORE_IDENT],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[BEFORE_IDENT] = {\n 'ws': [BEFORE_IDENT],\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND]\n};\n\npathStateMachine[IN_IDENT] = {\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND],\n 'ws': [IN_PATH, PUSH],\n '.': [BEFORE_IDENT, PUSH],\n '[': [IN_SUB_PATH, PUSH],\n 'eof': [AFTER_PATH, PUSH]\n};\n\npathStateMachine[IN_SUB_PATH] = {\n \"'\": [IN_SINGLE_QUOTE, APPEND],\n '\"': [IN_DOUBLE_QUOTE, APPEND],\n '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],\n ']': [IN_PATH, PUSH_SUB_PATH],\n 'eof': ERROR,\n 'else': [IN_SUB_PATH, APPEND]\n};\n\npathStateMachine[IN_SINGLE_QUOTE] = {\n \"'\": [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_SINGLE_QUOTE, APPEND]\n};\n\npathStateMachine[IN_DOUBLE_QUOTE] = {\n '\"': [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_DOUBLE_QUOTE, APPEND]\n};\n\n/**\n * Check if an expression is a literal value.\n */\n\nvar literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\nfunction isLiteral (exp) {\n return literalValueRE.test(exp)\n}\n\n/**\n * Strip quotes from a string\n */\n\nfunction stripQuotes (str) {\n var a = str.charCodeAt(0);\n var b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27)\n ? str.slice(1, -1)\n : str\n}\n\n/**\n * Determine the type of a character in a keypath.\n */\n\nfunction getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n return ch\n\n case 0x5F: // _\n case 0x24: // $\n case 0x2D: // -\n return 'ident'\n\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029: // Paragraph Separator\n return 'ws'\n }\n\n return 'ident'\n}\n\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n */\n\nfunction formatSubPath (path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\n}\n\n/**\n * Parse a string path into an array of segments\n */\n\nfunction parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\n\n\n\n\nvar I18nPath = function I18nPath () {\n this._cache = Object.create(null);\n};\n\n/**\n * External parse that check for a cache hit first\n */\nI18nPath.prototype.parsePath = function parsePath (path) {\n var hit = this._cache[path];\n if (!hit) {\n hit = parse$1(path);\n if (hit) {\n this._cache[path] = hit;\n }\n }\n return hit || []\n};\n\n/**\n * Get path value from path string\n */\nI18nPath.prototype.getPathValue = function getPathValue (obj, path) {\n if (!isObject(obj)) { return null }\n\n var paths = this.parsePath(path);\n if (paths.length === 0) {\n return null\n } else {\n var length = paths.length;\n var last = obj;\n var i = 0;\n while (i < length) {\n var value = last[paths[i]];\n if (value === undefined || value === null) {\n return null\n }\n last = value;\n i++;\n }\n\n return last\n }\n};\n\n/* */\n\n\n\nvar htmlTagMatcher = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\nvar linkKeyMatcher = /(?:@(?:\\.[a-z]+)?:(?:[\\w\\-_|./]+|\\([\\w\\-_|./]+\\)))/g;\nvar linkKeyPrefixMatcher = /^@(?:\\.([a-z]+))?:/;\nvar bracketsMatcher = /[()]/g;\nvar defaultModifiers = {\n 'upper': function (str) { return str.toLocaleUpperCase(); },\n 'lower': function (str) { return str.toLocaleLowerCase(); },\n 'capitalize': function (str) { return (\"\" + (str.charAt(0).toLocaleUpperCase()) + (str.substr(1))); }\n};\n\nvar defaultFormatter = new BaseFormatter();\n\nvar VueI18n = function VueI18n (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #290\n /* istanbul ignore if */\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n var locale = options.locale || 'en-US';\n var fallbackLocale = options.fallbackLocale === false\n ? false\n : options.fallbackLocale || 'en-US';\n var messages = options.messages || {};\n var dateTimeFormats = options.dateTimeFormats || options.datetimeFormats || {};\n var numberFormats = options.numberFormats || {};\n\n this._vm = null;\n this._formatter = options.formatter || defaultFormatter;\n this._modifiers = options.modifiers || {};\n this._missing = options.missing || null;\n this._root = options.root || null;\n this._sync = options.sync === undefined ? true : !!options.sync;\n this._fallbackRoot = options.fallbackRoot === undefined\n ? true\n : !!options.fallbackRoot;\n this._fallbackRootWithEmptyString = options.fallbackRootWithEmptyString === undefined\n ? true\n : !!options.fallbackRootWithEmptyString;\n this._formatFallbackMessages = options.formatFallbackMessages === undefined\n ? false\n : !!options.formatFallbackMessages;\n this._silentTranslationWarn = options.silentTranslationWarn === undefined\n ? false\n : options.silentTranslationWarn;\n this._silentFallbackWarn = options.silentFallbackWarn === undefined\n ? false\n : !!options.silentFallbackWarn;\n this._dateTimeFormatters = {};\n this._numberFormatters = {};\n this._path = new I18nPath();\n this._dataListeners = new Set();\n this._componentInstanceCreatedListener = options.componentInstanceCreatedListener || null;\n this._preserveDirectiveContent = options.preserveDirectiveContent === undefined\n ? false\n : !!options.preserveDirectiveContent;\n this.pluralizationRules = options.pluralizationRules || {};\n this._warnHtmlInMessage = options.warnHtmlInMessage || 'off';\n this._postTranslation = options.postTranslation || null;\n this._escapeParameterHtml = options.escapeParameterHtml || false;\n\n if ('__VUE_I18N_BRIDGE__' in options) {\n this.__VUE_I18N_BRIDGE__ = options.__VUE_I18N_BRIDGE__;\n }\n\n /**\n * @param choice {number} a choice index given by the input to $tc: `$tc('path.to.rule', choiceIndex)`\n * @param choicesLength {number} an overall amount of available choices\n * @returns a final choice index\n */\n this.getChoiceIndex = function (choice, choicesLength) {\n var thisPrototype = Object.getPrototypeOf(this$1);\n if (thisPrototype && thisPrototype.getChoiceIndex) {\n var prototypeGetChoiceIndex = (thisPrototype.getChoiceIndex);\n return (prototypeGetChoiceIndex).call(this$1, choice, choicesLength)\n }\n\n // Default (old) getChoiceIndex implementation - english-compatible\n var defaultImpl = function (_choice, _choicesLength) {\n _choice = Math.abs(_choice);\n\n if (_choicesLength === 2) {\n return _choice\n ? _choice > 1\n ? 1\n : 0\n : 1\n }\n\n return _choice ? Math.min(_choice, 2) : 0\n };\n\n if (this$1.locale in this$1.pluralizationRules) {\n return this$1.pluralizationRules[this$1.locale].apply(this$1, [choice, choicesLength])\n } else {\n return defaultImpl(choice, choicesLength)\n }\n };\n\n\n this._exist = function (message, key) {\n if (!message || !key) { return false }\n if (!isNull(this$1._path.getPathValue(message, key))) { return true }\n // fallback for flat key\n if (message[key]) { return true }\n return false\n };\n\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n\n this._initVM({\n locale: locale,\n fallbackLocale: fallbackLocale,\n messages: messages,\n dateTimeFormats: dateTimeFormats,\n numberFormats: numberFormats\n });\n};\n\nvar prototypeAccessors = { vm: { configurable: true },messages: { configurable: true },dateTimeFormats: { configurable: true },numberFormats: { configurable: true },availableLocales: { configurable: true },locale: { configurable: true },fallbackLocale: { configurable: true },formatFallbackMessages: { configurable: true },missing: { configurable: true },formatter: { configurable: true },silentTranslationWarn: { configurable: true },silentFallbackWarn: { configurable: true },preserveDirectiveContent: { configurable: true },warnHtmlInMessage: { configurable: true },postTranslation: { configurable: true },sync: { configurable: true } };\n\nVueI18n.prototype._checkLocaleMessage = function _checkLocaleMessage (locale, level, message) {\n var paths = [];\n\n var fn = function (level, locale, message, paths) {\n if (isPlainObject(message)) {\n Object.keys(message).forEach(function (key) {\n var val = message[key];\n if (isPlainObject(val)) {\n paths.push(key);\n paths.push('.');\n fn(level, locale, val, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push(key);\n fn(level, locale, val, paths);\n paths.pop();\n }\n });\n } else if (isArray(message)) {\n message.forEach(function (item, index) {\n if (isPlainObject(item)) {\n paths.push((\"[\" + index + \"]\"));\n paths.push('.');\n fn(level, locale, item, paths);\n paths.pop();\n paths.pop();\n } else {\n paths.push((\"[\" + index + \"]\"));\n fn(level, locale, item, paths);\n paths.pop();\n }\n });\n } else if (isString(message)) {\n var ret = htmlTagMatcher.test(message);\n if (ret) {\n var msg = \"Detected HTML in message '\" + message + \"' of keypath '\" + (paths.join('')) + \"' at '\" + locale + \"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp\";\n if (level === 'warn') {\n warn(msg);\n } else if (level === 'error') {\n error(msg);\n }\n }\n }\n };\n\n fn(level, locale, message, paths);\n};\n\nVueI18n.prototype._initVM = function _initVM (data) {\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n this._vm = new Vue({ data: data, __VUE18N__INSTANCE__: true });\n Vue.config.silent = silent;\n};\n\nVueI18n.prototype.destroyVM = function destroyVM () {\n this._vm.$destroy();\n};\n\nVueI18n.prototype.subscribeDataChanging = function subscribeDataChanging (vm) {\n this._dataListeners.add(vm);\n};\n\nVueI18n.prototype.unsubscribeDataChanging = function unsubscribeDataChanging (vm) {\n remove(this._dataListeners, vm);\n};\n\nVueI18n.prototype.watchI18nData = function watchI18nData () {\n var this$1 = this;\n return this._vm.$watch('$data', function () {\n var listeners = arrayFrom(this$1._dataListeners);\n var i = listeners.length;\n while(i--) {\n Vue.nextTick(function () {\n listeners[i] && listeners[i].$forceUpdate();\n });\n }\n }, { deep: true })\n};\n\nVueI18n.prototype.watchLocale = function watchLocale (composer) {\n if (!composer) {\n /* istanbul ignore if */\n if (!this._sync || !this._root) { return null }\n var target = this._vm;\n return this._root.$i18n.vm.$watch('locale', function (val) {\n target.$set(target, 'locale', val);\n target.$forceUpdate();\n }, { immediate: true })\n } else {\n // deal with vue-i18n-bridge\n if (!this.__VUE_I18N_BRIDGE__) { return null }\n var self = this;\n var target$1 = this._vm;\n return this.vm.$watch('locale', function (val) {\n target$1.$set(target$1, 'locale', val);\n if (self.__VUE_I18N_BRIDGE__ && composer) {\n composer.locale.value = val;\n }\n target$1.$forceUpdate();\n }, { immediate: true })\n }\n};\n\nVueI18n.prototype.onComponentInstanceCreated = function onComponentInstanceCreated (newI18n) {\n if (this._componentInstanceCreatedListener) {\n this._componentInstanceCreatedListener(newI18n, this);\n }\n};\n\nprototypeAccessors.vm.get = function () { return this._vm };\n\nprototypeAccessors.messages.get = function () { return looseClone(this._getMessages()) };\nprototypeAccessors.dateTimeFormats.get = function () { return looseClone(this._getDateTimeFormats()) };\nprototypeAccessors.numberFormats.get = function () { return looseClone(this._getNumberFormats()) };\nprototypeAccessors.availableLocales.get = function () { return Object.keys(this.messages).sort() };\n\nprototypeAccessors.locale.get = function () { return this._vm.locale };\nprototypeAccessors.locale.set = function (locale) {\n this._vm.$set(this._vm, 'locale', locale);\n};\n\nprototypeAccessors.fallbackLocale.get = function () { return this._vm.fallbackLocale };\nprototypeAccessors.fallbackLocale.set = function (locale) {\n this._localeChainCache = {};\n this._vm.$set(this._vm, 'fallbackLocale', locale);\n};\n\nprototypeAccessors.formatFallbackMessages.get = function () { return this._formatFallbackMessages };\nprototypeAccessors.formatFallbackMessages.set = function (fallback) { this._formatFallbackMessages = fallback; };\n\nprototypeAccessors.missing.get = function () { return this._missing };\nprototypeAccessors.missing.set = function (handler) { this._missing = handler; };\n\nprototypeAccessors.formatter.get = function () { return this._formatter };\nprototypeAccessors.formatter.set = function (formatter) { this._formatter = formatter; };\n\nprototypeAccessors.silentTranslationWarn.get = function () { return this._silentTranslationWarn };\nprototypeAccessors.silentTranslationWarn.set = function (silent) { this._silentTranslationWarn = silent; };\n\nprototypeAccessors.silentFallbackWarn.get = function () { return this._silentFallbackWarn };\nprototypeAccessors.silentFallbackWarn.set = function (silent) { this._silentFallbackWarn = silent; };\n\nprototypeAccessors.preserveDirectiveContent.get = function () { return this._preserveDirectiveContent };\nprototypeAccessors.preserveDirectiveContent.set = function (preserve) { this._preserveDirectiveContent = preserve; };\n\nprototypeAccessors.warnHtmlInMessage.get = function () { return this._warnHtmlInMessage };\nprototypeAccessors.warnHtmlInMessage.set = function (level) {\n var this$1 = this;\n\n var orgLevel = this._warnHtmlInMessage;\n this._warnHtmlInMessage = level;\n if (orgLevel !== level && (level === 'warn' || level === 'error')) {\n var messages = this._getMessages();\n Object.keys(messages).forEach(function (locale) {\n this$1._checkLocaleMessage(locale, this$1._warnHtmlInMessage, messages[locale]);\n });\n }\n};\n\nprototypeAccessors.postTranslation.get = function () { return this._postTranslation };\nprototypeAccessors.postTranslation.set = function (handler) { this._postTranslation = handler; };\n\nprototypeAccessors.sync.get = function () { return this._sync };\nprototypeAccessors.sync.set = function (val) { this._sync = val; };\n\nVueI18n.prototype._getMessages = function _getMessages () { return this._vm.messages };\nVueI18n.prototype._getDateTimeFormats = function _getDateTimeFormats () { return this._vm.dateTimeFormats };\nVueI18n.prototype._getNumberFormats = function _getNumberFormats () { return this._vm.numberFormats };\n\nVueI18n.prototype._warnDefault = function _warnDefault (locale, key, result, vm, values, interpolateMode) {\n if (!isNull(result)) { return result }\n if (this._missing) {\n var missingRet = this._missing.apply(null, [locale, key, vm, values]);\n if (isString(missingRet)) {\n return missingRet\n }\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn(\n \"Cannot translate the value of keypath '\" + key + \"'. \" +\n 'Use the value of keypath as default.'\n );\n }\n }\n\n if (this._formatFallbackMessages) {\n var parsedArgs = parseArgs.apply(void 0, values);\n return this._render(key, interpolateMode, parsedArgs.params, key)\n } else {\n return key\n }\n};\n\nVueI18n.prototype._isFallbackRoot = function _isFallbackRoot (val) {\n return (this._fallbackRootWithEmptyString? !val : isNull(val)) && !isNull(this._root) && this._fallbackRoot\n};\n\nVueI18n.prototype._isSilentFallbackWarn = function _isSilentFallbackWarn (key) {\n return this._silentFallbackWarn instanceof RegExp\n ? this._silentFallbackWarn.test(key)\n : this._silentFallbackWarn\n};\n\nVueI18n.prototype._isSilentFallback = function _isSilentFallback (locale, key) {\n return this._isSilentFallbackWarn(key) && (this._isFallbackRoot() || locale !== this.fallbackLocale)\n};\n\nVueI18n.prototype._isSilentTranslationWarn = function _isSilentTranslationWarn (key) {\n return this._silentTranslationWarn instanceof RegExp\n ? this._silentTranslationWarn.test(key)\n : this._silentTranslationWarn\n};\n\nVueI18n.prototype._interpolate = function _interpolate (\n locale,\n message,\n key,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n if (!message) { return null }\n\n var pathRet = this._path.getPathValue(message, key);\n if (isArray(pathRet) || isPlainObject(pathRet)) { return pathRet }\n\n var ret;\n if (isNull(pathRet)) {\n /* istanbul ignore else */\n if (isPlainObject(message)) {\n ret = message[key];\n if (!(isString(ret) || isFunction(ret))) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function !\"));\n }\n return null\n }\n } else {\n return null\n }\n } else {\n /* istanbul ignore else */\n if (isString(pathRet) || isFunction(pathRet)) {\n ret = pathRet;\n } else {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallback(locale, key)) {\n warn((\"Value of key '\" + key + \"' is not a string or function!\"));\n }\n return null\n }\n }\n\n // Check for the existence of links within the translated string\n if (isString(ret) && (ret.indexOf('@:') >= 0 || ret.indexOf('@.') >= 0)) {\n ret = this._link(locale, message, ret, host, 'raw', values, visitedLinkStack);\n }\n\n return this._render(ret, interpolateMode, values, key)\n};\n\nVueI18n.prototype._link = function _link (\n locale,\n message,\n str,\n host,\n interpolateMode,\n values,\n visitedLinkStack\n) {\n var ret = str;\n\n // Match all the links within the local\n // We are going to replace each of\n // them with its translation\n var matches = ret.match(linkKeyMatcher);\n\n // eslint-disable-next-line no-autofix/prefer-const\n for (var idx in matches) {\n // ie compatible: filter custom array\n // prototype method\n if (!matches.hasOwnProperty(idx)) {\n continue\n }\n var link = matches[idx];\n var linkKeyPrefixMatches = link.match(linkKeyPrefixMatcher);\n var linkPrefix = linkKeyPrefixMatches[0];\n var formatterName = linkKeyPrefixMatches[1];\n\n // Remove the leading @:, @.case: and the brackets\n var linkPlaceholder = link.replace(linkPrefix, '').replace(bracketsMatcher, '');\n\n if (includes(visitedLinkStack, linkPlaceholder)) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Circular reference found. \\\"\" + link + \"\\\" is already visited in the chain of \" + (visitedLinkStack.reverse().join(' <- '))));\n }\n return ret\n }\n visitedLinkStack.push(linkPlaceholder);\n\n // Translate the link\n var translated = this._interpolate(\n locale, message, linkPlaceholder, host,\n interpolateMode === 'raw' ? 'string' : interpolateMode,\n interpolateMode === 'raw' ? undefined : values,\n visitedLinkStack\n );\n\n if (this._isFallbackRoot(translated)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(linkPlaceholder)) {\n warn((\"Fall back to translate the link placeholder '\" + linkPlaceholder + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n var root = this._root.$i18n;\n translated = root._translate(\n root._getMessages(), root.locale, root.fallbackLocale,\n linkPlaceholder, host, interpolateMode, values\n );\n }\n translated = this._warnDefault(\n locale, linkPlaceholder, translated, host,\n isArray(values) ? values : [values],\n interpolateMode\n );\n\n if (this._modifiers.hasOwnProperty(formatterName)) {\n translated = this._modifiers[formatterName](translated);\n } else if (defaultModifiers.hasOwnProperty(formatterName)) {\n translated = defaultModifiers[formatterName](translated);\n }\n\n visitedLinkStack.pop();\n\n // Replace the link with the translated\n ret = !translated ? ret : ret.replace(link, translated);\n }\n\n return ret\n};\n\nVueI18n.prototype._createMessageContext = function _createMessageContext (values, formatter, path, interpolateMode) {\n var this$1 = this;\n\n var _list = isArray(values) ? values : [];\n var _named = isObject(values) ? values : {};\n var list = function (index) { return _list[index]; };\n var named = function (key) { return _named[key]; };\n var messages = this._getMessages();\n var locale = this.locale;\n\n return {\n list: list,\n named: named,\n values: values,\n formatter: formatter,\n path: path,\n messages: messages,\n locale: locale,\n linked: function (linkedKey) { return this$1._interpolate(locale, messages[locale] || {}, linkedKey, null, interpolateMode, undefined, [linkedKey]); }\n }\n};\n\nVueI18n.prototype._render = function _render (message, interpolateMode, values, path) {\n if (isFunction(message)) {\n return message(\n this._createMessageContext(values, this._formatter || defaultFormatter, path, interpolateMode)\n )\n }\n\n var ret = this._formatter.interpolate(message, values, path);\n\n // If the custom formatter refuses to work - apply the default one\n if (!ret) {\n ret = defaultFormatter.interpolate(message, values, path);\n }\n\n // if interpolateMode is **not** 'string' ('row'),\n // return the compiled data (e.g. ['foo', VNode, 'bar']) with formatter\n return interpolateMode === 'string' && !isString(ret) ? ret.join('') : ret\n};\n\nVueI18n.prototype._appendItemToChain = function _appendItemToChain (chain, item, blocks) {\n var follow = false;\n if (!includes(chain, item)) {\n follow = true;\n if (item) {\n follow = item[item.length - 1] !== '!';\n item = item.replace(/!/g, '');\n chain.push(item);\n if (blocks && blocks[item]) {\n follow = blocks[item];\n }\n }\n }\n return follow\n};\n\nVueI18n.prototype._appendLocaleToChain = function _appendLocaleToChain (chain, locale, blocks) {\n var follow;\n var tokens = locale.split('-');\n do {\n var item = tokens.join('-');\n follow = this._appendItemToChain(chain, item, blocks);\n tokens.splice(-1, 1);\n } while (tokens.length && (follow === true))\n return follow\n};\n\nVueI18n.prototype._appendBlockToChain = function _appendBlockToChain (chain, block, blocks) {\n var follow = true;\n for (var i = 0; (i < block.length) && (isBoolean(follow)); i++) {\n var locale = block[i];\n if (isString(locale)) {\n follow = this._appendLocaleToChain(chain, locale, blocks);\n }\n }\n return follow\n};\n\nVueI18n.prototype._getLocaleChain = function _getLocaleChain (start, fallbackLocale) {\n if (start === '') { return [] }\n\n if (!this._localeChainCache) {\n this._localeChainCache = {};\n }\n\n var chain = this._localeChainCache[start];\n if (!chain) {\n if (!fallbackLocale) {\n fallbackLocale = this.fallbackLocale;\n }\n chain = [];\n\n // first block defined by start\n var block = [start];\n\n // while any intervening block found\n while (isArray(block)) {\n block = this._appendBlockToChain(\n chain,\n block,\n fallbackLocale\n );\n }\n\n // last block defined by default\n var defaults;\n if (isArray(fallbackLocale)) {\n defaults = fallbackLocale;\n } else if (isObject(fallbackLocale)) {\n /* $FlowFixMe */\n if (fallbackLocale['default']) {\n defaults = fallbackLocale['default'];\n } else {\n defaults = null;\n }\n } else {\n defaults = fallbackLocale;\n }\n\n // convert defaults to array\n if (isString(defaults)) {\n block = [defaults];\n } else {\n block = defaults;\n }\n if (block) {\n this._appendBlockToChain(\n chain,\n block,\n null\n );\n }\n this._localeChainCache[start] = chain;\n }\n return chain\n};\n\nVueI18n.prototype._translate = function _translate (\n messages,\n locale,\n fallback,\n key,\n host,\n interpolateMode,\n args\n) {\n var chain = this._getLocaleChain(locale, fallback);\n var res;\n for (var i = 0; i < chain.length; i++) {\n var step = chain[i];\n res =\n this._interpolate(step, messages[step], key, host, interpolateMode, args, [key]);\n if (!isNull(res)) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with '\" + step + \"' locale.\"));\n }\n return res\n }\n }\n return null\n};\n\nVueI18n.prototype._t = function _t (key, _locale, messages, host) {\n var ref;\n\n var values = [], len = arguments.length - 4;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 4 ];\n if (!key) { return '' }\n\n var parsedArgs = parseArgs.apply(void 0, values);\n if(this._escapeParameterHtml) {\n parsedArgs.params = escapeParams(parsedArgs.params);\n }\n\n var locale = parsedArgs.locale || _locale;\n\n var ret = this._translate(\n messages, locale, this.fallbackLocale, key,\n host, 'string', parsedArgs.params\n );\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to translate the keypath '\" + key + \"' with root locale.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return (ref = this._root).$t.apply(ref, [ key ].concat( values ))\n } else {\n ret = this._warnDefault(locale, key, ret, host, values, 'string');\n if (this._postTranslation && ret !== null && ret !== undefined) {\n ret = this._postTranslation(ret, key);\n }\n return ret\n }\n};\n\nVueI18n.prototype.t = function t (key) {\n var ref;\n\n var values = [], len = arguments.length - 1;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 1 ];\n return (ref = this)._t.apply(ref, [ key, this.locale, this._getMessages(), null ].concat( values ))\n};\n\nVueI18n.prototype._i = function _i (key, locale, messages, host, values) {\n var ret =\n this._translate(messages, locale, this.fallbackLocale, key, host, 'raw', values);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to interpolate the keypath '\" + key + \"' with root locale.\"));\n }\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.i(key, locale, values)\n } else {\n return this._warnDefault(locale, key, ret, host, [values], 'raw')\n }\n};\n\nVueI18n.prototype.i = function i (key, locale, values) {\n /* istanbul ignore if */\n if (!key) { return '' }\n\n if (!isString(locale)) {\n locale = this.locale;\n }\n\n return this._i(key, locale, this._getMessages(), null, values)\n};\n\nVueI18n.prototype._tc = function _tc (\n key,\n _locale,\n messages,\n host,\n choice\n) {\n var ref;\n\n var values = [], len = arguments.length - 5;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 5 ];\n if (!key) { return '' }\n if (choice === undefined) {\n choice = 1;\n }\n\n var predefined = { 'count': choice, 'n': choice };\n var parsedArgs = parseArgs.apply(void 0, values);\n parsedArgs.params = Object.assign(predefined, parsedArgs.params);\n values = parsedArgs.locale === null ? [parsedArgs.params] : [parsedArgs.locale, parsedArgs.params];\n return this.fetchChoice((ref = this)._t.apply(ref, [ key, _locale, messages, host ].concat( values )), choice)\n};\n\nVueI18n.prototype.fetchChoice = function fetchChoice (message, choice) {\n /* istanbul ignore if */\n if (!message || !isString(message)) { return null }\n var choices = message.split('|');\n\n choice = this.getChoiceIndex(choice, choices.length);\n if (!choices[choice]) { return message }\n return choices[choice].trim()\n};\n\nVueI18n.prototype.tc = function tc (key, choice) {\n var ref;\n\n var values = [], len = arguments.length - 2;\n while ( len-- > 0 ) values[ len ] = arguments[ len + 2 ];\n return (ref = this)._tc.apply(ref, [ key, this.locale, this._getMessages(), null, choice ].concat( values ))\n};\n\nVueI18n.prototype._te = function _te (key, locale, messages) {\n var args = [], len = arguments.length - 3;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 3 ];\n\n var _locale = parseArgs.apply(void 0, args).locale || locale;\n return this._exist(messages[_locale], key)\n};\n\nVueI18n.prototype.te = function te (key, locale) {\n return this._te(key, this.locale, this._getMessages(), locale)\n};\n\nVueI18n.prototype.getLocaleMessage = function getLocaleMessage (locale) {\n return looseClone(this._vm.messages[locale] || {})\n};\n\nVueI18n.prototype.setLocaleMessage = function setLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, message);\n};\n\nVueI18n.prototype.mergeLocaleMessage = function mergeLocaleMessage (locale, message) {\n if (this._warnHtmlInMessage === 'warn' || this._warnHtmlInMessage === 'error') {\n this._checkLocaleMessage(locale, this._warnHtmlInMessage, message);\n }\n this._vm.$set(this._vm.messages, locale, merge(\n typeof this._vm.messages[locale] !== 'undefined' && Object.keys(this._vm.messages[locale]).length\n ? Object.assign({}, this._vm.messages[locale])\n : {},\n message\n ));\n};\n\nVueI18n.prototype.getDateTimeFormat = function getDateTimeFormat (locale) {\n return looseClone(this._vm.dateTimeFormats[locale] || {})\n};\n\nVueI18n.prototype.setDateTimeFormat = function setDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, format);\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype.mergeDateTimeFormat = function mergeDateTimeFormat (locale, format) {\n this._vm.$set(this._vm.dateTimeFormats, locale, merge(this._vm.dateTimeFormats[locale] || {}, format));\n this._clearDateTimeFormat(locale, format);\n};\n\nVueI18n.prototype._clearDateTimeFormat = function _clearDateTimeFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._dateTimeFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._dateTimeFormatters[id];\n }\n};\n\nVueI18n.prototype._localizeDateTime = function _localizeDateTime (\n value,\n locale,\n fallback,\n dateTimeFormats,\n key\n) {\n var _locale = locale;\n var formats = dateTimeFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = dateTimeFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' datetime formats from '\" + current + \"' datetime formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n var id = _locale + \"__\" + key;\n var formatter = this._dateTimeFormatters[id];\n if (!formatter) {\n formatter = this._dateTimeFormatters[id] = new Intl.DateTimeFormat(_locale, format);\n }\n return formatter.format(value)\n }\n};\n\nVueI18n.prototype._d = function _d (value, locale, key) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && !VueI18n.availabilities.dateTimeFormat) {\n warn('Cannot format a Date value due to not supported Intl.DateTimeFormat.');\n return ''\n }\n\n if (!key) {\n return new Intl.DateTimeFormat(locale).format(value)\n }\n\n var ret =\n this._localizeDateTime(value, locale, this.fallbackLocale, this._getDateTimeFormats(), key);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to datetime localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.d(value, key, locale)\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.d = function d (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._d(value, locale, key)\n};\n\nVueI18n.prototype.getNumberFormat = function getNumberFormat (locale) {\n return looseClone(this._vm.numberFormats[locale] || {})\n};\n\nVueI18n.prototype.setNumberFormat = function setNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, format);\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype.mergeNumberFormat = function mergeNumberFormat (locale, format) {\n this._vm.$set(this._vm.numberFormats, locale, merge(this._vm.numberFormats[locale] || {}, format));\n this._clearNumberFormat(locale, format);\n};\n\nVueI18n.prototype._clearNumberFormat = function _clearNumberFormat (locale, format) {\n // eslint-disable-next-line no-autofix/prefer-const\n for (var key in format) {\n var id = locale + \"__\" + key;\n\n if (!this._numberFormatters.hasOwnProperty(id)) {\n continue\n }\n\n delete this._numberFormatters[id];\n }\n};\n\nVueI18n.prototype._getNumberFormatter = function _getNumberFormatter (\n value,\n locale,\n fallback,\n numberFormats,\n key,\n options\n) {\n var _locale = locale;\n var formats = numberFormats[_locale];\n\n var chain = this._getLocaleChain(locale, fallback);\n for (var i = 0; i < chain.length; i++) {\n var current = _locale;\n var step = chain[i];\n formats = numberFormats[step];\n _locale = step;\n // fallback locale\n if (isNull(formats) || isNull(formats[key])) {\n if (step !== locale && process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to '\" + step + \"' number formats from '\" + current + \"' number formats.\"));\n }\n } else {\n break\n }\n }\n\n if (isNull(formats) || isNull(formats[key])) {\n return null\n } else {\n var format = formats[key];\n\n var formatter;\n if (options) {\n // If options specified - create one time number formatter\n formatter = new Intl.NumberFormat(_locale, Object.assign({}, format, options));\n } else {\n var id = _locale + \"__\" + key;\n formatter = this._numberFormatters[id];\n if (!formatter) {\n formatter = this._numberFormatters[id] = new Intl.NumberFormat(_locale, format);\n }\n }\n return formatter\n }\n};\n\nVueI18n.prototype._n = function _n (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format a Number value due to not supported Intl.NumberFormat.');\n }\n return ''\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.format(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.format(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key) && !this._isSilentFallbackWarn(key)) {\n warn((\"Fall back to number localization of root: key '\" + key + \"'.\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n.n(value, Object.assign({}, { key: key, locale: locale }, options))\n } else {\n return ret || ''\n }\n};\n\nVueI18n.prototype.n = function n (value) {\n var args = [], len = arguments.length - 1;\n while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];\n\n var locale = this.locale;\n var key = null;\n var options = null;\n\n if (args.length === 1) {\n if (isString(args[0])) {\n key = args[0];\n } else if (isObject(args[0])) {\n if (args[0].locale) {\n locale = args[0].locale;\n }\n if (args[0].key) {\n key = args[0].key;\n }\n\n // Filter out number format options only\n options = Object.keys(args[0]).reduce(function (acc, key) {\n var obj;\n\n if (includes(numberFormatKeys, key)) {\n return Object.assign({}, acc, ( obj = {}, obj[key] = args[0][key], obj ))\n }\n return acc\n }, null);\n }\n } else if (args.length === 2) {\n if (isString(args[0])) {\n key = args[0];\n }\n if (isString(args[1])) {\n locale = args[1];\n }\n }\n\n return this._n(value, locale, key, options)\n};\n\nVueI18n.prototype._ntp = function _ntp (value, locale, key, options) {\n /* istanbul ignore if */\n if (!VueI18n.availabilities.numberFormat) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Cannot format to parts a Number value due to not supported Intl.NumberFormat.');\n }\n return []\n }\n\n if (!key) {\n var nf = !options ? new Intl.NumberFormat(locale) : new Intl.NumberFormat(locale, options);\n return nf.formatToParts(value)\n }\n\n var formatter = this._getNumberFormatter(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options);\n var ret = formatter && formatter.formatToParts(value);\n if (this._isFallbackRoot(ret)) {\n if (process.env.NODE_ENV !== 'production' && !this._isSilentTranslationWarn(key)) {\n warn((\"Fall back to format number to parts of root: key '\" + key + \"' .\"));\n }\n /* istanbul ignore if */\n if (!this._root) { throw Error('unexpected error') }\n return this._root.$i18n._ntp(value, locale, key, options)\n } else {\n return ret || []\n }\n};\n\nObject.defineProperties( VueI18n.prototype, prototypeAccessors );\n\nvar availabilities;\n// $FlowFixMe\nObject.defineProperty(VueI18n, 'availabilities', {\n get: function get () {\n if (!availabilities) {\n var intlDefined = typeof Intl !== 'undefined';\n availabilities = {\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\n };\n }\n\n return availabilities\n }\n});\n\nVueI18n.install = install;\nVueI18n.version = '8.27.0';\n\nexport default VueI18n;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"m-message-fade\",\"mode\":\"in-out\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.show),expression:\"show\"}],staticClass:\"m-message-wrapper\",class:_vm.wrapperClassName,style:({\r\n width: _vm.width\r\n })},[_c('mmessage',{class:[_vm.type && 'm-message--' + _vm.type, _vm.className],attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"closable\":_vm.showClose,\"is-collapsed\":_vm.isCollapsed,\"close-handler\":_vm.close,\"click-handler\":_vm.click,\"title\":_vm.title,\"supportHTML\":_vm.supportHTML},nativeOn:{\"mouseenter\":function($event){return _vm.clearTimer.apply(null, arguments)},\"mouseleave\":function($event){return _vm.startTimer.apply(null, arguments)}}},[_c('template',{slot:\"icon\"},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg}}):(_vm.type)?_c('icon',{staticClass:\"m-message--icon\",attrs:{\"name\":_vm.type}}):_vm._e()],1)],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.visible),expression:\"visible\"}],staticClass:\"m-message\"},[(_vm.iconImg || _vm.$slots.icon)?_c('div',{staticClass:\"m-message-icons\",on:{\"click\":_vm.handleClick}},[(_vm.iconImg)?_c('img',{staticClass:\"m-message--icon\",attrs:{\"src\":_vm.iconImg,\"alt\":\"Img\"}}):_vm._t(\"icon\")],2):_vm._e(),_c('div',{staticClass:\"m-message-content\",on:{\"click\":_vm.handleClick}},[(_vm.title || _vm.$slots.title)?_c('div',{staticClass:\"m-message--title\"},[_vm._t(\"title\",function(){return [_vm._v(\" \"+_vm._s(_vm.title)+\" \")]})],2):_vm._e(),(_vm.event && _vm.chat)?_c('event',{attrs:{\"event\":_vm.event,\"chat\":_vm.chat,\"preview\":true}}):_c('div',{staticClass:\"m-message--body\"},[_vm._t(\"message\")],2)],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mmessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./mmessage.vue?vue&type=template&id=03371e2c&\"\nimport script from \"./mmessage.vue?vue&type=script&lang=js&\"\nexport * from \"./mmessage.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","'use strict'\r\nconst icons = {}\r\n\r\nexport const addIcon = function (name, options) {\r\n icons[name] = options\r\n}\r\n\r\nconst Icon = {\r\n name: 'Icon',\r\n props: {\r\n name: String,\r\n color: String\r\n },\r\n computed: {\r\n svg () {\r\n return icons[this.name]\r\n }\r\n },\r\n // eslint-disable-next-line\r\n render (h) {\r\n const svg = this.svg\r\n\r\n if (!svg) {\r\n // eslint-disable-next-line\r\n console.warn(`The name of '${this.name}' could not be found.`)\r\n return ``\r\n }\r\n\r\n const style = {\r\n color: this.color ? this.color : (svg.fill ? svg.fill : null)\r\n }\r\n\r\n return (\r\n `\r\n \r\n { svg.defs && }\r\n { svg.path && }\r\n { svg.html && }\r\n {this.$slots.default}\r\n \r\n `\r\n )\r\n }\r\n}\r\n\r\nIcon.add = addIcon\r\n\r\nexport default Icon\r\n","export default {\r\n name: 'info',\r\n fill: '#1CADF2',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72z M581,673.9 c-33.2,49.9-67,88.3-123.8,88.3c-38.8-6.3-54.7-34.1-46.3-62.4L484,457.6c1.8-5.9-1.2-12.3-6.6-14.2c-5.4-1.9-15.9,5.1-25.1,15.1 l-44.2,53.2c-1.2-8.9-0.1-23.7-0.1-29.6c33.2-49.9,87.8-89.2,124.8-89.2c35.2,3.6,51.8,31.7,45.7,62.6l-73.6,243.3 c-1,5.5,1.9,11.1,6.9,12.8c5.4,1.9,16.8-5.1,26-15.1l44.2-53.1C583,652.3,581,667.9,581,673.9z M571.2,357.6 c-28,0-50.6-20.4-50.6-50.4c0-30,22.7-50.3,50.6-50.3c28,0,50.6,20.4,50.6,50.3C621.8,337.3,599.1,357.6,571.2,357.6z'\r\n}\r\n","export default {\r\n name: 'success',\r\n fill: '#17B77E',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,72C269,72,72,269,72,512s197,440,440,440s440-197,440-440S755,72,512,72L512,72z M758.9,374 c-48.5,48.6-81.2,76.9-172.3,186.8c-52.6,63.4-102.3,131.5-102.7,132L462.1,720c-4.6,6.1-13.5,6.8-19.1,1.6L267.9,558.9 c-17.8-16.5-18.8-44.4-2.3-62.2s44.4-18.8,62.2-2.3l104.9,97.5c5.5,5.1,14.1,4.5,18.9-1.3c16.2-20.1,38.4-44.5,62.4-68.6 c90.2-90.9,145.6-139.7,175.2-161.3c36-26.2,77.3-48.6,87.3-36.2C792,343.9,782.5,350.3,758.9,374L758.9,374z'\r\n}\r\n","export default {\r\n name: 'error',\r\n fill: '#F56C6C',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M579.7,512l101.6-101.6 c18.7-18.7,18.7-49,0-67.7c-18.7-18.7-49-18.7-67.7,0l0,0L512,444.3L410.4,342.7c-18.7-18.7-49-18.7-67.7,0s-18.7,49,0,67.7 L444.3,512L342.7,613.6c-18.7,18.7-18.7,49,0,67.7c18.7,18.7,49,18.7,67.7,0L512,579.7l101.6,101.6c18.7,18.7,49,18.7,67.7,0 c18.7-18.7,18.7-49,0-67.7L579.7,512z'\r\n}\r\n","export default {\r\n name: 'warning',\r\n fill: '#FFC603',\r\n viewBox: '0 0 1024 1024',\r\n path: 'M512,952C269,952,72,755,72,512S269,72,512,72s440,197,440,440S755,952,512,952z M510,770.8 c30.4,0,55-24.6,55-55s-24.6-55-55-55s-55,24.6-55,55S479.6,770.8,510,770.8z M509.8,255.3c-39.3,0-71.2,31.9-71.2,71.2 c0,3.1,0.2,6.2,0.6,9.3L472.4,588c2.5,19.3,18.9,33.7,38.4,33.7c19.4,0,35.8-14.4,38.2-33.7l31.8-252.2c5-39.2-22.8-75-62-79.9 C515.9,255.5,512.8,255.3,509.8,255.3z'\r\n}\r\n","export default {\r\n name: 'loading',\r\n viewBox: '0 0 50 50',\r\n class: 'm-loading-icon m-loading-wipe',\r\n defs: ``,\r\n html: ''\r\n}\r\n","import Icon from './icon'\r\nimport InfoIcon from './svgs/info'\r\nimport SuccessIcon from './svgs/success'\r\nimport ErrorIcon from './svgs/error'\r\nimport WarningIcon from './svgs/warning'\r\nimport LoadingIcon from './svgs/loading'\r\n\r\nIcon.add(InfoIcon.name, InfoIcon)\r\nIcon.add(SuccessIcon.name, SuccessIcon)\r\nIcon.add(ErrorIcon.name, ErrorIcon)\r\nIcon.add(WarningIcon.name, WarningIcon)\r\nIcon.add(LoadingIcon.name, LoadingIcon)\r\n\r\nexport default Icon\r\n","\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./message-template.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./message-template.vue?vue&type=template&id=7da7e992&\"\nimport script from \"./message-template.vue?vue&type=script&lang=js&\"\nexport * from \"./message-template.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","import MessageTemplate from './message-template'\r\nimport Vue from 'vue'\r\nconst MessageConstructor = Vue.extend(MessageTemplate)\r\n\r\nconst instances = []\r\nlet count = 1\r\nconst containers = {}\r\n\r\nconst Message = function (options) {\r\n let userOnClose = options.onClose\r\n let userOnClick = options.onClick\r\n const position = options.position || 'top-center'\r\n const hasMask = options.hasMask || false\r\n const containerKey = position + (hasMask ? '-mask' : '')\r\n let containerEl = containers[containerKey]\r\n\r\n if (!containerEl) {\r\n containerEl = containers[containerKey] = document.createElement('div')\r\n containerEl.className = [\r\n 'm-message-container',\r\n 'is-' + position,\r\n hasMask ? 'has-mask' : ''\r\n ].filter(function (e) { return !!e }).join(' ')\r\n document.body.appendChild(containerEl)\r\n }\r\n\r\n if (options.zIndex) {\r\n containerEl.style.zIndex = options.zIndex\r\n }\r\n\r\n const id = count++\r\n options.onClose = function () {\r\n Message.close(id, userOnClose)\r\n }\r\n\r\n options.onClick = function () {\r\n Message.click(id, userOnClick, userOnClose)\r\n }\r\n\r\n const instance = new MessageConstructor({\r\n el: document.createElement('div'),\r\n data: options\r\n })\r\n\r\n instance.id = id\r\n instance.containerKey = containerKey\r\n\r\n // for position of bottom-*\r\n if (position.indexOf('bottom') === 0 && containerEl.firstChild) {\r\n containerEl.insertBefore(instance.$el, containerEl.firstChild)\r\n } else {\r\n containerEl.appendChild(instance.$el)\r\n }\r\n // 挂载后再设置显示才有过渡效果\r\n instance.show = true\r\n\r\n instances.push(instance)\r\n\r\n return instance\r\n}\r\n\r\nMessage.click = function (id, userOnClick, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClick === 'function') {\r\n userOnClick(instances[i])\r\n }\r\n \r\n }\r\n }\r\n\r\n Message.close(id, userOnClose)\r\n}\r\n\r\nMessage.close = function (id, userOnClose) {\r\n for (let i = 0, len = instances.length; i < len; i++) {\r\n if (id === instances[i].id) {\r\n const { containerKey, hasMask } = instances[i]\r\n // 响应options.onClose\r\n if (typeof userOnClose === 'function') {\r\n userOnClose(instances[i])\r\n }\r\n instances[i] = null\r\n instances.splice(i, 1)\r\n\r\n const index = instances.findIndex(function (e) {\r\n return e.containerKey === containerKey\r\n })\r\n // 如果开启遮罩,300ms 后移除容器(不移除白屏时间太长)\r\n if (hasMask && index === -1) {\r\n setTimeout(function () {\r\n containers[containerKey].remove()\r\n containers[containerKey] = null\r\n }, 300)\r\n }\r\n break\r\n }\r\n }\r\n\r\n setTimeout(function () {\r\n // 当前没有消息后,移除容器\r\n if (instances.length === 0) {\r\n for (let type in containers) {\r\n if (containers[type]) {\r\n containers[type].remove()\r\n containers[type] = null\r\n }\r\n }\r\n }\r\n }, 300)\r\n}\r\n\r\nMessage.closeAll = function () {\r\n for (let i = instances.length - 1; i >= 0; i--) {\r\n instances[i].close()\r\n }\r\n}\r\n\r\nconst types = [ 'info', 'success', 'error', 'warning', 'loading' ]\r\n\r\ntypes.forEach(type => {\r\n Message[type] = function (options) {\r\n options = typeof options === 'string' ? { message: options } : options\r\n return Message({ ...options, type })\r\n }\r\n})\r\n\r\nexport default Message\r\n","import Message from './message.js'\r\nimport MessageComponent from './mmessage.vue'\r\nimport './asd.css'\r\n\r\nMessage.install = function (Vue, options) {\r\n if (options && options.name) {\r\n Vue.prototype[`$${options.name}`] = Message\r\n } else {\r\n Vue.prototype.$message = Message\r\n }\r\n}\r\n\r\nexport const MMessage = MessageComponent\r\nexport default Message\r\n","import f from \"@/application/functions\";\r\n\r\nvar cachestorage = {}\r\n\r\nclass MTRXKIT {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n }\r\n\r\n tetatetchat(m_chat){\r\n if(!m_chat) return false\r\n \r\n if(typeof m_chat.tetatet != 'undefined') return m_chat.tetatet\r\n\r\n var users = this.core.mtrx.chatUsersInfo(m_chat.roomId)\r\n var tt = false\r\n\r\n if(users.length == 2){\r\n tt = m_chat.name == '#' + this.tetatetid(users[0], users[1])\r\n }\r\n if(users.length > 1) m_chat.tetatet = tt\r\n\r\n return tt\r\n }\r\n\r\n tetatetid(user1, user2) {\r\n\r\n var seed = 2;\r\n\r\n if(user1.id == user2.id) return null\r\n\r\n var id = parseInt(user1.id, 16) * parseInt(user2.id, 16) * seed\r\n\r\n if(cachestorage[id]) return cachestorage[id]\r\n\r\n var hash = f.sha224(id.toString()).toString('hex')\r\n\r\n cachestorage[id] = hash\r\n\r\n return hash\r\n }\r\n\r\n unknowngroupusers(m_chat){\r\n return m_chat && m_chat._selfMembership === 'invite' && !m_chat.summary.members && !this.tetatetchat(this.m_chat)\r\n }\r\n\r\n usersFromChats(m_chats){\r\n var users = {}\r\n \r\n _.each(m_chats, (chat) => {\r\n\r\n users[chat.roomId] = _.map(_.uniq([].concat(_.toArray(chat.currentState.members), chat.summary.members || []), (r) => {\r\n return r.userId\r\n\r\n }), function(r){\r\n\r\n return {\r\n userId : f.getmatrixid(r.userId),\r\n membership : r.membership,\r\n powerLevel : r.powerLevel\r\n }\r\n\r\n }) \r\n })\r\n\r\n\r\n\r\n return users\r\n }\r\n\r\n prepareChat(m_chat){\r\n\t\treturn this.usersInfoForChatsStore([m_chat]).then(() => {\r\n return this.core.pcrypto.addroom(m_chat)\r\n })\r\n\t}\r\n\r\n fillContacts(m_chats){\r\n\r\n m_chats = _.filter(m_chats, (ch) => {\r\n return ch._selfMembership == 'join' && ch.name.length == 57\r\n })\r\n\r\n return this.usersInfoForChatsStore(m_chats).then(i => {\r\n\r\n this.core.store.commit('SET_CONTACTS_FROM_MATRIX', _.filter(i, (m) => {\r\n return !this.core.user.userinfo || m.id !== this.core.user.userinfo.id\r\n }))\r\n\r\n })\r\n }\r\n\r\n usersInfoForChatsStore(m_chats, reload){\r\n\r\n return this.usersInfoForChats(m_chats, reload).then(i => {\r\n\r\n this.core.store.commit('SET_CHATS_USERS', this.usersFromChats(m_chats))\r\n\r\n return Promise.resolve(i)\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n allchatmembers(m_chats, reload, withinvite){\r\n var members = []\r\n var promises = []\r\n\r\n\r\n if(withinvite){\r\n var promises = _.map(m_chats, (chat) => {\r\n\r\n\r\n if(chat._selfMembership === 'invite' && (!chat.summary.members || reload) && !chat.summary.membersloading){\r\n \r\n chat.summary.membersloading = true\r\n \r\n return chat._loadMembersFromServer().then(r => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n chat.summary.members = _.map(r, (user) => {\r\n \r\n return {\r\n name: f.getmatrixid(user.state_key),\r\n membership: user.content.membership,\r\n user: user,\r\n userId : user.state_key,\r\n powerLevel : user.content.powerLevel || 0\r\n }\r\n \r\n })\r\n \r\n if(chat._selfMembership === 'invite' && this.core.user.userinfo){\r\n \r\n if(!_.find(chat.summary.members, (m) => {\r\n return m.userId == this.core.user.matrixId(this.core.user.userinfo.id)\r\n } )){\r\n \r\n chat.summary.members.push({\r\n name: this.core.user.userinfo.id,\r\n membership: 'invite',\r\n user: this.core.user.userinfo,\r\n userId : this.core.user.matrixId(this.core.user.userinfo.id),\r\n powerLevel : 0\r\n })\r\n \r\n }\r\n \r\n }\r\n \r\n return Promise.resolve()\r\n \r\n }).catch(e => {\r\n \r\n chat.summary.membersloading = false\r\n \r\n return Promise.resolve()\r\n })\r\n }\r\n \r\n return Promise.resolve()\r\n \r\n })\r\n }\r\n\r\n return Promise.all(promises).then(r => {\r\n\r\n _.each(m_chats, (chat) => {\r\n members = members.concat(_.toArray(chat.currentState.members), chat.summary.members || [])\r\n })\r\n\r\n members = _.uniq(members, function(m){\r\n return m.userId\r\n })\r\n\r\n return Promise.resolve(members)\r\n })\r\n }\r\n\r\n usersInfoForChats(m_chats, reload) {\r\n\r\n /// TODO FILTER CONTACTS\r\n\r\n return this.allchatmembers(m_chats, reload).then(members => {\r\n\r\n return this.usersInfo(members, reload)\r\n })\r\n \r\n }\r\n\r\n usersInfoById(id) {\r\n\r\n var ids = [f.getmatrixid(id)]\r\n\r\n return this.core.user.usersInfo(ids, false).then( r => {\r\n return Promise.resolve(r[0])\r\n })\r\n }\r\n\r\n usersInfo(members, reload) {\r\n\r\n var ids = _.map(members, function (m) {\r\n return f.getmatrixid(m.userId)\r\n })\r\n\r\n ids = _.uniq(ids)\r\n\r\n return this.core.user.usersInfo(ids, false, reload)\r\n }\r\n\r\n groupId(users) {\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n users.forEach( (user) => {\r\n idForInviting.push( this.core.user.matrixId(user.id) )\r\n })\r\n\r\n users.forEach(function (user) {\r\n let idsForHash = parseInt(user.id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n\r\n return {hash: hash, idForInviting: idForInviting}\r\n\r\n }\r\n\r\n groupIdLight(ids) {\r\n\r\n let id = [];\r\n let idForInviting = []\r\n let self = this\r\n\r\n var domains = [null]\r\n\r\n if (window.chatinvitedomains) domains = [].concat(domains, window.chatinvitedomains)\r\n\r\n _.each(domains, (domain) => {\r\n\r\n _.each(ids, (id) => {\r\n idForInviting.push( this.core.user.matrixId(id, domain) )\r\n })\r\n\r\n })\r\n\r\n \r\n _.each(ids, (_id) => {\r\n let idsForHash = parseInt(_id, 16)\r\n\r\n id.push(idsForHash)\r\n })\r\n\r\n const groupNameId = id.reduce((product, n) => product * n, 1);\r\n const mGroupNamId = f.makeid(groupNameId)\r\n\r\n let hash = f.sha224(mGroupNamId.toString()).toString('hex')\r\n return {hash: hash, idForInviting: idForInviting}\r\n }\r\n\r\n chatIsPublic(chat){\r\n var join_rules = chat.currentState.getStateEvents(\"m.room.join_rules\")\r\n\r\n return _.find(join_rules, (v) => {\r\n return f.deep(v, 'event.content.join_rule') == 'public'\r\n }) ? true : false\r\n }\r\n\r\n \r\n}\r\n\r\nexport default MTRXKIT","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * FingerprintJS v3.3.2 - Copyright (c) FingerprintJS, Inc, 2021 (https://fingerprintjs.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArrays } from 'tslib';\n\nvar version = \"3.3.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction forEachWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\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\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\" + selector + \"'\";\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var isFinalResultLoaded = function (loadResult) {\n return typeof loadResult !== 'function';\n };\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n var sourceGetters = Array(includedSources.length);\n // Using `forEachWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n forEachWithBreaks(includedSources, function (sourceKey, index) {\n sourceGetters[index] = loadSource(sources[sourceKey], sourceOptions);\n });\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var components, _i, includedSources_1, sourceKey, componentPromises, _loop_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n components = {};\n for (_i = 0, includedSources_1 = includedSources; _i < includedSources_1.length; _i++) {\n sourceKey = includedSources_1[_i];\n components[sourceKey] = undefined;\n }\n componentPromises = Array(includedSources.length);\n _loop_1 = function () {\n var hasAllComponentPromises;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n hasAllComponentPromises = true;\n return [4 /*yield*/, forEachWithBreaks(includedSources, function (sourceKey, index) {\n if (!componentPromises[index]) {\n // `sourceGetters` may be incomplete at this point of execution because `forEachWithBreaks` is asynchronous\n if (sourceGetters[index]) {\n componentPromises[index] = sourceGetters[index]().then(function (component) { return (components[sourceKey] = component); });\n }\n else {\n hasAllComponentPromises = false;\n }\n }\n })];\n case 1:\n _a.sent();\n if (hasAllComponentPromises) {\n return [2 /*return*/, \"break\"];\n }\n return [4 /*yield*/, wait(1)]; // Lets the source load loop continue\n case 2:\n _a.sent(); // Lets the source load loop continue\n return [2 /*return*/];\n }\n });\n };\n _a.label = 1;\n case 1: return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (state_1 === \"break\")\n return [3 /*break*/, 4];\n _a.label = 3;\n case 3: return [3 /*break*/, 1];\n case 4: return [4 /*yield*/, Promise.all(componentPromises)];\n case 5:\n _a.sent();\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprintjs.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* Timeout */ || error.name === \"suspended\" /* Suspended */) {\n return -3 /* Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n fingerprintPromise.catch(function () { return undefined; });\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n context.startRendering();\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n element.setAttribute(name_1, attributes[name_1].join(' '));\n }\n return element;\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\" + fontToDetect + \"',\" + baseFont);\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n return { winding: false, geometry: '', text: '' };\n }\n return {\n winding: doesSupportWinding(context),\n geometry: makeGeometryImage(canvas, context),\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n text: makeTextImage(canvas, context),\n };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction makeTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \" + String.fromCharCode(55357, 56835) /* 😃 */;\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n return save(canvas);\n}\nfunction makeGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n return save(canvas);\n}\nfunction save(canvas) {\n // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArrays(screenFrameBackup)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\" + (offset >= 0 ? '+' : '') + Math.abs(offset);\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * See docs/content_blockers.md to learn how to make the list\n */\nvar filters = {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n 'a[title=\"7naga poker\" i]',\n '[title=\"ALIENBOLA\" i]',\n ],\n abpvn: [\n '#quangcaomb',\n '.iosAdsiosAds-layout',\n '.quangcao',\n '[href^=\"https://r88.vn/\"]',\n '[href^=\"https://zbet.vn/\"]',\n ],\n adBlockFinland: [\n '.mainostila',\n '.sponsorit',\n '.ylamainos',\n 'a[href*=\"/clickthrgh.asp?\"]',\n 'a[href^=\"https://app.readpeak.com/ads\"]',\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n 'a[href^=\"http://g1.v.fwmrm.net/ad/\"]',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n ],\n adBlockWarningRemoval: ['#adblock-honeypot', '.adblocker-root', '.wp_adblock_detect'],\n adGuardAnnoyances: ['amp-embed[type=\"zen\"]', '.hs-sosyal', '#cookieconsentdiv', 'div[class^=\"app_gdpr\"]', '.as-oil'],\n adGuardBase: ['#ad-after', '#ad-p3', '.BetterJsPopOverlay', '#ad_300X250', '#bannerfloat22'],\n adGuardChinese: [\n '#piao_div_0[style*=\"width:140px;\"]',\n 'a[href*=\".ttz5.cn\"]',\n 'a[href*=\".yabovip2027.com/\"]',\n '.tm3all2h4b',\n '.cc5278_banner_ad',\n ],\n adGuardFrench: [\n '.zonepub',\n '[class*=\"_adLeaderboard\"]',\n '[id^=\"block-xiti_oas-\"]',\n 'a[href^=\"http://ptapjmp.com/\"]',\n 'a[href^=\"https://go.alvexo.com/\"]',\n ],\n adGuardGerman: [\n '.banneritemwerbung_head_1',\n '.boxstartwerbung',\n '.werbung3',\n 'a[href^=\"http://www.eis.de/index.phtml?refid=\"]',\n 'a[href^=\"https://www.tipico.com/?affiliateId=\"]',\n ],\n adGuardJapanese: [\n '#kauli_yad_1',\n '#ad-giftext',\n '#adsSPRBlock',\n 'a[href^=\"http://ad2.trafficgate.net/\"]',\n 'a[href^=\"http://www.rssad.jp/\"]',\n ],\n adGuardMobile: ['amp-auto-ads', '#mgid_iframe', '.amp_ad', 'amp-embed[type=\"24smi\"]', '#mgid_iframe1'],\n adGuardRussian: [\n 'a[href^=\"https://ya-distrib.ru/r/\"]',\n 'a[href^=\"https://ad.letmeads.com/\"]',\n '.reclama',\n 'div[id^=\"smi2adblock\"]',\n 'div[id^=\"AdFox_banner_\"]',\n ],\n adGuardSocial: [\n 'a[href^=\"//www.stumbleupon.com/submit?url=\"]',\n 'a[href^=\"//telegram.me/share/url?\"]',\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: [\n '#barraPublicidade',\n '#Publicidade',\n '#publiEspecial',\n '#queTooltip',\n '[href^=\"http://ads.glispa.com/\"]',\n ],\n adGuardTrackingProtection: [\n 'amp-embed[type=\"taboola\"]',\n '#qoo-counter',\n 'a[href^=\"http://click.hotlog.ru/\"]',\n 'a[href^=\"http://hitcounter.ru/top/stat.php\"]',\n 'a[href^=\"http://top.mail.ru/jump\"]',\n ],\n adGuardTurkish: [\n '#backkapat',\n '#reklami',\n 'a[href^=\"http://adserv.ontek.com.tr/\"]',\n 'a[href^=\"http://izlenzi.com/campaign/\"]',\n 'a[href^=\"http://www.installads.net/\"]',\n ],\n bulgarian: ['td#freenet_table_ads', '#adbody', '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: ['#AD_banner_bottom', '#Ads_google_02', '#N-ad-article-rightRail-1', '#ad-fullbanner2', '#ad-zone-2'],\n easyListChina: [\n 'a[href*=\".wensixuetang.com/\"]',\n 'A[href*=\"/hth107.com/\"]',\n '.appguide-wrap[onclick*=\"bcebos.com\"]',\n '.frontpageAdvM',\n '#taotaole',\n ],\n easyListCookie: ['#adtoniq-msg-bar', '#CoockiesPage', '#CookieModal_cookiemodal', '#DO_CC_PANEL', '#ShowCookie'],\n easyListCzechSlovak: ['#onlajny-stickers', '#reklamni-box', '.reklama-megaboard', '.sklik', '[id^=\"sklikReklama\"]'],\n easyListDutch: [\n '#advertentie',\n '#vipAdmarktBannerBlock',\n '.adstekst',\n 'a[href^=\"https://xltube.nl/click/\"]',\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n 'a[href^=\"http://www.hw-area.com/?dp=\"]',\n 'a[href^=\"https://ads.sunmaker.com/tracking.php?\"]',\n '.werbung-skyscraper2',\n '.bannergroup_werbung',\n '.ads_rechts',\n ],\n easyListItaly: [\n '.box_adv_annunci',\n '.sb-box-pubbliredazionale',\n 'a[href^=\"http://affiliazioniads.snai.it/\"]',\n 'a[href^=\"https://adserver.html.it/\"]',\n 'a[href^=\"https://affiliazioniads.snai.it/\"]',\n ],\n easyListLithuania: [\n '.reklamos_tarpas',\n '.reklamos_nuorodos',\n 'img[alt=\"Reklaminis skydelis\"]',\n 'img[alt=\"Dedikuoti.lt serveriai\"]',\n 'img[alt=\"Hostingas Serveriai.lt\"]',\n ],\n estonian: ['A[href*=\"http://pay4results24.eu\"]'],\n fanboyAnnoyances: [\n '#feedback-tab',\n '#taboola-below-article',\n '.feedburnerFeedBlock',\n '.widget-feedburner-counter',\n '[title=\"Subscribe to our blog\"]',\n ],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: [\n '.td-tags-and-social-wrapper-box',\n '.twitterContainer',\n '.youtube-social',\n 'a[title^=\"Like us on Facebook\"]',\n 'img[alt^=\"Share on Digg\"]',\n ],\n frellwitSwedish: [\n 'a[href*=\"casinopro.se\"][target=\"_blank\"]',\n 'a[href*=\"doktor-se.onelink.me\"]',\n 'article.category-samarbete',\n 'div.holidAds',\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n 'A[href*=\"adman.otenet.gr/click?\"]',\n 'A[href*=\"http://axiabanners.exodus.gr/\"]',\n 'A[href*=\"http://interactive.forthnet.gr/click?\"]',\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n 'A[href*=\"ad.eval.hu\"]',\n 'A[href*=\"ad.netmedia.hu\"]',\n 'A[href*=\"daserver.ultraweb.hu\"]',\n '#cemp_doboz',\n '.optimonk-iframe-container',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '.cookie-msg-info-container',\n '#cookies-policy-sticky',\n ],\n icelandicAbp: ['A[href^=\"/framework/resources/forms/ads.aspx\"]'],\n latvian: [\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 120px; height: 40px; overflow: hidden; position: relative;\"]',\n 'a[href=\"http://www.salidzini.lv/\"][style=\"display: block; width: 88px; height: 31px; overflow: hidden; position: relative;\"]',\n ],\n listKr: [\n 'a[href*=\"//kingtoon.slnk.kr\"]',\n 'a[href*=\"//playdsb.com/kr\"]',\n 'div.logly-lift-adz',\n 'div[data-widget_id=\"ml6EJ074\"]',\n 'ins.daum_ddn_area',\n ],\n listeAr: [\n '.geminiLB1Ad',\n '.right-and-left-sponsers',\n 'a[href*=\".aflam.info\"]',\n 'a[href*=\"booraq.org\"]',\n 'a[href*=\"dubizzle.com/ar/?utm_source=\"]',\n ],\n listeFr: [\n 'a[href^=\"http://promo.vador.com/\"]',\n '#adcontainer_recherche',\n 'a[href*=\"weborama.fr/fcgi-bin/\"]',\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n '[href^=\"https://aff.sendhub.pl/\"]',\n 'a[href^=\"http://advmanager.techfun.pl/redirect/\"]',\n 'a[href^=\"http://www.trizer.pl/?utm_source\"]',\n 'div#skapiec_ad',\n ],\n ro: [\n 'a[href^=\"//afftrk.altex.ro/Counter/Click\"]',\n 'a[href^=\"/magazin/\"]',\n 'a[href^=\"https://blackfridaysales.ro/trk/shop/\"]',\n 'a[href^=\"https://event.2performant.com/events/click\"]',\n 'a[href^=\"https://l.profitshare.ro/\"]',\n ],\n ruAd: [\n 'a[href*=\"//febrare.ru/\"]',\n 'a[href*=\"//utimg.ru/\"]',\n 'a[href*=\"://chikidiki.ru\"]',\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: ['a[href*=macau-uta-popup]', '#ads-google-middle_rectangle-group', '.ads300s', '.bumq', '.img-kosana'],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n '.ctpl-fullbanner',\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n};\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var debug = (_a === void 0 ? {} : _a).debug;\n return __awaiter(this, void 0, void 0, function () {\n var filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filterNames = Object.keys(filters);\n allSelectors = (_b = []).concat.apply(_b, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _c.sent();\n if (debug) {\n printDebug(blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\" + filterName + \":\";\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \" + selector + \" \" + (blockedSelectors[selector] ? '🚫' : '➡️');\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(message + \"\\n```\");\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \" + gamut + \")\").matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch('inverted')) {\n return true;\n }\n if (doesMatch('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(inverted-colors: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$1('active')) {\n return true;\n }\n if (doesMatch$1('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(forced-colors: \" + value + \")\").matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \" + i + \")\").matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \" + value + \")\").matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$3('reduce')) {\n return true;\n }\n if (doesMatch$3('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(prefers-reduced-motion: \" + value + \")\").matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch$4('high')) {\n return true;\n }\n if (doesMatch$4('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(dynamic-range: \" + value + \")\").matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = containerWidthPx + \"px\";\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\" + 1 / iframeWindow.devicePixelRatio;\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArrays(Array((containerWidthPx / 20) << 0)).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\" + proConfidenceScore) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\" + (result ? '|' : '') + componentKey.replace(/([:|\\\\])/g, '\\\\$1') + \":\" + value;\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \" + result.version + \"\\nuserAgent: \" + navigator.userAgent + \"\\ntimeBetweenLoadAndGet: \" + (startTime - creationTime) + \"\\nvisitorId: \" + result.visitorId + \"\\ncomponents: \" + componentsToDebugString(components) + \"\\n```\");\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.01) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://openfpcdn.io/fingerprintjs/v\" + version + \"/npm-monitoring\", true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport default index;\nexport { componentsToDebugString, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources };\n","const sdk = require('@/matrix-js-sdk');\r\n\r\nimport MTRXKIT from \"./mtrxkit\";\r\nimport f from \"./functions\";\r\nimport images from \"./utils/images\";\r\nimport FingerprintJS from '@fingerprintjs/fingerprintjs';\r\n\r\nimport qs from 'qs';\r\nimport fileSaver from 'file-saver';\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar axios = require('axios');\r\n\r\n\r\nclass MTRX {\r\n\r\n constructor(core, p) {\r\n if (!p) p = {}\r\n\r\n this.core = core\r\n this.baseUrl = p.baseUrl\r\n this.ready = false\r\n this.error = false\r\n this.kit = new MTRXKIT(this.core, p)\r\n this.sdk = sdk\r\n this.sync = ''\r\n this.nd = false\r\n this.version = 4\r\n this.dversion = '2'\r\n this.backup = {}\r\n this.db = null\r\n\r\n this.customrequest = true\r\n\r\n this.devicekey = 'm8_device'\r\n }\r\n\r\n\r\n async setCredentials() {\r\n return this.core.user.matrixCredentials().then(credentials => {\r\n this.credentials = credentials\r\n return Promise.resolve(credentials)\r\n })\r\n\r\n }\r\n\r\n getDevices() {\r\n var devices = localStorage[this.devicekey] || ''\r\n\r\n if (devices) {\r\n try {\r\n var d = JSON.parse(devices)\r\n\r\n return d\r\n } catch (e) {\r\n }\r\n }\r\n\r\n return {}\r\n }\r\n\r\n setDevice(device, userkey) {\r\n\r\n var devices = this.getDevices()\r\n\r\n devices[userkey] = device\r\n\r\n localStorage[this.devicekey] = JSON.stringify(devices)\r\n localStorage.device_ = JSON.stringify(device)\r\n\r\n }\r\n\r\n getDevice(userkey) {\r\n // return localStorage.m8_device;\r\n // var devices = this.getDevices()\r\n // return devices[userkey] || null\r\n }\r\n\r\n request(opts, clbk) {\r\n\r\n var response = null;\r\n\r\n var error = null\r\n\r\n const cancelTokenSource = axios.CancelToken.source();\r\n\r\n var aopts = {\r\n url: opts.uri,\r\n params: opts.qs,\r\n data: JSON.parse(opts.body || \"{}\"),\r\n timeout: opts.timeout,\r\n headers: opts.headers,\r\n json: opts.json,\r\n method: opts.method,\r\n withCredentials: opts.withCredentials,\r\n _matrix_opts: opts,\r\n cancelToken: cancelTokenSource.token,\r\n\r\n paramsSerializer: function (params) {\r\n return qs.stringify(params, opts.qsStringifyOptions)\r\n },\r\n }\r\n\r\n var req = axios(aopts).then(response => {\r\n\r\n\r\n return Promise.resolve(response)\r\n }).catch(e => {\r\n\r\n error = e\r\n response = e.response\r\n\r\n return Promise.resolve(response)\r\n\r\n }).then(response => {\r\n\r\n var parsederror = error\r\n\r\n if (error) {\r\n\r\n try {\r\n parsederror = JSON.parse(f.deep(response, 'request.responseText'))\r\n\r\n error = new sdk.MatrixError(parsederror)\r\n\r\n } catch (e) {\r\n }\r\n\r\n //error.error = parsederror\r\n\r\n }\r\n\r\n clbk(error, response, f.deep(response, 'request.responseText') || '')\r\n\r\n /*if (error)\r\n return Promise.reject(parsederror)*/\r\n })\r\n\r\n req.abort = function () {\r\n cancelTokenSource.cancel();\r\n }\r\n\r\n return req\r\n\r\n /*\r\n uri\tstring\tThe complete URI.\r\n method\tstring\tThe HTTP method.\r\n qs\tObject\tThe query parameters to append to the URI.\r\n body\tObject\tThe JSON-serializable object.\r\n json\tboolean\tTrue if this is a JSON request.\r\n _matrix_opts\r\n */\r\n\r\n\r\n }\r\n\r\n async getFingerprint() {\r\n var fp = await FingerprintJS.load()\r\n var result = await fp.get()\r\n return result.visitorId + this.dversion\r\n }\r\n\r\n createMtrxClient(opts) {\r\n\r\n var client = sdk.createClient(opts);\r\n\r\n client.getProfileInfo = function () {\r\n return Promise.resolve({\r\n avatar_url: '',\r\n displayname: 'test'\r\n })\r\n }\r\n\r\n return client\r\n }\r\n\r\n async getClient() {\r\n\r\n await this.setCredentials();\r\n\r\n var userClientData = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n var opts = {\r\n baseUrl: this.baseUrl\r\n }\r\n\r\n if (this.customrequest)\r\n opts.request = this.request\r\n\r\n var client = this.createMtrxClient(opts);\r\n\r\n\r\n try {\r\n var userData = await client.login('m.login.password', {\r\n user: this.credentials.username,\r\n password: this.credentials.password,\r\n })\r\n\r\n } catch (e) {\r\n\r\n if(e && e.indexOf && e.indexOf('M_USER_DEACTIVATED') > -1){\r\n this.error = 'M_USER_DEACTIVATED'\r\n return null\r\n }\r\n\r\n if (await client.isUsernameAvailable(this.credentials.username)) {\r\n\r\n userData = await client.register(\r\n this.credentials.username,\r\n this.credentials.password,\r\n null,\r\n {\r\n type: 'm.login.dummy',\r\n //signature : this.core.user.signature('matrix')\r\n }\r\n )\r\n\r\n } else {\r\n throw 'Signup error, username is not available: ' + e\r\n }\r\n }\r\n\r\n localStorage.accessToken = userData.access_token\r\n var store = new sdk.IndexedDBStore({\r\n indexedDB: window.indexedDB,\r\n dbName: 'matrix-js-sdk:' + this.credentials.username\r\n })\r\n await store.startup()\r\n\r\n Object.assign(userClientData, {\r\n userId: userData.user_id,\r\n accessToken: userData.access_token,\r\n unstableClientRelationAggregation: true,\r\n timelineSupport: true,\r\n store: store,\r\n\r\n // deviceId: userData.device_id,\r\n })\r\n\r\n if (this.customrequest)\r\n userClientData.request = this.request\r\n\r\n\r\n var userClient = this.createMtrxClient(userClientData)\r\n window.client = userClient\r\n window.core = this.core\r\n\r\n await userClient.startClient({\r\n pollTimeout: 60000,\r\n resolveInvitesToProfiles: true\r\n });\r\n\r\n\r\n this.access = userClientData\r\n\r\n this.client = userClient\r\n\r\n return userClient;\r\n }\r\n\r\n clearstorage(key) {\r\n var keys = Object.keys(localStorage), i = keys.length;\r\n\r\n while (i--) {\r\n if (keys[i] && keys[i].indexOf(key) == 0) {\r\n localStorage.removeItem(keys[i]);\r\n }\r\n }\r\n }\r\n\r\n clearstore() {\r\n\r\n var version = Number(localStorage.matrixversion || '0')\r\n\r\n if (version < this.version) {\r\n\r\n this.clearstorage('crypto.')\r\n this.clearstorage('session.')\r\n\r\n var keys = ['', '2', '3', '4', '5', '6', '8']\r\n\r\n _.each(keys, function (key) {\r\n delete localStorage['m' + key + '_device']\r\n })\r\n\r\n }\r\n\r\n localStorage.matrixversion = this.version\r\n }\r\n\r\n async createClient() {\r\n try {\r\n this.client = await this.getClient()\r\n this.store = this.client.store\r\n this.ready = true\r\n\r\n } catch (e) {\r\n this.error = e\r\n }\r\n\r\n\r\n return true\r\n }\r\n\r\n wait() {\r\n return f.pretry(() => {\r\n return this.ready\r\n }).then(() => {\r\n\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n waitchats() {\r\n\r\n return f.pretry(() => {\r\n\r\n return this.chatsready\r\n\r\n }).then(() => {\r\n\r\n if (this.error) {\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n me(id) {\r\n return f.getmatrixid(id) == this.core.user.userinfo?.id\r\n }\r\n\r\n reciepts(event) {\r\n var room = null;\r\n\r\n return f.pretry(() => {\r\n\r\n var rooms = this.core.mtrx.store.rooms\r\n\r\n room = rooms[event.getRoomId()]\r\n\r\n return room\r\n\r\n }).then(() => {\r\n\r\n return room.getReceiptsForEvent(event)\r\n\r\n })\r\n }\r\n\r\n storeFileLocal(url, file){\r\n\r\n return file.arrayBuffer().then((arrayBuffer) => {\r\n const blob = new Blob([new Uint8Array(arrayBuffer)], {type: file.type });\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n return window.POCKETNETINSTANCE.storage.saveFile(url, blob);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n return this.db.set(url, blob)\r\n }\r\n }\r\n \r\n });\r\n \r\n \r\n }\r\n\r\n download(url) {\r\n\r\n // Function to download the file\r\n var dlFile = () => {\r\n return f.fetchLocal(url).then(response => {\r\n // Update the storage before returning\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova){\r\n window.POCKETNETINSTANCE.storage.saveFile(url, response.data);\r\n }\r\n \r\n else{\r\n if(this.db){\r\n this.db.set(url, response.data)\r\n }\r\n }\r\n\r\n return Promise.resolve(response.data);\r\n })\r\n }\r\n\r\n\r\n // Check if file is saved in the storage\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.storage && window.cordova) {\r\n return window.POCKETNETINSTANCE.storage.loadFile(url).then((file) => {\r\n return Promise.resolve(file);\r\n }, (e) => {\r\n\r\n // Nothing in storage, download file\r\n return dlFile();\r\n });\r\n } else {\r\n\r\n if(this.db){\r\n\r\n return this.db.get(url).then((file) => {\r\n\r\n return Promise.resolve(file);\r\n\r\n }).catch(() => {\r\n return dlFile();\r\n })\r\n \r\n }\r\n\r\n return dlFile();\r\n\r\n }\r\n \r\n \r\n }\r\n\r\n customRoomType(roomId) {\r\n var room = this.core.mtrx.client.getRoom(roomId)\r\n\r\n if (!room) return null\r\n\r\n var ev = room.currentState.getStateEvents(\"m.room.custom\", \"\") || {};\r\n\r\n return ev.event?.content.type\r\n\r\n }\r\n\r\n isReaded(event, me) {\r\n\r\n return this.reciepts(event).then(reciepts => {\r\n return Promise.resolve(\r\n _.find(reciepts, reciept => {\r\n var m = this.me(reciept.userId)\r\n\r\n\r\n return reciept.type == 'm.read' && ((me && m) || (!m && !me))\r\n })\r\n )\r\n })\r\n\r\n\r\n }\r\n\r\n initEvents() {\r\n\r\n let self = this\r\n\r\n let userId = this.core.mtrx.client.credentials.userId\r\n\r\n this.client.on(\"RoomMember.membership\", (event, member) => {\r\n\r\n\r\n if (!this.chatsready) return\r\n\r\n\r\n if ((member.membership === \"invite\" || member.membership === \"join\") && event.getSender() !== userId) {\r\n this.core.notifier.event(event)\r\n }\r\n\r\n });\r\n\r\n this.client.on(\"Room.timeline\", (message, member) => {\r\n\r\n if (!this.chatsready) return\r\n\r\n if (!message.event.content) return\r\n\r\n if (message.event.content.msgtype === 'm.file') {\r\n message.event.content.pbody = JSON.parse(message.event.content.body)\r\n }\r\n\r\n\r\n if (message.getSender() !== userId) {\r\n\r\n var m_chat = this.core.mtrx.client.getRoom(message.event.room_id)\r\n\r\n if (message.event.content['m.relates_to'] && message.event.content['m.relates_to'][\"rel_type\"] == 'm.replace') return false\r\n\r\n if (m_chat && this.core.pcrypto.rooms[message.event.room_id]) this.core.notifier.event(message, m_chat)\r\n\r\n }\r\n\r\n\r\n });\r\n\r\n this.client.on(\"RoomMember.typing\", (event, member) => {\r\n this.core.store.dispatch('TYPING_EVENT', member)\r\n });\r\n\r\n\r\n this.client.on('sync', (state, prevState, res) => {\r\n\r\n if (state === 'PREPARED') {\r\n this.setready()\r\n }\r\n\r\n this.core.store.dispatch('FETCH_CHATS').then(r => {\r\n this.core.store.dispatch('FETCH_EVENTS')\r\n this.core.store.commit('ALL_NOTIFICATIONS_COUNT', this.client.getRooms())\r\n })\r\n\r\n\r\n });\r\n\r\n }\r\n\r\n setready() {\r\n\r\n if (!this.chatsready) {\r\n this.chatsready = true\r\n this.core.store.commit('SET_CHATS_READY', true)\r\n }\r\n\r\n }\r\n\r\n initdb(){\r\n return ChatStorage('files', 1).then((db) => {\r\n this.db = db\r\n return Promise.resolve()\r\n }).catch(() => {\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n init() {\r\n return this.createClient().then(() => {\r\n\r\n if(this.error){\r\n return Promise.reject(this.error)\r\n }\r\n\r\n return this.initdb()\r\n \r\n }).then(() => {\r\n\r\n this.initEvents()\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n deactivateAccount(){\r\n\r\n if (this.client) {\r\n return this.client.deactivateAccount(this.credentials, true)\r\n }\r\n\r\n return Promise.reject('noclient')\r\n }\r\n\r\n destroy() {\r\n if (this.client) {\r\n // Before client is stopped, delete the pusher if needed\r\n if (window.cordova) {\r\n this.deletePusher();\r\n }\r\n\r\n this.client.stopClient()\r\n }\r\n\r\n this.chatsready = false\r\n this.ready = false\r\n this.error = false\r\n }\r\n\r\n // Try to delete the current pusher if needed\r\n deletePusher() {\r\n // Try to get a saved token\r\n\r\n if (!window.cordova) return\r\n\r\n var savedToken;\r\n if (localStorage)\r\n savedToken = localStorage.getItem('fcmtoken5');\r\n if (savedToken && this.client.setPusher) {\r\n var appName = 'pocketnet';\r\n var pusherData = {\r\n app_display_name: appName,\r\n app_id: appName + window.cordova.platformId,\r\n\r\n data: {\r\n url: this.core.mtrx.baseUrl + '/_matrix/push/v1/notify',\r\n default_payload: {\r\n aps: {\r\n \"sound\": \"default\",\r\n \"content-available\": 1\r\n }\r\n }\r\n },\r\n\r\n device_display_name: window.device.manufacturer + \" \" + window.device.model,\r\n kind: null,\t// Set to null to delete the pusher\r\n lang: localStorage.getItem('loc') || 'en',\r\n pushkey: savedToken\r\n\r\n };\r\n\r\n this.core.mtrx.client.setPusher(pusherData).then(() => {\r\n localStorage.removeItem('fcmtoken5');\r\n }, (err) => {\r\n console.log(err);\r\n });\r\n }\r\n }\r\n\r\n uploadContent(file, save) {\r\n return this.client.uploadContent(file).then(src => {\r\n return Promise.resolve(this.core.mtrx.client.mxcUrlToHttp(src))\r\n }).then(url => {\r\n\r\n if(save){\r\n return this.storeFileLocal(url, file).then(() => {\r\n return Promise.resolve(url)\r\n }).catch(e => {\r\n return Promise.resolve(url)\r\n })\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n /*transaction(roomId, txId){\r\n this.client.sendEvent(roomId, \"m.room.message\", {\r\n\r\n txId: roomId,\r\n msgtype: \"m.notice\"\r\n\r\n }, \"\");\r\n }*/\r\n\r\n\r\n originalEvent(id, timeline) {\r\n var rtr = timeline._timelineSet.getRelationsForEvent(e.event.event_id, 'm.reference', 'm.room.message')\r\n\r\n if (rtr) {\r\n var events = rtr.getRelations()\r\n return events[0]\r\n }\r\n }\r\n\r\n clearEventId(event) {\r\n var previd = null\r\n\r\n if (\r\n event.event.content['m.relates_to'] &&\r\n event.event.content['m.relates_to']['rel_type'] == 'm.replace') previd = event.event.content['m.relates_to']['event_id']\r\n\r\n\r\n return previd || event.getId()\r\n\r\n }\r\n\r\n textEvent(chat, text) {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return chat.pcrypto.encryptEvent(text)\r\n }\r\n\r\n return Promise.resolve(this.sdk.ContentHelpers.makeTextMessage(text))\r\n }\r\n\r\n sendtext(chat, text, {relation, from}) {\r\n\r\n return this.textEvent(chat, text).then(r => {\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n return this.client.sendEvent(chat.roomId, 'm.room.message', r)\r\n } else\r\n return this.client.sendMessage(chat.roomId, r)\r\n })\r\n\r\n\r\n }\r\n\r\n sendFile(chat, file, meta, {relation, from}, notenc) {\r\n\r\n if (!meta) meta = {}\r\n\r\n var fileInfo = {}\r\n fileInfo.name = file.name\r\n fileInfo.size = file.size\r\n\r\n var encpromise = (() => Promise.resolve(file))()\r\n var promise = null\r\n\r\n if (chat.pcrypto.canBeEncrypt() && !notenc) {\r\n\r\n encpromise = chat.pcrypto.encryptFile(file).then(r => {\r\n\r\n fileInfo.secrets = r.secrets\r\n\r\n return Promise.resolve(r.file)\r\n\r\n })\r\n\r\n }\r\n\r\n return encpromise.then(file => {\r\n\r\n promise = this.client.uploadContent(file)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n\r\n }).then(src => {\r\n\r\n if (meta.aborted)\r\n return Promise.reject('aborted')\r\n\r\n return Promise.resolve(this.client.mxcUrlToHttp(src))\r\n\r\n }).then((url) => {\r\n\r\n fileInfo.url = url\r\n\r\n let body = JSON.stringify(fileInfo)\r\n\r\n var r = {\r\n body: body,\r\n msgtype: 'm.file'\r\n }\r\n\r\n if (relation) {\r\n\r\n r['m.relates_to'] = {\r\n \"rel_type\": relation.type,\r\n \"event_id\": this.clearEventId(relation.event),\r\n }\r\n\r\n }\r\n\r\n if (from) {\r\n r['from'] = from\r\n }\r\n\r\n return this.client.sendMessage(chat.roomId, r)\r\n\r\n })\r\n\r\n }\r\n\r\n sendImageBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendImage(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendAudioBase64(chat, base64, meta, p) {\r\n\r\n var method = 'toFileFetch'\r\n\r\n if (base64.indexOf('data:') > -1) method = 'toFile'\r\n\r\n return f.Base64[method](base64).then(file => {\r\n return this.sendAudio(chat, base64, file, meta, p)\r\n })\r\n }\r\n\r\n sendImage(chat, base64, file, meta, {relation, from} = {}) {\r\n if (!file) return this.sendImageBase64(chat, base64, meta)\r\n\r\n var i = new images()\r\n var info = {}\r\n\r\n if (!meta) meta = {}\r\n\r\n return i.wh(base64).then(_info => {\r\n info = _info\r\n\r\n if (from)\r\n info.from = from\r\n\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return Promise.resolve(r.file)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve(file)\r\n\r\n\r\n }).then(file => {\r\n var promise = this.core.mtrx.uploadContent(file, true)\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((image) => {\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendImageMessage(chat.roomId, image, info, 'Image')\r\n })\r\n }\r\n\r\n sendAudio(chat, base64, file, meta, {relation, from} = {}) {\r\n\r\n\r\n if (!file) return this.sendAudioBase64(chat, base64, meta)\r\n\r\n \r\n let info = {}\r\n\r\n info.from = from\r\n\r\n return new Promise(resolve => {\r\n if (chat.pcrypto.canBeEncrypt()) {\r\n\r\n return chat.pcrypto.encryptFile(file).then(r => {\r\n info.secrets = r.secrets\r\n return resolve(r.file)\r\n })\r\n }\r\n\r\n resolve(file) \r\n\r\n }).then(file => {\r\n\r\n let promise = this.core.mtrx.uploadContent(file, true)\r\n\r\n if (promise.abort) meta.abort = promise.abort\r\n\r\n return promise\r\n }).then((audio) => {\r\n\r\n if (meta.aborted) return Promise.reject('aborted')\r\n\r\n return this.client.sendAudioMessage(chat.roomId, audio, info, 'Audio')\r\n })\r\n\r\n }\r\n\r\n async getFile(chat, event) {\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n\r\n return this.download(event.event.content.pbody.url).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return Promise.resolve({\r\n file: r,\r\n name: event.event.content.pbody.name\r\n });\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n async downloadFile(chat, event) {\r\n\r\n return this.getFile(chat, event).then(r => {\r\n\r\n if (window.cordova && f.saveFileCordova) {\r\n return new Promise((resolve, reject) => {\r\n\r\n f.saveFileCordova(r.file, r.name, function (i, e) {\r\n\r\n if (e) {\r\n console.error(e)\r\n }\r\n\r\n if (!e) resolve()\r\n\r\n else reject('unable')\r\n })\r\n })\r\n }\r\n\r\n return fileSaver.saveAs(r.file, r.name);\r\n\r\n }).catch(e => {\r\n console.error(e)\r\n return Promise.reject(e)\r\n })\r\n\r\n\r\n }\r\n\r\n async getAudioUnencrypt(chat, event){\r\n\r\n if(event.event.content.audioData){\r\n return Promise.resolve(event.event.content.audioData)\r\n }\r\n\r\n return this.download(event.event.content.url, true).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.content.audioData = arraybuffer\r\n\r\n return Promise.resolve(arraybuffer)\r\n })\r\n\r\n }\r\n\r\n async getAudio(chat, event) {\r\n\r\n if (event.event.decryptedAudio) {\r\n return Promise.resolve(event.event.decryptedAudio)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n\r\n return f.readFile(r)\r\n }).then(arraybuffer => {\r\n\r\n event.event.decryptedAudio = arraybuffer\r\n\r\n return Promise.resolve(event.event.decryptedAudio)\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n }\r\n }\r\n\r\n async getImage(chat, event) {\r\n\r\n if (event.event.decryptedImage) {\r\n return Promise.resolve(event.event.decryptedImage)\r\n }\r\n\r\n try {\r\n\r\n var decryptKey = await chat.pcrypto.decryptKey(event.event)\r\n\r\n event.event.decryptKey = decryptKey\r\n\r\n return this.download(event.event.content.url, true).then(blob => {\r\n\r\n return chat.pcrypto.decryptFile(blob, decryptKey)\r\n\r\n }).then(r => {\r\n return f.Base64.fromFile(r)\r\n }).then(url => {\r\n\r\n event.event.decryptedImage = url.replace('data:file;', 'data:image/jpeg;')\r\n return Promise.resolve(event.event.decryptedImage)\r\n\r\n\r\n }).catch(e => {\r\n return Promise.reject(e)\r\n })\r\n\r\n } catch (e) {\r\n return Promise.reject(e)\r\n\r\n }\r\n }\r\n\r\n\r\n shareInChat(id, share) {\r\n var m_chat = this.client.getRoom(id)\r\n\r\n\r\n //// share.openwithItems []\r\n\r\n //// https://github.com/j3k0/cordova-plugin-openwith (item.type ---> resize)\r\n\r\n return this.core.mtrx.kit.prepareChat(m_chat).then(r => {\r\n\r\n var promises = []\r\n\r\n //// todo resize images.resize.fit\r\n _.each(share.images, (base64) => {\r\n\r\n var promise = this.sendImageBase64(m_chat, base64, {}, {from: share.from})\r\n\r\n promises.push(promise)\r\n\r\n })\r\n\r\n _.each(share.files, (file) => {\r\n\r\n promises.push(this.sendFile(m_chat, file, {}, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.urls, (url) => {\r\n\r\n promises.push(this.sendtext(m_chat, url, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.messages, (text) => {\r\n\r\n promises.push(this.sendtext(m_chat, text, {from: share.from}))\r\n\r\n })\r\n\r\n _.each(share.audio, (arraybuffer) => {\r\n\r\n var base64 = 'data:audio/mpeg;base64,' + f._arrayBufferToBase64(arraybuffer)\r\n\r\n promises.push(this.sendAudioBase64(m_chat, base64,{}, {from: share.from}))\r\n\r\n })\r\n\r\n return Promise.all(promises)\r\n\r\n })\r\n }\r\n\r\n opencontact(contact) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: contact.name,\r\n type: 'contact',\r\n data: {\r\n contact: contact\r\n }\r\n })\r\n }\r\n\r\n complain(caption, p) {\r\n\r\n this.core.store.commit('setmodal', {\r\n caption: caption,\r\n type: 'complain',\r\n data: p\r\n })\r\n }\r\n\r\n blockeduser(id) {\r\n\r\n if (!this.core.mtrx.client) return\r\n\r\n return this.core.mtrx.client.isUserIgnored(this.core.user.matrixId(id))\r\n }\r\n\r\n blockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList.push(userId)\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n fastsync = function () {\r\n\r\n var state = this.client.getSyncState()\r\n\r\n if (state === \"PREPARED\" || state === \"SYNCING\") {\r\n\r\n } else {\r\n return this.client.retryImmediately().catch(e => {\r\n console.log('fastsyncerror', e)\r\n })\r\n }\r\n\r\n\r\n }\r\n\r\n unblockUser(userId) {\r\n\r\n userId = this.core.user.matrixId(userId)\r\n\r\n if (!this.client.isUserIgnored(userId)) {\r\n return Promise.resolve()\r\n }\r\n\r\n var blackList = this.client.getIgnoredUsers()\r\n\r\n blackList = _.filter(blackList, function (_id) {\r\n return userId != _id\r\n })\r\n\r\n return this.client.setIgnoredUsers(blackList).then(r => {\r\n return Promise.resolve(r)\r\n })\r\n }\r\n\r\n chatUsersInfo(roomId, m) {\r\n\r\n if (!m) m = 'chatUsers'\r\n\r\n var _users = this.core.store.state.users\r\n\r\n return _.filter(_.map(this[m](roomId), (user) => {\r\n return _users[user.userId]\r\n }), function (u) {\r\n return u\r\n })\r\n\r\n }\r\n\r\n chatUsers(roomId) {\r\n return this.core.store.state.chatusers[roomId] || []\r\n }\r\n\r\n\r\n anotherChatUsers(roomId) {\r\n return _.filter(this.chatUsers(roomId), (user) => {\r\n return user.userId != this.core.user.userinfo.id\r\n })\r\n }\r\n}\r\n\r\nexport default MTRX\r\n","//require('ion-sound')\r\nimport f from \"./functions\";\r\n//const { Howl, Howler } = require('howler');\r\n\r\nclass Notifier {\r\n\r\n\tconstructor(core, p) {\r\n\t\tif (!p) p = {}\r\n\r\n\t\tthis.core = core\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\r\n\t\tthis.ion = null\r\n\r\n\t\tif (typeof ion != 'undefined') this.ion = ion\r\n\r\n\t\t/*ion.sound({\r\n\t\t sounds: [\r\n\t\t\t{\r\n\t\t\t name: \"glass\"\r\n\t\t\t}\r\n\t\t ],\r\n\t\t path: \"sounds/\",\r\n\t\t preload: true\r\n\t\t});*/\r\n\t}\r\n\r\n\tkey = 'showednotifications'\r\n\tshowed = {}\r\n\r\n\taddshowed(id) {\r\n\r\n\t\tthis.showed = JSON.parse(localStorage[this.key] || \"{}\")\r\n\t\tthis.showed[id] = true\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\r\n\t}\r\n\r\n\tclearshowed() {\r\n\t\tthis.showed = {}\r\n\t\tlocalStorage[this.key] = JSON.stringify(this.showed)\r\n\t}\r\n\r\n\tplaysound() {\r\n\t\t// If cordova is available, use the media plugin to play a sound\r\n\t\tif (window.Media && window.cordova && window.cordova.file && window.cordova.file.applicationDirectory) {\r\n\r\n\t\t\tvar soundSrc = window.cordova.file.applicationDirectory + 'www/sounds/glass.mp3';\r\n\t\t\tif (soundSrc.startsWith('file://'))\r\n\t\t\t\tsoundSrc = soundSrc.substring(7);\r\n\t\t\tvar notificationSound = new Media(soundSrc);\r\n\t\t\t// Play audio\r\n\t\t\tnotificationSound.play();\r\n\t\t}\r\n\r\n\t\t// Else, try to use the Howler sound plugin\r\n\t\telse if (window.ion) {\r\n\r\n\t\t\tion.sound.play('glass')\r\n\r\n\t\t\t/*var notificationSound = new Howl({\r\n\t\t\t\tsrc: ['sounds/glass.mp3'],\r\n\t\t\t\thtml5: true\r\n\t\t\t});\r\n\t\t\tnotificationSound.play();*/\r\n\t\t}\r\n\t}\r\n\r\n\tnotifySoundOrAction() {\r\n\r\n\t\tvar lastsounddate = localStorage['lastsounddate'] || null\r\n\r\n\t\tif (lastsounddate) {\r\n\t\t\tlastsounddate = new Date(lastsounddate)\r\n\r\n\t\t\tif (f.date.addseconds(lastsounddate, 10) > (new Date())) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlocalStorage['lastsounddate'] = (new Date())\r\n\r\n\t\tif (window.cordova && window.POCKETNETINSTANCE) {\r\n\t\t\twindow.POCKETNETINSTANCE.mobile.vibration.small()\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.playsound()\r\n\t\t}\r\n\t}\r\n\r\n\tdecrypt(event, chat) {\r\n\r\n\t\treturn this.core.mtrx.kit.prepareChat(chat).then(r => {\r\n\r\n\t\t\t\r\n\t\t\tif (event.event.decrypted) {\r\n\r\n\t\t\t\treturn Promise.resolve()\r\n\t\t\t}\r\n\r\n\t\t\treturn chat.pcrypto.decryptEvent(event.event)\r\n\t\t\t \r\n\t\t}).catch(e => {\r\n\t\t\treturn Promise.resolve()\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tmessage(event, user, chat) {\r\n\r\n\t\tvar state = this.core.vm.$store.state\r\n\r\n\r\n\t\tif (this.showed[event.event.event_id]) return\r\n\r\n\t\tthis.addshowed(event.event.event_id)\r\n\r\n\t\tvar external = f.deep(this, 'core.external.clbks.NOTIFICATION') || {}\r\n\t\tvar ctype = ''\r\n\r\n\t\tvar t = f.deep(event, 'event.type')\r\n\r\n\t\tif (['m.room.member'].indexOf(t) > -1) ctype = 'invite'\r\n\t\tif (['m.room.message'].indexOf(t) > -1) ctype = 'message'\r\n\t\tif (['m.room.name'].indexOf(t) > -1) ctype = ''\r\n\t\tif (['m.room.power_levels'].indexOf(t) > -1) ctype = 'moder'\r\n\t\tif (['m.room.redaction'].indexOf(t) > -1) ctype = 'redaction'\r\n\t\tif (f.deep(event, 'event.content.msgtype') == 'm.encrypted') ctype = 'encrypted'\r\n\r\n\t\tvar c = () => {\r\n\r\n\t\t\t\r\n\t\t\tvar msg = {\r\n\t\t\t\ttitle: user.name,\r\n\t\t\t\tevent: event,\r\n\t\t\t\tmessage: event.event.content.type == 'm.encrypted' ? \"***\" : event.event.content.body, // event.content.body,\r\n\t\t\t\troomId: event.event.room_id,\r\n\t\t\t\ticon: user.image,\r\n\t\t\t\tchat: chat,\r\n\t\t\t\tctype: ctype\r\n\t\t\t}\r\n\r\n\t\t\t_.each(external, function (e) {\r\n\t\t\t\te(msg)\r\n\t\t\t})\r\n\r\n\t\t\tif (state.currentRoom === event.event.room_id && !this.core.hiddenInParent) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.notifySoundOrAction()\r\n\t\t\tthis.show(msg, '/chat?id=' + event.event.room_id)\r\n\t\t}\r\n\r\n\t\tif (ctype == 'encrypted') {\r\n\t\t\tthis.decrypt(event, chat).then(c)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tc()\r\n\t\t}\r\n\r\n\r\n\t}\r\n\r\n\tevent(event, chat) {\r\n\t\tlet pushAction = this.core.mtrx.client.getPushActionsForEvent(event)\r\n\r\n\r\n\t\tif (!pushAction.notify) return\r\n\r\n\t\t//let timeFromNow = moment(moment.utc(event.event.origin_server_ts).toDate()).local().fromNow()\r\n\r\n\t\tvar date = moment(moment.utc(event.event.origin_server_ts).toDate()).local().toDate()\r\n\t\tvar iftime = f.date.addseconds(date, 10) > moment().toDate()\r\n\r\n\r\n\t\tif (!iftime) return\r\n\r\n\t\tthis.core.mtrx.isReaded(event, true).then(r => {\r\n\r\n\t\t\tif (r) return\r\n\r\n\t\t\tif (!this.core.mtrx.me(event.getSender()) && event.getSender() && event.getSender() !== this.core.mtrx.client.credentials.userId) {\r\n\r\n\r\n\t\t\t\tthis.core.user.usersInfo([f.getmatrixid(event.getSender())]).then(info => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tinfo && info[0]\r\n\t\t\t\t\t) {\r\n\r\n\r\n\t\t\t\t\t\tthis.message(event, info[0], chat)\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t})\r\n\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t}\r\n\r\n\tshow = function (info, click) {\r\n\t\tif (typeof click != 'function') {\r\n\t\t\tvar route = click\r\n\t\t\tclick = () => {\r\n\t\t\t\tthis.core.vm.$router.push(route).catch(e => {})\r\n\r\n\t\t\t\tif (this.core.apptochat) this.core.apptochat()\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar position = \"bottom-right\";\r\n\r\n\t\tif (this.core.vm.$store.state.mobile) {\r\n\t\t\tposition = 'top-left'\r\n\t\t}\r\n\r\n\t\tthis.core.vm.$message({\r\n\t\t\tevent: info.event,\r\n\t\t\ttitle: info.title,\r\n\t\t\tmessage: info.message,\r\n\t\t\troomId: info.roomId,\r\n\t\t\ticonImg: info.icon || null,\r\n\t\t\tonClick: click,\r\n\t\t\tzIndex: 999,\r\n\t\t\tsupportHTML: true,\r\n\t\t\twrapperClassName: \"notificationWrapper\",\r\n\t\t\tposition: position,\r\n\t\t\ttype: 'info',\r\n\t\t\tchat: info.chat,\r\n\t\t\tduration: 5000\r\n\t\t})\r\n\t}\r\n}\r\n\r\nexport default Notifier","var Axios = require('axios');\r\nimport axiosRequest from '@nelsonomuto/axios-request-timeout';\r\nvar { error, byError } = require('./error')\r\n\r\nimport f from '@/application/functions'\r\nimport qs from 'qs';\r\n\r\nvar Axios = function(){\r\n\r\n var datakeys = [\r\n 'data.result'\r\n ]\r\n\r\n var errorkeys = [\r\n 'data.error'\r\n ]\r\n\r\n async function axios ({\r\n to : to,\r\n data : data\r\n }){\r\n\r\n data || (data = {})\r\n\r\n _.each(data, (v, i) => {\r\n if(_.isArray(v) || _.isObject(v)){\r\n data[i] = JSON.stringify(v)\r\n }\r\n }) \r\n\r\n var response = null;\r\n\r\n try{\r\n response = await axiosRequest({\r\n method: 'post',\r\n headers: { 'content-type': 'application/x-www-form-urlencoded' },\r\n url: to,\r\n data: qs.stringify(data),\r\n timeout: 35000\r\n })\r\n\r\n }\r\n catch(e){\r\n response = e.response\r\n }\r\n \r\n\r\n if(!response){\r\n return Promise.reject('noresponse')\r\n }\r\n\r\n ////errors\r\n \r\n var ke = _.find(errorkeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (ke){\r\n return Promise.reject(byError(f.deep(response.data, ke)))\r\n }\r\n\r\n ////result\r\n\r\n var k = _.find(datakeys, function(k){\r\n return f.deep(response.data, k)\r\n })\r\n\r\n\r\n if (k){\r\n return Promise.resolve(f.deep(response.data, k))\r\n }\r\n\r\n ////result\r\n \r\n return Promise.reject('error')\r\n \r\n\r\n }\r\n\r\n return {\r\n axios\r\n }\r\n\r\n}\r\n\r\nexport default Axios","import f from './functions'\r\nimport Axios from './axios'\r\nvar { error } = require('./error')\r\n\r\nimport ChatStorage from \"./chatstorage\";\r\n\r\nvar ApiWrapper = function (core) {\r\n\r\n\tvar self = this;\r\n\tvar a = new Axios();\r\n\r\n\tvar cache = {}\r\n\tvar loading = {}\r\n\tvar storages = {}\r\n\r\n\tvar apis = {\r\n\t\tpocketnet : null\r\n\t}\r\n\r\n\tvar ep = function(){\r\n\t\treturn Promise.resolve()\r\n\t}\r\n\r\n\tvar getstorage = function(p){\r\n\r\n\t\tif(!storages[p.storage]){\r\n\t\t\treturn ChatStorage(p.storage, p.version || 1, p.time).then(storage => {\r\n\r\n\t\t\t\tstorages[p.storage] = storage\r\n\r\n\t\t\t\treturn Promise.resolve(storage)\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn Promise.resolve(storages[p.storage])\r\n\t}\r\n\r\n\t\r\n\tvar scasheAct = function (ids, key, resultsKey, reload, storageparameters) {\r\n\r\n\t\tif (!_.isArray(ids)) ids = [ids]\r\n\r\n\t\tvar waitLoading = {}\r\n\r\n\t\tif(!resultsKey) \r\n\t\t\tresultsKey = key\r\n\r\n\t\tif(!cache[key]) {\r\n\t\t\tcache[key] = {}\r\n\t\t}\r\n\r\n\t\tif(!loading[key]) {\r\n\t\t\tloading[key] = {}\r\n\t\t}\r\n\r\n\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\r\n\t\t\tif (storage){\r\n\r\n\t\t\t\treturn Promise.all(_.map(ids, (id) => {\r\n\r\n\t\t\t\t\tif (cache[key][id]){\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn storage.get(id).then((stored) => {\r\n\t\t\t\t\t\tcache[key][stored[resultsKey]] = stored\r\n\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t}).catch(e => {\r\n\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t}))\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t\t\r\n\t\t}).then(r => {\r\n\r\n\t\t\tvar idtoloadPrev = _.uniq(_.filter(ids, function (id) {\r\n\t\t\t\treturn reload || !cache[key][id] || cache[key][id].nocache\r\n\t\t\t}))\r\n\t\r\n\t\t\tvar idtoload = _.filter(idtoloadPrev, function (id) {\r\n\t\r\n\t\t\t\tif(!loading[key][id]) {\r\n\t\t\t\t\tloading[key][id] = true\r\n\t\t\t\t\treturn true\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\twaitLoading[id] = true\r\n\t\t\t})\r\n\t\r\n\t\t\tvar handleResults = function (result, _ids) {\r\n\r\n\t\t\t\treturn (storageparameters ? getstorage(storageparameters) : ep()).then(storage => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(storage){\r\n\t\t\t\t\t\treturn Promise.all(_.map(result, (row) => {\r\n\r\n\t\t\t\t\t\t\tif(!row[resultsKey]){\r\n\t\t\t\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\treturn storage.set(row[resultsKey], row)\r\n\r\n\t\t\t\t\t\t}))\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.resolve()\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(() => {\r\n\r\n\t\t\t\t\t_.each(result, function (row) {\r\n\r\n\t\t\t\t\t\tif (row[resultsKey]) {\r\n\t\t\t\t\t\t\tcache[key][row[resultsKey]] = row\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t_.each(_ids, function(id){\r\n\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\r\n\t\t\t\t\t\tif(!cache[key][id])\r\n\t\t\t\t\t\t\tcache[key][id] = 'error'\r\n\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\tvar nresult = {};\r\n\t\t\r\n\t\t\t\t\treturn f.pretry(() => {\r\n\t\t\r\n\t\t\t\t\t\t_.each(ids, function (id) {\r\n\t\t\r\n\t\t\t\t\t\t\tif (cache[key][id]) {\r\n\t\t\r\n\t\t\t\t\t\t\t\tif (cache[key][id] != 'error')\r\n\t\t\r\n\t\t\t\t\t\t\t\t\tnresult[id] = (cache[key][id])\r\n\t\t\r\n\t\t\t\t\t\t\t\tdelete loading[key][id]\r\n\t\t\t\t\t\t\t\tdelete waitLoading[id]\r\n\t\t\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\r\n\t\t\t\t\t\treturn _.toArray(waitLoading).length == 0\r\n\t\t\r\n\t\t\t\t\t}).then(() => {\r\n\t\t\t\t\t\treturn Promise.resolve(nresult)\r\n\t\t\t\t\t})\r\n\r\n\t\t\t\t})\r\n\t\r\n\t\t\t\t\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.resolve({\r\n\t\t\t\tid: idtoload,\r\n\t\t\t\thandle: handleResults\r\n\t\t\t})\r\n\t\t})\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t}\r\n\r\n\tvar waitonline = function () {\r\n\r\n\t\tif (!core || !core.waitonline) {\r\n\t\t\treturn Promise.resolve()\r\n\t\t}\r\n\r\n\t\treturn core.waitonline()\r\n\r\n\t}\r\n\r\n\tvar crequest = function (ids, key, rkey, reload, storageparameters) {\r\n\r\n\t\treturn scasheAct(ids, key, rkey, reload, storageparameters).then(sh => {\r\n\r\n\t\t\tif (!sh.id.length) {\r\n\t\t\t\treturn sh.handle([])\r\n\t\t\t}\r\n\t\r\n\t\t\treturn Promise.reject(sh)\r\n\r\n\t\t})\r\n\r\n\t\t\r\n\t}\r\n\r\n\tvar request = function (data, to) {\r\n\r\n\t\treturn waitonline().then(() => {\r\n\r\n\t\t\tdata || (data = {})\r\n\r\n\t\t\treturn a.axios({\r\n\t\t\t\tto,\r\n\t\t\t\tdata,\r\n\t\t\t}).then(r => {\r\n\r\n\t\t\t\treturn Promise.resolve(r)\r\n\r\n\t\t\t})\r\n\t\t\t\t.catch(e => {\r\n\r\n\t\t\t\t\tif (e == 'noresponse') {\r\n\r\n\t\t\t\t\t\treturn new Promise((resolve, reject) => {\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\trequest(data, to).then(r => {\r\n\r\n\r\n\t\t\t\t\t\t\t\t\treturn resolve(r)\r\n\r\n\t\t\t\t\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\t\t\t\t\treturn reject(e)\r\n\r\n\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t\t}, 3000)\r\n\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn Promise.reject(e)\r\n\r\n\t\t\t\t})\r\n\r\n\r\n\t\t})\r\n\r\n\r\n\t}\r\n\r\n\tself.clearCache = function (key) {\r\n\r\n\t\tif (!key) {\r\n\t\t\tcache = {}\r\n\t\t} else {\r\n\t\t\tdelete cache[key]\r\n\t\t}\r\n\t}\r\n\r\n\tself.pocketnet = {\r\n\r\n\t\tcommon: (data, method) => {\r\n\r\n\t\t\tif(!data) data = {}\r\n\r\n\t\t\tif(!apis.pocketnet)\r\n\t\t\t\tapis.pocketnet = f.deep(window, 'POCKETNETINSTANCE.api')\r\n\t\t\t\t\r\n\t\t\tif(!apis.pocketnet && typeof Api != 'undefined'){\r\n\t\t\t\tapis.pocketnet = new Api(core)\r\n\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\tif (apis.pocketnet) {\r\n\r\n\t\t\t\treturn apis.pocketnet.initIf().then(() => {\r\n\t\t\t\t\treturn apis.pocketnet.wait.ready('use', 3000)\r\n\t\t\t\t\t\r\n\t\t\t\t}).then(r => {\r\n\t\t\t\t\treturn apis.pocketnet.rpc(method, data.parameters)\r\n\t\t\t\t}).catch(e => {\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\terror : e\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t})\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tdata.method = method\r\n\t\t\tdata.node = '185.148.147.15'\r\n\t\t\tdata.parameters = f.hexEncode(JSON.stringify(data.parameters || \"\"))\r\n\r\n\t\t\treturn request(data, servers.pocketnet + '/rpc-' + (method || \"common\"))\r\n\r\n\t\t},\r\n\t\t\r\n\t\tuserState: (addresses) => {\r\n\r\n\t\t\tif (!_.isArray(addresses)) addresses = [addresses]\r\n\r\n\t\t\tvar parameters = [addresses.join(',')];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserstate')\r\n\t\t},\r\n\r\n\t\tuserStateMe: (address) => {\r\n\r\n\t\t\tvar cacheresult = f.deep(window, 'POCKETNETINSTANCE.platform.sdk.ustate.storage.' + address)\r\n\r\n\t\t\tif(cacheresult){\r\n\t\t\t\treturn Promise.resolve(cacheresult)\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userState(address)\r\n\t\t},\r\n\r\n\t\tuserInfoCached: (addresses, reload) => {\r\n\r\n\t\t\tvar rescached = []\r\n\r\n\t\t\tif(!reload){\r\n\r\n\t\t\t\trescached = _.filter(_.map(addresses, (address) => {\r\n\t\t\t\t\treturn f.deep(window, 'POCKETNETINSTANCE.platform.sdk.userscl.storage.' + address) || null\r\n\t\t\t\t}), (u) => {return u})\r\n\r\n\t\t\t\taddresses = _.filter(addresses, (a) => {\r\n\t\t\t\t\treturn !_.find(rescached, (r) => {\r\n\t\t\t\t\t\treturn r.address == a\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\treturn self.pocketnet.userInfo(addresses, reload).then(rs => {\r\n\r\n\t\t\t\t\r\n\t\t\t\trs = _.toArray(rs)\r\n\r\n\t\t\t\t_.each(rescached, (c) => {\r\n\t\t\t\t\trs.push(c)\r\n\t\t\t\t})\r\n\r\n\r\n\t\t\t\treturn Promise.resolve(rs)\r\n\t\t\t})\r\n\r\n\t\t},\r\n\r\n\t\tsearch: (text) => {\r\n\r\n\t\t\tvar parameters = [text, 'users'];\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'searchusers').then(data => {\r\n\t\t\t\treturn Promise.resolve(data || [])\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tuserInfo: (addresses, reload) => {\r\n\r\n\t\t\tif(!addresses.length){\r\n\t\t\t\treturn Promise.resolve([])\r\n\t\t\t}\r\n\r\n\t\t\treturn crequest(addresses, 'pocketnet_userInfo', 'address', reload, {\r\n\t\t\t\tstorage : 'userInfo',\r\n\t\t\t\ttime : 60 * 60 * 24 \r\n\t\t\t}).catch(sh => {\r\n\r\n\t\t\t\tif(!sh || !sh.id) {\r\n\t\t\t\t\treturn Promise.reject(sh)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar parameters = [sh.id, '1'];\r\n\r\n\t\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\t\treturn sh.handle(results, sh.id)\r\n\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpostInfo: (params) => {\r\n\r\n\t\t\tvar parameters = [[params.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getrawtransactionwithmessagebyid').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileAddress: (profile_name) => {\r\n\r\n\t\t\tvar parameters = [[profile_name.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuseraddress').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\t\tpocketNetProfileInfo: (profile_address) => {\r\n\r\n\t\t\tvar parameters = [[profile_address.parameters]]\r\n\r\n\t\t\treturn self.pocketnet.common({ parameters }, 'getuserprofile').then(results => {\r\n\r\n\t\t\t\treturn Promise.resolve(results)\r\n\r\n\t\t\t})\r\n\t\t},\r\n\r\n\r\n\t}\r\n\r\n\treturn self;\r\n}\r\n\r\nexport default ApiWrapper\r\n\r\n","import f from './functions';\r\n\r\nvar Media = function () {\r\n var self = this\r\n\r\n self.gettingmedia = false\r\n\r\n var permissions = {\r\n\r\n ios : {\r\n audio : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n window.audioinput.checkMicrophonePermission(function(hasPermission) {\r\n if (hasPermission) {\r\n \r\n resolve();\r\n } \r\n else {\t \r\n // Ask the user for permission to access the microphone\r\n window.audioinput.getMicrophonePermission(function(hasPermission, message) {\r\n if (hasPermission) {\r\n resolve()\r\n } else {\r\n reject('permissions')\r\n }\r\n });\r\n }\r\n });\r\n\r\n })\r\n \r\n },\r\n\r\n video : function(){\r\n\r\n return new Promise((resolve, reject) => {\r\n \r\n var needMic = true;\r\n var needCamera = true;\r\n\r\n cordova.plugins.iosrtc.requestPermission(needMic, needCamera, function (permissionApproved) {\r\n // permissionApproved will be true if user accepted permission otherwise will be false.\r\n if(permissionApproved) resolve()\r\n else reject('permissions')\r\n\r\n })\r\n\r\n })\r\n \r\n } \r\n },\r\n\r\n audio : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n var request = function(){\r\n permissions.requestPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n reject('permissions')\r\n\r\n });\r\n }\r\n\r\n permissions.checkPermission(permissions.RECORD_AUDIO, (status) => {\r\n\r\n\r\n if (status.hasPermission) {\r\n resolve()\r\n }\r\n else {\r\n request()\r\n }\r\n\r\n }, (err) => {\r\n\r\n console.error(err)\r\n\r\n request()\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n },\r\n\r\n video : function(){\r\n\r\n var permissions = window.cordova.plugins.permissions;\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n if (permissions){\r\n\r\n permissions.hasPermission(permissions.CAMERA, (status) => {\r\n\r\n if (status.hasPermission) {\r\n\r\n resolve()\r\n\r\n }\r\n else {\r\n\r\n permissions.requestPermission(permissions.CAMERA, () => {\r\n\r\n resolve()\r\n\r\n }, () => {\r\n\r\n reject('permissions')\r\n\r\n });\r\n\r\n }\r\n\r\n });\r\n\r\n }\r\n else{\r\n reject('permissions')\r\n }\r\n\r\n })\r\n\r\n \r\n\r\n }\r\n \r\n }\r\n\r\n var initPermissions = function(mediasettings){\r\n\r\n var callperm = function(f, setting){\r\n if (setting){\r\n return f()\r\n }\r\n else{\r\n return Promise.resolve()\r\n }\r\n }\r\n\r\n if(window.cordova && window.device){\r\n\r\n var ios = f.isios()\r\n\r\n return callperm(ios ? permissions.ios.audio : permissions.audio, mediasettings.audio).then(() => {\r\n return callperm(ios ? permissions.ios.video : permissions.video, mediasettings.video)\r\n }).catch(e => {\r\n console.error(\"E\", e)\r\n return Promise.reject(e)\r\n })\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }\r\n\r\n var initMedia = function(mediasettings){\r\n\r\n return new Promise((resolve, reject)=> {\r\n\r\n\r\n initPermissions(mediasettings).then(() => {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n navigator.mediaDevices.getUserMedia(mediasettings).then(resolve).catch(reject);\r\n } else {\r\n (\r\n navigator.getUserMedia ||\r\n navigator.webkitGetUserMedia ||\r\n navigator.mozGetUserMedia ||\r\n navigator.msGetUserMedia\r\n )\r\n (mediasettings, resolve, reject);\r\n }\r\n\r\n }).catch(reject)\r\n\r\n })\r\n \r\n }\r\n \r\n self.get = function(mediasettings){\r\n\r\n return initMedia(mediasettings)\r\n\r\n }\r\n\r\n self.permissions = initPermissions\r\n\r\n}\r\n\r\n\r\nexport default Media","// Copied from https://github.com/chris-rudmin/Recorderjs\n\nexport default () => {\n let BYTES_PER_SAMPLE = 2\n\n let recorded = []\n\n function encode (buffer) {\n let length = buffer.length\n let data = new Uint8Array(length * BYTES_PER_SAMPLE)\n for (let i = 0; i < length; i++) {\n let index = i * BYTES_PER_SAMPLE\n let sample = buffer[i]\n if (sample > 1) {\n sample = 1\n } else if (sample < -1) {\n sample = -1\n }\n sample = sample * 32768\n data[index] = sample\n data[index + 1] = sample >> 8\n }\n recorded.push(data)\n }\n\n function dump (sampleRate) {\n let bufferLength = recorded.length ? recorded[0].length : 0\n let length = recorded.length * bufferLength\n let wav = new Uint8Array(44 + length)\n let view = new DataView(wav.buffer)\n\n // RIFF identifier 'RIFF'\n view.setUint32(0, 1380533830, false)\n // file length minus RIFF identifier length and file description length\n view.setUint32(4, 36 + length, true)\n // RIFF type 'WAVE'\n view.setUint32(8, 1463899717, false)\n // format chunk identifier 'fmt '\n view.setUint32(12, 1718449184, false)\n // format chunk length\n view.setUint32(16, 16, true)\n // sample format (raw)\n view.setUint16(20, 1, true)\n // channel count\n view.setUint16(22, 1, true)\n // sample rate\n view.setUint32(24, sampleRate, true)\n // byte rate (sample rate * block align)\n view.setUint32(28, sampleRate * BYTES_PER_SAMPLE, true)\n // block align (channel count * bytes per sample)\n view.setUint16(32, BYTES_PER_SAMPLE, true)\n // bits per sample\n view.setUint16(34, 8 * BYTES_PER_SAMPLE, true)\n // data chunk identifier 'data'\n view.setUint32(36, 1684108385, false)\n // data chunk length\n view.setUint32(40, length, true)\n\n // eslint-disable-next-line unicorn/no-for-loop\n for (let i = 0; i < recorded.length; i++) {\n wav.set(recorded[i], i * bufferLength + 44)\n }\n\n recorded = []\n postMessage(wav.buffer, [wav.buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else if (e.data[0] === 'dump') {\n dump(e.data[1])\n }\n }\n}\n","import waveEncoder from './wave-encoder/index.js'\n\nlet AudioContext = window.AudioContext || window.webkitAudioContext\n\nlet createWorker = fn => {\n let js = fn\n .toString()\n .replace(/^(\\(\\)\\s*=>|function\\s*\\(\\))\\s*{/, '')\n .replace(/}$/, '')\n let blob = new Blob([js])\n return new Worker(URL.createObjectURL(blob))\n}\n\nlet error = method => {\n let event = new Event('error')\n event.data = new Error('Wrong state for ' + method)\n return event\n}\n\nlet context\n\n/**\n * Audio Recorder with MediaRecorder API.\n *\n * @example\n * navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {\n * let recorder = new MediaRecorder(stream)\n * })\n */\nclass MediaRecorder {\n /**\n * @param {MediaStream} stream The audio stream to record.\n */\n constructor (stream, config = null) {\n /**\n * The `MediaStream` passed into the constructor.\n * @type {MediaStream}\n */\n this.stream = stream\n this.config = config\n /**\n * The current state of recording process.\n * @type {\"inactive\"|\"recording\"|\"paused\"}\n */\n this.state = 'inactive'\n\n this.em = document.createDocumentFragment()\n this.encoder = createWorker(MediaRecorder.encoder)\n\n let recorder = this\n this.encoder.addEventListener('message', e => {\n let event = new Event('dataavailable')\n event.data = new Blob([e.data], { type: recorder.mimeType })\n recorder.em.dispatchEvent(event)\n if (recorder.state === 'inactive') {\n recorder.em.dispatchEvent(new Event('stop'))\n }\n })\n }\n\n /**\n * Begins recording media.\n *\n * @param {number} [timeslice] The milliseconds to record into each `Blob`.\n * If this parameter isn’t included, single `Blob`\n * will be recorded.\n *\n * @return {undefined}\n *\n * @example\n * recordButton.addEventListener('click', () => {\n * recorder.start()\n * })\n */\n start (timeslice) {\n if (this.state !== 'inactive') {\n return this.em.dispatchEvent(error('start'))\n }\n\n this.state = 'recording'\n\n if (!context) {\n context = new AudioContext(this.config)\n }\n this.clone = this.stream.clone()\n this.input = context.createMediaStreamSource(this.clone)\n this.processor = context.createScriptProcessor(2048, 1, 1)\n\n this.encoder.postMessage(['init', context.sampleRate])\n\n this.processor.onaudioprocess = e => {\n if (this.state === 'recording') {\n this.encoder.postMessage(['encode', e.inputBuffer.getChannelData(0)])\n }\n }\n\n this.input.connect(this.processor)\n this.processor.connect(context.destination)\n\n this.em.dispatchEvent(new Event('start'))\n\n if (timeslice) {\n this.slicing = setInterval(() => {\n if (this.state === 'recording') this.requestData()\n }, timeslice)\n }\n\n return undefined\n }\n\n /**\n * Stop media capture and raise `dataavailable` event with recorded data.\n *\n * @return {undefined}\n *\n * @example\n * finishButton.addEventListener('click', () => {\n * recorder.stop()\n * })\n */\n stop () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('stop'))\n }\n\n this.requestData()\n this.state = 'inactive'\n this.clone.getTracks().forEach(track => {\n track.stop()\n })\n this.processor.disconnect()\n this.input.disconnect()\n return clearInterval(this.slicing)\n }\n\n /**\n * Pauses recording of media streams.\n *\n * @return {undefined}\n *\n * @example\n * pauseButton.addEventListener('click', () => {\n * recorder.pause()\n * })\n */\n pause () {\n if (this.state !== 'recording') {\n return this.em.dispatchEvent(error('pause'))\n }\n\n this.state = 'paused'\n return this.em.dispatchEvent(new Event('pause'))\n }\n\n /**\n * Resumes media recording when it has been previously paused.\n *\n * @return {undefined}\n *\n * @example\n * resumeButton.addEventListener('click', () => {\n * recorder.resume()\n * })\n */\n resume () {\n if (this.state !== 'paused') {\n return this.em.dispatchEvent(error('resume'))\n }\n\n this.state = 'recording'\n return this.em.dispatchEvent(new Event('resume'))\n }\n\n /**\n * Raise a `dataavailable` event containing the captured media.\n *\n * @return {undefined}\n *\n * @example\n * this.on('nextData', () => {\n * recorder.requestData()\n * })\n */\n requestData () {\n if (this.state === 'inactive') {\n return this.em.dispatchEvent(error('requestData'))\n }\n\n return this.encoder.postMessage(['dump', context.sampleRate])\n }\n\n /**\n * Add listener for specified event type.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The listener function.\n *\n * @return {undefined}\n *\n * @example\n * recorder.addEventListener('dataavailable', e => {\n * audio.src = URL.createObjectURL(e.data)\n * })\n */\n addEventListener (...args) {\n this.em.addEventListener(...args)\n }\n\n /**\n * Remove event listener.\n *\n * @param {\"start\"|\"stop\"|\"pause\"|\"resume\"|\"dataavailable\"|\"error\"}\n * type Event type.\n * @param {function} listener The same function used in `addEventListener`.\n *\n * @return {undefined}\n */\n removeEventListener (...args) {\n this.em.removeEventListener(...args)\n }\n\n /**\n * Calls each of the listeners registered for a given event.\n *\n * @param {Event} event The event object.\n *\n * @return {boolean} Is event was no canceled by any listener.\n */\n dispatchEvent (...args) {\n this.em.dispatchEvent(...args)\n }\n}\n\n/**\n * The MIME type that is being used for recording.\n * @type {string}\n */\nMediaRecorder.prototype.mimeType = 'audio/wav'\n\n/**\n * Returns `true` if the MIME type specified is one the polyfill can record.\n *\n * This polyfill supports `audio/wav` and `audio/mpeg`.\n *\n * @param {string} mimeType The mimeType to check.\n *\n * @return {boolean} `true` on `audio/wav` and `audio/mpeg` MIME type.\n */\nMediaRecorder.isTypeSupported = mimeType => {\n return MediaRecorder.prototype.mimeType === mimeType\n}\n\n/**\n * `true` if MediaRecorder can not be polyfilled in the current browser.\n * @type {boolean}\n *\n * @example\n * if (MediaRecorder.notSupported) {\n * showWarning('Audio recording is not supported in this browser')\n * }\n */\nMediaRecorder.notSupported = !navigator.mediaDevices || !AudioContext\n\n/**\n * Converts RAW audio buffer to compressed audio files.\n * It will be loaded to Web Worker.\n * By default, WAVE encoder will be used.\n * @type {function}\n *\n * @example\n * MediaRecorder.prototype.mimeType = 'audio/ogg'\n * MediaRecorder.encoder = oggEncoder\n */\nMediaRecorder.encoder = waveEncoder\n\nexport default MediaRecorder\n","\n\n\nexport default () => {\n importScripts(\n 'https://cdnjs.cloudflare.com/ajax/libs/lamejs/1.2.0/lame.min.js'\n )\n\n let CHANNELS = 1\n let KBPS = 128\n let DEFAULT_SAMPLE_RATE = 44100\n\n let encoder\n let recorded = new Int8Array()\n\n function concat (a, b) {\n if (b.length === 0) {\n return a\n }\n let c = new Int8Array(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n\n function init (sampleRate) {\n encoder = new lamejs.Mp3Encoder(\n CHANNELS,\n sampleRate || DEFAULT_SAMPLE_RATE,\n KBPS\n )\n }\n\n function encode (buffer) {\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = buffer[i] * 32767.5\n }\n\n let buf = encoder.encodeBuffer(buffer)\n recorded = concat(recorded, buf)\n }\n\n function dump () {\n let buf = encoder.flush()\n recorded = concat(recorded, buf)\n let buffer = recorded.buffer\n recorded = new Int8Array()\n postMessage(buffer, [buffer])\n }\n\n onmessage = e => {\n if (e.data[0] === 'init') {\n init(e.data[1])\n } else if (e.data[0] === 'encode') {\n encode(e.data[1])\n } else {\n dump(e.data[1])\n }\n }\n}\n","\r\n\r\nimport MTRX from \"./mtrx.js\";\r\nimport Notifier from \"./notifier.js\";\r\nimport PNUser from \"./user/pnuser.js\";\r\nimport ApiWrapper from \"./api.js\";\r\nimport Pcrypto from \"./pcrypto.js\";\r\nimport listeners from './listeners'\r\nimport f from './functions'\r\nimport Media from './media'\r\n/*\r\nimport pcm from '@/application/utils/pcm.js'\r\nlet Mp3 = require('js-mp3');\r\n*/\r\n/*\r\nvar {register} = require('extendable-media-recorder')\r\nvar {connect} = require('extendable-media-recorder-wav-encoder')*/\r\n\r\n\r\nimport AudioRecorder from 'audio-recorder-polyfill'\r\nimport mpegEncoder from 'audio-recorder-polyfill/mpeg-encoder'\r\n\r\nAudioRecorder.encoder = mpegEncoder\r\nAudioRecorder.prototype.mimeType = 'audio/mpeg'\r\n\r\n\r\n\r\n\r\nclass Core {\r\n constructor(vm, p){\r\n if(!p) p = {}\r\n\r\n this.options = {\r\n listofproxies : p.listofproxies\r\n }\r\n\r\n if(!p.mtrx) p.mtrx = {}\r\n p.mtrx.baseUrl = 'https://' + p.domain\r\n\r\n if (p.mtrx.baseUrl == 'https://test.matrix.pocketnet.app'){\r\n \r\n this.options.burn = {\r\n v : 'minutes',\r\n w : 120,\r\n m : 30,\r\n b : 15\r\n }\r\n }\r\n else{\r\n this.options.burn = {\r\n v : 'days',\r\n w : 7,\r\n m : 2,\r\n b : 1\r\n }\r\n }\r\n\r\n \r\n\r\n this.apiHandlers = {\r\n error : function(){},\r\n success : function(){}\r\n }\r\n\r\n this.domain = p.domain\r\n\r\n this.vm = vm\r\n this.mtrx = new MTRX(this, p.mtrx)\r\n this.user = new PNUser(this, p.user || {})\r\n this.notifier = new Notifier(this, p.notifier || {})\r\n this.pcrypto = new Pcrypto(this, p.pcrypto || {})\r\n this.api = new ApiWrapper(this, p.servers)\r\n\r\n this.onlineListener = new listeners.online(this)\r\n this.focusListener = new listeners.focus(this)\r\n this.online = true\r\n this.focus = true\r\n this.store = vm.$store\r\n this.loading = true\r\n\r\n this.external = {}\r\n this.hiddenInParent = false\r\n\r\n this.customRecorderConnected = false\r\n\r\n this.pcrypto.init(this.user)\r\n\r\n this.media = new Media()\r\n this.audioContext = null\r\n\r\n }\r\n\r\n hideOptimization = function(v){\r\n\r\n //this.hideOptimization = v\r\n this.store.commit('hideOptimization', v)\r\n\r\n }\r\n\r\n hideInParent = function(v){\r\n this.hiddenInParent = v\r\n this.store.commit('hiddenInParent', v)\r\n\r\n\r\n /*if(!v)\r\n this.store.commit('wasunhidden', true)*/\r\n }\r\n\r\n canback = function(){\r\n return this.store.state.gallery ? false : true\r\n }\r\n\r\n update = function({block}){\r\n\r\n this.pcrypto.set.block(block)\r\n }\r\n\r\n logerror = function(type, data){\r\n\r\n\r\n if (window.POCKETNETINSTANCE){\r\n\r\n window.POCKETNETINSTANCE.Logger.error({\r\n err: type,\r\n payload: data,\r\n code: 402,\r\n });\r\n\r\n }\r\n }\r\n\r\n destroy = function(){\r\n this.store.commit('clearall')\r\n this.removeEvents()\r\n\r\n if(!this.vm.$route.name != 'chats')\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n this.user.destroy()\r\n this.mtrx.destroy()\r\n this.pcrypto.destroy()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.unlink(this)\r\n }\r\n\r\n this.vm.$destroy();\r\n\r\n }\r\n\r\n init = function(){\r\n \r\n this.focusListener.init()\r\n this.onlineListener.init()\r\n\r\n this.initEvents()\r\n\r\n if (window.POCKETNETINSTANCE){\r\n window.POCKETNETINSTANCE.platform.matrixchat.link(this)\r\n }\r\n }\r\n \r\n\r\n setUnauthorized = function(v){\r\n this.unauthorized = v\r\n this.store.commit('SET_UNAUTHORIZED', v)\r\n }\r\n\r\n initWithUserBase = function(){\r\n\r\n this.loading = true\r\n\r\n return this.user.checkCredentials().then(state => {\r\n\r\n return this.user.userInfo()\r\n\r\n }).then(r => {\r\n\r\n if(!r){\r\n return Promise.reject('unknown')\r\n }\r\n\r\n if(r.deleted){\r\n return Promise.reject('deleted')\r\n }\r\n\r\n return this.pcrypto.prepare()\r\n\r\n }).then(r => {\r\n\r\n return this.mtrx.init()\r\n\r\n }).then(r => {\r\n\r\n this.loading = false\r\n this.setUnauthorized(null)\r\n\r\n this.pcrypto.helpers.checkuser()\r\n\r\n if (f.deep(this.user,'userinfo.name'))\r\n this.mtrx.client.setDisplayName(f.deep(this.user,'userinfo.name'))\r\n\r\n return Promise.resolve()\r\n\r\n }).catch(e => {\r\n\r\n console.log(\"E\", e)\r\n \r\n this.loading = false\r\n\r\n if(e == 'unauthorized' || e == 'unknown' || e == 'deleted'){\r\n this.setUnauthorized(e)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n })\r\n }\r\n\r\n initWithUser = function(credentials){\r\n\r\n\r\n this.user.setCredentials(credentials)\r\n\r\n return this.initWithUserBase().then(() => {\r\n return this.user.initKeysProcess()\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n }\r\n\r\n waitonline = function(){\r\n\r\n if(this.online) return Promise.resolve()\r\n\r\n return new Promise((resolve, reject) => {\r\n\r\n f.retry(() => {\r\n return this.online;\r\n }, function () {\r\n\r\n resolve()\r\n\r\n }, 5)\r\n\r\n })\r\n\r\n\r\n }\r\n\r\n removeEvents = function(){\r\n delete this.focusListener.clbks.resume.core\r\n delete this.focusListener.clbks.pause.core\r\n delete this.onlineListener.clbks.online.core\r\n delete this.onlineListener.clbks.offline.core\r\n }\r\n\r\n initEvents = function(){\r\n this.focusListener.clbks.resume.core = (time) => {\r\n\r\n this.focus = this.focusListener.focus\r\n\r\n if(time > 60){\r\n }\r\n }\r\n\r\n this.focusListener.clbks.pause.core = () => {\r\n this.focus = this.focusListener.focus\r\n }\r\n\r\n this.onlineListener.clbks.online.core = (time) => {\r\n this.online = this.onlineListener.online\r\n }\r\n\r\n this.onlineListener.clbks.offline.core = () => {\r\n this.online = this.onlineListener.online\r\n }\r\n }\r\n\r\n externalLink = function(pobj){\r\n this.external = pobj\r\n\r\n }\r\n\r\n destroyExternalLink = function(){\r\n this.external = {}\r\n }\r\n\r\n currentTime = function () {\r\n var created = Math.floor((new Date().getTime()) / 1000)\r\n\r\n if (this.timeDifference) {\r\n created += this.timeDifference\r\n }\r\n\r\n return created;\r\n }\r\n\r\n wait = function(){\r\n return f.pretry(() => {\r\n\t\t\treturn !this.loading\r\n\t\t}).then(() => {\r\n\r\n\t\t\treturn Promise.resolve()\r\n\r\n\t\t})\r\n }\r\n\r\n joinRoom(roomid){\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('JOINROOM', roomid)\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n return Promise.resolve()\r\n\r\n }).then(info => {\r\n\r\n if (this.store.state.chatsMap[roomid]){\r\n /// old chat\r\n this.vm.$router.push('/chat?id=' + roomid).catch(e => {})\r\n }\r\n else\r\n {\r\n this.store.commit('JOINROOM', roomid)\r\n this.vm.$router.push('/publicPreview?id=' + roomid).catch(e => {})\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n connect(address){\r\n\r\n return this.wait().then(() => {\r\n\r\n return this.mtrx.wait()\r\n\r\n }).then(() => {\r\n\r\n if (this.unauthorized){\r\n\r\n this.store.commit('CONNECT', f.hexEncode(address))\r\n \r\n return Promise.reject(this.unauthorized)\r\n }\r\n\r\n else{\r\n return this.user.usersInfo([address], true)\r\n }\r\n\r\n }).then(info => {\r\n\r\n var roomId = this.mtrx.kit.tetatetid(info[0], this.user.userinfo)\r\n\r\n\r\n if(!roomId) return Promise.reject('roomId')\r\n\r\n if (this.store.state.chatsMap[roomId]){\r\n /// old chat\r\n\r\n this.gotoRoute('/chat?id=' + roomId)\r\n /*this.vm.$router.push('/chat?id=' + roomId).catch(e => {\r\n console.error('e', e)\r\n })*/\r\n }\r\n else\r\n {\r\n\r\n this.gotoRoute('/contact?id=' + f.hexEncode(address))\r\n //this.store.commit('CONTACT', roomId)\r\n //this.gotoRoute('/chat?id=' + roomId + '&u=' + f.hexEncode(address))\r\n\r\n }\r\n\r\n return Promise.resolve()\r\n })\r\n }\r\n\r\n cancelshare(){\r\n this.store.commit('SHARE', null)\r\n\r\n return Promise.resolve()\r\n }\r\n\r\n share(share){\r\n\t\tthis.store.commit('SHARE', share)\r\n\r\n this.vm.$router.push('/chats').catch(e => {})\r\n\r\n return Promise.resolve()\r\n\t}\r\n\r\n goto(roomId){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push('/chat?id=' + roomId).catch(e => {});\r\n });\r\n }\r\n\r\n gotoRoute(route){\r\n\r\n this.cancelDefaultRoute = true;\r\n\r\n this.mtrx.wait().then(() => {\r\n this.vm.$router.push(route).catch(e => {});\r\n });\r\n }\r\n\r\n updateUser(){\r\n \r\n return this.user.userInfo(true).then(r => {\r\n\r\n /*if (this.unauthorized){\r\n return this.initWithUserBase()\r\n }*/\r\n \r\n })\r\n }\r\n\r\n isactive(){\r\n return this.vm.$store.state.minimized && this.vm.$store.state.active && this.vm.$store.state.pocketnet\r\n } \r\n\r\n sitemessage(title){\r\n\r\n var position = \"bottom-right\";\r\n\r\n if (this.vm.$store.state.mobile){\r\n position = 'top-left'\r\n }\r\n \r\n this.vm.$message({\r\n title: title,\r\n zIndex: 999,\r\n supportHTML: true,\r\n wrapperClassName: \"notificationWrapper\",\r\n position: position,\r\n type: 'info',\r\n duration : 2000\r\n })\r\n }\r\n\r\n menu(v){\r\n\r\n this.store.commit('SET_MENU', v ? {\r\n\t\t\titems : v.items,\r\n\t\t\titem : v.item,\r\n handler : v.handler\r\n\t\t} : null)\r\n }\r\n\r\n invitepnt(){\r\n\r\n var ui = f.deep(this, 'user.userinfo.source')\r\n\r\n if(ui){\r\n\r\n if (window.POCKETNETINSTANCE && window.POCKETNETINSTANCE.platform){\r\n \r\n if(this.backtoapp) this.backtoapp()\r\n\r\n window.POCKETNETINSTANCE.platform.ui.socialshare('welcome?connect=' + ui.address, {\r\n sharing : {\r\n image : '',\r\n images : [ui.i],\r\n title : this.vm.$i18n.t(\"caption.joinApp\"),\r\n html : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n },\r\n \r\n text : {\r\n body : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\"),\r\n preview : this.vm.$i18n.t(\"caption.joinApp\") + ' ' + this.vm.$i18n.t(\"caption.hasInvitedToJoin\")\r\n }\r\n \r\n },\r\n embedding : {\r\n type : 'connect',\r\n id : ui.address\r\n }\r\n })\r\n\r\n }\r\n else{\r\n var l = 'https://bastyon.com/welcome?connect=' + ui.address\r\n\r\n f.copytext(l)\r\n\r\n this.sitemessage('The link was copied successfully')\r\n }\r\n\r\n }\r\n\r\n else{\r\n this.sitemessage('The error was occuried')\r\n }\r\n\r\n \r\n }\r\n\r\n async convertAudioToBase64(blob) {\r\n const reader = new FileReader()\r\n reader.readAsDataURL(blob)\r\n return new Promise(resolve => {\r\n reader.onloadend = () => {\r\n resolve(reader.result)\r\n }\r\n })\r\n }\r\n\r\n /*async connectCustomRecorder() {\r\n\r\n if (this.customRecorderConnected) return\r\n this.customRecorderConnected = true\r\n \r\n await register(await connect());\r\n \r\n }*/\r\n\r\n /*mp3ToWav(base64Audio){\r\n\r\n var mp3ArrayBuffer = f._base64ToArrayBuffer(base64Audio.split(',')[1])\r\n\r\n var decoder = Mp3.newDecoder(mp3ArrayBuffer);\r\n var pcmArrayBuffer = decoder.decode();\r\n\r\n var dataURI = new pcm({channels: 1, rate: 8000, depth: 8}).toWav(pcmArrayBuffer).encode();\r\n\r\n return dataURI\r\n\r\n }*/\r\n\r\n initMediaRecorder() {\r\n\r\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\r\n\r\n\r\n return this.media.get({ audio: true }).then(stream => {\r\n\r\n let mediaRecorder = new AudioRecorder(stream, { audioBitsPerSecond : 32000 })\r\n \r\n return mediaRecorder\r\n \r\n }).catch(function (err) {\r\n return Promise.reject(err)\r\n });\r\n\r\n } else {\r\n return Promise.reject()\r\n }\r\n }\r\n\r\n getAudioContext(){\r\n\r\n if(this.audioContext && this.audioContext.state != 'closed') {\r\n\r\n\r\n if(this.audioContext.state === \"suspended\") this.audioContext.resume()\r\n\r\n\r\n\r\n return this.audioContext\r\n }\r\n else{\r\n }\r\n\r\n this.audioContext = new (window.AudioContext || window.webkitAudioContext)() || null;\r\n\r\n if(f.isios() && window.unmute){\r\n unmute(this.audioContext, false, false);\r\n }\r\n\r\n return this.audioContext\r\n }\r\n}\r\n\r\nexport default Core\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"preloader\",\"platform\":_vm.platform}},[_vm._m(0)])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"variant \"},[_c('div',{staticClass:\"iospreloadercenter\"},[_c('div',{staticClass:\"spinner-eff spinner-eff-3\"},[_c('div',{staticClass:\"circle circle-1\"}),_c('div',{staticClass:\"circle circle-2\"}),_c('div',{staticClass:\"circle circle-3\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\nimport f from '@/application/functions'\r\nexport default {\r\n name: 'preloader',\r\n props: {\r\n },\r\n\r\n computed : mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n active : state => state.active,\r\n platform : function(){\r\n return f.deep(window, 'device.platform') || 'browser'\r\n },\r\n })\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3e6353d6&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index_ex.sass?vue&type=style&index=0&id=3e6353d6&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&id=3e6353d6&scoped=true&lang=sass&\")\nif (style1.__inject__) style1.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"3e6353d6\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"wai-fixedmessageicon\"}},[_c('div',{staticClass:\"wrapper\"},[_c('div',{staticClass:\"table\"},[_c('div',{staticClass:\"cell\"},[(_vm.icon)?_c('div',{staticClass:\"iconWrapper\"},[_c('sweetalert',{attrs:{\"icon\":_vm.icon}})],1):_vm._e(),(_vm.message)?_c('div',{staticClass:\"message\"},[_c('div',[_vm._v(_vm._s(_vm.message))])]):_vm._e()])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa\",style:(_vm.cssVars)},[(_vm.isIcon('error'))?_c('div',{staticClass:\"sa-error\"},[_vm._m(0),_c('div',{staticClass:\"sa-error-placeholder\"}),_c('div',{staticClass:\"sa-error-fix\"})]):(_vm.isIcon('warning'))?_c('div',{staticClass:\"sa-warning\"},[_c('div',{staticClass:\"sa-warning-body\"}),_c('div',{staticClass:\"sa-warning-dot\"})]):(_vm.isIcon('info'))?_c('div',{staticClass:\"sa-info\"},[_c('div',{staticClass:\"sa-info-body\"}),_c('div',{staticClass:\"sa-info-dot\"})]):(_vm.isIcon('loading'))?_c('div',{staticClass:\"sa-loading\"},[_c('div',{staticClass:\"sa-loading-body\"})]):_c('div',{staticClass:\"sa-success\"},[_c('div',{staticClass:\"sa-success-tip\"}),_c('div',{staticClass:\"sa-success-long\"}),_c('div',{staticClass:\"sa-success-placeholder\"}),_c('div',{staticClass:\"sa-success-fix\"})])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sa-error-x\"},[_c('div',{staticClass:\"sa-error-left\"}),_c('div',{staticClass:\"sa-error-right\"})])}]\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./icon.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./icon.vue?vue&type=template&id=0635047f&scoped=true&\"\nimport script from \"./icon.vue?vue&type=script&lang=js&\"\nexport * from \"./icon.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./icon.vue?vue&type=style&index=0&id=0635047f&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0635047f\",\n null\n ,true\n)\n\nexport default component.exports","import { mapState } from 'vuex';\r\nimport sweetalert from '@/editedplugins/vue-sweetalert-icons/src/components/icon.vue'\r\nexport default {\r\n name: 'fixedmessageicon',\r\n props: {\r\n \r\n },\r\n\r\n components : {\r\n sweetalert\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n icon : {\r\n immediate: true,\r\n handler(){\r\n this.init()\r\n }\r\n }\r\n },\r\n\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n icon : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.icon : null\r\n },\r\n\r\n message : function(){\r\n return this.$store.state.icon ? this.$store.state.icon.message : null\r\n },\r\n\r\n \r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n }),\r\n\r\n methods : {\r\n init : function(){\r\n var t = this\r\n\r\n const timeout = this.$store.state.icon?.timeout;\r\n\r\n if(this.$store.state.icon.manual) return\r\n\r\n setTimeout(function(){\r\n\r\n t.$store.commit('icon', null)\r\n\r\n }, timeout || 2000)\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1cf419f0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1cf419f0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1cf419f0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{attrs:{\"id\":\"wai-date\"}},[_vm._v(_vm._s(_vm.label))])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'date',\r\n props: ['date'],\r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n label : function(){\r\n\r\n moment.locale(this.$i18n.locale)\r\n\r\n return moment(moment.utc(this.date).toDate()).local().fromNow();\r\n\r\n }\r\n }),\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=eb4df516&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=eb4df516&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"eb4df516\",\n null\n ,true\n)\n\nexport default component.exports","var render = function (_h,_vm) {var _c=_vm._c;return _c('div',{staticClass:\"userpic\"},[_c('div',{staticClass:\"userpicSquareWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\"},[_c('div',{staticClass:\"userpicSquareInnerWrapper\",class:_vm.props.status},[(_vm.props.userinfo.image)?_c('bgimage',{attrs:{\"src\":_vm.props.userinfo.image}}):_vm._e(),(!_vm.props.userinfo.image && _vm.props.userinfo.name && (_vm.props.status != 'blocked' && _vm.props.status != 'invite' && _vm.props.status != 'ban'))?_c('div',{staticClass:\"charAvatar\"},[_c('span',[_vm._v(_vm._s(_vm.props.userinfo.name.charAt(0)))])]):_vm._e(),_c('div',{staticClass:\"statusIcon\"},[(_vm.props.status == 'blocked' || _vm.props.status == 'ban')?_c('i',{staticClass:\"fas fa-ban\"}):_vm._e(),(_vm.props.status == 'invite')?_c('i',{staticClass:\"fas fa-user-plus\"}):_vm._e()])],1)])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nexport default {\r\n name: 'userpic',\r\n props: {\r\n userinfo: {\r\n type : Object,\r\n default : {}\r\n },\r\n status : ''\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=5034d1e2&scoped=true&functional=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=5034d1e2&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n true,\n injectStyles,\n \"5034d1e2\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.users)?_c('div',{staticClass:\"userspic\",class:{oneuser : _vm.users && _vm.users.length === 1}},[(_vm.users.length === 0)?_c('userpic',{attrs:{\"userinfo\":_vm.single,\"status\":_vm.single.status}}):_vm._e(),(_vm.users.length === 1)?_c('userpic',{attrs:{\"status\":_vm.status[_vm.users[0].id],\"userinfo\":_vm.users[0],\"unseen\":_vm.unseen}}):_vm._e(),(_vm.users.length > 1)?_c('many',{attrs:{\"slidesPerView\":_vm.slidesPerView,\"status\":_vm.status,\"userinfo\":_vm.users,\"unseen\":_vm.unseen}}):_vm._e(),(_vm.unseen)?_c('div',{staticClass:\"unseen\"},[_vm._v(\" \"+_vm._s(_vm.unseen > 99 ? '99' : _vm.unseen)+\" \")]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import many from '@/components/assets/userspic/many.vue'\r\n\r\nexport default {\r\n name: 'userspic',\r\n props: {\r\n users: Array,\r\n single: {},\r\n unseen: Number,\r\n slidesPerView: Number,\r\n status : {\r\n type : Object,\r\n default : {}\r\n }\r\n \r\n },\r\n\r\n data : function(){\r\n return {}\r\n },\r\n components: {\r\n many\r\n },\r\n\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=792279b0&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=792279b0&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"792279b0\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"bgimage\",class:{loaded: _vm.loaded, hasimage : _vm.src},style:('background-image:url('+_vm.imageSrc+'); background-size: cover; background-position: center center; background-repeat: no-repeat')},[_vm._t(\"cnt\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./bgimage.vue?vue&type=template&id=5d20f73c&scoped=true&\"\nimport script from \"./bgimage.vue?vue&type=script&lang=js&\"\nexport * from \"./bgimage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"5d20f73c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"wai-logotype\"}},[_c('div',{staticClass:\"items\"},[_c('div',{staticClass:\"item\"},[_c('div',{staticClass:\"logo\"},[_c('img',{attrs:{\"src\":'img/ldpiwide-' + _vm.themeL + '.png'}})])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nvar bwl = {\r\n black : 'black',\r\n white : 'white',\r\n classic : 'white'\r\n\r\n}\r\n\r\nexport default {\r\n name: 'wai-logotype',\r\n props: {\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n\r\n themeL : function(state){\r\n return bwl[state.theme] || 'white'\r\n }\r\n }),\r\n\r\n methods : {\r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e33cd7cc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e33cd7cc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e33cd7cc\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"outer-div\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, active: _vm.active, mobile: _vm.mobile},on:{\"click\":function($event){$event.stopPropagation();}}},[(_vm.menuIsVisible && !_vm.hiddenInParent)?_c('div',{staticClass:\"dropdown\",class:{visible: _vm.menuIsVisible}},[_c('div',{staticClass:\"backgr\",on:{\"click\":function($event){return _vm.hidePopup()}}}),_c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.hidePopup),expression:\"hidePopup\"}],staticClass:\"menuwrapper\"},[_c('simpleMenu',{attrs:{\"items\":_vm.menuItems},scopedSlots:_vm._u([{key:\"default\",fn:function(slotProps){return [_vm._t(\"default\",function(){return [_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.menuItemClick(slotProps.item)}}},[_c('div',{staticClass:\"iconWrapper\"},[(slotProps.item.icon)?_c('i',{class:slotProps.item.icon}):_vm._e()]),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(slotProps.item.title)+\" \")])])]},{\"item\":slotProps.item})]}}],null,true)}),_c('div',{staticClass:\"cancelWrapper\"},[_c('div',{staticClass:\"menu-item\",on:{\"click\":function($event){return _vm.hidePopup()}}},[_c('div',{staticClass:\"iconWrapper\"}),_c('div',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t(\"cancel\")))])])])],1)]):_vm._e(),_c('div',{staticClass:\"dropDownIcon\",on:{\"click\":_vm.onClickHandler}},[_c('i',{class:'icon ' + (_vm.icon || 'fas fa-ellipsis-h')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import simpleMenu from '@/components/assets/simpleMenu/simpleMenu.vue';\r\nimport { mapState } from 'vuex';\r\nexport default {\r\n name: 'dropdownMenu',\r\n props: {\r\n menuItems: {\r\n type: Array,\r\n required: true\r\n },\r\n\r\n rowObject: {\r\n type: Object,\r\n },\r\n\r\n icon : String\r\n },\r\n\r\n components: {\r\n simpleMenu,\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false,\r\n menuIsVisible: false,\r\n }\r\n\r\n },\r\n\r\n watch: {\r\n menuIsVisible: function(newValue) {\r\n this.$emit('menuIsVisible', newValue);\r\n }\r\n },\r\n\r\n computed: {\r\n\r\n dropdownWidthInner(){\r\n return this.dropdownWidth;\r\n },\r\n \r\n ...mapState({\r\n pocketnet: state => state.pocketnet,\r\n minimized : state => state.minimized,\r\n mobile : state => state.mobile,\r\n active: state => state.active,\r\n hiddenInParent : state => state.hiddenInParent\r\n })\r\n },\r\n\r\n methods : {\r\n menuItemClick(item) {\r\n this.$emit('itemClicked', item, this.rowObject, {\r\n hidePopup : this.hidePopup,\r\n showPopup : this.showPopup\r\n });\r\n },\r\n onClickHandler() {\r\n this.menuIsVisible = !this.menuIsVisible;\r\n\r\n\r\n },\r\n hidePopup() {\r\n this.menuIsVisible = false;\r\n\r\n },\r\n showPopup() {\r\n \r\n this.menuIsVisible = true;\r\n\r\n\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=e4f39dca&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=e4f39dca&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"e4f39dca\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"back\",on:{\"click\":_vm.click}},[_c('div',{staticClass:\"iconbutton\"},[_c('i',{class:(_vm.icon || 'fas fa-angle-left')})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7e97eec1&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7e97eec1&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7e97eec1\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fixedOnPageTop\",class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active, unauthorized: _vm.unauthorized, modalShowed : _vm.modalShowed ? true : false, mobile: _vm.mobile},attrs:{\"id\":\"maincontent\"},on:{\"mouseenter\":_vm.mouseenter,\"mouseleave\":_vm.mouseleave}},[_c('div',{staticClass:\"headerSpacerWrapper\"},[_c('div',{staticClass:\"headerSpacerWrapperOvf\"},[_c('div',{ref:\"scrollable\",staticClass:\"headerSpacer\"},[_vm._t(\"content\",function(){return [_vm._v(\"   \")]})],2)]),_c('pmenu'),(_vm.modalShowed && _vm.modalShowed.data && !_vm.hiddenInParent)?_c('modal',{on:{\"close\":_vm.closeModal},scopedSlots:_vm._u([{key:\"header\",fn:function(){return [_vm._v(_vm._s(_vm.modalShowed.caption))]},proxy:true},{key:\"body\",fn:function(){return [_c('div',{staticClass:\"modalcommoncontent\"},[(_vm.modalShowed.type == 'complain')?_c('complain',{attrs:{\"p\":_vm.modalShowed.data}}):_vm._e(),(_vm.modalShowed.type == 'contact')?_c('contact',{attrs:{\"contact\":_vm.modalShowed.data.contact}}):_vm._e(),(_vm.modalShowed.type == 'showuserselect')?_c('contacts',{attrs:{\"users\":_vm.modalShowed.data.users,\"mode\":\"Select\"},on:{\"close\":_vm.closeModal,\"select\":function (contact) {_vm.modalShowed.data.userselected(contact); _vm.closeModal()}}}):_vm._e()],1)]},proxy:true},{key:\"footer\",fn:function(){return undefined},proxy:true}],null,false,3972288297)}):_vm._e(),(!_vm.unauthorized && _vm.rbackexp)?_c('div',{staticClass:\"expandp\",on:{\"click\":_vm.setactive,\"mousemove\":_vm.effect}},[_vm._m(0)]):_vm._e()],1),(_vm.iconshow)?_c('transition',{attrs:{\"name\":\"fade\"}},[_c('fixedmessageicon')],1):_vm._e()],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"etablew\"},[_c('div',{staticClass:\"etable table\"},[_c('div',[_c('i',{staticClass:\"fas fa-expand-arrows-alt\"})])])])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'maincontent',\r\n props: {\r\n rbackexp : Boolean\r\n },\r\n\r\n components : {\r\n\r\n 'contact': () => import('@/components/contact/index.vue'),\r\n 'contacts': () => import('@/components/contacts/list/index.vue'),\r\n 'complain': () => import('@/components/complain/index.vue')\r\n },\r\n\r\n data : function(){\r\n\r\n return {\r\n loading : false\r\n }\r\n\r\n },\r\n\r\n created : () => {\r\n\r\n },\r\n\r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth : state => state.auth,\r\n iconshow: function() {\r\n\t\t\treturn this.$store.state.icon ? true : false\r\n\t\t},\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active : state => state.active,\r\n modalShowed : state => state.modalShowed,\r\n hiddenInParent : state => state.hiddenInParent,\r\n mobile : state => state.mobile,\r\n unauthorized : state => state.unauthorized\r\n }),\r\n\r\n methods : {\r\n setactive : function(){\r\n this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})\r\n this.$store.commit('setiteraction', true)\r\n },\r\n mouseenter : function(){\r\n /*this.$store.commit('active', true)\r\n this.$store.commit('blockactive', {value : true, item : 'main'})*/\r\n },\r\n\r\n mouseleave : function(){\r\n\r\n if (this.$store.state.autohide){\r\n this.$store.commit('active', false)\r\n }\r\n this.$store.commit('blockactive', {value : false, item : 'main'})\r\n },\r\n\r\n effect : function(e){\r\n /*const x = e.pageX - e.target.offsetLeft\r\n const y = e.pageY - e.target.offsetTop\r\n\r\n e.target.style.setProperty('--x', `${ x }px`)\r\n e.target.style.setProperty('--y', `${ y }px`)*/\r\n },\r\n\r\n closeModal : function(){\r\n this.$store.commit('setmodal', null)\r\n },\r\n\r\n scroll : function(v){\r\n this.$refs['scrollable'].scrollTop = v || 0\r\n },\r\n \r\n \r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=a8a70f9c&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=a8a70f9c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"a8a70f9c\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{'bin' : _vm.pocketnet, 'bout' : !_vm.pocketnet, minimized: _vm.minimized, fix : _vm.pocketnet, active: _vm.active},attrs:{\"id\":\"search\"}},[_c('div',{staticClass:\"searchWrapper\"},[_c('div',{staticClass:\"inputWrapper\"},[_c('input',{ref:\"input\",attrs:{\"placeholder\":_vm.placeholder || this.$i18n.t('caption.search'),\"type\":\"text\"},domProps:{\"value\":_vm.searchTxt},on:{\"keyup\":_vm.change,\"input\":_vm.change,\"focus\":_vm.focused,\"blur\":_vm.blured}})]),(!_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\"},[_c('i',{staticClass:\"fas fa-search\"})]):_vm._e(),(_vm.searchTxt)?_c('div',{staticClass:\"iconWrapper\",on:{\"click\":_vm.clear}},[_c('i',{staticClass:\"fas fa-times\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import {mapState} from 'vuex';\r\n// TODO IGOR' SEARCH ALL COMPONENTS\r\nexport default {\r\n name: 'search',\r\n props: {\r\n placeholder: String,\r\n minimize: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n isTyping: false,\r\n searchTxt: ''\r\n }\r\n\r\n },\r\n\r\n created: () => {\r\n\r\n },\r\n\r\n watch: {\r\n searchTxt : {\r\n handler : _.debounce(function() {\r\n\r\n var text = this.searchTxt.toLowerCase()\r\n this.$emit('search', text)\r\n \r\n }, 500)\r\n }\r\n },\r\n computed: mapState({\r\n auth: state => state.auth,\r\n pocketnet: state => state.pocketnet,\r\n minimized: state => state.minimized,\r\n active: function (state) {\r\n return state.active || !this.minimize\r\n },\r\n }),\r\n\r\n methods: {\r\n change : function(event){\r\n this.searchTxt = event.target.value\r\n },\r\n\r\n clear : function(event){\r\n this.searchTxt = ''\r\n }, \r\n \r\n clickicon: function () {\r\n this.$refs['input'].focus()\r\n },\r\n\r\n blured: function () {\r\n this.$store.commit('blockactive', {value: false, item: 'input'})\r\n },\r\n\r\n focused: function () {\r\n this.$store.commit('blockactive', {value: true, item: 'input'})\r\n }\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=1774f2a8&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=1774f2a8&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"1774f2a8\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"linepreloader\"}},[_c('span'),_c('span'),_c('span')])}]\n\nexport { render, staticRenderFns }","import { mapState } from 'vuex';\r\n\r\nexport default {\r\n name: 'linepreloader',\r\n props: {\r\n },\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=bcf20e38&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=bcf20e38&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"bcf20e38\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--1-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&shadow\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=01d24e5e&shadow\"\nimport script from \"./App.vue?vue&type=script&lang=js&shadow\"\nexport * from \"./App.vue?vue&type=script&lang=js&shadow\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./editedplugins/vue-m-message/dist/index.css?vue&type=style&index=0&lang=css&shadow\")\nif (style0.__inject__) style0.__inject__(context)\nvar style1 = require(\"./index.sass?vue&type=style&index=1&lang=sass&shadow\")\nif (style1.__inject__) style1.__inject__(context)\nvar style2 = require(\"./App.vue?vue&type=style&index=2&lang=css&shadow\")\nif (style2.__inject__) style2.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","import './setPublicPath'\nimport Vue from 'vue'\nimport wrap from '@vue/web-component-wrapper'\n\n// runtime shared by every component chunk\nimport 'css-loader/dist/runtime/api.js'\nimport 'vue-style-loader/lib/addStylesShadow'\nimport 'vue-loader/lib/runtime/componentNormalizer'\n\nimport matrixElement from '~root/src/App.vue?shadow'\nwindow.customElements.define('matrix-element', wrap(Vue, matrixElement))","var MD5 = require('md5.js')\n\nmodule.exports = function (buffer) {\n return new MD5().update(buffer).digest()\n}\n","module.exports=function(e){var r={};function n(t){if(r[t])return r[t].exports;var a=r[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var a in e)n.d(t,a,function(r){return e[r]}.bind(null,a));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,\"a\",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p=\"\",n(n.s=0)}([function(e,r,n){\"use strict\";n.r(r),n.d(r,\"validateHTMLColorName\",(function(){return l})),n.d(r,\"validateHTMLColorSpecialName\",(function(){return i})),n.d(r,\"validateHTMLColorHex\",(function(){return u})),n.d(r,\"validateHTMLColorRgb\",(function(){return d})),n.d(r,\"validateHTMLColorHsl\",(function(){return f})),n.d(r,\"validateHTMLColorHwb\",(function(){return h})),n.d(r,\"validateHTMLColorLab\",(function(){return g})),n.d(r,\"validateHTMLColor\",(function(){return m}));const t=e=>e&&\"string\"==typeof e,a=[\"AliceBlue\",\"AntiqueWhite\",\"Aqua\",\"Aquamarine\",\"Azure\",\"Beige\",\"Bisque\",\"Black\",\"BlanchedAlmond\",\"Blue\",\"BlueViolet\",\"Brown\",\"BurlyWood\",\"CadetBlue\",\"Chartreuse\",\"Chocolate\",\"Coral\",\"CornflowerBlue\",\"Cornsilk\",\"Crimson\",\"Cyan\",\"DarkBlue\",\"DarkCyan\",\"DarkGoldenrod\",\"DarkGray\",\"DarkGreen\",\"DarkKhaki\",\"DarkMagenta\",\"DarkOliveGreen\",\"DarkOrange\",\"DarkOrchid\",\"DarkRed\",\"DarkSalmon\",\"DarkSeaGreen\",\"DarkSlateBlue\",\"DarkSlateGray\",\"DarkTurquoise\",\"DarkViolet\",\"DeepPink\",\"DeepSkyBlue\",\"DimGray\",\"DodgerBlue\",\"FireBrick\",\"FloralWhite\",\"ForestGreen\",\"Fuchsia\",\"Gainsboro\",\"GhostWhite\",\"Gold\",\"Goldenrod\",\"Gray\",\"Green\",\"GreenYellow\",\"HoneyDew\",\"HotPink\",\"IndianRed\",\"Indigo\",\"Ivory\",\"Khaki\",\"Lavender\",\"LavenderBlush\",\"LawnGreen\",\"LemonChiffon\",\"LightBlue\",\"LightCoral\",\"LightCyan\",\"LightGoldenrodYellow\",\"LightGray\",\"LightGreen\",\"LightPink\",\"LightSalmon\",\"LightSalmon\",\"LightSeaGreen\",\"LightSkyBlue\",\"LightSlateGray\",\"LightSteelBlue\",\"LightYellow\",\"Lime\",\"LimeGreen\",\"Linen\",\"Magenta\",\"Maroon\",\"MediumAquamarine\",\"MediumBlue\",\"MediumOrchid\",\"MediumPurple\",\"MediumSeaGreen\",\"MediumSlateBlue\",\"MediumSlateBlue\",\"MediumSpringGreen\",\"MediumTurquoise\",\"MediumVioletRed\",\"MidnightBlue\",\"MintCream\",\"MistyRose\",\"Moccasin\",\"NavajoWhite\",\"Navy\",\"OldLace\",\"Olive\",\"OliveDrab\",\"Orange\",\"OrangeRed\",\"Orchid\",\"PaleGoldenrod\",\"PaleGreen\",\"PaleTurquoise\",\"PaleVioletRed\",\"PapayaWhip\",\"PeachPuff\",\"Peru\",\"Pink\",\"Plum\",\"PowderBlue\",\"Purple\",\"RebeccaPurple\",\"Red\",\"RosyBrown\",\"RoyalBlue\",\"SaddleBrown\",\"Salmon\",\"SandyBrown\",\"SeaGreen\",\"SeaShell\",\"Sienna\",\"Silver\",\"SkyBlue\",\"SlateBlue\",\"SlateGray\",\"Snow\",\"SpringGreen\",\"SteelBlue\",\"Tan\",\"Teal\",\"Thistle\",\"Tomato\",\"Turquoise\",\"Violet\",\"Wheat\",\"White\",\"WhiteSmoke\",\"Yellow\",\"YellowGreen\"],o=[\"currentColor\",\"inherit\",\"transparent\"],l=e=>{let r=!1;return t(e)&&a.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},i=e=>{let r=!1;return t(e)&&o.map(n=>(e.toLowerCase()===n.toLowerCase()&&(r=!0),null)),r},u=e=>{if(t(e)){const r=/^#([\\da-f]{3}){1,2}$|^#([\\da-f]{4}){1,2}$/i;return e&&r.test(e)}},d=e=>{if(t(e)){const r=/(rgb)a?\\((\\s*\\d+%?\\s*?,?\\s*){2}(\\s*\\d+%?\\s*?,?\\s*\\)?)(\\s*,?\\s*\\/?\\s*(0?\\.?\\d+%?\\s*)?|1|0)?\\)$/i;return e&&r.test(e)}},s=\"(([0-9]|[1-9][0-9]|100)%)\",c=`\\\\s*?\\\\)?)(\\\\s*?(\\\\/?)\\\\s+${`(((${s}))|(0?(\\\\.\\\\d+)?)|1))?`}\\\\s*?\\\\)$`,f=e=>{if(t(e)){const r=new RegExp(`(hsl)a?\\\\((\\\\s*?(${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}|${\"(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)gra)\"}|${\"((([0-5])?\\\\.\\\\d+|6\\\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)\"}|${\"((0?(\\\\.\\\\d+)?|1)turn)\"})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})((\\\\s*,\\\\s*)|(\\\\s+)))(\\\\s*?(0|${s})\\\\s*?\\\\)?)(\\\\s*?(\\\\/?|,?)\\\\s*?(((${s}))|(0?(\\\\.\\\\d+)?)|1))?\\\\)$`);return e&&r.test(e)}},h=e=>{if(t(e)){const r=new RegExp(`(hwb\\\\(\\\\s*?${\"(-?([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9]|360)(deg)?)\"}\\\\s+)((0|${s})\\\\s+)((0|${s})${c}`);return e&&r.test(e)}},g=e=>{if(t(e)){const r=\"(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])(\\\\.\\\\d+)??|160))\",n=new RegExp(`(lab\\\\(\\\\s*?((\\\\d*(\\\\.\\\\d+)?)%)\\\\s+${r}\\\\s+${r}${c}`);return e&&n.test(e)}},m=e=>!!(e&&u(e)||d(e)||f(e)||h(e)||g(e));r.default=e=>!!(e&&u(e)||l(e)||i(e)||d(e)||f(e)||h(e)||g(e))}]);","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"#teamroom.mobile[data-v-9b340a7a]{margin-bottom:10px}#teamroom[data-v-9b340a7a]:hover{cursor:pointer}#teamroom .teamChatWrapper[data-v-9b340a7a]{padding:.5em .25em;display:flex;align-items:center;transition:.3s}#teamroom .teamChatWrapper .iconWrapper[data-v-9b340a7a]{width:44px;display:flex;align-items:center;min-width:44px;height:44px;position:relative}#teamroom .teamChatWrapper .iconWrapper .logo[data-v-9b340a7a]{background-size:cover;background-position:50%;background-repeat:no-repeat;height:44px;width:44px;margin-left:0;margin-top:0;position:absolute;background:rgb(var(--text-on-bg-ac-color));border-radius:50%;padding-top:8px;text-align:center}#teamroom .teamChatWrapper .iconWrapper .logo img[data-v-9b340a7a]{width:28px;height:28px;margin:0 auto}#teamroom .teamChatWrapper .iconWrapper .unseen[data-v-9b340a7a]{background:rgba(var(--color-bg-ac),.9);color:rgb(var(--text-on-bg-ac-color));position:absolute;width:22px;height:22px;right:-10%;top:-10%;line-height:22px;text-align:center;font-weight:500;border-radius:50%;z-index:2;font-size:.6em}#teamroom .teamChatWrapper .infoWrapper[data-v-9b340a7a]{padding-left:.5em}#teamroom .teamChatWrapper .infoWrapper>div[data-v-9b340a7a]{display:flex;align-content:center}#teamroom .teamChatWrapper .infoWrapper .infoName span[data-v-9b340a7a]{font-size:.9em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;display:inline-block;max-width:190px;color:rgb(var(--text-color))}#teamroom .teamChatWrapper .infoWrapper .previewMessage[data-v-9b340a7a]{display:flex;justify-content:flex-start;align-items:center;width:100%}#teamroom .teamChatWrapper .infoWrapper .previewMessage span[data-v-9b340a7a]{display:block;color:rgb(var(--color-txt-gray));font-size:.9em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;text-align:left;max-width:210px}#teamroom.minimized:not(.active) .teamChatWrapper[data-v-9b340a7a]{padding:.5em 0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","// Ported from https://github.com/mafintosh/pump with\n// permission from the author, Mathias Buus (@mafintosh).\n'use strict';\n\nvar eos;\n\nfunction once(callback) {\n var called = false;\n return function () {\n if (called) return;\n called = true;\n callback.apply(void 0, arguments);\n };\n}\n\nvar _require$codes = require('../../../errors').codes,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,\n ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;\n\nfunction noop(err) {\n // Rethrow the error if it exists to avoid swallowing it\n if (err) throw err;\n}\n\nfunction isRequest(stream) {\n return stream.setHeader && typeof stream.abort === 'function';\n}\n\nfunction destroyer(stream, reading, writing, callback) {\n callback = once(callback);\n var closed = false;\n stream.on('close', function () {\n closed = true;\n });\n if (eos === undefined) eos = require('./end-of-stream');\n eos(stream, {\n readable: reading,\n writable: writing\n }, function (err) {\n if (err) return callback(err);\n closed = true;\n callback();\n });\n var destroyed = false;\n return function (err) {\n if (closed) return;\n if (destroyed) return;\n destroyed = true; // request.destroy just do .end - .abort is what we want\n\n if (isRequest(stream)) return stream.abort();\n if (typeof stream.destroy === 'function') return stream.destroy();\n callback(err || new ERR_STREAM_DESTROYED('pipe'));\n };\n}\n\nfunction call(fn) {\n fn();\n}\n\nfunction pipe(from, to) {\n return from.pipe(to);\n}\n\nfunction popCallback(streams) {\n if (!streams.length) return noop;\n if (typeof streams[streams.length - 1] !== 'function') return noop;\n return streams.pop();\n}\n\nfunction pipeline() {\n for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {\n streams[_key] = arguments[_key];\n }\n\n var callback = popCallback(streams);\n if (Array.isArray(streams[0])) streams = streams[0];\n\n if (streams.length < 2) {\n throw new ERR_MISSING_ARGS('streams');\n }\n\n var error;\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1;\n var writing = i > 0;\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err;\n if (err) destroys.forEach(call);\n if (reading) return;\n destroys.forEach(call);\n callback(error);\n });\n });\n return streams.reduce(pipe);\n}\n\nmodule.exports = pipeline;","// style-loader: Adds some css to the DOM by adding a \n","import mod from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../cache-loader/dist/cjs.js??ref--13-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader/lib/index.js??vue-loader-options!./ClipLoader.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ClipLoader.vue?vue&type=template&id=7edc50d8&\"\nimport script from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nexport * from \"./ClipLoader.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ClipLoader.vue?vue&type=style&index=0&lang=css&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=3d50eb11&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"listPreview\"},[(_vm.urlpreview && _vm.metaPreviewLink)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"linkTitle txt\"},[_vm._v(\"sent link: \"+_vm._s(_vm.meta['og:title'])+\" \")]),(_vm.meta['og:site_name'] === 'Pocketnet')?_c('span',{staticClass:\"pocketnetLink\"},[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")]):_c('span',[_vm._v(\" \"+_vm._s(_vm.meta['og:site_name'])+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.file')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"sname txt\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" sent file: \"+_vm._s(JSON.parse(_vm.content.body).name)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.bad.encrypted')?_c('div',{staticClass:\"previewMessage\"},[_c('span',[_vm._v(\" \"+_vm._s(_vm.$t(\"caption.unabletoDecrypt\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.redaction')?_c('div',{staticClass:\"previewMessage\"},[_c('span',{staticClass:\"txt\"},[_c('i',{staticClass:\"fas fa-eraser\"}),_vm._v(\" \"+_vm._s(_vm.$t(\"caption.messageDeleted\"))+\" \")])]):_vm._e(),(_vm.event.event.type === 'm.room.power_levels')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(\" \"+_vm._s(_vm.powerLevels)+\" \")])]):_vm._e(),(_vm.content.msgtype === 'm.image')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentImage\")))])]):_vm._e(),(_vm.content.msgtype === 'm.audio')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.sentVoiceMessage\")))])]):_vm._e(),((_vm.content.msgtype === 'm.text') && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.content.body}})],1)]):_vm._e(),(_vm.content.msgtype === 'm.encrypted' && !_vm.urlpreview)?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName && _vm.senderName!= 'You')?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_c('IncomingMessage',{attrs:{\"message\":_vm.decryptEvent.body}})],1)]):_vm._e(),(_vm.content.membership === 'invite')?_c('div',{staticClass:\"invitedEvent\"},[(_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToChat\")))]):_vm._e(),(!_vm.tetatetchat)?_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.invitationToRoom\")))]):_vm._e()]):_vm._e(),(_vm.content.membership === 'leave')?_c('div',{staticClass:\"previewMessage\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\": \")]):_vm._e(),_c('span',{staticClass:\"txt sname\"},[_vm._v(\" \"+_vm._s(_vm.name)+\" \")]),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.leftChat\")))])]):_vm._e(),(_vm.content.membership === 'ban')?_c('div',[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"txt\"},[_vm._v(\"banned \"+_vm._s(_vm.content.displayname))])]):_vm._e(),(_vm.content.membership === 'join' && _vm.event.getSender() !== _vm.userId)?_c('div',{staticClass:\"invitedEvent\"},[(_vm.senderName)?_c('span',{staticClass:\"txt sname\"},[_vm._v(_vm._s(_vm.senderName)+\" \")]):_vm._e(),_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.joined\")))])]):_vm._e(),(_vm.content.name)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatRenamed\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.name))])])]):_vm._e(),(_vm.content.topic)?_c('div',[_c('span',{staticClass:\"txt\"},[_vm._v(_vm._s(_vm.$t(\"caption.chatTopic\"))+\" \"),_c('b',[_vm._v(_vm._s(_vm.content.topic.replace(/_/g, ' ')))])])]):_vm._e(),(_vm.readed)?_c('div',{staticClass:\"statusWrapper\"},[(_vm.my)?_c('div',{staticClass:\"my\"},[_c('i',{staticClass:\"fas fa-check-double\"})]):_vm._e()]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',_vm._l((_vm.chunks),function(chunk,index){return _c('label',{key:index,attrs:{\"chunks\":_vm.chunks}},[(chunk.id)?_c('label',{staticClass:\"likelink\",on:{\"click\":function($event){return _vm.show(chunk)}}},[_vm._v(\"@\"+_vm._s(chunk.name))]):_c('label',[_vm._v(_vm._s(chunk))])])}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./incomingMessage.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./incomingMessage.vue?vue&type=template&id=6b3704ba&scoped=true&\"\nimport script from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nexport * from \"./incomingMessage.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./incomingMessage.vue?vue&type=style&index=0&id=6b3704ba&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"6b3704ba\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n","import mod from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=ba5ac396&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=ba5ac396&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"ba5ac396\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"urlMessage\",attrs:{\"id\":\"url\"}},[(_vm.urltype!= 'impty' && !_vm.error)?_c('div',{staticClass:\"urlwrapper\"},[(!_vm.loading)?_c('metaMessage',{ref:\"metamessage\",attrs:{\"type\":_vm.urltype,\"name\":_vm.meta['og:site_name'],\"title\":_vm.meta['og:title'],\"description\":_vm.meta['og:description'],\"image\":_vm.previewImageUrl,\"url\":_vm.url,\"h\":_vm.meta['og:image:height'],\"w\":_vm.meta['og:image:width']},on:{\"updatedSize\":_vm.updatedSize}}):_c('div',[_c('div',{staticClass:\"preloaderWrapperLocal\"},[_c('linepreloader')],1)])],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=791cf1f7&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=791cf1f7&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"791cf1f7\",\n null\n ,true\n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"voiceMessage\",class:{playing:_vm.isPlaying}},[_c('div',{staticClass:\"voiceMessage_wrapper\"},[_c('button',{staticClass:\"voiceMessage_toggle\",class:{encrypted: _vm.encrypted},on:{\"touchend\":_vm.audioToggle,\"click\":_vm.audioToggleClick}},[_c('i',{class:_vm.isPlaying ? 'fas fa-pause': 'fas fa-play'})]),_c('div',{staticClass:\"voiceMessage_graph\"},[_c('canvas',{ref:\"canvas\",attrs:{\"width\":\"100\",\"height\":\"50\"},on:{\"mousedown\":_vm.goTo}})]),_c('div',{staticClass:\"voiceMessage_options\"},[(!_vm.error)?_c('span',[_vm._v(_vm._s(_vm.getDurationString))]):_vm._e(),(_vm.error)?_c('i',{staticClass:\"fas fa-exclamation-circle\"}):_vm._e()]),(_vm.encrypted && !_vm.error)?_c('div',{staticClass:\"encsign\"},[_c('i',{staticClass:\"fas fa-lock\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0438bc11&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0438bc11&scoped=true&lang=scss&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0438bc11\",\n null\n ,true\n)\n\nexport default component.exports","import actions from \"@/components/events/event/actions/index.vue\";\r\nimport filePreview from \"@/components/events/previews/filePreview/index.vue\";\r\nimport fileMessage from \"@/components/events/event/fileMessage/index.vue\";\r\nimport listPreview from \"@/components/events/event/message/listPreview/index.vue\";\r\nimport f from '@/application/functions'\r\nimport url from '@/components/events/event/url/index.vue'\r\nimport imagesLoaded from 'vue-images-loaded'\r\nimport dummypreviews from \"@/components/chats/dummypreviews\";\r\nimport IncomingMessage from \"./incomingMessage/incomingMessage.vue\"\r\nimport VoiceMessage from '@/components/events/event/VoiceMessage';\r\n\r\nexport default {\r\n name: 'eventsMessage',\r\n props: {\r\n decryptEvent: {},\r\n origin: Object,\r\n prevevent : Object,\r\n event: Object,\r\n preview: Boolean,\r\n userinfo: Object,\r\n readed: Object,\r\n downloaded: Boolean,\r\n baseImg: {\r\n type: String,\r\n default: 'empty'\r\n },\r\n filePreview: Object,\r\n imgEvent: {},\r\n add_image: Function,\r\n goToGallery: Function,\r\n chat: Object,\r\n encrypted: false,\r\n encryptedData: Boolean,\r\n decryptedInfo: null,\r\n error: String,\r\n withImage: Boolean,\r\n reference: Object,\r\n last : Boolean,\r\n showmyicontrue : false,\r\n fromreference : Boolean,\r\n multiSelect: {\r\n default: false,\r\n type: Boolean,\r\n },\r\n selectedMessages: {\r\n default: [],\r\n type: Array,\r\n },\r\n isRemoveSelectedMessages: false,\r\n audioBuffer : null\r\n },\r\n directives: {\r\n imagesLoaded\r\n },\r\n\r\n data: function () {\r\n\r\n return {\r\n referenceshowed : false,\r\n }\r\n\r\n },\r\n components: {\r\n actions,\r\n filePreview,\r\n fileMessage,\r\n listPreview,\r\n url,\r\n dummypreviews,\r\n IncomingMessage,\r\n VoiceMessage,\r\n },\r\n watch : {\r\n isRemoveSelectedMessages: {\r\n immediate: true,\r\n handler: function () {\r\n if (this.isRemoveSelectedMessages) {\r\n for (let i = 0; i < this.selectedMessages.length; i++) {\r\n if (\r\n this.selectedMessages[i].message_id === this.origin.event.event_id\r\n ) {\r\n this.$emit('remove');\r\n\r\n return this.core.mtrx.client.redactEvent(\r\n this.chat.roomId,\r\n this.origin.event.event_id,\r\n null,\r\n {\r\n reason: 'messagedeleting',\r\n }\r\n );\r\n }\r\n }\r\n this.$emit('messagesIsDeleted', true);\r\n }\r\n },\r\n },\r\n readyToRender : {\r\n immediate : true,\r\n handler : function(){\r\n if(this.readyToRender) this.$emit('readyToRender')\r\n }\r\n }\r\n },\r\n computed: {\r\n showburn : function(){ \r\n\r\n if(new Date() < new Date(2021,11,28)) {\r\n return ''\r\n }\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.b) return 'big'\r\n\r\n if( - moment().diff(this.willburn, this.core.options.burn.v) < this.core.options.burn.m) return 'medium'\r\n\r\n return ''\r\n },\r\n willburn : function(){\r\n\r\n var d = moment(this.origin._localTimestamp).add(this.core.options.burn.w, this.core.options.burn.v)\r\n\r\n return d\r\n\r\n },\r\n\r\n readyToRender : function(){\r\n\r\n var r = ( this.content.msgtype === 'm.encrypted' && !this.textWithoutLinks && this.badenctypted ) || \r\n\r\n (this.content.membership) ||\r\n\r\n ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && this.textWithoutLinks) ||\r\n (this.file) || (this.error) || \r\n (this.content.msgtype === 'm.image' && this.imageUrl) ||\r\n (this.content.msgtype === 'm.audio' && this.audioUrl) ||\r\n (this.urlpreview) || \r\n (this.preview)\r\n\r\n return r \r\n\r\n },\r\n my: function () {\r\n return this.userinfo.id === this.core.user.userinfo?.id\r\n },\r\n stateChat: function () {\r\n var id = this.$route.query.id\r\n\r\n return this.$store.state.chatsMap[id]\r\n },\r\n\r\n\r\n sending: function () {\r\n return this.origin.status == 'sending'\r\n },\r\n\r\n showmeta : function(){\r\n if(!this.prevevent) return true\r\n\r\n var prevuser = this.$f.getmatrixid(this.prevevent.getSender())\r\n\r\n var t = 10 * 60000\r\n\r\n if((moment().diff(this.origin._localTimestamp, 'days')) != 0){\r\n t = 60 * 1000 * 60 * 24\r\n }\r\n\r\n if (prevuser != this.userinfo.id || this.prevevent._localTimestamp + t < this.origin._localTimestamp){\r\n return true\r\n }\r\n \r\n },\r\n\r\n imageFrom: function () {\r\n if (this.content && this.content.info) return this.content.info.from\r\n },\r\n\r\n showmyicon: function () {\r\n \r\n return this.showmyicontrue || \r\n this.content.msgtype === 'm.image' ||\r\n /*this.content.msgtype === 'm.audio' ||*/\r\n this.content.msgtype === 'm.file' || \r\n this.urlpreview || (!this.$store.state.active && this.$store.state.minimized)\r\n\r\n\r\n },\r\n\r\n file: function () {\r\n if (this.content.msgtype === 'm.file') {\r\n return this.body\r\n }\r\n },\r\n\r\n replacedmintionsbody:function(){\r\n return this.body.replace(/@\\w{68}:(\\w{1,50})/g, function(str, l){\r\n return '@' + l\r\n })\r\n\r\n },\r\n\r\n body: function () {\r\n\r\n var bc = this.origin.event.content\r\n\r\n if (this.origin.event.content.msgtype == 'm.encrypted') {\r\n bc = this.decryptEvent\r\n }\r\n\r\n return bc.pbody || bc.body || ''\r\n },\r\n\r\n content: function () {\r\n return this.origin.event.content\r\n },\r\n\r\n badenctypted: function () {\r\n return this.decryptEvent.msgtype == 'm.bad.encrypted'\r\n },\r\n\r\n \r\n\r\n textWithoutLinks: function () {\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (!this.urlpreview || this.urlpreview.length < 10 ||\r\n (trimmed.indexOf(this.urlpreview) > 0 && trimmed.indexOf(this.urlpreview) + this.urlpreview.length < trimmed.length)\r\n ) {\r\n return trimmed\r\n }\r\n\r\n return this.$f.trim(trimmed.replace(this.urlpreview, ''))\r\n\r\n },\r\n\r\n imageUrl: function () {\r\n if (this.content.msgtype === 'm.image') {\r\n\r\n if (this.encryptedData) {\r\n return this.decryptedInfo\r\n } else {\r\n\r\n \r\n\r\n return this.content && this.content.url;\r\n }\r\n\r\n }\r\n },\r\n\r\n audioUrl: function () {\r\n if (this.content.msgtype === 'm.audio') {\r\n\r\n if(this.encryptedData && this.decryptedInfo) return this.decryptedInfo\r\n\r\n return this.audioBuffer\r\n\r\n //return this.content && this.content.audioData\r\n }\r\n },\r\n\r\n\r\n canediting: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n cancopy: function () {\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n if (this.origin.event.content.msgtype == 'm.encrypted' || this.origin.event.content.msgtype == 'm.text') {\r\n return true\r\n }\r\n }\r\n },\r\n\r\n menuItems: function () {\r\n var menu = [\r\n {\r\n click: \"reply\",\r\n title: this.$i18n.t(\"button.reply\"),\r\n icon: \"fas fa-reply\"\r\n },\r\n {\r\n click: \"showMultiSelect\",\r\n title: this.$i18n.t(\"button.select\"),\r\n icon: \"fas fa-check-circle\",\r\n },\r\n ]\r\n\r\n if(!this.file){\r\n menu.push({\r\n click: \"share\",\r\n title: this.$i18n.t(\"button.share\"),\r\n icon: \"fas fa-share-alt\"\r\n })\r\n }\r\n\r\n\r\n if (this.my) {\r\n menu.push({\r\n click: \"delete\",\r\n title: this.$i18n.t(\"button.delete\"),\r\n icon: \"far fa-trash-alt\"\r\n })\r\n }\r\n\r\n var type = f.deep(this.origin, 'event.type')\r\n\r\n if (type == 'm.room.message') {\r\n menu.unshift({\r\n click: \"copy\",\r\n title: this.$i18n.t(\"button.copy\"),\r\n icon: \"far fa-copy\"\r\n })\r\n\r\n if (this.my && this.canediting)\r\n menu.unshift({\r\n click: \"edit\",\r\n title: this.$i18n.t(\"button.edit\"),\r\n icon: \"far fa-edit\"\r\n })\r\n }\r\n\r\n return menu\r\n },\r\n\r\n\r\n urlpreview: function () {\r\n if (!this.preview && this.content.msgtype !== 'm.file') {\r\n\r\n\r\n var url = f.getUrl(this.body)\r\n\r\n if (url){\r\n var _u = new URL(url)\r\n\r\n if(_u.pathname == '/'){\r\n if(f.knsite(url)) return ''\r\n }\r\n\r\n return url\r\n }\r\n\r\n return url || ''\r\n }\r\n },\r\n\r\n edited: function () {\r\n if (this.content.edited) return true\r\n\r\n if (\r\n this.origin.event.content['m.relates_to'] &&\r\n this.origin.event.content['m.relates_to']['rel_type'] == 'm.replace') return true\r\n },\r\n\r\n selectedMessage: function () {\r\n const elem = this.selectedMessages.filter(\r\n (item) => item.message_id === this.origin.event.event_id\r\n );\r\n return elem[0]?.message_id === this.origin.event.event_id ? true : false;\r\n },\r\n },\r\n\r\n mounted() {\r\n\r\n },\r\n\r\n methods: {\r\n gotoreference: function () {\r\n var id = this.reference.getId()\r\n\r\n this.$emit('gotoreference', id)\r\n },\r\n\r\n showwhenburn : function(){\r\n\r\n var text = ''\r\n\r\n //console.log(this.willburn.toDate(), new Date(), this.willburn.toDate() > new Date())\r\n\r\n if(this.willburn.toDate() < new Date()){\r\n text = this.$i18n.t(\"messagewasburn\")\r\n }\r\n else{\r\n text = this.$i18n.t(\"messagewillburn\")\r\n\r\n //this.willburn.locale(this.$i18n.locale).format('DD MMMM YYYY')\r\n }\r\n\r\n this.$store.commit('icon', {\r\n\t\t\t\ticon: 'info',\r\n\t\t\t\tmessage: text\r\n \r\n \r\n\t\t\t})\r\n\r\n },\r\n\r\n imagesLoaded: function () {\r\n this.updatedSize()\r\n },\r\n updatedSize: function (before) {\r\n this.$emit('updatedSize', before)\r\n },\r\n\r\n dropDownMenuShow: function () {\r\n\r\n if(this.urlpreview) return\r\n\r\n setTimeout(() => {\r\n this.setmenu()\r\n }, 200)\r\n\r\n },\r\n\r\n setmenu : function(){\r\n this.core.menu({\r\n items : this.menuItems,\r\n handler : this.menuItemClickHandler,\r\n item : {}\r\n })\r\n },\r\n\r\n menushare: function () {\r\n\r\n var sharing = {}\r\n\r\n var trimmed = this.$f.trim(this.body)\r\n \r\n if (this.content.msgtype === 'm.image' && this.imageUrl) sharing.images = [this.imageUrl]\r\n\r\n if (this.content.msgtype === 'm.audio' && this.audioUrl) sharing.audio = [this.audioUrl]\r\n\r\n if ((this.content.msgtype === 'm.text' || this.content.msgtype === 'm.encrypted') && trimmed) sharing.messages = [trimmed]\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id\r\n\r\n this.$emit('share', sharing)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menuedit: function () {\r\n this.$emit('editing', this.body)\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menushowMultiSelect: function () {\r\n this.$emit('showMultiSelect');\r\n this.selectMessage();\r\n\r\n return Promise.resolve()\r\n },\r\n\r\n menureply: function () {\r\n\r\n this.$emit('reply')\r\n\r\n return Promise.resolve()\r\n },\r\n menucopy: function () {\r\n\r\n \r\n\r\n this.$f.copytext(this.replacedmintionsbody)\r\n\r\n return Promise.resolve()\r\n },\r\n menudelete: function () {\r\n\r\n return this.$dialog.confirm(\r\n 'Do you really want to delete message?', {\r\n okText: this.$i18n.t(\"yes\"),\r\n cancelText: this.$i18n.t(\"cancel\")\r\n })\r\n\r\n .then((dialog) => {\r\n\r\n this.$emit('remove')\r\n\r\n\r\n return this.core.mtrx.client.redactEvent(this.chat.roomId, this.origin.event.event_id, null, {\r\n reason: \"messagedeleting\",\r\n })\r\n\r\n }).catch(e => {\r\n return Promise.resolve()\r\n })\r\n\r\n\r\n },\r\n menuItemClickHandler: function (item, d, p) {\r\n\r\n p.hidePopup()\r\n\r\n this['menu' + item.click]().then(r => {\r\n\r\n }).catch(e => {\r\n p.showPopup()\r\n })\r\n\r\n },\r\n\r\n imagePaddingStyle : function(c){\r\n\r\n if(c.info && c.info.h && c.info.w){\r\n\r\n var cc = c.info.h / c.info.w\r\n\r\n if (cc > 1.7) cc = 1.7\r\n\r\n var h = 'padding-bottom:' + ((cc) * 100) + '%'\r\n\r\n return h\r\n }\r\n\r\n return ''\r\n },\r\n parser(event) {\r\n return JSON.parse(event)['og:title']\r\n },\r\n openImage(img) {\r\n this.$emit('openImg', img)\r\n },\r\n\r\n format_date(value) {\r\n if (value) {\r\n if ((moment().diff(value, 'days')) === 0) {\r\n return new Date(value).toLocaleTimeString([], {hour: '2-digit', minute: \"2-digit\", hour12: false})\r\n } else {\r\n if (moment().year() === moment(value).year()) {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM')\r\n } else {\r\n return moment(value).locale(this.$i18n.locale).format('D MMMM YYYY')\r\n }\r\n }\r\n }\r\n },\r\n\r\n download: function () {\r\n this.$emit('download')\r\n },\r\n\r\n decryptagain : function(){\r\n this.$emit('decryptagain')\r\n },\r\n \r\n openImageGallery(msgEvent) {\r\n this.$emit('openGalleryImg', msgEvent)\r\n },\r\n reshareKeys() {\r\n let roomId = this.chat.roomId\r\n },\r\n textDonation: function (withTx = false) {\r\n var from = this.$i18n.t(\"caption.somebody\"), msg = '';\r\n try {\r\n from = this.$f.deep(this, '$store.state.users.' + this.content.from).name;\r\n } catch (err) {\r\n }\r\n var to = this.$i18n.t(\"caption.somebody\");\r\n try {\r\n to = this.$f.deep(this, '$store.state.users.' + this.content.to).name;\r\n } catch (err) {\r\n }\r\n msg += from + this.$i18n.t(\"caption.sent\") + this.content.amount + this.$i18n.t(\"caption.sent\") + to;\r\n return msg;\r\n },\r\n\r\n menuIsVisibleHandler(isVisible) {\r\n this.$emit('menuIsVisible', isVisible);\r\n },\r\n\r\n showreference : function(){\r\n this.referenceshowed = !this.referenceshowed\r\n },\r\n\r\n selectMessage: function () {\r\n var sharing = {};\r\n\r\n var trimmed = this.$f.trim(this.body);\r\n\r\n if (this.content.msgtype === 'm.image' && this.imageUrl)\r\n sharing.images = [this.imageUrl];\r\n\r\n if (this.content.msgtype === 'm.audio' && this.decryptedInfo)\r\n sharing.audio = [this.decryptedInfo];\r\n\r\n if (\r\n (this.content.msgtype === 'm.text' ||\r\n this.content.msgtype === 'm.encrypted') &&\r\n trimmed\r\n )\r\n sharing.messages = [trimmed];\r\n\r\n //if(this.urlpreview) sharing.urls = [urlpreview]\r\n\r\n if (this.file) {\r\n sharing.download = true;\r\n }\r\n\r\n //sharing.route = 'chat?id=' + this.chat.roomId\r\n sharing.from = this.userinfo.id;\r\n this.$emit('selectMessage', {\r\n message_id: this.origin.event.event_id,\r\n ...sharing,\r\n });\r\n },\r\n removeMessage: function () {\r\n this.$emit('removeMessage', {\r\n message_id: this.origin.event.event_id,\r\n });\r\n },\r\n\r\n eventMessage: function (state) {\r\n state ? this.removeMessage() : this.selectMessage()\r\n }\r\n }\r\n}","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=c8f458dc&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=c8f458dc&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"c8f458dc\",\n null\n ,true\n)\n\nexport default component.exports","\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=72e46191&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=72e46191&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"72e46191\",\n null\n ,true\n)\n\nexport default component.exports","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&id=79bb4e47&scoped=true&lang=sass&\"","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.EventTimelineSet = EventTimelineSet;\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _eventTimeline = require(\"./event-timeline\");\r\n\r\nvar _event = require(\"./event\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\nvar _relations = require(\"./relations\");\r\n\r\n/*\r\nCopyright 2016 OpenMarket Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module models/event-timeline-set\r\n */\r\n// var DEBUG = false;\r\nconst DEBUG = true;\r\nlet debuglog;\r\n\r\nif (DEBUG) {\r\n // using bind means that we get to keep useful line numbers in the console\r\n debuglog = _logger.logger.log.bind(_logger.logger);\r\n} else {\r\n debuglog = function () {};\r\n}\r\n/**\r\n * Construct a set of EventTimeline objects, typically on behalf of a given\r\n * room. A room may have multiple EventTimelineSets for different levels\r\n * of filtering. The global notification list is also an EventTimelineSet, but\r\n * lacks a room.\r\n *\r\n *

This is an ordered sequence of timelines, which may or may not\r\n * be continuous. Each timeline lists a series of events, as well as tracking\r\n * the room state at the start and the end of the timeline (if appropriate).\r\n * It also tracks forward and backward pagination tokens, as well as containing\r\n * links to the next timeline in the sequence.\r\n *\r\n *

There is one special timeline - the 'live' timeline, which represents the\r\n * timeline to which events are being added in real-time as they are received\r\n * from the /sync API. Note that you should not retain references to this\r\n * timeline - even if it is the current timeline right now, it may not remain\r\n * so if the server gives us a timeline gap in /sync.\r\n *\r\n *

In order that we can find events from their ids later, we also maintain a\r\n * map from event_id to timeline and index.\r\n *\r\n * @constructor\r\n * @param {?Room} room\r\n * Room for this timelineSet. May be null for non-room cases, such as the\r\n * notification timeline.\r\n * @param {Object} opts Options inherited from Room.\r\n *\r\n * @param {boolean} [opts.timelineSupport = false]\r\n * Set to true to enable improved timeline support.\r\n * @param {Object} [opts.filter = null]\r\n * The filter object, if any, for this timelineSet.\r\n * @param {boolean} [opts.unstableClientRelationAggregation = false]\r\n * Optional. Set to true to enable client-side aggregation of event relations\r\n * via `getRelationsForEvent`.\r\n * This feature is currently unstable and the API may change without notice.\r\n */\r\n\r\n\r\nfunction EventTimelineSet(room, opts) {\r\n this.room = room;\r\n this._timelineSupport = Boolean(opts.timelineSupport);\r\n this._liveTimeline = new _eventTimeline.EventTimeline(this);\r\n this._unstableClientRelationAggregation = !!opts.unstableClientRelationAggregation; // just a list - *not* ordered.\r\n\r\n this._timelines = [this._liveTimeline];\r\n this._eventIdToTimeline = {};\r\n this._filter = opts.filter || null;\r\n\r\n if (this._unstableClientRelationAggregation) {\r\n // A tree of objects to access a set of relations for an event, as in:\r\n // this._relations[relatesToEventId][relationType][relationEventType]\r\n this._relations = {};\r\n }\r\n}\r\n\r\nutils.inherits(EventTimelineSet, _events.EventEmitter);\r\n/**\r\n * Get all the timelines in this set\r\n * @return {module:models/event-timeline~EventTimeline[]} the timelines in this set\r\n */\r\n\r\nEventTimelineSet.prototype.getTimelines = function () {\r\n return this._timelines;\r\n};\r\n/**\r\n * Get the filter object this timeline set is filtered on, if any\r\n * @return {?Filter} the optional filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getFilter = function () {\r\n return this._filter;\r\n};\r\n/**\r\n * Set the filter object this timeline set is filtered on\r\n * (passed to the server when paginating via /messages).\r\n * @param {Filter} filter the filter for this timelineSet\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setFilter = function (filter) {\r\n this._filter = filter;\r\n};\r\n/**\r\n * Get the list of pending sent events for this timelineSet's room, filtered\r\n * by the timelineSet's filter if appropriate.\r\n *\r\n * @return {module:models/event.MatrixEvent[]} A list of the sent events\r\n * waiting for remote echo.\r\n *\r\n * @throws If opts.pendingEventOrdering was not 'detached'\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getPendingEvents = function () {\r\n if (!this.room) {\r\n return [];\r\n }\r\n\r\n if (this._filter) {\r\n return this._filter.filterRoomTimeline(this.room.getPendingEvents());\r\n } else {\r\n return this.room.getPendingEvents();\r\n }\r\n};\r\n/**\r\n * Get the live timeline for this room.\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} live timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getLiveTimeline = function () {\r\n return this._liveTimeline;\r\n};\r\n/**\r\n * Return the timeline (if any) this event is in.\r\n * @param {String} eventId the eventId being sought\r\n * @return {module:models/event-timeline~EventTimeline} timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.eventIdToTimeline = function (eventId) {\r\n return this._eventIdToTimeline[eventId];\r\n};\r\n/**\r\n * Track a new event as if it were in the same timeline as an old event,\r\n * replacing it.\r\n * @param {String} oldEventId event ID of the original event\r\n * @param {String} newEventId event ID of the replacement event\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.replaceEventId = function (oldEventId, newEventId) {\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n }\r\n};\r\n/**\r\n * Reset the live timeline, and start a new one.\r\n *\r\n *

This is used when /sync returns a 'limited' timeline.\r\n *\r\n * @param {string=} backPaginationToken token for back-paginating the new timeline\r\n * @param {string=} forwardPaginationToken token for forward-paginating the old live timeline,\r\n * if absent or null, all timelines are reset.\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timelineReset\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.resetLiveTimeline = function (backPaginationToken, forwardPaginationToken) {\r\n // Each EventTimeline has RoomState objects tracking the state at the start\r\n // and end of that timeline. The copies at the end of the live timeline are\r\n // special because they will have listeners attached to monitor changes to\r\n // the current room state, so we move this RoomState from the end of the\r\n // current live timeline to the end of the new one and, if necessary,\r\n // replace it with a newly created one. We also make a copy for the start\r\n // of the new timeline.\r\n // if timeline support is disabled, forget about the old timelines\r\n const resetAllTimelines = !this._timelineSupport || !forwardPaginationToken;\r\n const oldTimeline = this._liveTimeline;\r\n const newTimeline = resetAllTimelines ? oldTimeline.forkLive(_eventTimeline.EventTimeline.FORWARDS) : oldTimeline.fork(_eventTimeline.EventTimeline.FORWARDS);\r\n\r\n if (resetAllTimelines) {\r\n this._timelines = [newTimeline];\r\n this._eventIdToTimeline = {};\r\n } else {\r\n this._timelines.push(newTimeline);\r\n }\r\n\r\n if (forwardPaginationToken) {\r\n // Now set the forward pagination token on the old live timeline\r\n // so it can be forward-paginated.\r\n oldTimeline.setPaginationToken(forwardPaginationToken, _eventTimeline.EventTimeline.FORWARDS);\r\n } // make sure we set the pagination token before firing timelineReset,\r\n // otherwise clients which start back-paginating will fail, and then get\r\n // stuck without realising that they *can* back-paginate.\r\n\r\n\r\n newTimeline.setPaginationToken(backPaginationToken, _eventTimeline.EventTimeline.BACKWARDS); // Now we can swap the live timeline to the new one.\r\n\r\n this._liveTimeline = newTimeline;\r\n this.emit(\"Room.timelineReset\", this.room, this, resetAllTimelines);\r\n};\r\n/**\r\n * Get the timeline which contains the given event, if any\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event-timeline~EventTimeline} timeline containing\r\n * the given event, or null if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getTimelineForEvent = function (eventId) {\r\n const res = this._eventIdToTimeline[eventId];\r\n return res === undefined ? null : res;\r\n};\r\n/**\r\n * Get an event which is stored in our timelines\r\n *\r\n * @param {string} eventId event ID to look for\r\n * @return {?module:models/event~MatrixEvent} the given event, or undefined if unknown\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.findEventById = function (eventId) {\r\n const tl = this.getTimelineForEvent(eventId);\r\n\r\n if (!tl) {\r\n return undefined;\r\n }\r\n\r\n return utils.findElement(tl.getEvents(), function (ev) {\r\n return ev.getId() == eventId;\r\n });\r\n};\r\n/**\r\n * Add a new timeline to this timeline list\r\n *\r\n * @return {module:models/event-timeline~EventTimeline} newly-created timeline\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addTimeline = function () {\r\n if (!this._timelineSupport) {\r\n throw new Error(\"timeline support is disabled. Set the 'timelineSupport'\" + \" parameter to true when creating MatrixClient to enable\" + \" it.\");\r\n }\r\n\r\n const timeline = new _eventTimeline.EventTimeline(this);\r\n\r\n this._timelines.push(timeline);\r\n\r\n return timeline;\r\n};\r\n/**\r\n * Add events to a timeline\r\n *\r\n *

Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent[]} events A list of events to add.\r\n *\r\n * @param {boolean} toStartOfTimeline True to add these events to the start\r\n * (oldest) instead of the end (newest) of the timeline. If true, the oldest\r\n * event will be the last element of 'events'.\r\n *\r\n * @param {module:models/event-timeline~EventTimeline} timeline timeline to\r\n * add events to.\r\n *\r\n * @param {string=} paginationToken token for the next batch of events\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n *\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventsToTimeline = function (events, toStartOfTimeline, timeline, paginationToken) {\r\n if (!timeline) {\r\n throw new Error(\"'timeline' not specified for EventTimelineSet.addEventsToTimeline\");\r\n }\r\n\r\n if (!toStartOfTimeline && timeline == this._liveTimeline) {\r\n throw new Error(\"EventTimelineSet.addEventsToTimeline cannot be used for adding events to \" + \"the live timeline - use Room.addLiveEvents instead\");\r\n }\r\n\r\n if (this._filter) {\r\n events = this._filter.filterRoomTimeline(events);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const direction = toStartOfTimeline ? _eventTimeline.EventTimeline.BACKWARDS : _eventTimeline.EventTimeline.FORWARDS;\r\n const inverseDirection = toStartOfTimeline ? _eventTimeline.EventTimeline.FORWARDS : _eventTimeline.EventTimeline.BACKWARDS; // Adding events to timelines can be quite complicated. The following\r\n // illustrates some of the corner-cases.\r\n //\r\n // Let's say we start by knowing about four timelines. timeline3 and\r\n // timeline4 are neighbours:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M] [P] [S] <------> [T]\r\n //\r\n // Now we paginate timeline1, and get the following events from the server:\r\n // [M, N, P, R, S, T, U].\r\n //\r\n // 1. First, we ignore event M, since we already know about it.\r\n //\r\n // 2. Next, we append N to timeline 1.\r\n //\r\n // 3. Next, we don't add event P, since we already know about it,\r\n // but we do link together the timelines. We now have:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P] [S] <------> [T]\r\n //\r\n // 4. Now we add event R to timeline2:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] [S] <------> [T]\r\n //\r\n // Note that we have switched the timeline we are working on from\r\n // timeline1 to timeline2.\r\n //\r\n // 5. We ignore event S, but again join the timelines:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T]\r\n //\r\n // 6. We ignore event T, and the timelines are already joined, so there\r\n // is nothing to do.\r\n //\r\n // 7. Finally, we add event U to timeline4:\r\n //\r\n // timeline1 timeline2 timeline3 timeline4\r\n // [M, N] <---> [P, R] <---> [S] <------> [T, U]\r\n //\r\n // The important thing to note in the above is what happened when we\r\n // already knew about a given event:\r\n //\r\n // - if it was appropriate, we joined up the timelines (steps 3, 5).\r\n // - in any case, we started adding further events to the timeline which\r\n // contained the event we knew about (steps 3, 5, 6).\r\n //\r\n //\r\n // So much for adding events to the timeline. But what do we want to do\r\n // with the pagination token?\r\n //\r\n // In the case above, we will be given a pagination token which tells us how to\r\n // get events beyond 'U' - in this case, it makes sense to store this\r\n // against timeline4. But what if timeline4 already had 'U' and beyond? in\r\n // that case, our best bet is to throw away the pagination token we were\r\n // given and stick with whatever token timeline4 had previously. In short,\r\n // we want to only store the pagination token if the last event we receive\r\n // is one we didn't previously know about.\r\n //\r\n // We make an exception for this if it turns out that we already knew about\r\n // *all* of the events, and we weren't able to join up any timelines. When\r\n // that happens, it means our existing pagination token is faulty, since it\r\n // is only telling us what we already know. Rather than repeatedly\r\n // paginating with the same token, we might as well use the new pagination\r\n // token in the hope that we eventually work our way out of the mess.\r\n\r\n let didUpdate = false;\r\n let lastEventWasNew = false;\r\n\r\n for (let i = 0; i < events.length; i++) {\r\n const event = events[i];\r\n const eventId = event.getId();\r\n const existingTimeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!existingTimeline) {\r\n // we don't know about this event yet. Just add it to the timeline.\r\n this.addEventToTimeline(event, timeline, toStartOfTimeline);\r\n lastEventWasNew = true;\r\n didUpdate = true;\r\n continue;\r\n }\r\n\r\n lastEventWasNew = false;\r\n\r\n if (existingTimeline == timeline) {\r\n debuglog(\"Event \" + eventId + \" already in timeline \" + timeline);\r\n continue;\r\n }\r\n\r\n const neighbour = timeline.getNeighbouringTimeline(direction);\r\n\r\n if (neighbour) {\r\n // this timeline already has a neighbour in the relevant direction;\r\n // let's assume the timelines are already correctly linked up, and\r\n // skip over to it.\r\n //\r\n // there's probably some edge-case here where we end up with an\r\n // event which is in a timeline a way down the chain, and there is\r\n // a break in the chain somewhere. But I can't really imagine how\r\n // that would happen, so I'm going to ignore it for now.\r\n //\r\n if (existingTimeline == neighbour) {\r\n debuglog(\"Event \" + eventId + \" in neighbouring timeline - \" + \"switching to \" + existingTimeline);\r\n } else {\r\n debuglog(\"Event \" + eventId + \" already in a different \" + \"timeline \" + existingTimeline);\r\n }\r\n\r\n timeline = existingTimeline;\r\n continue;\r\n } // time to join the timelines.\r\n\r\n\r\n _logger.logger.info(\"Already have timeline for \" + eventId + \" - joining timeline \" + timeline + \" to \" + existingTimeline); // Variables to keep the line length limited below.\r\n\r\n\r\n const existingIsLive = existingTimeline === this._liveTimeline;\r\n const timelineIsLive = timeline === this._liveTimeline;\r\n const backwardsIsLive = direction === _eventTimeline.EventTimeline.BACKWARDS && existingIsLive;\r\n const forwardsIsLive = direction === _eventTimeline.EventTimeline.FORWARDS && timelineIsLive;\r\n\r\n if (backwardsIsLive || forwardsIsLive) {\r\n // The live timeline should never be spliced into a non-live position.\r\n // We use independent logging to better discover the problem at a glance.\r\n if (backwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set a preceding existingTimeLine on our \" + \"timeline as the existingTimeLine is live (\" + existingTimeline + \")\");\r\n }\r\n\r\n if (forwardsIsLive) {\r\n _logger.logger.warn(\"Refusing to set our preceding timeline on a existingTimeLine \" + \"as our timeline is live (\" + timeline + \")\");\r\n }\r\n\r\n continue; // abort splicing - try next event\r\n }\r\n\r\n timeline.setNeighbouringTimeline(existingTimeline, direction);\r\n existingTimeline.setNeighbouringTimeline(timeline, inverseDirection);\r\n timeline = existingTimeline;\r\n didUpdate = true;\r\n } // see above - if the last event was new to us, or if we didn't find any\r\n // new information, we update the pagination token for whatever\r\n // timeline we ended up on.\r\n\r\n\r\n if (lastEventWasNew || !didUpdate) {\r\n if (direction === _eventTimeline.EventTimeline.FORWARDS && timeline === this._liveTimeline) {\r\n _logger.logger.warn({\r\n lastEventWasNew,\r\n didUpdate\r\n }); // for debugging\r\n\r\n\r\n _logger.logger.warn(`Refusing to set forwards pagination token of live timeline ` + `${timeline} to ${paginationToken}`);\r\n\r\n return;\r\n }\r\n\r\n timeline.setPaginationToken(paginationToken, direction);\r\n }\r\n};\r\n/**\r\n * Add an event to the end of this live timeline.\r\n *\r\n * @param {MatrixEvent} event Event to be added\r\n * @param {string?} duplicateStrategy 'ignore' or 'replace'\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addLiveEvent = function (event, duplicateStrategy, fromCache) {\r\n if (this._filter) {\r\n const events = this._filter.filterRoomTimeline([event]);\r\n\r\n if (!events.length) {\r\n return;\r\n }\r\n }\r\n\r\n const timeline = this._eventIdToTimeline[event.getId()];\r\n\r\n if (timeline) {\r\n if (duplicateStrategy === \"replace\") {\r\n debuglog(\"EventTimelineSet.addLiveEvent: replacing duplicate event \" + event.getId());\r\n const tlEvents = timeline.getEvents();\r\n\r\n for (let j = 0; j < tlEvents.length; j++) {\r\n if (tlEvents[j].getId() === event.getId()) {\r\n // still need to set the right metadata on this event\r\n _eventTimeline.EventTimeline.setEventMetadata(event, timeline.getState(_eventTimeline.EventTimeline.FORWARDS), false);\r\n\r\n if (!tlEvents[j].encryptedType) {\r\n tlEvents[j] = event;\r\n } // XXX: we need to fire an event when this happens.\r\n\r\n\r\n break;\r\n }\r\n }\r\n } else {\r\n debuglog(\"EventTimelineSet.addLiveEvent: ignoring duplicate event \" + event.getId());\r\n }\r\n\r\n return;\r\n }\r\n\r\n this.addEventToTimeline(event, this._liveTimeline, false, fromCache);\r\n};\r\n/**\r\n * Add event to the given timeline, and emit Room.timeline. Assumes\r\n * we have already checked we don't know about this event.\r\n *\r\n * Will fire \"Room.timeline\" for each event added.\r\n *\r\n * @param {MatrixEvent} event\r\n * @param {EventTimeline} timeline\r\n * @param {boolean} toStartOfTimeline\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.addEventToTimeline = function (event, timeline, toStartOfTimeline, fromCache) {\r\n const eventId = event.getId();\r\n timeline.addEvent(event, toStartOfTimeline);\r\n this._eventIdToTimeline[eventId] = timeline;\r\n this.setRelationsTarget(event);\r\n this.aggregateRelations(event);\r\n const data = {\r\n timeline: timeline,\r\n liveEvent: !toStartOfTimeline && timeline == this._liveTimeline && !fromCache\r\n };\r\n this.emit(\"Room.timeline\", event, this.room, Boolean(toStartOfTimeline), false, data);\r\n};\r\n/**\r\n * Replaces event with ID oldEventId with one with newEventId, if oldEventId is\r\n * recognised. Otherwise, add to the live timeline. Used to handle remote echos.\r\n *\r\n * @param {MatrixEvent} localEvent the new event to be added to the timeline\r\n * @param {String} oldEventId the ID of the original event\r\n * @param {boolean} newEventId the ID of the replacement event\r\n *\r\n * @fires module:client~MatrixClient#event:\"Room.timeline\"\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.handleRemoteEcho = function (localEvent, oldEventId, newEventId) {\r\n // XXX: why don't we infer newEventId from localEvent?\r\n const existingTimeline = this._eventIdToTimeline[oldEventId];\r\n\r\n if (existingTimeline) {\r\n delete this._eventIdToTimeline[oldEventId];\r\n this._eventIdToTimeline[newEventId] = existingTimeline;\r\n } else {\r\n if (this._filter) {\r\n if (this._filter.filterRoomTimeline([localEvent]).length) {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n } else {\r\n this.addEventToTimeline(localEvent, this._liveTimeline, false);\r\n }\r\n }\r\n};\r\n/**\r\n * Removes a single event from this room.\r\n *\r\n * @param {String} eventId The id of the event to remove\r\n *\r\n * @return {?MatrixEvent} the removed event, or null if the event was not found\r\n * in this room.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.removeEvent = function (eventId) {\r\n const timeline = this._eventIdToTimeline[eventId];\r\n\r\n if (!timeline) {\r\n return null;\r\n }\r\n\r\n const removed = timeline.removeEvent(eventId);\r\n\r\n if (removed) {\r\n delete this._eventIdToTimeline[eventId];\r\n const data = {\r\n timeline: timeline\r\n };\r\n this.emit(\"Room.timeline\", removed, this.room, undefined, true, data);\r\n }\r\n\r\n return removed;\r\n};\r\n/**\r\n * Determine where two events appear in the timeline relative to one another\r\n *\r\n * @param {string} eventId1 The id of the first event\r\n * @param {string} eventId2 The id of the second event\r\n\r\n * @return {?number} a number less than zero if eventId1 precedes eventId2, and\r\n * greater than zero if eventId1 succeeds eventId2. zero if they are the\r\n * same event; null if we can't tell (either because we don't know about one\r\n * of the events, or because they are in separate timelines which don't join\r\n * up).\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.compareEventOrdering = function (eventId1, eventId2) {\r\n if (eventId1 == eventId2) {\r\n // optimise this case\r\n return 0;\r\n }\r\n\r\n const timeline1 = this._eventIdToTimeline[eventId1];\r\n const timeline2 = this._eventIdToTimeline[eventId2];\r\n\r\n if (timeline1 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline2 === undefined) {\r\n return null;\r\n }\r\n\r\n if (timeline1 === timeline2) {\r\n // both events are in the same timeline - figure out their\r\n // relative indices\r\n let idx1;\r\n let idx2;\r\n const events = timeline1.getEvents();\r\n\r\n for (let idx = 0; idx < events.length && (idx1 === undefined || idx2 === undefined); idx++) {\r\n const evId = events[idx].getId();\r\n\r\n if (evId == eventId1) {\r\n idx1 = idx;\r\n }\r\n\r\n if (evId == eventId2) {\r\n idx2 = idx;\r\n }\r\n }\r\n\r\n return idx1 - idx2;\r\n } // the events are in different timelines. Iterate through the\r\n // linkedlist to see which comes first.\r\n // first work forwards from timeline1\r\n\r\n\r\n let tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline1 is before timeline2\r\n return -1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.FORWARDS);\r\n } // now try backwards from timeline1\r\n\r\n\r\n tl = timeline1;\r\n\r\n while (tl) {\r\n if (tl === timeline2) {\r\n // timeline2 is before timeline1\r\n return 1;\r\n }\r\n\r\n tl = tl.getNeighbouringTimeline(_eventTimeline.EventTimeline.BACKWARDS);\r\n } // the timelines are not contiguous.\r\n\r\n\r\n return null;\r\n};\r\n/**\r\n * Get a collection of relations to a given event in this timeline set.\r\n *\r\n * @param {String} eventId\r\n * The ID of the event that you'd like to access relation events for.\r\n * For example, with annotations, this would be the ID of the event being annotated.\r\n * @param {String} relationType\r\n * The type of relation involved, such as \"m.annotation\", \"m.reference\", \"m.replace\", etc.\r\n * @param {String} eventType\r\n * The relation event's type, such as \"m.reaction\", etc.\r\n * @throws If eventId, relationType or eventType\r\n * are not valid.\r\n *\r\n * @returns {?Relations}\r\n * A container for relation events or undefined if there are no relation events for\r\n * the relationType.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.getRelationsForEvent = function (eventId, relationType, eventType) {\r\n if (!this._unstableClientRelationAggregation) {\r\n throw new Error(\"Client-side relation aggregation is disabled\");\r\n }\r\n\r\n if (!eventId || !relationType || !eventType) {\r\n throw new Error(\"Invalid arguments for `getRelationsForEvent`\");\r\n } // debuglog(\"Getting relations for: \", eventId, relationType, eventType);\r\n\r\n\r\n const relationsForEvent = this._relations[eventId] || {};\r\n const relationsWithRelType = relationsForEvent[relationType] || {};\r\n return relationsWithRelType[eventType];\r\n};\r\n/**\r\n * Set an event as the target event if any Relations exist for it already\r\n *\r\n * @param {MatrixEvent} event\r\n * The event to check as relation target.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.setRelationsTarget = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n const relationsForEvent = this._relations[event.getId()];\r\n\r\n if (!relationsForEvent) {\r\n return;\r\n } // don't need it for non m.replace relations for now\r\n\r\n\r\n const relationsWithRelType = relationsForEvent[\"m.replace\"];\r\n\r\n if (!relationsWithRelType) {\r\n return;\r\n } // only doing replacements for messages for now (e.g. edits)\r\n\r\n\r\n const relationsWithEventType = relationsWithRelType[\"m.room.message\"];\r\n\r\n if (relationsWithEventType) {\r\n relationsWithEventType.setTargetEvent(event);\r\n }\r\n};\r\n/**\r\n * Add relation events to the relevant relation collection.\r\n *\r\n * @param {MatrixEvent} event\r\n * The new relation event to be aggregated.\r\n */\r\n\r\n\r\nEventTimelineSet.prototype.aggregateRelations = function (event) {\r\n if (!this._unstableClientRelationAggregation) {\r\n return;\r\n }\r\n\r\n if (event.isRedacted() || event.status === _event.EventStatus.CANCELLED) {\r\n return;\r\n } // If the event is currently encrypted, wait until it has been decrypted.\r\n\r\n\r\n if (event.isBeingDecrypted()) {\r\n event.once(\"Event.decrypted\", () => {\r\n this.aggregateRelations(event);\r\n });\r\n return;\r\n }\r\n\r\n const relation = event.getRelation();\r\n\r\n if (!relation) {\r\n return;\r\n }\r\n\r\n const relatesToEventId = relation.event_id;\r\n const relationType = relation.rel_type;\r\n const eventType = event.getType(); // debuglog(\"Aggregating relation: \", event.getId(), eventType, relation);\r\n\r\n let relationsForEvent = this._relations[relatesToEventId];\r\n\r\n if (!relationsForEvent) {\r\n relationsForEvent = this._relations[relatesToEventId] = {};\r\n }\r\n\r\n let relationsWithRelType = relationsForEvent[relationType];\r\n\r\n if (!relationsWithRelType) {\r\n relationsWithRelType = relationsForEvent[relationType] = {};\r\n }\r\n\r\n let relationsWithEventType = relationsWithRelType[eventType];\r\n let isNewRelations = false;\r\n let relatesToEvent;\r\n\r\n if (!relationsWithEventType) {\r\n relationsWithEventType = relationsWithRelType[eventType] = new _relations.Relations(relationType, eventType, this.room);\r\n isNewRelations = true;\r\n relatesToEvent = this.findEventById(relatesToEventId) || this.room.getPendingEvent(relatesToEventId);\r\n\r\n if (relatesToEvent) {\r\n relationsWithEventType.setTargetEvent(relatesToEvent);\r\n }\r\n }\r\n\r\n relationsWithEventType.addEvent(event); // only emit once event has been added to relations\r\n\r\n if (isNewRelations && relatesToEvent) {\r\n relatesToEvent.emit(\"Event.relationsCreated\", relationType, eventType);\r\n }\r\n};\r\n/**\r\n * Fires whenever the timeline in a room is updated.\r\n * @event module:client~MatrixClient#\"Room.timeline\"\r\n * @param {MatrixEvent} event The matrix event which caused this event to fire.\r\n * @param {?Room} room The room, if any, whose timeline was updated.\r\n * @param {boolean} toStartOfTimeline True if this event was added to the start\r\n * @param {boolean} removed True if this event has just been removed from the timeline\r\n * (beginning; oldest) of the timeline e.g. due to pagination.\r\n *\r\n * @param {object} data more data about the event\r\n *\r\n * @param {module:models/event-timeline.EventTimeline} data.timeline the timeline the\r\n * event was added to/removed from\r\n *\r\n * @param {boolean} data.liveEvent true if the event was a real-time event\r\n * added to the end of the live timeline\r\n *\r\n * @example\r\n * matrixClient.on(\"Room.timeline\",\r\n * function(event, room, toStartOfTimeline, removed, data) {\r\n * if (!toStartOfTimeline && data.liveEvent) {\r\n * var messageToAppend = room.timeline.[room.timeline.length - 1];\r\n * }\r\n * });\r\n */\r\n\r\n/**\r\n * Fires whenever the live timeline in a room is reset.\r\n *\r\n * When we get a 'limited' sync (for example, after a network outage), we reset\r\n * the live timeline to be empty before adding the recent events to the new\r\n * timeline. This event is fired after the timeline is reset, and before the\r\n * new events are added.\r\n *\r\n * @event module:client~MatrixClient#\"Room.timelineReset\"\r\n * @param {Room} room The room whose live timeline was reset, if any\r\n * @param {EventTimelineSet} timelineSet timelineSet room whose live timeline was reset\r\n * @param {boolean} resetAllTimelines True if all timelines were reset.\r\n */","\"use strict\";\r\n\r\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.logger = void 0;\r\n\r\nvar _loglevel = _interopRequireDefault(require(\"loglevel\"));\r\n\r\n/*\r\nCopyright 2018 André Jaenisch\r\nCopyright 2019, 2021 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module logger\r\n */\r\n// This is to demonstrate, that you can use any namespace you want.\r\n// Namespaces allow you to turn on/off the logging for specific parts of the\r\n// application.\r\n// An idea would be to control this via an environment variable (on Node.js).\r\n// See https://www.npmjs.com/package/debug to see how this could be implemented\r\n// Part of #332 is introducing a logging library in the first place.\r\nconst DEFAULT_NAMESPACE = \"matrix\"; // because rageshakes in react-sdk hijack the console log, also at module load time,\r\n// initializing the logger here races with the initialization of rageshakes.\r\n// to avoid the issue, we override the methodFactory of loglevel that binds to the\r\n// console methods at initialization time by a factory that looks up the console methods\r\n// when logging so we always get the current value of console methods.\r\n\r\n_loglevel.default.methodFactory = function (methodName, logLevel, loggerName) {\r\n return function (...args) {\r\n /* eslint-disable @babel/no-invalid-this */\r\n if (this.prefix) {\r\n args.unshift(this.prefix);\r\n }\r\n /* eslint-enable @babel/no-invalid-this */\r\n\r\n\r\n const supportedByConsole = methodName === \"error\" || methodName === \"warn\" || methodName === \"trace\" || methodName === \"info\";\r\n /* eslint-disable no-console */\r\n\r\n return\r\n\r\n if (supportedByConsole) {\r\n return console[methodName](...args);\r\n } else {\r\n return console.log(...args);\r\n }\r\n /* eslint-enable no-console */\r\n\r\n };\r\n};\r\n/**\r\n * Drop-in replacement for console using {@link https://www.npmjs.com/package/loglevel|loglevel}.\r\n * Can be tailored down to specific use cases if needed.\r\n */\r\n\r\n\r\nconst logger = _loglevel.default.getLogger(DEFAULT_NAMESPACE);\r\n\r\nexports.logger = logger;\r\nlogger.setLevel(_loglevel.default.levels.DEBUG);\r\n\r\nfunction extendLogger(logger) {\r\n logger.withPrefix = function (prefix) {\r\n const existingPrefix = this.prefix || \"\";\r\n return getPrefixedLogger(existingPrefix + prefix);\r\n };\r\n}\r\n\r\nextendLogger(logger);\r\n\r\nfunction getPrefixedLogger(prefix) {\r\n const prefixLogger = _loglevel.default.getLogger(`${DEFAULT_NAMESPACE}-${prefix}`);\r\n\r\n if (prefixLogger.prefix !== prefix) {\r\n // Only do this setup work the first time through, as loggers are saved by name.\r\n extendLogger(prefixLogger);\r\n prefixLogger.prefix = prefix;\r\n prefixLogger.setLevel(_loglevel.default.levels.DEBUG);\r\n }\r\n\r\n return prefixLogger;\r\n}","var Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar StringDecoder = require('string_decoder').StringDecoder\nvar inherits = require('inherits')\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.SyncApi = SyncApi;\r\n\r\nvar _user = require(\"./models/user\");\r\n\r\nvar _room = require(\"./models/room\");\r\n\r\nvar _group = require(\"./models/group\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"./utils\"));\r\n\r\nvar _filter = require(\"./filter\");\r\n\r\nvar _eventTimeline = require(\"./models/event-timeline\");\r\n\r\nvar _pushprocessor = require(\"./pushprocessor\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\nvar _errors = require(\"./errors\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/*\r\n * TODO:\r\n * This class mainly serves to take all the syncing logic out of client.js and\r\n * into a separate file. It's all very fluid, and this class gut wrenches a lot\r\n * of MatrixClient props (e.g. _http). Given we want to support WebSockets as\r\n * an alternative syncing API, we may want to have a proper syncing interface\r\n * for HTTP and WS at some point.\r\n */\r\nconst DEBUG = true; // /sync requests allow you to set a timeout= but the request may continue\r\n// beyond that and wedge forever, so we need to track how long we are willing\r\n// to keep open the connection. This constant is *ADDED* to the timeout= value\r\n// to determine the max time we're willing to wait.\r\n\r\nconst BUFFER_PERIOD_MS = 80 * 1000; // Number of consecutive failed syncs that will lead to a syncState of ERROR as opposed\r\n// to RECONNECTING. This is needed to inform the client of server issues when the\r\n// keepAlive is successful but the server /sync fails.\r\n\r\nconst FAILED_SYNC_ERROR_THRESHOLD = 3;\r\n\r\nfunction getFilterName(userId, suffix) {\r\n // scope this on the user ID because people may login on many accounts\r\n // and they all need to be stored!\r\n return \"FILTER_SYNC_\" + userId + (suffix ? \"_\" + suffix : \"\");\r\n}\r\n\r\nfunction debuglog(...params) {\r\n if (!DEBUG) {\r\n return;\r\n }\r\n\r\n _logger.logger.log(...params);\r\n}\r\n/**\r\n * Internal class - unstable.\r\n * Construct an entity which is able to sync with a homeserver.\r\n * @constructor\r\n * @param {MatrixClient} client The matrix client instance to use.\r\n * @param {Object} opts Config options\r\n * @param {module:crypto=} opts.crypto Crypto manager\r\n * @param {Function=} opts.canResetEntireTimeline A function which is called\r\n * with a room ID and returns a boolean. It should return 'true' if the SDK can\r\n * SAFELY remove events from this room. It may not be safe to remove events if\r\n * there are other references to the timelines for this room.\r\n * Default: returns false.\r\n * @param {Boolean=} opts.disablePresence True to perform syncing without automatically\r\n * updating presence.\r\n */\r\n\r\n\r\nfunction SyncApi(client, opts) {\r\n this.client = client;\r\n opts = opts || {};\r\n opts.initialSyncLimit = opts.initialSyncLimit === undefined ? 8 : opts.initialSyncLimit;\r\n opts.resolveInvitesToProfiles = opts.resolveInvitesToProfiles || false;\r\n opts.pollTimeout = opts.pollTimeout || 30 * 1000;\r\n opts.pendingEventOrdering = opts.pendingEventOrdering || \"chronological\";\r\n\r\n if (!opts.canResetEntireTimeline) {\r\n opts.canResetEntireTimeline = function (roomId) {\r\n return false;\r\n };\r\n }\r\n\r\n this.opts = opts;\r\n this._peekRoom = null;\r\n this._currentSyncRequest = null;\r\n this._syncState = null;\r\n this._syncStateData = null; // additional data (eg. error object for failed sync)\r\n\r\n this._catchingUp = false;\r\n this._running = false;\r\n this._keepAliveTimer = null;\r\n this._connectionReturnedDefer = null;\r\n this._notifEvents = []; // accumulator of sync events in the current sync response\r\n\r\n this._failedSyncCount = 0; // Number of consecutive failed /sync requests\r\n\r\n this._storeIsInvalid = false; // flag set if the store needs to be cleared before we can start\r\n\r\n if (client.getNotifTimelineSet()) {\r\n client.reEmitter.reEmit(client.getNotifTimelineSet(), [\"Room.timeline\", \"Room.timelineReset\"]);\r\n }\r\n}\r\n/**\r\n * @param {string} roomId\r\n * @return {Room}\r\n */\r\n\r\n\r\nSyncApi.prototype.createRoom = function (roomId) {\r\n const client = this.client;\r\n const {\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n } = client;\r\n const room = new _room.Room(roomId, client, client.getUserId(), {\r\n lazyLoadMembers: this.opts.lazyLoadMembers,\r\n pendingEventOrdering: this.opts.pendingEventOrdering,\r\n timelineSupport,\r\n unstableClientRelationAggregation\r\n });\r\n client.reEmitter.reEmit(room, [\"Room.name\", \"Room.avatar\", \"Room.timeline\", \"Room.redaction\", \"Room.redactionCancelled\", \"Room.receipt\", \"Room.tags\", \"Room.timelineReset\", \"Room.localEchoUpdated\", \"Room.accountData\", \"Room.myMembership\", \"Room.replaceEvent\"]);\r\n\r\n this._registerStateListeners(room);\r\n\r\n return room;\r\n};\r\n/**\r\n * @param {string} groupId\r\n * @return {Group}\r\n */\r\n\r\n\r\nSyncApi.prototype.createGroup = function (groupId) {\r\n const client = this.client;\r\n const group = new _group.Group(groupId);\r\n client.reEmitter.reEmit(group, [\"Group.profile\", \"Group.myMembership\"]);\r\n client.store.storeGroup(group);\r\n return group;\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._registerStateListeners = function (room) {\r\n const client = this.client; // we need to also re-emit room state and room member events, so hook it up\r\n // to the client now. We need to add a listener for RoomState.members in\r\n // order to hook them correctly. (TODO: find a better way?)\r\n\r\n client.reEmitter.reEmit(room.currentState, [\"RoomState.events\", \"RoomState.members\", \"RoomState.newMember\"]);\r\n room.currentState.on(\"RoomState.newMember\", function (event, state, member) {\r\n member.user = client.getUser(member.userId);\r\n client.reEmitter.reEmit(member, [\"RoomMember.name\", \"RoomMember.typing\", \"RoomMember.powerLevel\", \"RoomMember.membership\"]);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @private\r\n */\r\n\r\n\r\nSyncApi.prototype._deregisterStateListeners = function (room) {\r\n // could do with a better way of achieving this.\r\n room.currentState.removeAllListeners(\"RoomState.events\");\r\n room.currentState.removeAllListeners(\"RoomState.members\");\r\n room.currentState.removeAllListeners(\"RoomState.newMember\");\r\n};\r\n/**\r\n * Sync rooms the user has left.\r\n * @return {Promise} Resolved when they've been added to the store.\r\n */\r\n\r\n\r\nSyncApi.prototype.syncLeftRooms = function () {\r\n const client = this.client;\r\n const self = this; // grab a filter with limit=1 and include_leave=true\r\n\r\n const filter = new _filter.Filter(this.client.credentials.userId);\r\n filter.setTimelineLimit(1);\r\n filter.setIncludeLeaveRooms(true);\r\n const localTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;\r\n const qps = {\r\n timeout: 0 // don't want to block since this is a single isolated req\r\n\r\n };\r\n return client.getOrCreateFilter(getFilterName(client.credentials.userId, \"LEFT_ROOMS\"), filter).then(function (filterId) {\r\n qps.filter = filterId;\r\n return client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, localTimeoutMs);\r\n }).then(function (data) {\r\n let leaveRooms = [];\r\n\r\n if (data.rooms && data.rooms.leave) {\r\n leaveRooms = self._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n\r\n const rooms = [];\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n rooms.push(room);\r\n\r\n if (!leaveObj.isBrandNewRoom) {\r\n // the intention behind syncLeftRooms is to add in rooms which were\r\n // *omitted* from the initial /sync. Rooms the user were joined to\r\n // but then left whilst the app is running will appear in this list\r\n // and we do not want to bother with them since they will have the\r\n // current state already (and may get dupe messages if we add\r\n // yet more timeline events!), so skip them.\r\n // NB: When we persist rooms to localStorage this will be more\r\n // complicated...\r\n return;\r\n }\r\n\r\n leaveObj.timeline = leaveObj.timeline || {};\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room); // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n\r\n\r\n room.getLiveTimeline().setPaginationToken(leaveObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n });\r\n return rooms;\r\n });\r\n};\r\n/**\r\n * Peek into a room. This will result in the room in question being synced so it\r\n * is accessible via getRooms(). Live updates for the room will be provided.\r\n * @param {string} roomId The room ID to peek into.\r\n * @return {Promise} A promise which resolves once the room has been added to the\r\n * store.\r\n */\r\n\r\n\r\nSyncApi.prototype.peek = function (roomId) {\r\n if (this._peekRoom && this._peekRoom.roomId === roomId) {\r\n return Promise.resolve(this._peekRoom);\r\n }\r\n\r\n const client = this.client;\r\n this._peekRoom = this.createRoom(roomId);\r\n return this.client.roomInitialSync(roomId, 20).then(response => {\r\n // make sure things are init'd\r\n response.messages = response.messages || {};\r\n response.messages.chunk = response.messages.chunk || [];\r\n response.state = response.state || []; // FIXME: Mostly duplicated from _processRoomEvents but not entirely\r\n // because \"state\" in this API is at the BEGINNING of the chunk\r\n\r\n const oldStateEvents = utils.map(utils.deepCopy(response.state), client.getEventMapper());\r\n const stateEvents = utils.map(response.state, client.getEventMapper());\r\n const messages = utils.map(response.messages.chunk, client.getEventMapper()); // XXX: copypasted from /sync until we kill off this\r\n // minging v1 API stuff)\r\n // handle presence events (User objects)\r\n\r\n if (response.presence && utils.isArray(response.presence)) {\r\n response.presence.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // set the pagination token before adding the events in case people\r\n // fire off pagination requests in response to the Room.timeline\r\n // events.\r\n\r\n\r\n if (response.messages.start) {\r\n this._peekRoom.oldState.paginationToken = response.messages.start;\r\n } // set the state of the room to as it was after the timeline executes\r\n\r\n\r\n this._peekRoom.oldState.setStateEvents(oldStateEvents);\r\n\r\n this._peekRoom.currentState.setStateEvents(stateEvents);\r\n\r\n this._resolveInvites(this._peekRoom);\r\n\r\n this._peekRoom.recalculate(); // roll backwards to diverge old state. addEventsToTimeline\r\n // will overwrite the pagination token, so make sure it overwrites\r\n // it with the right thing.\r\n\r\n\r\n this._peekRoom.addEventsToTimeline(messages.reverse(), true, this._peekRoom.getLiveTimeline(), response.messages.start);\r\n\r\n client.store.storeRoom(this._peekRoom);\r\n client.emit(\"Room\", this._peekRoom);\r\n\r\n this._peekPoll(this._peekRoom);\r\n\r\n return this._peekRoom;\r\n });\r\n};\r\n/**\r\n * Stop polling for updates in the peeked room. NOPs if there is no room being\r\n * peeked.\r\n */\r\n\r\n\r\nSyncApi.prototype.stopPeeking = function () {\r\n this._peekRoom = null;\r\n};\r\n/**\r\n * Do a peek room poll.\r\n * @param {Room} peekRoom\r\n * @param {string?} token from= token\r\n */\r\n\r\n\r\nSyncApi.prototype._peekPoll = function (peekRoom, token) {\r\n if (this._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n }\r\n\r\n const self = this; // FIXME: gut wrenching; hard-coded timeout values\r\n\r\n this.client._http.authedRequest(undefined, \"GET\", \"/events\", {\r\n room_id: peekRoom.roomId,\r\n timeout: 30 * 1000,\r\n from: token\r\n }, undefined, 50 * 1000).then(function (res) {\r\n if (self._peekRoom !== peekRoom) {\r\n debuglog(\"Stopped peeking in room %s\", peekRoom.roomId);\r\n return;\r\n } // We have a problem that we get presence both from /events and /sync\r\n // however, /sync only returns presence for users in rooms\r\n // you're actually joined to.\r\n // in order to be sure to get presence for all of the users in the\r\n // peeked room, we handle presence explicitly here. This may result\r\n // in duplicate presence events firing for some users, which is a\r\n // performance drain, but such is life.\r\n // XXX: copypasted from /sync until we can kill this minging v1 stuff.\r\n\r\n\r\n res.chunk.filter(function (e) {\r\n return e.type === \"m.presence\";\r\n }).map(self.client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = self.client.store.getUser(presenceEvent.getContent().user_id);\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(self.client, presenceEvent.getContent().user_id);\r\n user.setPresenceEvent(presenceEvent);\r\n self.client.store.storeUser(user);\r\n }\r\n\r\n self.client.emit(\"event\", presenceEvent);\r\n }); // strip out events which aren't for the given room_id (e.g presence)\r\n // and also ephemeral events (which we're assuming is anything without\r\n // and event ID because the /events API doesn't separate them).\r\n\r\n const events = res.chunk.filter(function (e) {\r\n return e.room_id === peekRoom.roomId && e.event_id;\r\n }).map(self.client.getEventMapper());\r\n peekRoom.addLiveEvents(events);\r\n\r\n self._peekPoll(peekRoom, res.end);\r\n }, function (err) {\r\n _logger.logger.error(\"[%s] Peek poll failed: %s\", peekRoom.roomId, err);\r\n\r\n setTimeout(function () {\r\n self._peekPoll(peekRoom, token);\r\n }, 30 * 1000);\r\n });\r\n};\r\n/**\r\n * Returns the current state of this sync object\r\n * @see module:client~MatrixClient#event:\"sync\"\r\n * @return {?String}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncState = function () {\r\n return this._syncState;\r\n};\r\n/**\r\n * Returns the additional data object associated with\r\n * the current sync state, or null if there is no\r\n * such data.\r\n * Sync errors, if available, are put in the 'error' key of\r\n * this object.\r\n * @return {?Object}\r\n */\r\n\r\n\r\nSyncApi.prototype.getSyncStateData = function () {\r\n return this._syncStateData;\r\n};\r\n\r\nSyncApi.prototype.recoverFromSyncStartupError = async function (savedSyncPromise, err) {\r\n // Wait for the saved sync to complete - we send the pushrules and filter requests\r\n // before the saved sync has finished so they can run in parallel, but only process\r\n // the results after the saved sync is done. Equivalently, we wait for it to finish\r\n // before reporting failures from these functions.\r\n await savedSyncPromise;\r\n\r\n const keepaliveProm = this._startKeepAlives();\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n\r\n await keepaliveProm;\r\n};\r\n/**\r\n * Is the lazy loading option different than in previous session?\r\n * @param {bool} lazyLoadMembers current options for lazy loading\r\n * @return {bool} whether or not the option has changed compared to the previous session */\r\n\r\n\r\nSyncApi.prototype._wasLazyLoadingToggled = async function (lazyLoadMembers) {\r\n lazyLoadMembers = !!lazyLoadMembers; // assume it was turned off before\r\n // if we don't know any better\r\n\r\n let lazyLoadMembersBefore = false;\r\n const isStoreNewlyCreated = await this.client.store.isNewlyCreated();\r\n\r\n if (!isStoreNewlyCreated) {\r\n const prevClientOptions = await this.client.store.getClientOptions();\r\n\r\n if (prevClientOptions) {\r\n lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers;\r\n }\r\n\r\n return lazyLoadMembersBefore !== lazyLoadMembers;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nSyncApi.prototype._shouldAbortSync = function (error) {\r\n if (error.errcode === \"M_UNKNOWN_TOKEN\") {\r\n // The logout already happened, we just need to stop.\r\n _logger.logger.warn(\"Token no longer valid - assuming logout\");\r\n\r\n this.stop();\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n/**\r\n * Main entry point\r\n */\r\n\r\n\r\nSyncApi.prototype.sync = function () {\r\n const client = this.client;\r\n const self = this;\r\n this._running = true;\r\n\r\n if (global.window && global.window.addEventListener) {\r\n this._onOnlineBound = this._onOnline.bind(this);\r\n global.window.addEventListener(\"online\", this._onOnlineBound, false);\r\n }\r\n\r\n let savedSyncPromise = Promise.resolve();\r\n let savedSyncToken = null; // We need to do one-off checks before we can begin the /sync loop.\r\n // These are:\r\n // 1) We need to get push rules so we can check if events should bing as we get\r\n // them from /sync.\r\n // 2) We need to get/create a filter which we can use for /sync.\r\n // 3) We need to check the lazy loading option matches what was used in the\r\n // stored sync. If it doesn't, we can't use the stored sync.\r\n\r\n async function getPushRules() {\r\n try {\r\n debuglog(\"Getting push rules...\");\r\n const result = await client.getPushRules();\r\n debuglog(\"Got push rules\");\r\n client.pushRules = result;\r\n } catch (err) {\r\n _logger.logger.error(\"Getting push rules failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying push rules...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getPushRules();\r\n return;\r\n }\r\n\r\n checkLazyLoadStatus(); // advance to the next stage\r\n }\r\n\r\n function buildDefaultFilter() {\r\n const filter = new _filter.Filter(client.credentials.userId);\r\n filter.setTimelineLimit(self.opts.initialSyncLimit);\r\n return filter;\r\n }\r\n\r\n const checkLazyLoadStatus = async () => {\r\n debuglog(\"Checking lazy load status...\");\r\n\r\n if (this.opts.lazyLoadMembers && client.isGuest()) {\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers) {\r\n debuglog(\"Checking server lazy load support...\");\r\n const supported = await client.doesServerSupportLazyLoading();\r\n\r\n if (supported) {\r\n debuglog(\"Enabling lazy load on sync filter...\");\r\n\r\n if (!this.opts.filter) {\r\n this.opts.filter = buildDefaultFilter();\r\n }\r\n\r\n this.opts.filter.setLazyLoadMembers(true);\r\n } else {\r\n debuglog(\"LL: lazy loading requested but not supported \" + \"by server, so disabling\");\r\n this.opts.lazyLoadMembers = false;\r\n }\r\n } // need to vape the store when enabling LL and wasn't enabled before\r\n\r\n\r\n debuglog(\"Checking whether lazy loading has changed in store...\");\r\n const shouldClear = await this._wasLazyLoadingToggled(this.opts.lazyLoadMembers);\r\n\r\n if (shouldClear) {\r\n this._storeIsInvalid = true;\r\n const reason = _errors.InvalidStoreError.TOGGLED_LAZY_LOADING;\r\n const error = new _errors.InvalidStoreError(reason, !!this.opts.lazyLoadMembers);\r\n\r\n this._updateSyncState(\"ERROR\", {\r\n error\r\n }); // bail out of the sync loop now: the app needs to respond to this error.\r\n // we leave the state as 'ERROR' which isn't great since this normally means\r\n // we're retrying. The client must be stopped before clearing the stores anyway\r\n // so the app should stop the client, clear the store and start it again.\r\n\r\n\r\n _logger.logger.warn(\"InvalidStoreError: store is not usable: stopping sync.\");\r\n\r\n return;\r\n }\r\n\r\n if (this.opts.lazyLoadMembers && this.opts.crypto) {\r\n this.opts.crypto.enableLazyLoading();\r\n }\r\n\r\n try {\r\n debuglog(\"Storing client options...\");\r\n await this.client._storeClientOptions();\r\n debuglog(\"Stored client options\");\r\n } catch (err) {\r\n _logger.logger.error(\"Storing client options failed\", err);\r\n\r\n throw err;\r\n }\r\n\r\n getFilter(); // Now get the filter and start syncing\r\n };\r\n\r\n async function getFilter() {\r\n debuglog(\"Getting filter...\");\r\n let filter;\r\n\r\n if (self.opts.filter) {\r\n filter = self.opts.filter;\r\n } else {\r\n filter = buildDefaultFilter();\r\n }\r\n\r\n let filterId;\r\n\r\n try {\r\n filterId = await client.getOrCreateFilter(getFilterName(client.credentials.userId), filter);\r\n } catch (err) {\r\n _logger.logger.error(\"Getting filter failed\", err);\r\n\r\n if (self._shouldAbortSync(err)) return; // wait for saved sync to complete before doing anything else,\r\n // otherwise the sync state will end up being incorrect\r\n\r\n debuglog(\"Waiting for saved sync before retrying filter...\");\r\n await self.recoverFromSyncStartupError(savedSyncPromise, err);\r\n getFilter();\r\n return;\r\n } // reset the notifications timeline to prepare it to paginate from\r\n // the current point in time.\r\n // The right solution would be to tie /sync pagination tokens into\r\n // /notifications API somehow.\r\n\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n if (self._currentSyncRequest === null) {\r\n // Send this first sync request here so we can then wait for the saved\r\n // sync data to finish processing before we process the results of this one.\r\n debuglog(\"Sending first sync request...\");\r\n self._currentSyncRequest = self._doSyncRequest({\r\n filterId\r\n }, savedSyncToken);\r\n } // Now wait for the saved sync to finish...\r\n\r\n\r\n debuglog(\"Waiting for saved sync before starting sync processing...\");\r\n await savedSyncPromise;\r\n\r\n self._sync({\r\n filterId\r\n });\r\n }\r\n\r\n if (client.isGuest()) {\r\n // no push rules for guests, no access to POST filter for guests.\r\n self._sync({});\r\n } else {\r\n // Pull the saved sync token out first, before the worker starts sending\r\n // all the sync data which could take a while. This will let us send our\r\n // first incremental sync request before we've processed our saved data.\r\n debuglog(\"Getting saved sync token...\");\r\n savedSyncPromise = client.store.getSavedSyncToken().then(tok => {\r\n debuglog(\"Got saved sync token\");\r\n savedSyncToken = tok;\r\n debuglog(\"Getting saved sync...\");\r\n return client.store.getSavedSync();\r\n }).then(savedSync => {\r\n debuglog(`Got reply from saved sync, exists? ${!!savedSync}`);\r\n\r\n if (savedSync) {\r\n return self._syncFromCache(savedSync);\r\n }\r\n }).catch(err => {\r\n _logger.logger.error(\"Getting saved sync failed\", err);\r\n }); // Now start the first incremental sync request: this can also\r\n // take a while so if we set it going now, we can wait for it\r\n // to finish while we process our saved sync data.\r\n\r\n getPushRules();\r\n }\r\n};\r\n/**\r\n * Stops the sync object from syncing.\r\n */\r\n\r\n\r\nSyncApi.prototype.stop = function () {\r\n debuglog(\"SyncApi.stop\");\r\n\r\n if (global.window) {\r\n global.window.removeEventListener(\"online\", this._onOnlineBound, false);\r\n this._onOnlineBound = undefined;\r\n }\r\n\r\n this._running = false;\r\n\r\n if (this._currentSyncRequest) {\r\n this._currentSyncRequest.abort();\r\n }\r\n\r\n if (this._keepAliveTimer) {\r\n clearTimeout(this._keepAliveTimer);\r\n this._keepAliveTimer = null;\r\n }\r\n};\r\n/**\r\n * Retry a backed off syncing request immediately. This should only be used when\r\n * the user explicitly attempts to retry their lost connection.\r\n * @return {boolean} True if this resulted in a request being retried.\r\n */\r\n\r\n\r\nSyncApi.prototype.retryImmediately = function () {\r\n if (!this._connectionReturnedDefer) {\r\n return false;\r\n }\r\n\r\n this._startKeepAlives(0);\r\n\r\n return true;\r\n};\r\n/**\r\n * Process a single set of cached sync data.\r\n * @param {Object} savedSync a saved sync that was persisted by a store. This\r\n * should have been acquired via client.store.getSavedSync().\r\n */\r\n\r\n\r\nSyncApi.prototype._syncFromCache = async function (savedSync) {\r\n debuglog(\"sync(): not doing HTTP hit, instead returning stored /sync data\");\r\n const nextSyncToken = savedSync.nextBatch; // Set sync token for future incremental syncing\r\n\r\n this.client.store.setSyncToken(nextSyncToken); // No previous sync, set old token to null\r\n\r\n const syncEventData = {\r\n oldSyncToken: null,\r\n nextSyncToken,\r\n catchingUp: false,\r\n fromCache: true\r\n };\r\n const data = {\r\n next_batch: nextSyncToken,\r\n rooms: savedSync.roomsData,\r\n groups: savedSync.groupsData,\r\n account_data: {\r\n events: savedSync.accountData\r\n }\r\n };\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n _logger.logger.error(\"Error processing cached sync\", e.stack || e);\r\n } // Don't emit a prepared if we've bailed because the store is invalid:\r\n // in this case the client will not be usable until stopped & restarted\r\n // so this would be useless and misleading.\r\n\r\n\r\n if (!this._storeIsInvalid) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n }\r\n};\r\n/**\r\n * Invoke me to do /sync calls\r\n * @param {Object} syncOptions\r\n * @param {string} syncOptions.filterId\r\n * @param {boolean} syncOptions.hasSyncedBefore\r\n */\r\n\r\n\r\nSyncApi.prototype._sync = async function (syncOptions) {\r\n const client = this.client;\r\n\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting.\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n const syncToken = client.store.getSyncToken();\r\n let data;\r\n\r\n try {\r\n //debuglog('Starting sync since=' + syncToken);\r\n if (this._currentSyncRequest === null) {\r\n this._currentSyncRequest = this._doSyncRequest(syncOptions, syncToken);\r\n }\r\n\r\n data = await this._currentSyncRequest;\r\n } catch (e) {\r\n this._onSyncError(e, syncOptions);\r\n\r\n return;\r\n } finally {\r\n this._currentSyncRequest = null;\r\n } //debuglog('Completed sync, next_batch=' + data.next_batch);\r\n // set the sync token NOW *before* processing the events. We do this so\r\n // if something barfs on an event we can skip it rather than constantly\r\n // polling with the same token.\r\n\r\n\r\n client.store.setSyncToken(data.next_batch); // Reset after a successful sync\r\n\r\n this._failedSyncCount = 0;\r\n await client.store.setSyncData(data);\r\n const syncEventData = {\r\n oldSyncToken: syncToken,\r\n nextSyncToken: data.next_batch,\r\n catchingUp: this._catchingUp\r\n };\r\n\r\n if (this.opts.crypto) {\r\n // tell the crypto module we're about to process a sync\r\n // response\r\n await this.opts.crypto.onSyncWillProcess(syncEventData);\r\n }\r\n\r\n try {\r\n await this._processSyncResponse(syncEventData, data);\r\n } catch (e) {\r\n // log the exception with stack if we have it, else fall back\r\n // to the plain description\r\n _logger.logger.error(\"Caught /sync error\", e.stack || e); // Emit the exception for client handling\r\n\r\n\r\n this.client.emit(\"sync.unexpectedError\", e);\r\n } // update this as it may have changed\r\n\r\n\r\n syncEventData.catchingUp = this._catchingUp; // emit synced events\r\n\r\n if (!syncOptions.hasSyncedBefore) {\r\n this._updateSyncState(\"PREPARED\", syncEventData);\r\n\r\n syncOptions.hasSyncedBefore = true;\r\n } // tell the crypto module to do its processing. It may block (to do a\r\n // /keys/changes request).\r\n\r\n\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.onSyncCompleted(syncEventData);\r\n } // keep emitting SYNCING -> SYNCING for clients who want to do bulk updates\r\n\r\n\r\n this._updateSyncState(\"SYNCING\", syncEventData);\r\n\r\n if (client.store.wantsSave()) {\r\n // We always save the device list (if it's dirty) before saving the sync data:\r\n // this means we know the saved device list data is at least as fresh as the\r\n // stored sync data which means we don't have to worry that we may have missed\r\n // device changes. We can also skip the delay since we're not calling this very\r\n // frequently (and we don't really want to delay the sync for it).\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.saveDeviceList(0);\r\n } // tell databases that everything is now in a consistent state and can be saved.\r\n\r\n\r\n client.store.save();\r\n } // Begin next sync\r\n\r\n\r\n this._sync(syncOptions);\r\n};\r\n\r\nSyncApi.prototype._doSyncRequest = function (syncOptions, syncToken) {\r\n const qps = this._getSyncParams(syncOptions, syncToken);\r\n\r\n return this.client._http.authedRequest(undefined, \"GET\", \"/sync\", qps, undefined, qps.timeout + BUFFER_PERIOD_MS);\r\n};\r\n\r\nSyncApi.prototype._getSyncParams = function (syncOptions, syncToken) {\r\n let pollTimeout = this.opts.pollTimeout;\r\n\r\n if (this.getSyncState() !== 'SYNCING' || this._catchingUp) {\r\n // unless we are happily syncing already, we want the server to return\r\n // as quickly as possible, even if there are no events queued. This\r\n // serves two purposes:\r\n //\r\n // * When the connection dies, we want to know asap when it comes back,\r\n // so that we can hide the error from the user. (We don't want to\r\n // have to wait for an event or a timeout).\r\n //\r\n // * We want to know if the server has any to_device messages queued up\r\n // for us. We do that by calling it with a zero timeout until it\r\n // doesn't give us any more to_device messages.\r\n this._catchingUp = true;\r\n pollTimeout = 0;\r\n }\r\n\r\n let filterId = syncOptions.filterId;\r\n\r\n if (this.client.isGuest() && !filterId) {\r\n filterId = this._getGuestFilter();\r\n }\r\n\r\n const qps = {\r\n filter: filterId,\r\n timeout: pollTimeout\r\n };\r\n\r\n if (this.opts.disablePresence) {\r\n qps.set_presence = \"offline\";\r\n }\r\n\r\n if (syncToken) {\r\n qps.since = syncToken;\r\n } else {\r\n // use a cachebuster for initialsyncs, to make sure that\r\n // we don't get a stale sync\r\n // (https://github.com/vector-im/vector-web/issues/1354)\r\n qps._cacheBuster = Date.now();\r\n }\r\n\r\n if (this.getSyncState() == 'ERROR' || this.getSyncState() == 'RECONNECTING') {\r\n // we think the connection is dead. If it comes back up, we won't know\r\n // about it till /sync returns. If the timeout= is high, this could\r\n // be a long time. Set it to 0 when doing retries so we don't have to wait\r\n // for an event or a timeout before emiting the SYNCING event.\r\n qps.timeout = 0;\r\n }\r\n\r\n return qps;\r\n};\r\n\r\nSyncApi.prototype._onSyncError = function (err, syncOptions) {\r\n if (!this._running) {\r\n debuglog(\"Sync no longer running: exiting\");\r\n\r\n if (this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer.reject();\r\n\r\n this._connectionReturnedDefer = null;\r\n }\r\n\r\n this._updateSyncState(\"STOPPED\");\r\n\r\n return;\r\n }\r\n\r\n _logger.logger.error(\"/sync error %s\", err);\r\n\r\n _logger.logger.error(err);\r\n\r\n if (this._shouldAbortSync(err)) {\r\n return;\r\n }\r\n\r\n this._failedSyncCount++;\r\n\r\n _logger.logger.log('Number of consecutive failed sync requests:', this._failedSyncCount);\r\n\r\n debuglog(\"Starting keep-alive\"); // Note that we do *not* mark the sync connection as\r\n // lost yet: we only do this if a keepalive poke\r\n // fails, since long lived HTTP connections will\r\n // go away sometimes and we shouldn't treat this as\r\n // erroneous. We set the state to 'reconnecting'\r\n // instead, so that clients can observe this state\r\n // if they wish.\r\n\r\n this._startKeepAlives().then(connDidFail => {\r\n // Only emit CATCHUP if we detected a connectivity error: if we didn't,\r\n // it's quite likely the sync will fail again for the same reason and we\r\n // want to stay in ERROR rather than keep flip-flopping between ERROR\r\n // and CATCHUP.\r\n if (connDidFail && this.getSyncState() === 'ERROR') {\r\n this._updateSyncState(\"CATCHUP\", {\r\n oldSyncToken: null,\r\n nextSyncToken: null,\r\n catchingUp: true\r\n });\r\n }\r\n\r\n this._sync(syncOptions);\r\n });\r\n\r\n this._currentSyncRequest = null; // Transition from RECONNECTING to ERROR after a given number of failed syncs\r\n\r\n this._updateSyncState(this._failedSyncCount >= FAILED_SYNC_ERROR_THRESHOLD ? \"ERROR\" : \"RECONNECTING\", {\r\n error: err\r\n });\r\n};\r\n/**\r\n * Process data returned from a sync response and propagate it\r\n * into the model objects\r\n *\r\n * @param {Object} syncEventData Object containing sync tokens associated with this sync\r\n * @param {Object} data The response from /sync\r\n */\r\n\r\n\r\nSyncApi.prototype._processSyncResponse = async function (syncEventData, data) {\r\n const client = this.client;\r\n const self = this; // data looks like:\r\n // {\r\n // next_batch: $token,\r\n // presence: { events: [] },\r\n // account_data: { events: [] },\r\n // device_lists: { changed: [\"@user:server\", ... ]},\r\n // to_device: { events: [] },\r\n // device_one_time_keys_count: { signed_curve25519: 42 },\r\n // rooms: {\r\n // invite: {\r\n // $roomid: {\r\n // invite_state: { events: [] }\r\n // }\r\n // },\r\n // join: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token, limited: true },\r\n // ephemeral: { events: [] },\r\n // summary: {\r\n // m.heroes: [ $user_id ],\r\n // m.joined_member_count: $count,\r\n // m.invited_member_count: $count\r\n // },\r\n // account_data: { events: [] },\r\n // unread_notifications: {\r\n // highlight_count: 0,\r\n // notification_count: 0,\r\n // }\r\n // }\r\n // },\r\n // leave: {\r\n // $roomid: {\r\n // state: { events: [] },\r\n // timeline: { events: [], prev_batch: $token }\r\n // }\r\n // }\r\n // },\r\n // groups: {\r\n // invite: {\r\n // $groupId: {\r\n // inviter: $inviter,\r\n // profile: {\r\n // avatar_url: $avatarUrl,\r\n // name: $groupName,\r\n // },\r\n // },\r\n // },\r\n // join: {},\r\n // leave: {},\r\n // },\r\n // }\r\n // TODO-arch:\r\n // - Each event we pass through needs to be emitted via 'event', can we\r\n // do this in one place?\r\n // - The isBrandNewRoom boilerplate is boilerplatey.\r\n // handle presence events (User objects)\r\n\r\n if (data.presence && utils.isArray(data.presence.events)) {\r\n data.presence.events.map(client.getEventMapper()).forEach(function (presenceEvent) {\r\n let user = client.store.getUser(presenceEvent.getSender());\r\n\r\n if (user) {\r\n user.setPresenceEvent(presenceEvent);\r\n } else {\r\n user = createNewUser(client, presenceEvent.getSender());\r\n user.setPresenceEvent(presenceEvent);\r\n client.store.storeUser(user);\r\n }\r\n\r\n client.emit(\"event\", presenceEvent);\r\n });\r\n } // handle non-room account_data\r\n\r\n\r\n if (data.account_data && utils.isArray(data.account_data.events)) {\r\n const events = data.account_data.events.map(client.getEventMapper());\r\n const prevEventsMap = events.reduce((m, c) => {\r\n m[c.getId()] = client.store.getAccountData(c.getType());\r\n return m;\r\n }, {});\r\n client.store.storeAccountDataEvents(events);\r\n events.forEach(function (accountDataEvent) {\r\n // Honour push rules that come down the sync stream but also\r\n // honour push rules that were previously cached. Base rules\r\n // will be updated when we receive push rules via getPushRules\r\n // (see SyncApi.prototype.sync) before syncing over the network.\r\n if (accountDataEvent.getType() === 'm.push_rules') {\r\n const rules = accountDataEvent.getContent();\r\n client.pushRules = _pushprocessor.PushProcessor.rewriteDefaultRules(rules);\r\n }\r\n\r\n const prevEvent = prevEventsMap[accountDataEvent.getId()];\r\n client.emit(\"accountData\", accountDataEvent, prevEvent);\r\n return accountDataEvent;\r\n });\r\n } // handle to-device events\r\n\r\n\r\n if (data.to_device && utils.isArray(data.to_device.events) && data.to_device.events.length > 0) {\r\n const cancelledKeyVerificationTxns = [];\r\n data.to_device.events.map(client.getEventMapper()).map(toDeviceEvent => {\r\n // map is a cheap inline forEach\r\n // We want to flag m.key.verification.start events as cancelled\r\n // if there's an accompanying m.key.verification.cancel event, so\r\n // we pull out the transaction IDs from the cancellation events\r\n // so we can flag the verification events as cancelled in the loop\r\n // below.\r\n if (toDeviceEvent.getType() === \"m.key.verification.cancel\") {\r\n const txnId = toDeviceEvent.getContent()['transaction_id'];\r\n\r\n if (txnId) {\r\n cancelledKeyVerificationTxns.push(txnId);\r\n }\r\n } // as mentioned above, .map is a cheap inline forEach, so return\r\n // the unmodified event.\r\n\r\n\r\n return toDeviceEvent;\r\n }).forEach(function (toDeviceEvent) {\r\n const content = toDeviceEvent.getContent();\r\n\r\n if (toDeviceEvent.getType() == \"m.room.message\" && content.msgtype == \"m.bad.encrypted\") {\r\n // the mapper already logged a warning.\r\n _logger.logger.log('Ignoring undecryptable to-device event from ' + toDeviceEvent.getSender());\r\n\r\n return;\r\n }\r\n\r\n if (toDeviceEvent.getType() === \"m.key.verification.start\" || toDeviceEvent.getType() === \"m.key.verification.request\") {\r\n const txnId = content['transaction_id'];\r\n\r\n if (cancelledKeyVerificationTxns.includes(txnId)) {\r\n toDeviceEvent.flagCancelled();\r\n }\r\n }\r\n\r\n client.emit(\"toDeviceEvent\", toDeviceEvent);\r\n });\r\n } else {\r\n // no more to-device events: we can stop polling with a short timeout.\r\n this._catchingUp = false;\r\n }\r\n\r\n if (data.groups) {\r\n if (data.groups.invite) {\r\n this._processGroupSyncEntry(data.groups.invite, 'invite');\r\n }\r\n\r\n if (data.groups.join) {\r\n this._processGroupSyncEntry(data.groups.join, 'join');\r\n }\r\n\r\n if (data.groups.leave) {\r\n this._processGroupSyncEntry(data.groups.leave, 'leave');\r\n }\r\n } // the returned json structure is a bit crap, so make it into a\r\n // nicer form (array) after applying sanity to make sure we don't fail\r\n // on missing keys (on the off chance)\r\n\r\n\r\n let inviteRooms = [];\r\n let joinRooms = [];\r\n let leaveRooms = [];\r\n\r\n if (data.rooms) {\r\n if (data.rooms.invite) {\r\n inviteRooms = this._mapSyncResponseToRoomArray(data.rooms.invite);\r\n }\r\n\r\n if (data.rooms.join) {\r\n joinRooms = this._mapSyncResponseToRoomArray(data.rooms.join);\r\n }\r\n\r\n if (data.rooms.leave) {\r\n leaveRooms = this._mapSyncResponseToRoomArray(data.rooms.leave);\r\n }\r\n }\r\n\r\n this._notifEvents = []; // Handle invites\r\n\r\n inviteRooms.forEach(function (inviteObj) {\r\n const room = inviteObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(inviteObj.invite_state, room);\r\n\r\n self._processRoomEvents(room, stateEvents);\r\n\r\n if (inviteObj.isBrandNewRoom) {\r\n room.recalculate();\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"invite\");\r\n }); // Handle joins\r\n\r\n await utils.promiseMapSeries(joinRooms, async function (joinObj) {\r\n const room = joinObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(joinObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(joinObj.timeline, room);\r\n\r\n const ephemeralEvents = self._mapSyncEventsFormat(joinObj.ephemeral);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(joinObj.account_data); // we do this first so it's correct when any of the events fire\r\n\r\n\r\n if (joinObj.unread_notifications) {\r\n room.setUnreadNotificationCount('total', joinObj.unread_notifications.notification_count); // We track unread notifications ourselves in encrypted rooms, so don't\r\n // bother setting it here. We trust our calculations better than the\r\n // server's for this case, and therefore will assume that our non-zero\r\n // count is accurate.\r\n\r\n const encrypted = client.isRoomEncrypted(room.roomId);\r\n\r\n if (!encrypted || encrypted && room.getUnreadNotificationCount('highlight') <= 0) {\r\n room.setUnreadNotificationCount('highlight', joinObj.unread_notifications.highlight_count);\r\n }\r\n }\r\n\r\n joinObj.timeline = joinObj.timeline || {};\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n // set the back-pagination token. Do this *before* adding any\r\n // events so that clients can start back-paginating.\r\n room.getLiveTimeline().setPaginationToken(joinObj.timeline.prev_batch, _eventTimeline.EventTimeline.BACKWARDS);\r\n } else if (joinObj.timeline.limited) {\r\n let limited = true; // we've got a limited sync, so we *probably* have a gap in the\r\n // timeline, so should reset. But we might have been peeking or\r\n // paginating and already have some of the events, in which\r\n // case we just want to append any subsequent events to the end\r\n // of the existing timeline.\r\n //\r\n // This is particularly important in the case that we already have\r\n // *all* of the events in the timeline - in that case, if we reset\r\n // the timeline, we'll end up with an entirely empty timeline,\r\n // which we'll try to paginate but not get any new events (which\r\n // will stop us linking the empty timeline into the chain).\r\n //\r\n\r\n for (let i = timelineEvents.length - 1; i >= 0; i--) {\r\n const eventId = timelineEvents[i].getId();\r\n\r\n if (room.getTimelineForEvent(eventId)) {\r\n debuglog(\"Already have event \" + eventId + \" in limited \" + \"sync - not resetting\");\r\n limited = false; // we might still be missing some of the events before i;\r\n // we don't want to be adding them to the end of the\r\n // timeline because that would put them out of order.\r\n\r\n timelineEvents.splice(0, i); // XXX: there's a problem here if the skipped part of the\r\n // timeline modifies the state set in stateEvents, because\r\n // we'll end up using the state from stateEvents rather\r\n // than the later state from timelineEvents. We probably\r\n // need to wind stateEvents forward over the events we're\r\n // skipping.\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (limited) {\r\n self._deregisterStateListeners(room);\r\n\r\n room.resetLiveTimeline(joinObj.timeline.prev_batch, self.opts.canResetEntireTimeline(room.roomId) ? null : syncEventData.oldSyncToken); // We have to assume any gap in any timeline is\r\n // reason to stop incrementally tracking notifications and\r\n // reset the timeline.\r\n\r\n client.resetNotifTimelineSet();\r\n\r\n self._registerStateListeners(room);\r\n }\r\n }\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents, syncEventData.fromCache); // set summary after processing events,\r\n // because it will trigger a name calculation\r\n // which needs the room state to be up to date\r\n\r\n\r\n if (joinObj.summary) {\r\n room.setSummary(joinObj.summary);\r\n } // we deliberately don't add ephemeral events to the timeline\r\n\r\n\r\n room.addEphemeralEvents(ephemeralEvents); // we deliberately don't add accountData to the timeline\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (joinObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n async function processRoomEvent(e) {\r\n client.emit(\"event\", e);\r\n\r\n if (e.isState() && e.getType() == \"m.room.encryption\" && self.opts.crypto) {\r\n await self.opts.crypto.onCryptoEvent(e);\r\n }\r\n\r\n if (e.isState() && e.getType() === \"im.vector.user_status\") {\r\n let user = client.store.getUser(e.getStateKey());\r\n\r\n if (user) {\r\n user._unstable_updateStatusMessage(e);\r\n } else {\r\n user = createNewUser(client, e.getStateKey());\r\n\r\n user._unstable_updateStatusMessage(e);\r\n\r\n client.store.storeUser(user);\r\n }\r\n }\r\n }\r\n\r\n await utils.promiseMapSeries(stateEvents, processRoomEvent);\r\n await utils.promiseMapSeries(timelineEvents, processRoomEvent);\r\n ephemeralEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"join\");\r\n }); // Handle leaves (e.g. kicked rooms)\r\n\r\n leaveRooms.forEach(function (leaveObj) {\r\n const room = leaveObj.room;\r\n\r\n const stateEvents = self._mapSyncEventsFormat(leaveObj.state, room);\r\n\r\n const timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);\r\n\r\n const accountDataEvents = self._mapSyncEventsFormat(leaveObj.account_data);\r\n\r\n self._processRoomEvents(room, stateEvents, timelineEvents);\r\n\r\n room.addAccountData(accountDataEvents);\r\n room.recalculate();\r\n\r\n if (leaveObj.isBrandNewRoom) {\r\n client.store.storeRoom(room);\r\n client.emit(\"Room\", room);\r\n }\r\n\r\n self._processEventsForNotifs(room, timelineEvents);\r\n\r\n stateEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n timelineEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n accountDataEvents.forEach(function (e) {\r\n client.emit(\"event\", e);\r\n });\r\n room.updateMyMembership(\"leave\");\r\n }); // update the notification timeline, if appropriate.\r\n // we only do this for live events, as otherwise we can't order them sanely\r\n // in the timeline relative to ones paginated in by /notifications.\r\n // XXX: we could fix this by making EventTimeline support chronological\r\n // ordering... but it doesn't, right now.\r\n\r\n if (syncEventData.oldSyncToken && this._notifEvents.length) {\r\n this._notifEvents.sort(function (a, b) {\r\n return a.getTs() - b.getTs();\r\n });\r\n\r\n this._notifEvents.forEach(function (event) {\r\n client.getNotifTimelineSet().addLiveEvent(event);\r\n });\r\n } // Handle device list updates\r\n\r\n\r\n if (data.device_lists) {\r\n if (this.opts.crypto) {\r\n await this.opts.crypto.handleDeviceListChanges(syncEventData, data.device_lists);\r\n } else {// FIXME if we *don't* have a crypto module, we still need to\r\n // invalidate the device lists. But that would require a\r\n // substantial bit of rework :/.\r\n }\r\n } // Handle one_time_keys_count\r\n\r\n\r\n if (this.opts.crypto && data.device_one_time_keys_count) {\r\n const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0;\r\n this.opts.crypto.updateOneTimeKeyCount(currentCount);\r\n }\r\n\r\n if (this.opts.crypto && data[\"org.matrix.msc2732.device_unused_fallback_key_types\"]) {\r\n // The presence of device_unused_fallback_key_types indicates that the\r\n // server supports fallback keys. If there's no unused\r\n // signed_curve25519 fallback key we need a new one.\r\n const unusedFallbackKeys = data[\"org.matrix.msc2732.device_unused_fallback_key_types\"];\r\n this.opts.crypto.setNeedsNewFallback(unusedFallbackKeys instanceof Array && !unusedFallbackKeys.includes(\"signed_curve25519\"));\r\n }\r\n};\r\n/**\r\n * Starts polling the connectivity check endpoint\r\n * @param {number} delay How long to delay until the first poll.\r\n * defaults to a short, randomised interval (to prevent\r\n * tightlooping if /versions succeeds but /sync etc. fail).\r\n * @return {promise} which resolves once the connection returns\r\n */\r\n\r\n\r\nSyncApi.prototype._startKeepAlives = function (delay) {\r\n if (delay === undefined) {\r\n delay = 2000 + Math.floor(Math.random() * 5000);\r\n }\r\n\r\n if (this._keepAliveTimer !== null) {\r\n clearTimeout(this._keepAliveTimer);\r\n }\r\n\r\n const self = this;\r\n\r\n if (delay > 0) {\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self), delay);\r\n } else {\r\n self._pokeKeepAlive();\r\n }\r\n\r\n if (!this._connectionReturnedDefer) {\r\n this._connectionReturnedDefer = utils.defer();\r\n }\r\n\r\n return this._connectionReturnedDefer.promise;\r\n};\r\n/**\r\n * Make a dummy call to /_matrix/client/versions, to see if the HS is\r\n * reachable.\r\n *\r\n * On failure, schedules a call back to itself. On success, resolves\r\n * this._connectionReturnedDefer.\r\n *\r\n * @param {bool} connDidFail True if a connectivity failure has been detected. Optional.\r\n */\r\n\r\n\r\nSyncApi.prototype._pokeKeepAlive = function (connDidFail) {\r\n if (connDidFail === undefined) connDidFail = false;\r\n const self = this;\r\n\r\n function success() {\r\n clearTimeout(self._keepAliveTimer);\r\n\r\n if (self._connectionReturnedDefer) {\r\n self._connectionReturnedDefer.resolve(connDidFail);\r\n\r\n self._connectionReturnedDefer = null;\r\n }\r\n }\r\n\r\n this.client._http.request(undefined, // callback\r\n \"GET\", \"/_matrix/client/versions\", undefined, // queryParams\r\n undefined, // data\r\n {\r\n prefix: '',\r\n localTimeoutMs: 15 * 1000\r\n }).then(function () {\r\n success();\r\n }, function (err) {\r\n if (err.httpStatus == 400 || err.httpStatus == 404) {\r\n // treat this as a success because the server probably just doesn't\r\n // support /versions: point is, we're getting a response.\r\n // We wait a short time though, just in case somehow the server\r\n // is in a mode where it 400s /versions responses and sync etc.\r\n // responses fail, this will mean we don't hammer in a loop.\r\n self._keepAliveTimer = setTimeout(success, 2000);\r\n } else {\r\n connDidFail = true;\r\n self._keepAliveTimer = setTimeout(self._pokeKeepAlive.bind(self, connDidFail), 5000 + Math.floor(Math.random() * 5000)); // A keepalive has failed, so we emit the\r\n // error state (whether or not this is the\r\n // first failure).\r\n // Note we do this after setting the timer:\r\n // this lets the unit tests advance the mock\r\n // clock when they get the error.\r\n\r\n self._updateSyncState(\"ERROR\", {\r\n error: err\r\n });\r\n }\r\n });\r\n};\r\n/**\r\n * @param {Object} groupsSection Groups section object, eg. response.groups.invite\r\n * @param {string} sectionName Which section this is ('invite', 'join' or 'leave')\r\n */\r\n\r\n\r\nSyncApi.prototype._processGroupSyncEntry = function (groupsSection, sectionName) {\r\n // Processes entries from 'groups' section of the sync stream\r\n for (const groupId of Object.keys(groupsSection)) {\r\n const groupInfo = groupsSection[groupId];\r\n let group = this.client.store.getGroup(groupId);\r\n const isBrandNew = group === null;\r\n\r\n if (group === null) {\r\n group = this.createGroup(groupId);\r\n }\r\n\r\n if (groupInfo.profile) {\r\n group.setProfile(groupInfo.profile.name, groupInfo.profile.avatar_url);\r\n }\r\n\r\n if (groupInfo.inviter) {\r\n group.setInviter({\r\n userId: groupInfo.inviter\r\n });\r\n }\r\n\r\n group.setMyMembership(sectionName);\r\n\r\n if (isBrandNew) {\r\n // Now we've filled in all the fields, emit the Group event\r\n this.client.emit(\"Group\", group);\r\n }\r\n }\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @return {Object[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncResponseToRoomArray = function (obj) {\r\n // Maps { roomid: {stuff}, roomid: {stuff} }\r\n // to\r\n // [{stuff+Room+isBrandNewRoom}, {stuff+Room+isBrandNewRoom}]\r\n const client = this.client;\r\n const self = this;\r\n return utils.keys(obj).map(function (roomId) {\r\n const arrObj = obj[roomId];\r\n let room = client.store.getRoom(roomId);\r\n let isBrandNewRoom = false;\r\n\r\n if (!room) {\r\n room = self.createRoom(roomId);\r\n isBrandNewRoom = true;\r\n }\r\n\r\n arrObj.room = room;\r\n arrObj.isBrandNewRoom = isBrandNewRoom;\r\n return arrObj;\r\n });\r\n};\r\n/**\r\n * @param {Object} obj\r\n * @param {Room} room\r\n * @return {MatrixEvent[]}\r\n */\r\n\r\n\r\nSyncApi.prototype._mapSyncEventsFormat = function (obj, room) {\r\n if (!obj || !utils.isArray(obj.events)) {\r\n return [];\r\n }\r\n\r\n const mapper = this.client.getEventMapper();\r\n return obj.events.map(function (e) {\r\n if (room) {\r\n e.room_id = room.roomId;\r\n }\r\n\r\n return mapper(e);\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n */\r\n\r\n\r\nSyncApi.prototype._resolveInvites = function (room) {\r\n if (!room || !this.opts.resolveInvitesToProfiles) {\r\n return;\r\n }\r\n\r\n const client = this.client; // For each invited room member we want to give them a displayname/avatar url\r\n // if they have one (the m.room.member invites don't contain this).\r\n\r\n room.getMembersWithMembership(\"invite\").forEach(function (member) {\r\n if (member._requestedProfileInfo) {\r\n return;\r\n }\r\n\r\n member._requestedProfileInfo = true; // try to get a cached copy first.\r\n\r\n const user = client.getUser(member.userId);\r\n let promise;\r\n\r\n if (user) {\r\n promise = Promise.resolve({\r\n avatar_url: user.avatarUrl,\r\n displayname: user.displayName\r\n });\r\n } else {\r\n promise = client.getProfileInfo(member.userId);\r\n }\r\n\r\n promise.then(function (info) {\r\n // slightly naughty by doctoring the invite event but this means all\r\n // the code paths remain the same between invite/join display name stuff\r\n // which is a worthy trade-off for some minor pollution.\r\n const inviteEvent = member.events.member;\r\n\r\n if (inviteEvent.getContent().membership !== \"invite\") {\r\n // between resolving and now they have since joined, so don't clobber\r\n return;\r\n }\r\n\r\n inviteEvent.getContent().avatar_url = info.avatar_url;\r\n inviteEvent.getContent().displayname = info.displayname; // fire listeners\r\n\r\n member.setMembershipEvent(inviteEvent, room.currentState);\r\n }, function (err) {// OH WELL.\r\n });\r\n });\r\n};\r\n/**\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} stateEventList A list of state events. This is the state\r\n * at the *START* of the timeline list if it is supplied.\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * @param {boolean} fromCache whether the sync response came from cache\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processRoomEvents = function (room, stateEventList, timelineEventList, fromCache) {\r\n // If there are no events in the timeline yet, initialise it with\r\n // the given state events\r\n const liveTimeline = room.getLiveTimeline();\r\n const timelineWasEmpty = liveTimeline.getEvents().length == 0;\r\n\r\n if (timelineWasEmpty) {\r\n // Passing these events into initialiseState will freeze them, so we need\r\n // to compute and cache the push actions for them now, otherwise sync dies\r\n // with an attempt to assign to read only property.\r\n // XXX: This is pretty horrible and is assuming all sorts of behaviour from\r\n // these functions that it shouldn't be. We should probably either store the\r\n // push actions cache elsewhere so we can freeze MatrixEvents, or otherwise\r\n // find some solution where MatrixEvents are immutable but allow for a cache\r\n // field.\r\n for (const ev of stateEventList) {\r\n this.client.getPushActionsForEvent(ev);\r\n }\r\n\r\n liveTimeline.initialiseState(stateEventList);\r\n }\r\n\r\n this._resolveInvites(room); // recalculate the room name at this point as adding events to the timeline\r\n // may make notifications appear which should have the right name.\r\n // XXX: This looks suspect: we'll end up recalculating the room once here\r\n // and then again after adding events (_processSyncResponse calls it after\r\n // calling us) even if no state events were added. It also means that if\r\n // one of the room events in timelineEventList is something that needs\r\n // a recalculation (like m.room.name) we won't recalculate until we've\r\n // finished adding all the events, which will cause the notification to have\r\n // the old room name rather than the new one.\r\n\r\n\r\n room.recalculate(); // If the timeline wasn't empty, we process the state events here: they're\r\n // defined as updates to the state before the start of the timeline, so this\r\n // starts to roll the state forward.\r\n // XXX: That's what we *should* do, but this can happen if we were previously\r\n // peeking in a room, in which case we obviously do *not* want to add the\r\n // state events here onto the end of the timeline. Historically, the js-sdk\r\n // has just set these new state events on the old and new state. This seems\r\n // very wrong because there could be events in the timeline that diverge the\r\n // state, in which case this is going to leave things out of sync. However,\r\n // for now I think it;s best to behave the same as the code has done previously.\r\n\r\n if (!timelineWasEmpty) {\r\n // XXX: As above, don't do this...\r\n //room.addLiveEvents(stateEventList || []);\r\n // Do this instead...\r\n room.oldState.setStateEvents(stateEventList || []);\r\n room.currentState.setStateEvents(stateEventList || []);\r\n } // execute the timeline events. This will continue to diverge the current state\r\n // if the timeline has any state events in it.\r\n // This also needs to be done before running push rules on the events as they need\r\n // to be decorated with sender etc.\r\n\r\n\r\n room.addLiveEvents(timelineEventList || [], null, fromCache);\r\n};\r\n/**\r\n * Takes a list of timelineEvents and adds and adds to _notifEvents\r\n * as appropriate.\r\n * This must be called after the room the events belong to has been stored.\r\n *\r\n * @param {Room} room\r\n * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index\r\n * is earlier in time. Higher index is later.\r\n */\r\n\r\n\r\nSyncApi.prototype._processEventsForNotifs = function (room, timelineEventList) {\r\n // gather our notifications into this._notifEvents\r\n if (this.client.getNotifTimelineSet()) {\r\n for (let i = 0; i < timelineEventList.length; i++) {\r\n const pushActions = this.client.getPushActionsForEvent(timelineEventList[i]);\r\n\r\n if (pushActions && pushActions.notify && pushActions.tweaks && pushActions.tweaks.highlight) {\r\n this._notifEvents.push(timelineEventList[i]);\r\n }\r\n }\r\n }\r\n};\r\n/**\r\n * @return {string}\r\n */\r\n\r\n\r\nSyncApi.prototype._getGuestFilter = function () {\r\n const guestRooms = this.client._guestRooms; // FIXME: horrible gut-wrenching\r\n\r\n if (!guestRooms) {\r\n return \"{}\";\r\n } // we just need to specify the filter inline if we're a guest because guests\r\n // can't create filters.\r\n\r\n\r\n return JSON.stringify({\r\n room: {\r\n timeline: {\r\n limit: 20\r\n }\r\n }\r\n });\r\n};\r\n/**\r\n * Sets the sync state and emits an event to say so\r\n * @param {String} newState The new state string\r\n * @param {Object} data Object of additional data to emit in the event\r\n */\r\n\r\n\r\nSyncApi.prototype._updateSyncState = function (newState, data) {\r\n const old = this._syncState;\r\n this._syncState = newState;\r\n this._syncStateData = data;\r\n this.client.emit(\"sync\", this._syncState, old, data);\r\n};\r\n/**\r\n * Event handler for the 'online' event\r\n * This event is generally unreliable and precise behaviour\r\n * varies between browsers, so we poll for connectivity too,\r\n * but this might help us reconnect a little faster.\r\n */\r\n\r\n\r\nSyncApi.prototype._onOnline = function () {\r\n debuglog(\"Browser thinks we are back online\");\r\n\r\n this._startKeepAlives(0);\r\n};\r\n\r\nfunction createNewUser(client, userId) {\r\n const user = new _user.User(userId);\r\n client.reEmitter.reEmit(user, [\"User.avatarUrl\", \"User.displayName\", \"User.presence\", \"User.currentlyActive\", \"User.lastPresenceTs\"]);\r\n return user;\r\n}","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\"","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".topheader[data-v-62a1ab6a]{top:0;z-index:999}.newChat[data-v-62a1ab6a] #maincontent .headerSpacer,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapper,.newChat[data-v-62a1ab6a] #maincontent .headerSpacerWrapperOvf{overflow:visible!important}.newChat.minimized.active[data-v-62a1ab6a] #maincontent .desktopList{display:none}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"br[data-v-ba5ac396]{content:\\\"\\\"}.sname[data-v-ba5ac396]{font-weight:700}.listPreview[data-v-ba5ac396]{display:flex;align-items:center}.statusWrapper[data-v-ba5ac396]{padding-left:.5em}.statusWrapper .my[data-v-ba5ac396]{font-size:.6em;opacity:.5}.previewMessage[data-v-ba5ac396]{min-height:25px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar colorString = require('color-string');\nvar convert = require('color-convert');\n\nvar _slice = [].slice;\n\nvar skippedModels = [\n\t// to be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// shouldn't really be in color-convert either...\n\t'hex'\n];\n\nvar hashedModelKeys = {};\nObject.keys(convert).forEach(function (model) {\n\thashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;\n});\n\nvar limiters = {};\n\nfunction Color(obj, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tvar i;\n\tvar channels;\n\n\tif (obj == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (obj instanceof Color) {\n\t\tthis.model = obj.model;\n\t\tthis.color = obj.color.slice();\n\t\tthis.valpha = obj.valpha;\n\t} else if (typeof obj === 'string') {\n\t\tvar result = colorString.get(obj);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + obj);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (obj.length) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tvar newArr = _slice.call(obj, 0, channels);\n\t\tthis.color = zeroArray(newArr, channels);\n\t\tthis.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;\n\t} else if (typeof obj === 'number') {\n\t\t// this is always RGB - can be converted later on.\n\t\tobj &= 0xFFFFFF;\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(obj >> 16) & 0xFF,\n\t\t\t(obj >> 8) & 0xFF,\n\t\t\tobj & 0xFF\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tvar keys = Object.keys(obj);\n\t\tif ('alpha' in obj) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;\n\t\t}\n\n\t\tvar hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(obj));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tvar labels = convert[this.model].labels;\n\t\tvar color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(obj[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tvar limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString: function () {\n\t\treturn this.string();\n\t},\n\n\ttoJSON: function () {\n\t\treturn this[this.model]();\n\t},\n\n\tstring: function (places) {\n\t\tvar self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to[self.model](args);\n\t},\n\n\tpercentString: function (places) {\n\t\tvar self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to.rgb.percent(args);\n\t},\n\n\tarray: function () {\n\t\treturn this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);\n\t},\n\n\tobject: function () {\n\t\tvar result = {};\n\t\tvar channels = convert[this.model].channels;\n\t\tvar labels = convert[this.model].labels;\n\n\t\tfor (var i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray: function () {\n\t\tvar rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject: function () {\n\t\tvar rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround: function (places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);\n\t},\n\n\talpha: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(100)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(100)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn colorString.to.hex(this.rgb().round().color);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.rgb().color;\n\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.rgb().color;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight: function () {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = this.rgb();\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\t\treturn rgb;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale: function () {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar rgb = this.rgb().color;\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(val, val, val);\n\t},\n\n\tfade: function (ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer: function (ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.hsl();\n\t\tvar hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix: function (mixinColor, weight) {\n\t\t// ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\t\tvar color1 = mixinColor.rgb();\n\t\tvar color2 = this.rgb();\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t}\n};\n\n// model conversion methods and static constructors\nObject.keys(convert).forEach(function (model) {\n\tif (skippedModels.indexOf(model) !== -1) {\n\t\treturn;\n\t}\n\n\tvar channels = convert[model].channels;\n\n\t// conversion methods\n\tColor.prototype[model] = function () {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments.length) {\n\t\t\treturn new Color(arguments, model);\n\t\t}\n\n\t\tvar newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;\n\t\treturn new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (color) {\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(_slice.call(arguments), channels);\n\t\t}\n\t\treturn new Color(color, model);\n\t};\n});\n\nfunction roundTo(num, places) {\n\treturn Number(num.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (num) {\n\t\treturn roundTo(num, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tmodel.forEach(function (m) {\n\t\t(limiters[m] || (limiters[m] = []))[channel] = modifier;\n\t});\n\n\tmodel = model[0];\n\n\treturn function (val) {\n\t\tvar result;\n\n\t\tif (arguments.length) {\n\t\t\tif (modifier) {\n\t\t\t\tval = modifier(val);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = val;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(val) {\n\treturn Array.isArray(val) ? val : [val];\n}\n\nfunction zeroArray(arr, length) {\n\tfor (var i = 0; i < length; i++) {\n\t\tif (typeof arr[i] !== 'number') {\n\t\t\tarr[i] = 0;\n\t\t}\n\t}\n\n\treturn arr;\n}\n\nmodule.exports = Color;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__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 (_) 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 __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar axios_1 = __importDefault(require(\"axios\"));\nvar CancelToken = axios_1.default.CancelToken;\n/**\n * Axios request with timeout throw\n */\nfunction axiosRequest(config) {\n return __awaiter(this, void 0, void 0, function () {\n var timeout, cancel;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n timeout = config.timeout;\n if (timeout) {\n config.cancelToken = new CancelToken(function (c) { return cancel = c; });\n setTimeout(function () {\n cancel('timeout cancel', { timeout: timeout });\n }, timeout);\n }\n return [4 /*yield*/, axios_1.default(config)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n}\nexports.default = axiosRequest;\n","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.MemoryStore = MemoryStore;\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * This is an internal module. See {@link MemoryStore} for the public class.\r\n * @module store/memory\r\n */\r\nfunction isValidFilterId(filterId) {\r\n const isValidStr = typeof filterId === \"string\" && !!filterId && filterId !== \"undefined\" && // exclude these as we've serialized undefined in localStorage before\r\n filterId !== \"null\";\r\n return isValidStr || typeof filterId === \"number\";\r\n}\r\n/**\r\n * Construct a new in-memory data store for the Matrix Client.\r\n * @constructor\r\n * @param {Object=} opts Config options\r\n * @param {LocalStorage} opts.localStorage The local storage instance to persist\r\n * some forms of data such as tokens. Rooms will NOT be stored.\r\n */\r\n\r\n\r\nfunction MemoryStore(opts) {\r\n opts = opts || {};\r\n this.rooms = {// roomId: Room\r\n };\r\n this.groups = {// groupId: Group\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n this.localStorage = opts.localStorage;\r\n this._oobMembers = {// roomId: [member events]\r\n };\r\n this._clientOptions = {};\r\n}\r\n\r\nMemoryStore.prototype = {\r\n /**\r\n * Retrieve the token to stream from.\r\n * @return {string} The token or null.\r\n */\r\n getSyncToken: function () {\r\n return this.syncToken;\r\n },\r\n\r\n /** @return {Promise} whether or not the database was newly created in this session. */\r\n isNewlyCreated: function () {\r\n return Promise.resolve(true);\r\n },\r\n\r\n /**\r\n * Set the token to stream from.\r\n * @param {string} token The token to stream from.\r\n */\r\n setSyncToken: function (token) {\r\n this.syncToken = token;\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Group} group The group to be stored\r\n */\r\n storeGroup: function (group) {\r\n this.groups[group.groupId] = group;\r\n },\r\n\r\n /**\r\n * Retrieve a group by its group ID.\r\n * @param {string} groupId The group ID.\r\n * @return {Group} The group or null.\r\n */\r\n getGroup: function (groupId) {\r\n return this.groups[groupId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known groups.\r\n * @return {Group[]} A list of groups, which may be empty.\r\n */\r\n getGroups: function () {\r\n return utils.values(this.groups);\r\n },\r\n\r\n /**\r\n * Store the given room.\r\n * @param {Room} room The room to be stored. All properties must be stored.\r\n */\r\n storeRoom: function (room) {\r\n this.rooms[room.roomId] = room; // add listeners for room member changes so we can keep the room member\r\n // map up-to-date.\r\n\r\n room.currentState.on(\"RoomState.members\", this._onRoomMember.bind(this)); // add existing members\r\n\r\n const self = this;\r\n room.currentState.getMembers().forEach(function (m) {\r\n self._onRoomMember(null, room.currentState, m);\r\n });\r\n },\r\n\r\n /**\r\n * Called when a room member in a room being tracked by this store has been\r\n * updated.\r\n * @param {MatrixEvent} event\r\n * @param {RoomState} state\r\n * @param {RoomMember} member\r\n */\r\n _onRoomMember: function (event, state, member) {\r\n if (member.membership === \"invite\") {\r\n // We do NOT add invited members because people love to typo user IDs\r\n // which would then show up in these lists (!)\r\n return;\r\n }\r\n\r\n const user = this.users[member.userId] || new _user.User(member.userId);\r\n\r\n if (member.name) {\r\n user.setDisplayName(member.name);\r\n\r\n if (member.events.member) {\r\n user.setRawDisplayName(member.events.member.getDirectionalContent().displayname);\r\n }\r\n }\r\n\r\n if (member.events.member && member.events.member.getContent().avatar_url) {\r\n user.setAvatarUrl(member.events.member.getContent().avatar_url);\r\n }\r\n\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a room by its' room ID.\r\n * @param {string} roomId The room ID.\r\n * @return {Room} The room or null.\r\n */\r\n getRoom: function (roomId) {\r\n return this.rooms[roomId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known rooms.\r\n * @return {Room[]} A list of rooms, which may be empty.\r\n */\r\n getRooms: function () {\r\n return utils.values(this.rooms);\r\n },\r\n\r\n /**\r\n * Permanently delete a room.\r\n * @param {string} roomId\r\n */\r\n removeRoom: function (roomId) {\r\n if (this.rooms[roomId]) {\r\n this.rooms[roomId].removeListener(\"RoomState.members\", this._onRoomMember);\r\n }\r\n\r\n delete this.rooms[roomId];\r\n },\r\n\r\n /**\r\n * Retrieve a summary of all the rooms.\r\n * @return {RoomSummary[]} A summary of each room.\r\n */\r\n getRoomSummaries: function () {\r\n return utils.map(utils.values(this.rooms), function (room) {\r\n return room.summary;\r\n });\r\n },\r\n\r\n /**\r\n * Store a User.\r\n * @param {User} user The user to store.\r\n */\r\n storeUser: function (user) {\r\n this.users[user.userId] = user;\r\n },\r\n\r\n /**\r\n * Retrieve a User by its' user ID.\r\n * @param {string} userId The user ID.\r\n * @return {User} The user or null.\r\n */\r\n getUser: function (userId) {\r\n return this.users[userId] || null;\r\n },\r\n\r\n /**\r\n * Retrieve all known users.\r\n * @return {User[]} A list of users, which may be empty.\r\n */\r\n getUsers: function () {\r\n return utils.values(this.users);\r\n },\r\n\r\n /**\r\n * Retrieve scrollback for this room.\r\n * @param {Room} room The matrix room\r\n * @param {integer} limit The max number of old events to retrieve.\r\n * @return {Array} An array of objects which will be at most 'limit'\r\n * length and at least 0. The objects are the raw event JSON.\r\n */\r\n scrollback: function (room, limit) {\r\n return [];\r\n },\r\n\r\n /**\r\n * Store events for a room. The events have already been added to the timeline\r\n * @param {Room} room The room to store events for.\r\n * @param {Array} events The events to store.\r\n * @param {string} token The token associated with these events.\r\n * @param {boolean} toStart True if these are paginated results.\r\n */\r\n storeEvents: function (room, events, token, toStart) {// no-op because they've already been added to the room instance.\r\n },\r\n\r\n /**\r\n * Store a filter.\r\n * @param {Filter} filter\r\n */\r\n storeFilter: function (filter) {\r\n if (!filter) {\r\n return;\r\n }\r\n\r\n if (!this.filters[filter.userId]) {\r\n this.filters[filter.userId] = {};\r\n }\r\n\r\n this.filters[filter.userId][filter.filterId] = filter;\r\n },\r\n\r\n /**\r\n * Retrieve a filter.\r\n * @param {string} userId\r\n * @param {string} filterId\r\n * @return {?Filter} A filter or null.\r\n */\r\n getFilter: function (userId, filterId) {\r\n if (!this.filters[userId] || !this.filters[userId][filterId]) {\r\n return null;\r\n }\r\n\r\n return this.filters[userId][filterId];\r\n },\r\n\r\n /**\r\n * Retrieve a filter ID with the given name.\r\n * @param {string} filterName The filter name.\r\n * @return {?string} The filter ID or null.\r\n */\r\n getFilterIdByName: function (filterName) {\r\n if (!this.localStorage) {\r\n return null;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName; // XXX Storage.getItem doesn't throw ...\r\n // or are we using something different\r\n // than window.localStorage in some cases\r\n // that does throw?\r\n // that would be very naughty\r\n\r\n try {\r\n const value = this.localStorage.getItem(key);\r\n\r\n if (isValidFilterId(value)) {\r\n return value;\r\n }\r\n } catch (e) {}\r\n\r\n return null;\r\n },\r\n\r\n /**\r\n * Set a filter name to ID mapping.\r\n * @param {string} filterName\r\n * @param {string} filterId\r\n */\r\n setFilterIdByName: function (filterName, filterId) {\r\n if (!this.localStorage) {\r\n return;\r\n }\r\n\r\n const key = \"mxjssdk_memory_filter_\" + filterName;\r\n\r\n try {\r\n if (isValidFilterId(filterId)) {\r\n this.localStorage.setItem(key, filterId);\r\n } else {\r\n this.localStorage.removeItem(key);\r\n }\r\n } catch (e) {}\r\n },\r\n\r\n /**\r\n * Store user-scoped account data events.\r\n * N.B. that account data only allows a single event per type, so multiple\r\n * events with the same type will replace each other.\r\n * @param {Array} events The events to store.\r\n */\r\n storeAccountDataEvents: function (events) {\r\n const self = this;\r\n events.forEach(function (event) {\r\n self.accountData[event.getType()] = event;\r\n });\r\n },\r\n\r\n /**\r\n * Get account data event by event type\r\n * @param {string} eventType The event type being queried\r\n * @return {?MatrixEvent} the user account_data event of given type, if any\r\n */\r\n getAccountData: function (eventType) {\r\n return this.accountData[eventType];\r\n },\r\n\r\n /**\r\n * setSyncData does nothing as there is no backing data store.\r\n *\r\n * @param {Object} syncData The sync data\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n setSyncData: function (syncData) {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * We never want to save becase we have nothing to save to.\r\n *\r\n * @return {boolean} If the store wants to save\r\n */\r\n wantsSave: function () {\r\n return false;\r\n },\r\n\r\n /**\r\n * Save does nothing as there is no backing data store.\r\n * @param {bool} force True to force a save (but the memory\r\n * store still can't save anything)\r\n */\r\n save: function (force) {},\r\n\r\n /**\r\n * Startup does nothing as this store doesn't require starting up.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n startup: function () {\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n getSavedSync: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n getSavedSyncToken: function () {\r\n return Promise.resolve(null);\r\n },\r\n\r\n /**\r\n * Delete all data from this store.\r\n * @return {Promise} An immediately resolved promise.\r\n */\r\n deleteAllData: function () {\r\n this.rooms = {// roomId: Room\r\n };\r\n this.users = {// userId: User\r\n };\r\n this.syncToken = null;\r\n this.filters = {// userId: {\r\n // filterId: Filter\r\n // }\r\n };\r\n this.accountData = {// type : content\r\n };\r\n return Promise.resolve();\r\n },\r\n\r\n /**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n getOutOfBandMembers: function (roomId) {\r\n return Promise.resolve(this._oobMembers[roomId] || null);\r\n },\r\n\r\n /**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n setOutOfBandMembers: function (roomId, membershipEvents) {\r\n this._oobMembers[roomId] = membershipEvents;\r\n return Promise.resolve();\r\n },\r\n clearOutOfBandMembers: function () {\r\n this._oobMembers = {};\r\n return Promise.resolve();\r\n },\r\n getClientOptions: function () {\r\n return Promise.resolve(this._clientOptions);\r\n },\r\n storeClientOptions: function (options) {\r\n this._clientOptions = Object.assign({}, options);\r\n return Promise.resolve();\r\n }\r\n};","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"wrapper table\"},[_c('div',{staticClass:\"filecontent\"},[_c('div',{staticClass:\"name\"},[_c('span',[_vm._v(_vm._s(_vm.file.name))])]),_c('div',{staticClass:\"size\"},[_c('span',[_vm._v(_vm._s(_vm.humanReadableSize(_vm.file.size)))])]),(!_vm.encryptedData)?_c('div',{staticClass:\"download\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('button',{staticClass:\"button small rounded\"},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]):_c('div',{staticClass:\"download\"},[_c('button',{staticClass:\"button small rounded\",on:{\"click\":_vm.download}},[(!_vm.downloaded)?_c('span',[_vm._v(_vm._s(_vm.$t(\"button.download\")))]):_c('span',[_vm._v(_vm._s(_vm.$t(\"button.downloaded\")))])])])]),_c('div',{staticClass:\"icon\"},[_c('a',{staticClass:\"fileMessage\",attrs:{\"href\":_vm.file.url,\"download\":_vm.download,\"target\":\"_external\"}},[_c('i',{staticClass:\"fas fa-file-download\"})])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0f8b05de&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=0f8b05de&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"0f8b05de\",\n null\n ,true\n)\n\nexport default component.exports","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".m-message-container{position:fixed;z-index:1010;pointer-events:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;padding:15px}.m-message-container.is-top-center,.m-message-container.is-top-left,.m-message-container.is-top-right{width:100%;top:0;left:0}.m-message-container.is-top-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-top-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-top-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.is-center{width:100%;height:100%;left:0;top:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.m-message-container.is-bottom-center,.m-message-container.is-bottom-left,.m-message-container.is-bottom-right{bottom:0;left:0;width:100%;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.m-message-container.is-bottom-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.m-message-container.is-bottom-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.m-message-container.is-bottom-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.m-message-container.has-mask{background-color:hsla(0,0%,100%,.5);width:100%;height:100%;pointer-events:all}.m-message-wrapper{display:inline-block;max-width:500px}.m-message-wrapper+.m-message-wrapper{margin-top:15px}.m-message-wrapper:after,.m-message-wrapper:before{content:\\\"\\\";clear:both;display:table}.m-message{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:10px 16px;font-size:14px;overflow:hidden;border-radius:4px;-webkit-box-shadow:0 1px 8px rgba(0,0,0,.15);box-shadow:0 1px 8px rgba(0,0,0,.15);color:rgba(0,0,0,.65);background:hsla(0,0%,100%,.95);pointer-events:all;position:relative}.m-message,.m-message-icons{-webkit-box-sizing:border-box;box-sizing:border-box}.m-message-icons{float:left;margin-right:10px}.m-message--title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-message-content{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:auto;width:100%}.m-message--description{line-height:1.6;color:#777}.m-message--title+.m-message--description{margin-top:5px}.m-message--icon{width:25px;height:25px;vertical-align:middle;display:inline-block;border-radius:50%}.m-message--control{position:relative;height:100%;-ms-flex-item-align:start;align-self:flex-start;white-space:nowrap;margin-right:-5px;margin-left:10px}.m-message--button{border:none;outline:none;background:none;cursor:pointer;font-size:15px;color:#646464;font-weight:600;padding:0;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle}.m-message--button:hover{color:#f56c6c}.m-message--arrow-down.is-collapsed{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.m-message-fade-enter-active{-webkit-animation:m-message-fade-in-down .3s;animation:m-message-fade-in-down .3s}.m-message-fade-leave-active{-webkit-animation:m-message-fade-out .3s;animation:m-message-fade-out .3s}@-webkit-keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes m-message-fade-in-down{0%{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}@keyframes m-message-fade-out{0%{opacity:1;margin-top:0}to{opacity:0;margin-top:-45px}}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","var exports = module.exports = function SHA (algorithm) {\n algorithm = algorithm.toLowerCase()\n\n var Algorithm = exports[algorithm]\n if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n return new Algorithm()\n}\n\nexports.sha = require('./sha')\nexports.sha1 = require('./sha1')\nexports.sha224 = require('./sha224')\nexports.sha256 = require('./sha256')\nexports.sha384 = require('./sha384')\nexports.sha512 = require('./sha512')\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","\"use strict\";\n// Copyright (C) 2017 Tony Arcieri\n// MIT License. See LICENSE file for details.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst block_1 = require(\"../../internals/block\");\n/**\n * WebCrypto-based implementation of the AES block cipher.\n *\n * This implementation (ab)uses AES-CBC mode to implement AES-ECB. This is\n * likely to be rather slow, as it requires an async call per block, and\n * discards half the buffer.\n *\n * In theory it should be constant time due to the use of WebCrypto (provided\n * the browser's implementation is constant time), but it could probably benefit\n * from some clever optimization work, or improvements to the WebCrypto API.\n *\n * Some WebCrypto implementations (e.g. node-webcrypto-ossl) support ECB mode\n * natively, so we could take advantage of that to potentially encrypt multiple\n * blocks in a single invocation.\n *\n * Key size: 16 or 32 bytes, block size: 16 bytes.\n */\nclass WebCryptoAes {\n constructor(_crypto, _key) {\n this._crypto = _crypto;\n this._key = _key;\n // An initialization vector of all zeros, exposing the raw AES function\n this._iv = new block_1.default();\n this._emptyPromise = Promise.resolve(this);\n }\n /**\n * Create a new WebCryptoAes instance\n *\n * @param {Crypto} crypto - the Web Cryptography provider\n * @param {Uint8Array} keyData - the AES secret key\n * @returns {Promise}\n */\n encryptBlock(block) {\n return __awaiter(this, void 0, void 0, function* () {\n const params = { name: \"AES-CBC\", iv: this._iv.data };\n const ctBlock = yield this._crypto.subtle.encrypt(params, this._key, block.data);\n // TODO: a more efficient way to do in-place encryption?\n block.data.set(new Uint8Array(ctBlock, 0, block_1.default.SIZE));\n return this._emptyPromise;\n });\n }\n}\nexports.default = WebCryptoAes;\n","\"use strict\";\n/** Type which represents AES blocks */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst constant_time_1 = require(\"./constant-time\");\nconst wipe_1 = require(\"./wipe\");\n/** An AES block (128-bits) */\nclass Block {\n constructor() {\n this.data = new Uint8Array(Block.SIZE);\n }\n /**\n * Clear the given array by setting its values to zero.\n *\n * WARNING: The fact that it sets bytes to zero can be relied on.\n *\n * There is no guarantee that this function makes data disappear from memory,\n * as runtime implementation can, for example, have copying garbage collector\n * that will make copies of sensitive data before we wipe it. Or that an\n * operating system will write our data to swap or sleep image. Another thing\n * is that an optimizing compiler can remove calls to this function or make it\n * no-op. There's nothing we can do with it, so we just do our best and hope\n * that everything will be okay and good will triumph over evil.\n */\n clear() {\n wipe_1.wipe(this.data);\n }\n /**\n * Make a copy of this block, returning a new block\n */\n clone() {\n const ret = new Block();\n ret.copy(this);\n return ret;\n }\n /** Copy the contents of another block into this one */\n copy(other) {\n this.data.set(other.data);\n }\n /**\n * Double a value over GF(2^128):\n *\n * a<<1 if firstbit(a)=0\n * (a<<1) ⊕ 0¹²⁰10000111 if firstbit(a)=1\n */\n dbl() {\n let carry = 0;\n for (let i = Block.SIZE - 1; i >= 0; i--) {\n const b = (this.data[i] >>> 7) & 0xff;\n this.data[i] = (this.data[i] << 1) | carry;\n carry = b;\n }\n this.data[Block.SIZE - 1] ^= constant_time_1.select(carry, Block.R, 0);\n carry = 0;\n }\n}\n/** Size of a block as used by the AES cipher */\nBlock.SIZE = 16;\n/** Minimal irreducible polynomial for a 128-bit block size */\nBlock.R = 0x87;\nexports.default = Block;\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./chats.vue?vue&type=template&id=62a1ab6a&scoped=true&\"\nimport script from \"./chats.vue?vue&type=script&lang=js&\"\nexport * from \"./chats.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"62a1ab6a\",\n null\n ,true\n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a \r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=7ed73c7c&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.vue?vue&type=style&index=0&id=7ed73c7c&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"7ed73c7c\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","// style-loader: Adds some css to the DOM by adding a \r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./name.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./name.vue?vue&type=template&id=72a9c575&scoped=true&\"\nimport script from \"./name.vue?vue&type=script&lang=js&\"\nexport * from \"./name.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./name.vue?vue&type=style&index=0&id=72a9c575&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"72a9c575\",\n null\n ,true\n)\n\nexport default component.exports","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".previewWrapper[data-v-691bf714]{height:60px;position:absolute;top:0;width:100%;display:flex;align-items:center;justify-content:flex-start;padding:0;border-bottom:1px solid rgb(var(--background-main))}.previewWrapper .previewContact[data-v-691bf714],.previewWrapper .previewContactSelect[data-v-691bf714]{width:100%}.previewWrapper .previewBox[data-v-691bf714]{width:100%;display:flex;justify-content:space-between;align-items:center}.previewWrapper .previewBox .previewWrapper[data-v-691bf714]{flex-grow:1;width:100%}.previewWrapper .checkBox[data-v-691bf714]{text-align:center;position:absolute;right:12px;top:50%;transform:translateY(-50%)}.previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList[data-v-691bf714]{margin-bottom:8px}.contactList .title[data-v-691bf714]{padding:0 .5em}.contactList.minimized .title[data-v-691bf714]{display:none}.contactList.minimized .previewWrapper[data-v-691bf714]{padding:.5em 0;border-bottom:0;cursor:pointer}.contactList.minimized .previewWrapper[data-v-691bf714]:last-child{border-bottom:0}.contactList.minimized .previewWrapper[data-v-691bf714] .previewWrapper{padding:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".matrin[data-v-9d2b1700]{margin:0 auto 0 0!important}.msgAction[data-v-9d2b1700]{position:absolute}.msgAction[data-v-9d2b1700]:before{content:\\\"\\\";display:block;width:100%;height:100%;position:fixed;z-index:10;opacity:.9;left:0;right:0;top:0;bottom:0}.msgAction .contentAction[data-v-9d2b1700],.msgAction[data-v-9d2b1700]:before{background-color:rgb(var(--background-main))}.msgAction .contentAction[data-v-9d2b1700]{width:180px;position:relative;z-index:300;border:.1em solid rgb(var(--neutral-grad-0));border-radius:.8em;margin:.6em 0 0 auto}.msgAction .contentAction ul[data-v-9d2b1700]{padding:0;list-style:none;margin:0;display:block;width:100%;height:100%}.msgAction .contentAction ul li[data-v-9d2b1700]{display:flex;justify-content:space-between;padding:.2em .8em;align-items:center;border-top:.1em solid rgb(var(--neutral-grad-1));font-size:1em}.msgAction .contentAction ul li[data-v-9d2b1700]:first-child{border:0}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".outer-div[data-v-e4f39dca]{line-height:inherit;border-radius:50%}.dropDownIcon[data-v-e4f39dca]{width:35px;height:35px;line-height:35px}.dropDownIcon i[data-v-e4f39dca]{line-height:35px!important}.menuwrapper[data-v-e4f39dca]{padding-left:1em;padding-right:1em;padding-bottom:1em;position:absolute;z-index:100;bottom:0;left:0;right:0}.menuwrapper[data-v-e4f39dca] .items{max-height:500px;overflow-y:auto;border-radius:3px;padding-left:.5em;padding-right:.5em;padding-bottom:.5em}.dropdown[data-v-e4f39dca]{z-index:10000;position:absolute;width:100%;right:0;height:auto;color:rgb(var(--text-color));transition:.3s;bottom:-100em;top:100em}.dropdown .backgr[data-v-e4f39dca]{background:rgba(var(--background-total-theme),.15);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);position:fixed;z-index:100;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}.dropdown.visible[data-v-e4f39dca]{bottom:0;top:0}.dropdown.visible .backgr[data-v-e4f39dca]{opacity:1}.dropdown[data-v-e4f39dca] .contentWrapper{margin-top:.25em;border-radius:10px;overflow:hidden}.dropdown .contentWrapper[data-v-e4f39dca],.dropdown[data-v-e4f39dca] .contentWrapper{border-top:1px solid rgba(var(--neutral-grad-1),.5);box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .cancelWrapper .menu-item[data-v-e4f39dca]{margin-top:0;box-shadow:none;color:rgb(var(--neutral-grad-3));box-shadow:0 5px 5px -3px rgba(var(--color-shadow-base),.4)}.dropdown .menu-item[data-v-e4f39dca]{padding:.5em;background:rgb(var(--background-total-theme));color:rgb(var(--neutral-grad-3));line-height:44px;margin-top:.25em;display:flex;border-radius:10px;box-shadow:0 5px 7px -5px rgba(var(--color-shadow-base),.7)}.dropdown .menu-item .title[data-v-e4f39dca]{flex-grow:2;padding-right:44px;text-align:center}.dropdown .menu-item .iconWrapper[data-v-e4f39dca]{width:44px;text-align:center}.dropdown .blocker[data-v-e4f39dca]{position:fixed;top:0;left:0;bottom:0;right:0;content:\\\" \\\"}.cancelWrapper[data-v-e4f39dca]{border-radius:3px;padding-left:.5em;padding-right:.5em;color:rgb(var(--neutral-grad-3))}.small[data-v-e4f39dca]{font-size:.85em}.outer-div.mobile .menuwrapper[data-v-e4f39dca]{position:fixed}.outer-div.minimized[data-v-e4f39dca]{position:static}.outer-div.minimized .backgr[data-v-e4f39dca]{border-radius:4px;height:1000px;bottom:0;top:auto;background:transparent;position:absolute}.outer-div.minimized .dropdown[data-v-e4f39dca]{z-index:10000;right:0}.outer-div.minimized .menuwrapper[data-v-e4f39dca]{border-radius:4px;padding-top:.5em}.outer-div.minimized .menuwrapper[data-v-e4f39dca] .menu-item{margin-top:.25em;border-radius:5px;background:rgba(var(--background-total-theme),.95)}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nmodule.exports = Readable;\n/**/\n\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n/**/\n\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function EElistenerCount(emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\n\n\nvar Stream = require('./internal/streams/stream');\n/**/\n\n\nvar Buffer = require('buffer').Buffer;\n\nvar OurUint8Array = global.Uint8Array || function () {};\n\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\n\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n/**/\n\n\nvar debugUtil = require('util');\n\nvar debug;\n\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function debug() {};\n}\n/**/\n\n\nvar BufferList = require('./internal/streams/buffer_list');\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nvar _require = require('./internal/streams/state'),\n getHighWaterMark = _require.getHighWaterMark;\n\nvar _require$codes = require('../errors').codes,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,\n ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,\n ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.\n\n\nvar StringDecoder;\nvar createReadableStreamAsyncIterator;\nvar from;\n\nrequire('inherits')(Readable, Stream);\n\nvar errorOrDestroy = destroyImpl.errorOrDestroy;\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream, isDuplex) {\n Duplex = Duplex || require('./_stream_duplex');\n options = options || {}; // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n\n if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n\n this.objectMode = !!options.objectMode;\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n\n this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n\n this.sync = true; // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n this.paused = true; // Should close be emitted on destroy. Defaults to true.\n\n this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')\n\n this.autoDestroy = !!options.autoDestroy; // has it been destroyed\n\n this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n\n this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s\n\n this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled\n\n this.readingMore = false;\n this.decoder = null;\n this.encoding = null;\n\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside\n // the ReadableState constructor, at least with V8 6.5\n\n var isDuplex = this instanceof Duplex;\n this._readableState = new ReadableState(options, this, isDuplex); // legacy\n\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n if (this._readableState === undefined) {\n return false;\n }\n\n return this._readableState.destroyed;\n },\n set: function set(value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n } // backward compatibility, the user is explicitly\n // managing destroyed\n\n\n this._readableState.destroyed = value;\n }\n});\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\n\nReadable.prototype._destroy = function (err, cb) {\n cb(err);\n}; // Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\n\n\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n}; // Unshift should *always* be something directly out of read()\n\n\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n debug('readableAddChunk', chunk);\n var state = stream._readableState;\n\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n\n if (er) {\n errorOrDestroy(stream, er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());\n } else if (state.destroyed) {\n return false;\n } else {\n state.reading = false;\n\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n maybeReadMore(stream, state);\n }\n } // We can push more data if we are below the highWaterMark.\n // Also, if we have no data yet, we can stand some more bytes.\n // This is to work around cases where hwm=0, such as the repl.\n\n\n return !state.ended && (state.length < state.highWaterMark || state.length === 0);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n state.awaitDrain = 0;\n stream.emit('data', chunk);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n if (state.needReadable) emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);\n }\n\n return er;\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n}; // backwards compatibility.\n\n\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n var decoder = new StringDecoder(enc);\n this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8\n\n this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:\n\n var p = this._readableState.buffer.head;\n var content = '';\n\n while (p !== null) {\n content += decoder.write(p.data);\n p = p.next;\n }\n\n this._readableState.buffer.clear();\n\n if (content !== '') this._readableState.buffer.push(content);\n this._readableState.length = content.length;\n return this;\n}; // Don't raise the hwm > 1GB\n\n\nvar MAX_HWM = 0x40000000;\n\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n\n return n;\n} // This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\n\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n; // Don't have enough\n\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n\n return state.length;\n} // you can override either this method, or the async _read(n) below.\n\n\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n\n if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.\n\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n } // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n // if we need a readable event, then we need to do some reading.\n\n\n var doRead = state.needReadable;\n debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some\n\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n } // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n\n\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true; // if the length is currently zero, then we *need* a readable event.\n\n if (state.length === 0) state.needReadable = true; // call internal read method\n\n this._read(state.highWaterMark);\n\n state.sync = false; // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = state.length <= state.highWaterMark;\n n = 0;\n } else {\n state.length -= n;\n state.awaitDrain = 0;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.\n\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n debug('onEofChunk');\n if (state.ended) return;\n\n if (state.decoder) {\n var chunk = state.decoder.end();\n\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n\n state.ended = true;\n\n if (state.sync) {\n // if we are sync, wait until next tick to emit the data.\n // Otherwise we risk emitting data in the flow()\n // the readable code triggers during a read() call\n emitReadable(stream);\n } else {\n // emit 'readable' now to make sure it gets picked up.\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n state.emittedReadable = true;\n emitReadable_(stream);\n }\n }\n} // Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\n\n\nfunction emitReadable(stream) {\n var state = stream._readableState;\n debug('emitReadable', state.needReadable, state.emittedReadable);\n state.needReadable = false;\n\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n process.nextTick(emitReadable_, stream);\n }\n}\n\nfunction emitReadable_(stream) {\n var state = stream._readableState;\n debug('emitReadable_', state.destroyed, state.length, state.ended);\n\n if (!state.destroyed && (state.length || state.ended)) {\n stream.emit('readable');\n state.emittedReadable = false;\n } // The stream needs another readable event if\n // 1. It is not flowing, as the flow mechanism will take\n // care of it.\n // 2. It is not ended.\n // 3. It is below the highWaterMark, so we can schedule\n // another readable later.\n\n\n state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;\n flow(stream);\n} // at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\n\n\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n process.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n // Attempt to read more data if we should.\n //\n // The conditions for reading more data are (one of):\n // - Not enough data buffered (state.length < state.highWaterMark). The loop\n // is responsible for filling the buffer with enough data if such data\n // is available. If highWaterMark is 0 and we are not in the flowing mode\n // we should _not_ attempt to buffer any extra data. We'll get more data\n // when the stream consumer calls read() instead.\n // - No data in the buffer, and the stream is in flowing mode. In this mode\n // the loop below is responsible for ensuring read() is called. Failing to\n // call read here would abort the flow and there's no other mechanism for\n // continuing the flow if the stream consumer has just subscribed to the\n // 'data' event.\n //\n // In addition to the above conditions to keep reading data, the following\n // conditions prevent the data from being read:\n // - The stream has ended (state.ended).\n // - There is already a pending 'read' operation (state.reading). This is a\n // case where the the stream has called the implementation defined _read()\n // method, but they are processing the call asynchronously and have _not_\n // called push() with new data. In this case we skip performing more\n // read()s. The execution ends in this method again after the _read() ends\n // up calling push() with more data.\n while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {\n var len = state.length;\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length) // didn't get any data, stop spinning.\n break;\n }\n\n state.readingMore = false;\n} // abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\n\n\nReadable.prototype._read = function (n) {\n errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n\n default:\n state.pipes.push(dest);\n break;\n }\n\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);\n dest.on('unpipe', onunpipe);\n\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n } // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n\n\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n var cleanedUp = false;\n\n function cleanup() {\n debug('cleanup'); // cleanup event handlers once the pipe is broken\n\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n cleanedUp = true; // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n src.on('data', ondata);\n\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n debug('dest.write', ret);\n\n if (ret === false) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', state.awaitDrain);\n state.awaitDrain++;\n }\n\n src.pause();\n }\n } // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n\n\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.\n\n\n prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.\n\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n\n dest.once('close', onclose);\n\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n } // tell the dest that it's being piped to\n\n\n dest.emit('pipe', src); // start the flow if it hasn't been started already.\n\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function pipeOnDrainFunctionResult() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = {\n hasUnpiped: false\n }; // if we're not piping anywhere, then do nothing.\n\n if (state.pipesCount === 0) return this; // just one destination. most common case.\n\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n if (!dest) dest = state.pipes; // got a match.\n\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n } // slow case. multiple pipe destinations.\n\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, {\n hasUnpiped: false\n });\n }\n\n return this;\n } // try to find the right one.\n\n\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n dest.emit('unpipe', this, unpipeInfo);\n return this;\n}; // set up data events if they are asked for\n// Ensure readable listeners eventually get something\n\n\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n var state = this._readableState;\n\n if (ev === 'data') {\n // update readableListening so that resume() may be a no-op\n // a few lines down. This is needed to support once('readable').\n state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused\n\n if (state.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.flowing = false;\n state.emittedReadable = false;\n debug('on readable', state.length, state.reading);\n\n if (state.length) {\n emitReadable(this);\n } else if (!state.reading) {\n process.nextTick(nReadingNextTick, this);\n }\n }\n }\n\n return res;\n};\n\nReadable.prototype.addListener = Readable.prototype.on;\n\nReadable.prototype.removeListener = function (ev, fn) {\n var res = Stream.prototype.removeListener.call(this, ev, fn);\n\n if (ev === 'readable') {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nReadable.prototype.removeAllListeners = function (ev) {\n var res = Stream.prototype.removeAllListeners.apply(this, arguments);\n\n if (ev === 'readable' || ev === undefined) {\n // We need to check if there is someone still listening to\n // readable and reset the state. However this needs to happen\n // after readable has been emitted but before I/O (nextTick) to\n // support once('readable', fn) cycles. This means that calling\n // resume within the same tick will have no\n // effect.\n process.nextTick(updateReadableListening, this);\n }\n\n return res;\n};\n\nfunction updateReadableListening(self) {\n var state = self._readableState;\n state.readableListening = self.listenerCount('readable') > 0;\n\n if (state.resumeScheduled && !state.paused) {\n // flowing needs to be set to true now, otherwise\n // the upcoming resume will not flow.\n state.flowing = true; // crude way to check if we should resume\n } else if (self.listenerCount('data') > 0) {\n self.resume();\n }\n}\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n} // pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\n\n\nReadable.prototype.resume = function () {\n var state = this._readableState;\n\n if (!state.flowing) {\n debug('resume'); // we flow only if there is no one listening\n // for readable, but we still have to call\n // resume()\n\n state.flowing = !state.readableListening;\n resume(this, state);\n }\n\n state.paused = false;\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n process.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n debug('resume', state.reading);\n\n if (!state.reading) {\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n\n if (this._readableState.flowing !== false) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n\n this._readableState.paused = true;\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n\n while (state.flowing && stream.read() !== null) {\n ;\n }\n} // wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\n\n\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n stream.on('end', function () {\n debug('wrapped end');\n\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode\n\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n\n if (!ret) {\n paused = true;\n stream.pause();\n }\n }); // proxy all the other methods.\n // important when wrapping filters and duplexes.\n\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function methodWrap(method) {\n return function methodWrapReturnFunction() {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n } // proxy certain important events.\n\n\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n } // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n\n\n this._read = function (n) {\n debug('wrapped _read', n);\n\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nif (typeof Symbol === 'function') {\n Readable.prototype[Symbol.asyncIterator] = function () {\n if (createReadableStreamAsyncIterator === undefined) {\n createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');\n }\n\n return createReadableStreamAsyncIterator(this);\n };\n}\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.highWaterMark;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableBuffer', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState && this._readableState.buffer;\n }\n});\nObject.defineProperty(Readable.prototype, 'readableFlowing', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.flowing;\n },\n set: function set(state) {\n if (this._readableState) {\n this._readableState.flowing = state;\n }\n }\n}); // exposed for testing purposes only.\n\nReadable._fromList = fromList;\nObject.defineProperty(Readable.prototype, 'readableLength', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function get() {\n return this._readableState.length;\n }\n}); // Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\n\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = state.buffer.consume(n, state.decoder);\n }\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n debug('endReadable', state.endEmitted);\n\n if (!state.endEmitted) {\n state.ended = true;\n process.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.\n\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n\n if (state.autoDestroy) {\n // In case of duplex streams we need a way to detect\n // if the writable side is ready for autoDestroy as well\n var wState = stream._writableState;\n\n if (!wState || wState.autoDestroy && wState.finished) {\n stream.destroy();\n }\n }\n }\n}\n\nif (typeof Symbol === 'function') {\n Readable.from = function (iterable, opts) {\n if (from === undefined) {\n from = require('./internal/streams/from');\n }\n\n return from(Readable, iterable, opts);\n };\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n\n return -1;\n}","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","module.exports = require('./lib/_stream_writable.js');\n","export * from \"-!../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./chats.vue?vue&type=style&index=0&id=62a1ab6a&scoped=true&lang=sass&\"","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst aes_1 = require(\"./polyfill/aes\");\nconst aes_ctr_1 = require(\"./polyfill/aes_ctr\");\n/**\n * Pure JavaScript cryptography implementations\n *\n * WARNING: Not constant time! May leak keys or have other security issues.\n */\nclass PolyfillCryptoProvider {\n constructor() {\n // This class doesn't do anything, it just signals that polyfill impls should be used\n }\n importBlockCipherKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_1.default(keyData);\n });\n }\n importCTRKey(keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n return new aes_ctr_1.default(new aes_1.default(keyData));\n });\n }\n}\nexports.PolyfillCryptoProvider = PolyfillCryptoProvider;\n","// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./many.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./many.vue?vue&type=template&id=71d5e826&scoped=true&\"\nimport script from \"./many.vue?vue&type=script&lang=js&\"\nexport * from \"./many.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./many.vue?vue&type=style&index=0&id=71d5e826&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"71d5e826\",\n null\n ,true\n)\n\nexport default component.exports","\"use strict\";\r\n\r\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.IndexedDBStore = IndexedDBStore;\r\n\r\nvar _memory = require(\"./memory\");\r\n\r\nvar utils = _interopRequireWildcard(require(\"../utils\"));\r\n\r\nvar _events = require(\"events\");\r\n\r\nvar _indexeddbLocalBackend = require(\"./indexeddb-local-backend.js\");\r\n\r\nvar _indexeddbRemoteBackend = require(\"./indexeddb-remote-backend.js\");\r\n\r\nvar _user = require(\"../models/user\");\r\n\r\nvar _event = require(\"../models/event\");\r\n\r\nvar _logger = require(\"../logger\");\r\n\r\n/*\r\nCopyright 2017 Vector Creations Ltd\r\nCopyright 2018 New Vector Ltd\r\nCopyright 2019 The Matrix.org Foundation C.I.C.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/* eslint-disable @babel/no-invalid-this */\r\n\r\n/**\r\n * This is an internal module. See {@link IndexedDBStore} for the public class.\r\n * @module store/indexeddb\r\n */\r\n// If this value is too small we'll be writing very often which will cause\r\n// noticable stop-the-world pauses. If this value is too big we'll be writing\r\n// so infrequently that the /sync size gets bigger on reload. Writing more\r\n// often does not affect the length of the pause since the entire /sync\r\n// response is persisted each time.\r\nconst WRITE_DELAY_MS = 1000 * 60 * 5; // once every 5 minutes\r\n\r\n/**\r\n * Construct a new Indexed Database store, which extends MemoryStore.\r\n *\r\n * This store functions like a MemoryStore except it periodically persists\r\n * the contents of the store to an IndexedDB backend.\r\n *\r\n * All data is still kept in-memory but can be loaded from disk by calling\r\n * startup(). This can make startup times quicker as a complete\r\n * sync from the server is not required. This does not reduce memory usage as all\r\n * the data is eagerly fetched when startup() is called.\r\n *
\r\n * let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };\r\n * let store = new IndexedDBStore(opts);\r\n * await store.startup(); // load from indexed db\r\n * let client = sdk.createClient({\r\n *     store: store,\r\n * });\r\n * client.startClient();\r\n * client.on(\"sync\", function(state, prevState, data) {\r\n *     if (state === \"PREPARED\") {\r\n *         console.log(\"Started up, now with go faster stripes!\");\r\n *     }\r\n * });\r\n * 
\r\n *\r\n * @constructor\r\n * @extends MemoryStore\r\n * @param {Object} opts Options object.\r\n * @param {Object} opts.indexedDB The Indexed DB interface e.g.\r\n * window.indexedDB\r\n * @param {string=} opts.dbName Optional database name. The same name must be used\r\n * to open the same database.\r\n * @param {string=} opts.workerScript Optional URL to a script to invoke a web\r\n * worker with to run IndexedDB queries on the web worker. The IndexedDbStoreWorker\r\n * class is provided for this purpose and requires the application to provide a\r\n * trivial wrapper script around it.\r\n * @param {Object=} opts.workerApi The webWorker API object. If omitted, the global Worker\r\n * object will be used if it exists.\r\n * @prop {IndexedDBStoreBackend} backend The backend instance. Call through to\r\n * this API if you need to perform specific indexeddb actions like deleting the\r\n * database.\r\n */\r\n\r\nfunction IndexedDBStore(opts) {\r\n _memory.MemoryStore.call(this, opts);\r\n\r\n if (!opts.indexedDB) {\r\n throw new Error('Missing required option: indexedDB');\r\n }\r\n\r\n if (opts.workerScript) {\r\n // try & find a webworker-compatible API\r\n let workerApi = opts.workerApi;\r\n\r\n if (!workerApi) {\r\n // default to the global Worker object (which is where it in a browser)\r\n workerApi = global.Worker;\r\n }\r\n\r\n this.backend = new _indexeddbRemoteBackend.RemoteIndexedDBStoreBackend(opts.workerScript, opts.dbName, workerApi);\r\n } else {\r\n this.backend = new _indexeddbLocalBackend.LocalIndexedDBStoreBackend(opts.indexedDB, opts.dbName);\r\n }\r\n\r\n this.startedUp = false;\r\n this._syncTs = 0; // Records the last-modified-time of each user at the last point we saved\r\n // the database, such that we can derive the set if users that have been\r\n // modified since we last saved.\r\n\r\n this._userModifiedMap = {// user_id : timestamp\r\n };\r\n}\r\n\r\nutils.inherits(IndexedDBStore, _memory.MemoryStore);\r\nutils.extend(IndexedDBStore.prototype, _events.EventEmitter.prototype);\r\n\r\nIndexedDBStore.exists = function (indexedDB, dbName) {\r\n return _indexeddbLocalBackend.LocalIndexedDBStoreBackend.exists(indexedDB, dbName);\r\n};\r\n/**\r\n * @return {Promise} Resolved when loaded from indexed db.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.startup = function () {\r\n if (this.startedUp) {\r\n _logger.logger.log(`IndexedDBStore.startup: already started`);\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n _logger.logger.log(`IndexedDBStore.startup: connecting to backend`);\r\n\r\n return this.backend.connect().then(() => {\r\n _logger.logger.log(`IndexedDBStore.startup: loading presence events`);\r\n\r\n return this.backend.getUserPresenceEvents();\r\n }).then(userPresenceEvents => {\r\n _logger.logger.log(`IndexedDBStore.startup: processing presence events`);\r\n\r\n userPresenceEvents.forEach(([userId, rawEvent]) => {\r\n const u = new _user.User(userId);\r\n\r\n if (rawEvent) {\r\n u.setPresenceEvent(new _event.MatrixEvent(rawEvent));\r\n }\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n this.storeUser(u);\r\n });\r\n });\r\n};\r\n/**\r\n * @return {Promise} Resolves with a sync response to restore the\r\n * client state to where it was at the last save, or null if there\r\n * is no saved sync data.\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.getSavedSync = degradable(function () {\r\n return this.backend.getSavedSync();\r\n}, \"getSavedSync\");\r\n/** @return {Promise} whether or not the database was newly created in this session. */\r\n\r\nIndexedDBStore.prototype.isNewlyCreated = degradable(function () {\r\n return this.backend.isNewlyCreated();\r\n}, \"isNewlyCreated\");\r\n/**\r\n * @return {Promise} If there is a saved sync, the nextBatch token\r\n * for this sync, otherwise null.\r\n */\r\n\r\nIndexedDBStore.prototype.getSavedSyncToken = degradable(function () {\r\n return this.backend.getNextBatchToken();\r\n}, \"getSavedSyncToken\"),\r\n/**\r\n * Delete all data from this store.\r\n * @return {Promise} Resolves if the data was deleted from the database.\r\n */\r\nIndexedDBStore.prototype.deleteAllData = degradable(function () {\r\n _memory.MemoryStore.prototype.deleteAllData.call(this);\r\n\r\n return this.backend.clearDatabase().then(() => {\r\n _logger.logger.log(\"Deleted indexeddb data.\");\r\n }, err => {\r\n _logger.logger.error(`Failed to delete indexeddb data: ${err}`);\r\n\r\n throw err;\r\n });\r\n});\r\n/**\r\n * Whether this store would like to save its data\r\n * Note that obviously whether the store wants to save or\r\n * not could change between calling this function and calling\r\n * save().\r\n *\r\n * @return {boolean} True if calling save() will actually save\r\n * (at the time this function is called).\r\n */\r\n\r\nIndexedDBStore.prototype.wantsSave = function () {\r\n const now = Date.now();\r\n return now - this._syncTs > WRITE_DELAY_MS;\r\n};\r\n/**\r\n * Possibly write data to the database.\r\n *\r\n * @param {bool} force True to force a save to happen\r\n * @return {Promise} Promise resolves after the write completes\r\n * (or immediately if no write is performed)\r\n */\r\n\r\n\r\nIndexedDBStore.prototype.save = function (force) {\r\n if (force || this.wantsSave()) {\r\n return this._reallySave();\r\n }\r\n\r\n return Promise.resolve();\r\n};\r\n\r\nIndexedDBStore.prototype._reallySave = degradable(function () {\r\n this._syncTs = Date.now(); // set now to guard against multi-writes\r\n // work out changed users (this doesn't handle deletions but you\r\n // can't 'delete' users as they are just presence events).\r\n\r\n const userTuples = [];\r\n\r\n for (const u of this.getUsers()) {\r\n if (this._userModifiedMap[u.userId] === u.getLastModifiedTime()) continue;\r\n if (!u.events.presence) continue;\r\n userTuples.push([u.userId, u.events.presence.event]); // note that we've saved this version of the user\r\n\r\n this._userModifiedMap[u.userId] = u.getLastModifiedTime();\r\n }\r\n\r\n return this.backend.syncToDatabase(userTuples);\r\n});\r\nIndexedDBStore.prototype.setSyncData = degradable(function (syncData) {\r\n return this.backend.setSyncData(syncData);\r\n}, \"setSyncData\");\r\n/**\r\n * Returns the out-of-band membership events for this room that\r\n * were previously loaded.\r\n * @param {string} roomId\r\n * @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members\r\n * @returns {null} in case the members for this room haven't been stored yet\r\n */\r\n\r\nIndexedDBStore.prototype.getOutOfBandMembers = degradable(function (roomId) {\r\n return this.backend.getOutOfBandMembers(roomId);\r\n}, \"getOutOfBandMembers\");\r\n/**\r\n * Stores the out-of-band membership events for this room. Note that\r\n * it still makes sense to store an empty array as the OOB status for the room is\r\n * marked as fetched, and getOutOfBandMembers will return an empty array instead of null\r\n * @param {string} roomId\r\n * @param {event[]} membershipEvents the membership events to store\r\n * @returns {Promise} when all members have been stored\r\n */\r\n\r\nIndexedDBStore.prototype.setOutOfBandMembers = degradable(function (roomId, membershipEvents) {\r\n _memory.MemoryStore.prototype.setOutOfBandMembers.call(this, roomId, membershipEvents);\r\n\r\n return this.backend.setOutOfBandMembers(roomId, membershipEvents);\r\n}, \"setOutOfBandMembers\");\r\nIndexedDBStore.prototype.clearOutOfBandMembers = degradable(function (roomId) {\r\n _memory.MemoryStore.prototype.clearOutOfBandMembers.call(this);\r\n\r\n return this.backend.clearOutOfBandMembers(roomId);\r\n}, \"clearOutOfBandMembers\");\r\nIndexedDBStore.prototype.getClientOptions = degradable(function () {\r\n return this.backend.getClientOptions();\r\n}, \"getClientOptions\");\r\nIndexedDBStore.prototype.storeClientOptions = degradable(function (options) {\r\n _memory.MemoryStore.prototype.storeClientOptions.call(this, options);\r\n\r\n return this.backend.storeClientOptions(options);\r\n}, \"storeClientOptions\");\r\n/**\r\n * All member functions of `IndexedDBStore` that access the backend use this wrapper to\r\n * watch for failures after initial store startup, including `QuotaExceededError` as\r\n * free disk space changes, etc.\r\n *\r\n * When IndexedDB fails via any of these paths, we degrade this back to a `MemoryStore`\r\n * in place so that the current operation and all future ones are in-memory only.\r\n *\r\n * @param {Function} func The degradable work to do.\r\n * @param {String} fallback The method name for fallback.\r\n * @returns {Function} A wrapped member function.\r\n */\r\n\r\nfunction degradable(func, fallback) {\r\n return async function (...args) {\r\n try {\r\n return await func.call(this, ...args);\r\n } catch (e) {\r\n _logger.logger.error(\"IndexedDBStore failure, degrading to MemoryStore\", e);\r\n\r\n this.emit(\"degraded\", e);\r\n\r\n try {\r\n // We try to delete IndexedDB after degrading since this store is only a\r\n // cache (the app will still function correctly without the data).\r\n // It's possible that deleting repair IndexedDB for the next app load,\r\n // potenially by making a little more space available.\r\n _logger.logger.log(\"IndexedDBStore trying to delete degraded data\");\r\n\r\n await this.backend.clearDatabase();\r\n\r\n _logger.logger.log(\"IndexedDBStore delete after degrading succeeeded\");\r\n } catch (e) {\r\n _logger.logger.warn(\"IndexedDBStore delete after degrading failed\", e);\r\n } // Degrade the store from being an instance of `IndexedDBStore` to instead be\r\n // an instance of `MemoryStore` so that future API calls use the memory path\r\n // directly and skip IndexedDB entirely. This should be safe as\r\n // `IndexedDBStore` already extends from `MemoryStore`, so we are making the\r\n // store become its parent type in a way. The mutator methods of\r\n // `IndexedDBStore` also maintain the state that `MemoryStore` uses (many are\r\n // not overridden at all).\r\n\r\n\r\n Object.setPrototypeOf(this, _memory.MemoryStore.prototype);\r\n\r\n if (fallback) {\r\n return await _memory.MemoryStore.prototype[fallback].call(this, ...args);\r\n }\r\n }\r\n };\r\n}","(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Scrollparent = factory();\n }\n}(this, function () {\n var regex = /(auto|scroll)/;\n\n var parents = function (node, ps) {\n if (node.parentNode === null) { return ps; }\n\n return parents(node.parentNode, ps.concat([node]));\n };\n\n var style = function (node, prop) {\n return getComputedStyle(node, null).getPropertyValue(prop);\n };\n\n var overflow = function (node) {\n return style(node, \"overflow\") + style(node, \"overflow-y\") + style(node, \"overflow-x\");\n };\n\n var scroll = function (node) {\n return regex.test(overflow(node));\n };\n\n var scrollParent = function (node) {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return ;\n }\n\n var ps = parents(node.parentNode, []);\n\n for (var i = 0; i < ps.length; i += 1) {\n if (scroll(ps[i])) {\n return ps[i];\n }\n }\n\n return document.scrollingElement || document.documentElement;\n };\n\n return scrollParent;\n}));\n","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!./index.sass?vue&type=style&index=0&lang=sass&\"","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".bgimage[data-v-5d20f73c]{width:100%;height:100%;opacity:0;transition:.3s}.bgimage.loaded[data-v-5d20f73c]{opacity:1}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.PushProcessor = PushProcessor;\r\n\r\nvar _utils = require(\"./utils\");\r\n\r\nvar _logger = require(\"./logger\");\r\n\r\n/*\r\nCopyright 2015, 2016 OpenMarket Ltd\r\nCopyright 2017 New Vector Ltd\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n/**\r\n * @module pushprocessor\r\n */\r\nconst RULEKINDS_IN_ORDER = ['override', 'content', 'room', 'sender', 'underride']; // The default override rules to apply to the push rules that arrive from the server.\r\n// We do this for two reasons:\r\n// 1. Synapse is unlikely to send us the push rule in an incremental sync - see\r\n// https://github.com/matrix-org/synapse/pull/4867#issuecomment-481446072 for\r\n// more details.\r\n// 2. We often want to start using push rules ahead of the server supporting them,\r\n// and so we can put them here.\r\n\r\nconst DEFAULT_OVERRIDE_RULES = [{\r\n // For homeservers which don't support MSC1930 yet\r\n rule_id: \".m.rule.tombstone\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.room.tombstone\"\r\n }, {\r\n kind: \"event_match\",\r\n key: \"state_key\",\r\n pattern: \"\"\r\n }],\r\n actions: [\"notify\", {\r\n set_tweak: \"highlight\",\r\n value: true\r\n }]\r\n}, {\r\n // For homeservers which don't support MSC2153 yet\r\n rule_id: \".m.rule.reaction\",\r\n default: true,\r\n enabled: true,\r\n conditions: [{\r\n kind: \"event_match\",\r\n key: \"type\",\r\n pattern: \"m.reaction\"\r\n }],\r\n actions: [\"dont_notify\"]\r\n}];\r\n/**\r\n * Construct a Push Processor.\r\n * @constructor\r\n * @param {Object} client The Matrix client object to use\r\n */\r\n\r\nfunction PushProcessor(client) {\r\n const cachedGlobToRegex = {// $glob: RegExp,\r\n };\r\n\r\n const matchingRuleFromKindSet = (ev, kindset) => {\r\n for (let ruleKindIndex = 0; ruleKindIndex < RULEKINDS_IN_ORDER.length; ++ruleKindIndex) {\r\n const kind = RULEKINDS_IN_ORDER[ruleKindIndex];\r\n const ruleset = kindset[kind];\r\n\r\n if (!ruleset) {\r\n continue;\r\n }\r\n\r\n for (let ruleIndex = 0; ruleIndex < ruleset.length; ++ruleIndex) {\r\n const rule = ruleset[ruleIndex];\r\n\r\n if (!rule.enabled) {\r\n continue;\r\n }\r\n\r\n const rawrule = templateRuleToRaw(kind, rule);\r\n\r\n if (!rawrule) {\r\n continue;\r\n }\r\n\r\n if (this.ruleMatchesEvent(rawrule, ev)) {\r\n rule.kind = kind;\r\n return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const templateRuleToRaw = function (kind, tprule) {\r\n const rawrule = {\r\n 'rule_id': tprule.rule_id,\r\n 'actions': tprule.actions,\r\n 'conditions': []\r\n };\r\n\r\n switch (kind) {\r\n case 'underride':\r\n case 'override':\r\n rawrule.conditions = tprule.conditions;\r\n break;\r\n\r\n case 'room':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'room_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'sender':\r\n if (!tprule.rule_id) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'user_id',\r\n 'value': tprule.rule_id\r\n });\r\n break;\r\n\r\n case 'content':\r\n if (!tprule.pattern) {\r\n return null;\r\n }\r\n\r\n rawrule.conditions.push({\r\n 'kind': 'event_match',\r\n 'key': 'content.body',\r\n 'pattern': tprule.pattern\r\n });\r\n break;\r\n }\r\n\r\n return rawrule;\r\n };\r\n\r\n const eventFulfillsCondition = function (cond, ev) {\r\n const condition_functions = {\r\n \"event_match\": eventFulfillsEventMatchCondition,\r\n \"contains_display_name\": eventFulfillsDisplayNameCondition,\r\n \"room_member_count\": eventFulfillsRoomMemberCountCondition,\r\n \"sender_notification_permission\": eventFulfillsSenderNotifPermCondition\r\n };\r\n\r\n if (condition_functions[cond.kind]) {\r\n return condition_functions[cond.kind](cond, ev);\r\n } // unknown conditions: we previously matched all unknown conditions,\r\n // but given that rules can be added to the base rules on a server,\r\n // it's probably better to not match unknown conditions.\r\n\r\n\r\n return false;\r\n };\r\n\r\n const eventFulfillsSenderNotifPermCondition = function (cond, ev) {\r\n const notifLevelKey = cond['key'];\r\n\r\n if (!notifLevelKey) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState) {\r\n return false;\r\n } // Note that this should not be the current state of the room but the state at\r\n // the point the event is in the DAG. Unfortunately the js-sdk does not store\r\n // this.\r\n\r\n\r\n return room.currentState.mayTriggerNotifOfType(notifLevelKey, ev.getSender());\r\n };\r\n\r\n const eventFulfillsRoomMemberCountCondition = function (cond, ev) {\r\n if (!cond.is) {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members) {\r\n return false;\r\n }\r\n\r\n const memberCount = room.currentState.getJoinedMemberCount();\r\n const m = cond.is.match(/^([=<>]*)([0-9]*)$/);\r\n\r\n if (!m) {\r\n return false;\r\n }\r\n\r\n const ineq = m[1];\r\n const rhs = parseInt(m[2]);\r\n\r\n if (isNaN(rhs)) {\r\n return false;\r\n }\r\n\r\n switch (ineq) {\r\n case '':\r\n case '==':\r\n return memberCount == rhs;\r\n\r\n case '<':\r\n return memberCount < rhs;\r\n\r\n case '>':\r\n return memberCount > rhs;\r\n\r\n case '<=':\r\n return memberCount <= rhs;\r\n\r\n case '>=':\r\n return memberCount >= rhs;\r\n\r\n default:\r\n return false;\r\n }\r\n };\r\n\r\n const eventFulfillsDisplayNameCondition = function (cond, ev) {\r\n let content = ev.getContent();\r\n\r\n if (ev.isEncrypted() && ev.getClearContent()) {\r\n content = ev.getClearContent();\r\n }\r\n\r\n if (!content || !content.body || typeof content.body != 'string') {\r\n return false;\r\n }\r\n\r\n const room = client.getRoom(ev.getRoomId());\r\n\r\n if (!room || !room.currentState || !room.currentState.members || !room.currentState.getMember(client.credentials.userId)) {\r\n return false;\r\n }\r\n\r\n const displayName = room.currentState.getMember(client.credentials.userId).name; // N.B. we can't use \\b as it chokes on unicode. however \\W seems to be okay\r\n // as shorthand for [^0-9A-Za-z_].\r\n\r\n const pat = new RegExp(\"(^|\\\\W)\" + (0, _utils.escapeRegExp)(displayName) + \"(\\\\W|$)\", 'i');\r\n return content.body.search(pat) > -1;\r\n };\r\n\r\n const eventFulfillsEventMatchCondition = function (cond, ev) {\r\n if (!cond.key) {\r\n return false;\r\n }\r\n\r\n const val = valueForDottedKey(cond.key, ev);\r\n\r\n if (typeof val !== 'string') {\r\n return false;\r\n }\r\n\r\n if (cond.value) {\r\n return cond.value === val;\r\n }\r\n\r\n if (typeof cond.pattern !== 'string') {\r\n return false;\r\n }\r\n\r\n let regex;\r\n\r\n if (cond.key == 'content.body') {\r\n regex = createCachedRegex('(^|\\\\W)', cond.pattern, '(\\\\W|$)');\r\n } else {\r\n regex = createCachedRegex('^', cond.pattern, '$');\r\n }\r\n\r\n return !!val.match(regex);\r\n };\r\n\r\n const createCachedRegex = function (prefix, glob, suffix) {\r\n if (cachedGlobToRegex[glob]) {\r\n return cachedGlobToRegex[glob];\r\n }\r\n\r\n cachedGlobToRegex[glob] = new RegExp(prefix + (0, _utils.globToRegexp)(glob) + suffix, 'i');\r\n return cachedGlobToRegex[glob];\r\n };\r\n\r\n const valueForDottedKey = function (key, ev) {\r\n const parts = key.split('.');\r\n let val; // special-case the first component to deal with encrypted messages\r\n\r\n const firstPart = parts[0];\r\n\r\n if (firstPart === 'content') {\r\n val = ev.getContent();\r\n parts.shift();\r\n } else if (firstPart === 'type') {\r\n val = ev.getType();\r\n parts.shift();\r\n } else {\r\n // use the raw event for any other fields\r\n val = ev.event;\r\n }\r\n\r\n while (parts.length > 0) {\r\n const thisPart = parts.shift();\r\n\r\n if ((0, _utils.isNullOrUndefined)(val[thisPart])) {\r\n return null;\r\n }\r\n\r\n val = val[thisPart];\r\n }\r\n\r\n return val;\r\n };\r\n\r\n const matchingRuleForEventWithRulesets = function (ev, rulesets) {\r\n if (!rulesets) {\r\n return null;\r\n }\r\n\r\n if (ev.getSender() === client.credentials.userId) {\r\n return null;\r\n }\r\n\r\n return matchingRuleFromKindSet(ev, rulesets.global);\r\n };\r\n\r\n const pushActionsForEventAndRulesets = function (ev, rulesets) {\r\n const rule = matchingRuleForEventWithRulesets(ev, rulesets);\r\n\r\n if (!rule) {\r\n return {};\r\n }\r\n\r\n const actionObj = PushProcessor.actionListToActionsObject(rule.actions); // Some actions are implicit in some situations: we add those here\r\n\r\n if (actionObj.tweaks.highlight === undefined) {\r\n // if it isn't specified, highlight if it's a content\r\n // rule but otherwise not\r\n actionObj.tweaks.highlight = rule.kind == 'content';\r\n }\r\n\r\n return actionObj;\r\n };\r\n\r\n this.ruleMatchesEvent = function (rule, ev) {\r\n let ret = true;\r\n\r\n for (let i = 0; i < rule.conditions.length; ++i) {\r\n const cond = rule.conditions[i];\r\n ret &= eventFulfillsCondition(cond, ev);\r\n } //console.log(\"Rule \"+rule.rule_id+(ret ? \" matches\" : \" doesn't match\"));\r\n\r\n\r\n return ret;\r\n };\r\n /**\r\n * Get the user's push actions for the given event\r\n *\r\n * @param {module:models/event.MatrixEvent} ev\r\n *\r\n * @return {PushAction}\r\n */\r\n\r\n\r\n this.actionsForEvent = function (ev) {\r\n return pushActionsForEventAndRulesets(ev, client.pushRules);\r\n };\r\n /**\r\n * Get one of the users push rules by its ID\r\n *\r\n * @param {string} ruleId The ID of the rule to search for\r\n * @return {object} The push rule, or null if no such rule was found\r\n */\r\n\r\n\r\n this.getPushRuleById = function (ruleId) {\r\n for (const scope of ['global']) {\r\n if (client.pushRules[scope] === undefined) continue;\r\n\r\n for (const kind of RULEKINDS_IN_ORDER) {\r\n if (client.pushRules[scope][kind] === undefined) continue;\r\n\r\n for (const rule of client.pushRules[scope][kind]) {\r\n if (rule.rule_id === ruleId) return rule;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n}\r\n/**\r\n * Convert a list of actions into a object with the actions as keys and their values\r\n * eg. [ 'notify', { set_tweak: 'sound', value: 'default' } ]\r\n * becomes { notify: true, tweaks: { sound: 'default' } }\r\n * @param {array} actionlist The actions list\r\n *\r\n * @return {object} A object with key 'notify' (true or false) and an object of actions\r\n */\r\n\r\n\r\nPushProcessor.actionListToActionsObject = function (actionlist) {\r\n const actionobj = {\r\n 'notify': false,\r\n 'tweaks': {}\r\n };\r\n\r\n for (let i = 0; i < actionlist.length; ++i) {\r\n const action = actionlist[i];\r\n\r\n if (action === 'notify') {\r\n actionobj.notify = true;\r\n } else if (typeof action === 'object') {\r\n if (action.value === undefined) {\r\n action.value = true;\r\n }\r\n\r\n actionobj.tweaks[action.set_tweak] = action.value;\r\n }\r\n }\r\n\r\n return actionobj;\r\n};\r\n/**\r\n * Rewrites conditions on a client's push rules to match the defaults\r\n * where applicable. Useful for upgrading push rules to more strict\r\n * conditions when the server is falling behind on defaults.\r\n * @param {object} incomingRules The client's existing push rules\r\n * @returns {object} The rewritten rules\r\n */\r\n\r\n\r\nPushProcessor.rewriteDefaultRules = function (incomingRules) {\r\n let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone\r\n // These lines are mostly to make the tests happy. We shouldn't run into these\r\n // properties missing in practice.\r\n\r\n if (!newRules) newRules = {};\r\n if (!newRules.global) newRules.global = {};\r\n if (!newRules.global.override) newRules.global.override = []; // Merge the client-level defaults with the ones from the server\r\n\r\n const globalOverrides = newRules.global.override;\r\n\r\n for (const override of DEFAULT_OVERRIDE_RULES) {\r\n const existingRule = globalOverrides.find(r => r.rule_id === override.rule_id);\r\n\r\n if (existingRule) {\r\n // Copy over the actions, default, and conditions. Don't touch the user's\r\n // preference.\r\n existingRule.default = override.default;\r\n existingRule.conditions = override.conditions;\r\n existingRule.actions = override.actions;\r\n } else {\r\n // Add the rule\r\n const ruleId = override.rule_id;\r\n\r\n _logger.logger.warn(`Adding default global override for ${ruleId}`);\r\n\r\n globalOverrides.push(override);\r\n }\r\n }\r\n\r\n return newRules;\r\n};\r\n/**\r\n * @typedef {Object} PushAction\r\n * @type {Object}\r\n * @property {boolean} notify Whether this event should notify the user or not.\r\n * @property {Object} tweaks How this event should be notified.\r\n * @property {boolean} tweaks.highlight Whether this event should be highlighted\r\n * on the UI.\r\n * @property {boolean} tweaks.sound Whether this notification should produce a\r\n * noise.\r\n */","export * from \"-!../../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=33d22462&scoped=true&lang=sass&\"","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./bgimage.vue?vue&type=style&index=0&id=5d20f73c&scoped=true&lang=sass&\"","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vue-js-toggle-button\"] = factory();\n\telse\n\t\troot[\"vue-js-toggle-button\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(8)\n\nvar Component = __webpack_require__(6)(\n /* script */\n __webpack_require__(1),\n /* template */\n __webpack_require__(7),\n /* scopeId */\n \"data-v-25adc6c0\",\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(3);\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\nvar DEFAULT_COLOR_CHECKED = '#75c791';\nvar DEFAULT_COLOR_UNCHECKED = '#bfcbd9';\nvar DEFAULT_LABEL_CHECKED = 'on';\nvar DEFAULT_LABEL_UNCHECKED = 'off';\nvar DEFAULT_SWITCH_COLOR = '#fff';\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'ToggleButton',\n props: {\n value: {\n type: Boolean,\n default: false\n },\n name: {\n type: String\n },\n disabled: {\n type: Boolean,\n default: false\n },\n tag: {\n type: String\n },\n sync: {\n type: Boolean,\n default: false\n },\n speed: {\n type: Number,\n default: 300\n },\n color: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'disabled');\n }\n },\n switchColor: {\n type: [String, Object],\n validator: function validator(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"a\" /* isString */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'checked') || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"b\" /* has */])(value, 'unchecked');\n }\n },\n cssColors: {\n type: Boolean,\n default: false\n },\n labels: {\n type: [Boolean, Object],\n default: false,\n validator: function validator(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' ? value.checked || value.unchecked : typeof value === 'boolean';\n }\n },\n height: {\n type: Number,\n default: 22\n },\n width: {\n type: Number,\n default: 50\n },\n margin: {\n type: Number,\n default: 3\n },\n fontSize: {\n type: Number\n }\n },\n computed: {\n className: function className() {\n var toggled = this.toggled,\n disabled = this.disabled;\n\n\n return ['vue-js-switch', {\n toggled: toggled,\n disabled: disabled\n }];\n },\n coreStyle: function coreStyle() {\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n backgroundColor: this.cssColors ? null : this.disabled ? this.colorDisabled : this.colorCurrent,\n borderRadius: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(Math.round(this.height / 2))\n };\n },\n buttonRadius: function buttonRadius() {\n return this.height - this.margin * 2;\n },\n distance: function distance() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.width - this.height + this.margin);\n },\n buttonStyle: function buttonStyle() {\n var transition = 'transform ' + this.speed + 'ms';\n var margin = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.margin);\n\n var transform = this.toggled ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(this.distance, margin) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"d\" /* translate3d */])(margin, margin);\n\n var background = this.switchColor ? this.switchColorCurrent : null;\n\n return {\n width: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n height: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.buttonRadius),\n transition: transition,\n transform: transform,\n background: background\n };\n },\n labelStyle: function labelStyle() {\n return {\n lineHeight: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.height),\n fontSize: this.fontSize ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"c\" /* px */])(this.fontSize) : null\n };\n },\n colorChecked: function colorChecked() {\n var color = this.color;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(color)) {\n return color || DEFAULT_COLOR_CHECKED;\n }\n\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(color, 'checked', DEFAULT_COLOR_CHECKED);\n },\n colorUnchecked: function colorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'unchecked', DEFAULT_COLOR_UNCHECKED);\n },\n colorDisabled: function colorDisabled() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.color, 'disabled', this.colorCurrent);\n },\n colorCurrent: function colorCurrent() {\n return this.toggled ? this.colorChecked : this.colorUnchecked;\n },\n labelChecked: function labelChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'checked', DEFAULT_LABEL_CHECKED);\n },\n labelUnchecked: function labelUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.labels, 'unchecked', DEFAULT_LABEL_UNCHECKED);\n },\n switchColorChecked: function switchColorChecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'checked', DEFAULT_SWITCH_COLOR);\n },\n switchColorUnchecked: function switchColorUnchecked() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"f\" /* get */])(this.switchColor, 'unchecked', DEFAULT_SWITCH_COLOR);\n },\n switchColorCurrent: function switchColorCurrent() {\n var switchColor = this.switchColor;\n\n\n if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__[\"e\" /* isObject */])(this.switchColor)) {\n return this.switchColor || DEFAULT_SWITCH_COLOR;\n }\n\n return this.toggled ? this.switchColorChecked : this.switchColorUnchecked;\n }\n },\n watch: {\n value: function value(_value) {\n if (this.sync) {\n this.toggled = !!_value;\n }\n }\n },\n data: function data() {\n return {\n toggled: !!this.value\n };\n },\n\n methods: {\n toggle: function toggle(event) {\n var toggled = !this.toggled;\n\n if (!this.sync) {\n this.toggled = toggled;\n }\n\n this.$emit('input', toggled);\n this.$emit('change', {\n value: toggled,\n tag: this.tag,\n srcEvent: event\n });\n }\n }\n});\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Button_vue__);\n/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, \"ToggleButton\", function() { return __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a; });\n\n\nvar installed = false;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n install: function install(Vue) {\n if (installed) {\n return;\n }\n\n Vue.component('ToggleButton', __WEBPACK_IMPORTED_MODULE_0__Button_vue___default.a);\n installed = true;\n }\n});\n\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return isString; });\n/* unused harmony export isBoolean */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return has; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return px; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return translate3d; });\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isString = function isString(value) {\n return typeof value === 'string';\n};\n\nvar isBoolean = function isBoolean(value) {\n return typeof value === 'boolean';\n};\n\nvar isObject = function isObject(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';\n};\n\nvar has = function has(object, key) {\n return isObject(object) && object.hasOwnProperty(key);\n};\n\nvar get = function get(object, key, defaultValue) {\n return has(object, key) ? object[key] : defaultValue;\n};\n\nvar px = function px(value) {\n return value + 'px';\n};\n\nvar translate3d = function translate3d(x, y) {\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0px';\n\n return 'translate3d(' + x + ', ' + y + ', ' + z + ')';\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)();\n// imports\n\n\n// module\nexports.push([module.i, \".vue-js-switch[data-v-25adc6c0]{display:inline-block;position:relative;vertical-align:middle;user-select:none;font-size:10px;cursor:pointer}.vue-js-switch .v-switch-input[data-v-25adc6c0]{opacity:0;position:absolute;width:1px;height:1px}.vue-js-switch .v-switch-label[data-v-25adc6c0]{position:absolute;top:0;font-weight:600;color:#fff;z-index:1}.vue-js-switch .v-switch-label.v-left[data-v-25adc6c0]{left:10px}.vue-js-switch .v-switch-label.v-right[data-v-25adc6c0]{right:10px}.vue-js-switch .v-switch-core[data-v-25adc6c0]{display:block;position:relative;box-sizing:border-box;outline:0;margin:0;transition:border-color .3s,background-color .3s;user-select:none}.vue-js-switch .v-switch-core .v-switch-button[data-v-25adc6c0]{display:block;position:absolute;overflow:hidden;top:0;left:0;border-radius:100%;background-color:#fff;z-index:2}.vue-js-switch.disabled[data-v-25adc6c0]{pointer-events:none;opacity:.6}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n scopeId,\n cssModules\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n // inject cssModules\n if (cssModules) {\n var computed = Object.create(options.computed || null)\n Object.keys(cssModules).forEach(function (key) {\n var module = cssModules[key]\n computed[key] = function () { return module }\n })\n options.computed = computed\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('label', {\n class: _vm.className\n }, [_c('input', {\n staticClass: \"v-switch-input\",\n attrs: {\n \"type\": \"checkbox\",\n \"name\": _vm.name,\n \"disabled\": _vm.disabled\n },\n domProps: {\n \"checked\": _vm.value\n },\n on: {\n \"change\": function($event) {\n $event.stopPropagation();\n return _vm.toggle($event)\n }\n }\n }), _vm._v(\" \"), _c('div', {\n staticClass: \"v-switch-core\",\n style: (_vm.coreStyle)\n }, [_c('div', {\n staticClass: \"v-switch-button\",\n style: (_vm.buttonStyle)\n })]), _vm._v(\" \"), (_vm.labels) ? [(_vm.toggled) ? _c('span', {\n staticClass: \"v-switch-label v-left\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"checked\", [\n [_vm._v(_vm._s(_vm.labelChecked))]\n ])], 2) : _c('span', {\n staticClass: \"v-switch-label v-right\",\n style: (_vm.labelStyle)\n }, [_vm._t(\"unchecked\", [\n [_vm._v(_vm._s(_vm.labelUnchecked))]\n ])], 2)] : _vm._e()], 2)\n},staticRenderFns: []}\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a ","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalWindow.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ModalWindow.vue?vue&type=template&id=96a5a68e&scoped=true&\"\nimport script from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nexport * from \"./ModalWindow.vue?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./ModalWindow.vue?vue&type=style&index=0&id=96a5a68e&lang=sass&scoped=true&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"96a5a68e\",\n null\n ,true\n)\n\nexport default component.exports","import {mapActions, mapGetters, mapState} from 'vuex'\r\nimport preview from '@/components/contacts/preview/index.vue'\r\nimport ModalWindow from '@/components/utils/ModalWindow.vue'\r\n\r\n\r\nexport default {\r\n name: \"contactsList\",\r\n data: function () {\r\n\r\n return {\r\n loading: false,\r\n }\r\n\r\n },\r\n components: {\r\n preview,\r\n ModalWindow\r\n },\r\n\r\n props: {\r\n mode: {\r\n default: '',\r\n type: String\r\n },\r\n users: Array,\r\n selected : Object,\r\n title: String,\r\n },\r\n \r\n watch: {\r\n //$route: 'getdata'\r\n },\r\n\r\n \r\n\r\n computed: mapState({\r\n auth: state => state.auth,\r\n minimized : state => state.minimized,\r\n\r\n ...mapActions([\r\n 'PREPARE_USERDATA'\r\n ]),\r\n\r\n ...mapState([\r\n 'contactsMap',\r\n 'signedUpUsers',\r\n ]),\r\n\r\n }),\r\n\r\n methods: {\r\n select(contact) {\r\n this.$emit('select', contact)\r\n },\r\n\r\n navigateToProfile(id, contact) {\r\n\r\n if(this.mode == \"Select\"){\r\n this.select(contact)\r\n }\r\n else{\r\n this.$router.push({path: `/contact?id=${id}`}).catch(e => {})\r\n }\r\n },\r\n\r\n toggleUser(contact){\r\n this.$emit('toggleUser', contact.id)\r\n }\r\n\r\n },\r\n\r\n mounted() {\r\n }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!./index.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=691bf714&scoped=true&\"\nimport script from \"./index.js?vue&type=script&lang=js&\"\nexport * from \"./index.js?vue&type=script&lang=js&\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./index.sass?vue&type=style&index=0&id=691bf714&scoped=true&lang=sass&\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n \"691bf714\",\n null\n ,true\n)\n\nexport default component.exports","export * from \"-!../../../node_modules/vue-style-loader/index.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../node_modules/sass-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=9b340a7a&scoped=true&lang=sass&\"","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","// style-loader: Adds some css to the DOM by adding a